class_docstr: **Biaffine Dependency Parser** 实现。
  论文参考 `Deep Biaffine Attention for Neural Dependency Parsing (Dozat and Manning, 2016) <https://arxiv.org/abs/1611.01734>`_ 。
  
  :param embed: 单词词典，支持以下几种输入类型：
  
          - ``tuple(num_embedings, embedding_dim)``，即 embedding 的大小和每个词的维度，此时将随机初始化一个 :class:`torch.nn.Embedding` 实例；
          - :class:`torch.nn.Embedding` 或 **fastNLP** 的 ``Embedding`` 对象，此时就以传入的对象作为 embedding；
          - :class:`numpy.ndarray` ，将使用传入的 ndarray 作为 Embedding 初始化；
          - :class:`torch.Tensor`，此时将使用传入的值作为 Embedding 初始化；
  
  :param pos_vocab_size: part-of-speech 词典大小
  :param pos_emb_dim: part-of-speech 向量维度
  :param num_label: 边的类别个数
  :param rnn_layers: rnn encoder 的层数
  :param rnn_hidden_size: rnn encoder 的隐状态维度
  :param arc_mlp_size: 边预测的 MLP 维度
  :param label_mlp_size: 类别预测的 MLP 维度
  :param dropout: dropout 概率
  :param encoder: encoder 类别，可选 ``['lstm', 'var-lstm', 'transformer']``。
  :param use_greedy_infer: 是否在 inference 时使用 :meth:`贪心算法 <GraphParser.greedy_decoder>` ，若为 ``False`` ，
      将使用更加精确但相对缓慢的 :meth:`MST算法 <GraphParser.mst_decoder>` 。
class_docstr_tok: ["*","*","Biaffine","Dependency","Parser","*","*","\u5b9e\u73b0\u3002","\u8bba\u6587\u53c2\u8003","`","Deep","Biaffine","Attention","for","Neural","Dependency","Parsing","(","Dozat","and","Manning",",","2016",")","<","https",":","\/\/arxiv.org\/abs\/1611.01734",">","`","_","\u3002",":","param","embed",":","\u5355\u8bcd\u8bcd\u5178\uff0c\u652f\u6301\u4ee5\u4e0b\u51e0\u79cd\u8f93\u5165\u7c7b\u578b\uff1a","-","``","tuple","(","num_embedings",",","embedding_dim",")","``","\uff0c\u5373","embedding","\u7684\u5927\u5c0f\u548c\u6bcf\u4e2a\u8bcd\u7684\u7ef4\u5ea6\uff0c\u6b64\u65f6\u5c06\u968f\u673a\u521d\u59cb\u5316\u4e00\u4e2a",":","class",":","`","torch.nn.Embedding","`","\u5b9e\u4f8b\uff1b","-",":","class",":","`","torch.nn.Embedding","`","\u6216","*","*","fastNLP","*","*","\u7684","``","Embedding","``","\u5bf9\u8c61\uff0c\u6b64\u65f6\u5c31\u4ee5\u4f20\u5165\u7684\u5bf9\u8c61\u4f5c\u4e3a","embedding\uff1b","-",":","class",":","`","numpy.ndarray","`","\uff0c\u5c06\u4f7f\u7528\u4f20\u5165\u7684","ndarray","\u4f5c\u4e3a","Embedding","\u521d\u59cb\u5316\uff1b","-",":","class",":","`","torch.Tensor","`","\uff0c\u6b64\u65f6\u5c06\u4f7f\u7528\u4f20\u5165\u7684\u503c\u4f5c\u4e3a","Embedding","\u521d\u59cb\u5316\uff1b",":","param","pos_vocab_size",":","part-of-speech","\u8bcd\u5178\u5927\u5c0f",":","param","pos_emb_dim",":","part-of-speech","\u5411\u91cf\u7ef4\u5ea6",":","param","num_label",":","\u8fb9\u7684\u7c7b\u522b\u4e2a\u6570",":","param","rnn_layers",":","rnn","encoder","\u7684\u5c42\u6570",":","param","rnn_hidden_size",":","rnn","encoder","\u7684\u9690\u72b6\u6001\u7ef4\u5ea6",":","param","arc_mlp_size",":","\u8fb9\u9884\u6d4b\u7684","MLP","\u7ef4\u5ea6",":","param","label_mlp_size",":","\u7c7b\u522b\u9884\u6d4b\u7684","MLP","\u7ef4\u5ea6",":","param","dropout",":","dropout","\u6982\u7387",":","param","encoder",":","encoder","\u7c7b\u522b\uff0c\u53ef\u9009","``","[","'lstm","'",",","'var-lstm","'",",","'transformer","'","]","``","\u3002",":","param","use_greedy_infer",":","\u662f\u5426\u5728","inference","\u65f6\u4f7f\u7528",":","meth",":","`","\u8d2a\u5fc3\u7b97\u6cd5","<","GraphParser.greedy_decoder",">","`","\uff0c\u82e5\u4e3a","``","False","``","\uff0c","\u5c06\u4f7f\u7528\u66f4\u52a0\u7cbe\u786e\u4f46\u76f8\u5bf9\u7f13\u6162\u7684",":","meth",":","`","MST\u7b97\u6cd5","<","GraphParser.mst_decoder",">","`","\u3002"]
docstr: 模型预测API
  
  :param words1: 输入 word 序列，形状为 ``[batch_size, seq_len]``
  :param words2: 输入 pos 序列，形状为 ``[batch_size, seq_len]`` 
  :param seq_len: 输入序列长度，形状为 ``[batch_size, seq_len]``
  :return: 字典类型的 parsing 结果，各个键的含义为：
  
          * ``pred1`` -- **heads** 的预测结果，形状为 ``[batch_size, seq_len]``；
          * ``pred2`` -- **label** 预测 logits，形状为 ``[batch_size, seq_len, num_label]`` ；
