code: def __init__(
      self,
      vocab_size,
      num_labels,
      embedding_dim,
      hidden_size,
      drop_out,
      bidirectional,
      num_layers,
  ):
      super().__init__()
      """ nn.Embedding: parameter size (num_words, embedding_dim) """
      self.embed = nn.Embedding(vocab_size, embedding_dim)
      self.lstm = nn.LSTM(
          embedding_dim,
          hidden_size,
          dropout=drop_out,
          num_layers=num_layers,
          batch_first=True,
          bidirectional=bidirectional,
      )
      self.linear = nn.Linear(hidden_size * 2, num_labels)
      """https://pytorch-crf.readthedocs.io/en/stable/_modules/torchcrf.html"""
      self.crf = CRF(num_labels, batch_first=True)
  
file_path: DeepKE/src/deepke/name_entity_re/standard/models/BiLSTM_CRF.py
imports: import torch.nn
  from torchcrf import CRF
label_desc: Use image node_id 1 to create a new BiLSTM_CRF object from inherited base classes: nn with example: obj = BiLSTM_CRF(vocab_size, num_labels, embedding_dim, hidden_size, drop_out, bidirectional, num_layers)