code: def __init__(self, model_dir: str):
      self.model, self.tokenizer, self.model_config = self.load_model(
          model_dir
      )
      self.label_map = self.model_config["label_map"]
      self.max_seq_length = self.model_config["max_seq_length"]
      self.label_map = {int(k): v for k, v in self.label_map.items()}
      self.device = "cuda" if torch.cuda.is_available() else "cpu"
      self.model = self.model.to(self.device)
      self.model.eval()
  
file_path: DeepKE/example/triple/cnschema/InferBert.py
imports: from __future__ import absolute_import, division, print_function
  import json
  import os
  import torch
  import torch.nn.functional
  from pytorch_transformers import BertConfig, BertForTokenClassification, BertTokenizer
  from collections import OrderedDict
label_desc: Use image node_id 1 to create a new InferNer object  with example: obj = InferNer(model_dir)