class_docstr: The implementation of Biaffine Dependency Parser.
  
  References:
      - Timothy Dozat and Christopher D. Manning. 2017.
        `Deep Biaffine Attention for Neural Dependency Parsing`_.
  
  .. _Deep Biaffine Attention for Neural Dependency Parsing:
      https://openreview.net/forum?id=Hk95PK9le
class_docstr_tok: ["The","implementation","of","Biaffine","Dependency","Parser",".","References",":","-","Timothy","Dozat","and","Christopher","D.","Manning",".","2017",".","`","Deep","Biaffine","Attention","for","Neural","Dependency","Parsing","`","_",".","..","_Deep","Biaffine","Attention","for","Neural","Dependency","Parsing",":","https",":","\/\/openreview.net\/forum","?","id=Hk95PK9le"]
docstr: Args:
      s_arc (~torch.Tensor): ``[batch_size, seq_len, seq_len]``.
          Scores of all possible arcs.
      s_rel (~torch.Tensor): ``[batch_size, seq_len, seq_len, n_labels]``.
          Scores of all possible labels on each arc.
      arcs (~torch.LongTensor): ``[batch_size, seq_len]``.
          The tensor of gold-standard arcs.
      rels (~torch.LongTensor): ``[batch_size, seq_len]``.
          The tensor of gold-standard labels.
      mask (~torch.BoolTensor): ``[batch_size, seq_len]``.
          The mask for covering the unpadded tokens.
  
  Returns:
      ~torch.Tensor:
          The training loss.
docstr_tok: ["Args",":","s_arc","(","~torch.Tensor",")",":","``","[","batch_size",",","seq_len",",","seq_len","]","``",".","Scores","of","all","possible","arcs",".","s_rel","(","~torch.Tensor",")",":","``","[","batch_size",",","seq_len",",","seq_len",",","n_labels","]","``",".","Scores","of","all","possible","labels","on","each","arc",".","arcs","(","~torch.LongTensor",")",":","``","[","batch_size",",","seq_len","]","``",".","The","tensor","of","gold-standard","arcs",".","rels","(","~torch.LongTensor",")",":","``","[","batch_size",",","seq_len","]","``",".","The","tensor","of","gold-standard","labels",".","mask","(","~torch.BoolTensor",")",":","``","[","batch_size",",","seq_len","]","``",".","The","mask","for","covering","the","unpadded","tokens",".","Returns",":","~torch.Tensor",":","The","training","loss","."]
code: def forward_loss(self, s_arc, s_rel, arcs, rels, mask):
      r"""
      Args:
          s_arc (~torch.Tensor): ``[batch_size, seq_len, seq_len]``.
              Scores of all possible arcs.
          s_rel (~torch.Tensor): ``[batch_size, seq_len, seq_len, n_labels]``.
              Scores of all possible labels on each arc.
          arcs (~torch.LongTensor): ``[batch_size, seq_len]``.
              The tensor of gold-standard arcs.
          rels (~torch.LongTensor): ``[batch_size, seq_len]``.
              The tensor of gold-standard labels.
          mask (~torch.BoolTensor): ``[batch_size, seq_len]``.
              The mask for covering the unpadded tokens.
  
      Returns:
          ~torch.Tensor:
              The training loss.
      """
  
      s_arc, arcs = s_arc[mask], arcs[mask]
      s_rel, rels = s_rel[mask], rels[mask]
      s_rel = s_rel[torch.arange(len(arcs)), arcs]
      arc_loss = self.criterion(s_arc, arcs)
      rel_loss = self.criterion(s_rel, rels)
  
      return arc_loss + rel_loss
  
imports: import os
  from datetime import datetime
  from underthesea.utils import logger
  from underthesea.utils.sp_data import Dataset
  from underthesea.utils.sp_field import Field
  from underthesea.utils.sp_fn import ispunct
  from underthesea.utils.sp_init import PRETRAINED
  from underthesea.utils.sp_metric import AttachmentMetric
  import torch
  import torch.nn
  from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
  from underthesea.transforms.conll import CoNLL
  from underthesea.modules.base import CharLSTM, IndependentDropout, BiLSTM, SharedDropout, MLP, Biaffine
  from underthesea.modules.bert import BertEmbedding
  from underthesea.utils.sp_alg import eisner, mst
  import underthesea.modules.nn
  from underthesea.utils.util_deep_learning import device
label_desc: Use image node_id 10 for calling the DependencyParser obj's underlying member method code with example usage: obj.forward_loss(s_arc, s_rel, arcs, rels, mask) and returns: unknown