class_docstr: Base class for reranker models
class_docstr_tok: ["Base","class","for","reranker","models"]
docstr: assign relative ranks to each choice
docstr_tok: ["assign","relative","ranks","to","each","choice"]
code: def rank(
      self,
      query: str,
      choices: List[str],
      filter_results=defaults.filter_results,
  ) -> Tuple[List[int], List[float]]:
      """assign relative ranks to each choice"""
      if len(choices) == 0:
          return [], []
  
      logits = self.get_logits(query, choices)
      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/base.py
imports: from typing import List, Tuple
  import time
  from nboost.plugins import Plugin
  from nboost.delegates import RequestDelegate, ResponseDelegate
  from nboost.helpers import calculate_mrr
  from nboost.database import DatabaseRow
  from nboost import defaults
  import numpy
label_desc: Use image node_id 3 for calling the RerankModelPlugin obj's underlying member method code with example usage: obj.rank(query, choices, filter_results) and returns: sorted_indices,  unknown, list,  list