docstr_tok: ["\u6a21\u578b\u9884\u6d4bAPI",":","param","words1",":","\u8f93\u5165","word","\u5e8f\u5217\uff0c\u5f62\u72b6\u4e3a","``","[","batch_size",",","seq_len","]","``",":","param","words2",":","\u8f93\u5165","pos","\u5e8f\u5217\uff0c\u5f62\u72b6\u4e3a","``","[","batch_size",",","seq_len","]","``",":","param","seq_len",":","\u8f93\u5165\u5e8f\u5217\u957f\u5ea6\uff0c\u5f62\u72b6\u4e3a","``","[","batch_size",",","seq_len","]","``",":","return",":","\u5b57\u5178\u7c7b\u578b\u7684","parsing","\u7ed3\u679c\uff0c\u5404\u4e2a\u952e\u7684\u542b\u4e49\u4e3a\uff1a","*","``","pred1","``","--","*","*","heads","*","*","\u7684\u9884\u6d4b\u7ed3\u679c\uff0c\u5f62\u72b6\u4e3a","``","[","batch_size",",","seq_len","]","``","\uff1b","*","``","pred2","``","--","*","*","label","*","*","\u9884\u6d4b","logits\uff0c\u5f62\u72b6\u4e3a","``","[","batch_size",",","seq_len",",","num_label","]","``","\uff1b"]
code: def evaluate_step(self, words1, words2, seq_len):
      r"""模型预测API
  
      :param words1: 输入 word 序列，形状为 ``[batch_size, seq_len]``
      :param words2: 输入 pos 序列，形状为 ``[batch_size, seq_len]``
      :param seq_len: 输入序列长度，形状为 ``[batch_size, seq_len]``
      :return: 字典类型的 parsing 结果，各个键的含义为：
  
              * ``pred1`` -- **heads** 的预测结果，形状为 ``[batch_size, seq_len]``；
              * ``pred2`` -- **label** 预测 logits，形状为 ``[batch_size, seq_len, num_label]`` ；
  
      """
      res = self(words1, words2, seq_len)
      output = {}
      output["pred1"] = res.pop("pred3")
      _, label_pred = res.pop("pred2").max(2)
      output["pred2"] = label_pred
      return output
  
imports: from collections import defaultdict
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from ...core.utils import seq_len_to_mask
  from ...embeddings.torch.utils import get_embeddings
  from ...modules.torch.dropout import TimestepDropout
  from ...modules.torch.encoder.transformer import TransformerEncoder
  from ...modules.torch.encoder.variational_rnn import VarLSTM
label_desc: Use image node_id 6 for calling the BiaffineParser obj's underlying member method code with example usage: obj.evaluate_step(words1, words2, seq_len) and returns: output