code: def __init__(self, args, num_ner_labels):
      super().__init__()
  
      bert_model_name = args.entity_model
      vocab_name = bert_model_name
  
      if args.entity_bert_model_dir is not None:
          bert_model_name = str(args.entity_bert_model_dir) + "/"
          # vocab_name = bert_model_name + 'vocab.txt'
          vocab_name = bert_model_name
          logger.info(
              "Loading BERT model from {}".format(bert_model_name)
          )
  
      if args.entity_use_albert:
          self.tokenizer = AlbertTokenizer.from_pretrained(vocab_name)
          self.bert_model = AlbertForEntity.from_pretrained(
              bert_model_name,
              num_ner_labels=num_ner_labels,
              max_span_length=args.entity_max_span_length,
          )
      else:
          self.tokenizer = BertTokenizer.from_pretrained(vocab_name)
          self.bert_model = BertForEntity.from_pretrained(
              bert_model_name,
              num_ner_labels=num_ner_labels,
              max_span_length=args.entity_max_span_length,
          )
  
      self._model_device = "cpu"
      self.move_model_to_cuda(args=args)
  
imports: import os
  import sys
  import torch
  from torch import nn
  import torch.nn.functional
  from torch.nn import CrossEntropyLoss
  from allennlp.nn.util import batched_index_select
  from allennlp.nn import util
  from allennlp.modules import FeedForward
  import numpy
  from transformers import BertTokenizer, BertPreTrainedModel, BertModel
  from transformers import AlbertTokenizer, AlbertPreTrainedModel, AlbertModel
  import os
  import json
  import logging
label_desc: Use image node_id 1 to create a new EntityModel object  with example: obj = EntityModel(args, num_ner_labels)