code: def predict(self, text, group=True, exclude_entities=["O"]):
      # Inputs are provided through numpy array
      tokens = self.tokenizer.tokenize(
          self.tokenizer.decode(self.tokenizer.encode(text))
      )
  
      model_inputs = self.tokenizer(text, return_tensors="pt")
      inputs_onnx = {
          k: v.cpu().detach().numpy() for k, v in model_inputs.items()
      }
      outputs = self.model.run(None, inputs_onnx)[0]
      outputs = softmax(outputs)
  
      predictions = np.argmax(outputs, axis=2)
  
      preds = [
          (token, self.labels[prediction], output[prediction])
          for token, output, prediction in zip(
              tokens, outputs[0], predictions[0]
          )
      ][1:-1]
  
      preds = [
          {
              "index": index,
              "word": prediction[0],
              "entity": prediction[1],
              "score": prediction[2],
          }
          for index, prediction in enumerate(preds)
      ]
  
      if group is True:
          preds = group_entities(preds)
  
      out_preds = []
      for pred in preds:
          if pred["entity"] not in exclude_entities:
              try:
                  pred["entity"] = pred["entity"].split("-")[1]
              except Exception:
                  pass
  
              out_preds.append(pred)
  
      return out_preds
  
imports: import torch
  from pathlib import Path
  from .onnx_helper import load_model
  from .learner_ner import group_entities
  from .data_ner import get_labels
  from transformers import AutoTokenizer
  import numpy
  import warnings
label_desc: Use image node_id 2 for calling the BertOnnxNERPredictor obj's underlying member method code with example usage: obj.predict(text, group, exclude_entities) and returns: out_preds