docstr: Get model predictions using features as input 
docstr_tok: ["Get","model","predictions","using","features","as","input"]
code: def __call__(
      self,
      input_ids: List,
      attention_mask: List,
      entity_pos: List,
      entity_tags: List,
  ) -> Union[List[int], List[np.ndarray]]:
      """Get model predictions using features as input"""
  
      self.model.eval()
  
      _input = {
          "input_ids": torch.LongTensor(input_ids).to(self.device),
          "attention_mask": torch.LongTensor(attention_mask).to(
              self.device
          ),
          "entity_pos": entity_pos,
          "ner_tags": entity_tags,
      }
  
      with torch.no_grad():
          indices, probas = self.model(**_input)
  
      if self.return_probas:
          pred = probas.cpu().numpy()
          pred[np.isnan(pred)] = 0
          pred_without_no_rel = []  # eliminate no_relation predictions
          for elem in pred:
              elem[0] = 0.0
              pred_without_no_rel.append(elem)
          new_pred = np.argmax(pred_without_no_rel, axis=1)
          one_hot = [[0.0] * self.n_classes] * len(new_pred)
          for i in range(len(new_pred)):
              one_hot[i][new_pred[i]] = 1.0
          pred = np.array(one_hot)
      else:
          pred = indices.cpu().numpy()
          pred[np.isnan(pred)] = 0
      return pred
  
file_path: DeepPavlov/deeppavlov/models/relation_extraction/relation_extraction_bert.py
imports: from logging import getLogger
  from typing import List, Optional, Union
  import numpy
  import torch
  from deeppavlov.core.common.errors import ConfigError
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.models.torch_model import TorchModel
  from deeppavlov.models.classifiers.re_bert import BertWithAdaThresholdLocContextPooling
label_desc: Use image node_id 3 for calling the REBertModel obj's underlying member method code with example usage: obj.__call__(input_ids, attention_mask, entity_pos, entity_tags) and returns: pred