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: Loads a parser with data fields and pretrained model parameters.
  
  Args:
      path (str):
          - a string with the shortcut name of a pretrained parser defined in ``underthesea.PRETRAINED``
            to load from cache or download, e.g., ``'crf-dep-en'``.
          - a path to a directory containing a pre-trained parser, e.g., `./<path>/model`.
      kwargs (dict):
          A dict holding the unconsumed arguments that can be used to update the configurations and initiate the model.
  
  Examples:
      >>> # from underthesea.models.dependency_parser import DependencyParser
      >>> # parser = DependencyParser.load('vi-dp-v1')
      >>> # parser = DependencyParser.load('./tmp/resources/parsers/dp')
docstr_tok: ["Loads","a","parser","with","data","fields","and","pretrained","model","parameters",".","Args",":","path","(","str",")",":","-","a","string","with","the","shortcut","name","of","a","pretrained","parser","defined","in","``","underthesea.PRETRAINED","``","to","load","from","cache","or","download",",","e.g.",",","``","'crf-dep-en","'","``",".","-","a","path","to","a","directory","containing","a","pre-trained","parser",",","e.g.",",","`",".\/","<","path",">","\/model","`",".","kwargs","(","dict",")",":","A","dict","holding","the","unconsumed","arguments","that","can","be","used","to","update","the","configurations","and","initiate","the","model",".","Examples",":",">",">",">","#","from","underthesea.models.dependency_parser","import","DependencyParser",">",">",">","#","parser","=","DependencyParser.load","(","'vi-dp-v1","'",")",">",">",">","#","parser","=","DependencyParser.load","(","'.\/tmp\/resources\/parsers\/dp","'",")"]
code: def load(cls, path):
      r"""
      Loads a parser with data fields and pretrained model parameters.
  
      Args:
          path (str):
              - a string with the shortcut name of a pretrained parser defined in ``underthesea.PRETRAINED``
                to load from cache or download, e.g., ``'crf-dep-en'``.
              - a path to a directory containing a pre-trained parser, e.g., `./<path>/model`.
          kwargs (dict):
              A dict holding the unconsumed arguments that can be used to update the configurations and initiate the model.
  
      Examples:
          >>> # from underthesea.models.dependency_parser import DependencyParser
          >>> # parser = DependencyParser.load('vi-dp-v1')
          >>> # parser = DependencyParser.load('./tmp/resources/parsers/dp')
      """
      if os.path.exists(path):
          state = torch.load(path)
      else:
          path = PRETRAINED[path] if path in PRETRAINED else path
          state = torch.hub.load_state_dict_from_url(path)
  
      model = cls._init_model_with_state_dict(state)
      model.eval()
      model.to(device)
      return model
  
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 6 for calling the DependencyParser obj's underlying member method code with example usage: obj.load(cls, path) and returns: model