docstr: :param query:
  :param choices:
  :param filter_results:
  :return:
docstr_tok: [":","param","query",":",":","param","choices",":",":","param","filter_results",":",":","return",":"]
code: def rank(
      self,
      query: str,
      choices: List[str],
      filter_results=defaults.filter_results,
  ):
      """
      :param query:
      :param choices:
      :param filter_results:
      :return:
      """
      if len(choices) == 0:
          return [], []
      input_ids, attention_mask, token_type_ids = self.encode(
          query, choices
      )
  
      logits = np.array(
          self.session.run(
              None,
              {
                  "input_ids": np.array(
                      input_ids
                  ),  # .reshape(-1, self.max_seq_len),
                  "input_mask": np.array(
                      attention_mask
                  ),  # .reshape(-1, self.max_seq_len),
                  "segment_ids": np.array(
                      token_type_ids
                  ),  # .reshape(-1, self.max_seq_len)
              },
          )
      )[0]
  
      scores = []
      all_scores = []
      index_map = []
      for i, logit in enumerate(logits):
          neg_logit = logit[0]
          score = logit[1]
          all_scores.append(score)
          if score > neg_logit or not filter_results:
              scores.append(score)
              index_map.append(i)
      sorted_indices = [index_map[i] for i in np.argsort(scores)[::-1]]
      return sorted_indices, [all_scores[i] for i in sorted_indices]
  
file_path: nboost/nboost/plugins/rerank/onnxbert.py
imports: from transformers import AutoTokenizer
  from typing import List
  import numpy
  from nboost.plugins.models.rerank.base import RerankModelPlugin
  from nboost import defaults
  import onnxruntime
  import glob
  import os
label_desc: Use image node_id 2 for calling the ONNXBertRerankModelPlugin obj's underlying member method code with example usage: obj.rank(query, choices, filter_results) and returns: sorted_indices,  unknown, list,  list