class_docstr: Class for ranking of relations using the model trained with NLL loss
  Args:
      pretrained_bert: pretrained transformer checkpoint path or key title (e.g. "bert-base-uncased")
      encoder_save_path: path to save the encoder checkpoint
      linear_save_path: path to save linear layer checkpoint
      return_probas: set this to `True` if you need the probabilities instead of raw answers
code: def __call__(
      self, input_features: Dict[str, Any]
  ) -> Union[List[int], List[np.ndarray]]:
      self.model.eval()
      _input = {
          "input_ids": torch.LongTensor(input_features["input_ids"]).to(
              self.device
          ),
          "attention_mask": torch.LongTensor(
              input_features["attention_mask"]
          ).to(self.device),
          "token_type_ids": torch.LongTensor(
              input_features["token_type_ids"]
          ).to(self.device),
      }
  
      with torch.no_grad():
          output = self.model(**_input)
          if isinstance(output, tuple) and len(output) == 2:
              loss, softmax_scores = output
          else:
              softmax_scores = output
      if self.return_probas:
          softmax_scores = softmax_scores.cpu().numpy().tolist()
          return softmax_scores
      else:
          pred = torch.argmax(softmax_scores, dim=1)
          pred = pred.cpu()
          pred = pred.numpy()
          return pred
  
imports: from logging import getLogger
  from pathlib import Path
  from typing import List, Dict, Tuple, Union, Any
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
  from transformers import AutoConfig, AutoModel, AutoTokenizer
  from deeppavlov.core.commands.utils import expand_path
  from deeppavlov.core.common.errors import ConfigError
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.models.torch_model import TorchModel
label_desc: Use image node_id 3 for calling the TorchTransformersNLLRanker obj's underlying member method code with example usage: obj.__call__(input_features) and returns: softmax_scores, pred