class_docstr: Qa Evaluator. Now, we support metrics `'bleu'`
      
class_docstr_tok: ["Qa","Evaluator",".","Now",",","we","support","metrics","`","'bleu","'","`"]
code: def _metric_max_over_ground_truths(
      self, metric_fn, prediction, ground_truths
  ):
      scores_for_ground_truths = []
      for ground_truth in ground_truths:
          score = metric_fn(prediction, ground_truth)
          scores_for_ground_truths.append(score)
      if (
          len(scores_for_ground_truths) > 1
          and self.multiref_strategy == "leave_one_out"
      ):
          func = lambda x: (
              max(x) * (len(x) - 1) + np.partition(x, -2)[-2]
          ) / len(x)
      else:
          func = max
      return func(scores_for_ground_truths)
  
file_path: TextBox/textbox/evaluator/qa_evaluator.py
imports: import string
  import re
  import numpy
  from .abstract_evaluator import AbstractEvaluator
  from collections import Counter
label_desc: Use image node_id 5 for calling the QaEvaluator obj's underlying member method code with example usage: obj._metric_max_over_ground_truths(metric_fn, prediction, ground_truths) and returns: func