class_docstr: 结构为 ``Embedding`` + :class:`BiLSTM <fastNLP.modules.torch.encoder.LSTM>` + ``FC`` + ``Dropout`` +
  :class:`CRF <fastNLP.modules.torch.decoder.ConditionalRandomField>` 。
  
  :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 num_classes: 一共多少个类
  :param num_layers: **BiLSTM** 的层数
  :param hidden_size: **BiLSTM** 的 ``hidden_size``，实际 hidden size 为该值的 **两倍** （前向、后向）
  :param dropout: dropout 的概率，0 为不 dropout
  :param target_vocab: :class:`~fastNLP.core.Vocabulary` 对象，target 与 index 的对应关系。如果传入该值，将自动避免非法的解码序列。
class_docstr_tok: ["\u7ed3\u6784\u4e3a","``","Embedding","``","+",":","class",":","`","BiLSTM","<","fastNLP.modules.torch.encoder.LSTM",">","`","+","``","FC","``","+","``","Dropout","``","+",":","class",":","`","CRF","<","fastNLP.modules.torch.decoder.ConditionalRandomField",">","`","\u3002",":","param","embed",":","\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","num_classes",":","\u4e00\u5171\u591a\u5c11\u4e2a\u7c7b",":","param","num_layers",":","*","*","BiLSTM","*","*","\u7684\u5c42\u6570",":","param","hidden_size",":","*","*","BiLSTM","*","*","\u7684","``","hidden_size","``","\uff0c\u5b9e\u9645","hidden","size","\u4e3a\u8be5\u503c\u7684","*","*","\u4e24\u500d","*","*","\uff08\u524d\u5411\u3001\u540e\u5411\uff09",":","param","dropout",":","dropout","\u7684\u6982\u7387\uff0c0","\u4e3a\u4e0d","dropout",":","param","target_vocab",":",":","class",":","`","~fastNLP.core.Vocabulary","`","\u5bf9\u8c61\uff0ctarget","\u4e0e","index","\u7684\u5bf9\u5e94\u5173\u7cfb\u3002\u5982\u679c\u4f20\u5165\u8be5\u503c\uff0c\u5c06\u81ea\u52a8\u907f\u514d\u975e\u6cd5\u7684\u89e3\u7801\u5e8f\u5217\u3002"]
docstr: :param words: 句子中 word 的 index，形状为 ``[batch_size, seq_len]``
  :param seq_len: 每个句子的长度，形状为 ``[batch,]``
  :return: 预测结果 ``{'pred': torch.Tensor}``
docstr_tok: [":","param","words",":","\u53e5\u5b50\u4e2d","word","\u7684","index\uff0c\u5f62\u72b6\u4e3a","``","[","batch_size",",","seq_len","]","``",":","param","seq_len",":","\u6bcf\u4e2a\u53e5\u5b50\u7684\u957f\u5ea6\uff0c\u5f62\u72b6\u4e3a","``","[","batch",",","]","``",":","return",":","\u9884\u6d4b\u7ed3\u679c","``","{","'pred","'",":","torch.Tensor","}","``"]
code: def evaluate_step(
      self, words: "torch.LongTensor", seq_len: "torch.LongTensor"
  ):
      """
      :param words: 句子中 word 的 index，形状为 ``[batch_size, seq_len]``
      :param seq_len: 每个句子的长度，形状为 ``[batch,]``
      :return: 预测结果 ``{'pred': torch.Tensor}``
      """
      return self(words, seq_len=seq_len)
  
imports: 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.decoder import ConditionalRandomField
  from ...modules.torch.encoder import LSTM
  from ...modules.torch import decoder, encoder
  from ...modules.torch.decoder.crf import allowed_transitions
label_desc: Use image node_id 4 for calling the BiLSTMCRF obj's underlying member method code with example usage: obj.evaluate_step(words, seq_len) and returns: self