def batch_bleurt(
      self, paired_annos: List[annotation.PairedAnnotation]
  ) -> List[float]:
    """Batches calls to the wrapped BLEURT model for efficiency.

    Note this method does not handle batching and only a single batch should be
    passed.

    Args:
      paired_annos: A single batch of examples.

    Returns:
      A list of scores returned by the BLEURT model, using 0.0 or 1.0 to
        replace empty string matches.
    """
    negative_preds = {}
    for i, paired_anno in enumerate(paired_annos):
      if not paired_anno.pred_question and not paired_anno.gold_question:
        negative_preds[i] = 1.0
      elif not paired_anno.pred_question or not paired_anno.gold_question:
        negative_preds[i] = 0.0
    references = [paired_anno.gold_question for paired_anno in paired_annos]
    candidates = [paired_anno.pred_question for paired_anno in paired_annos]
    bleurt_scores = self.bleurt_scorer.score(
        references=references, candidates=candidates, batch_size=len(references)
    )
    return [
        bleurt_scores[i] if i not in negative_preds else negative_preds[i]
        for (i, score) in enumerate(bleurt_scores)
    ]
Batches calls to the wrapped BLEURT model for efficiency.

    Note this method does not handle batching and only a single batch should be
    passed.

    Args:
      paired_annos: A single batch of examples.

    Returns:
      A list of scores returned by the BLEURT model, using 0.0 or 1.0 to
        replace empty string matches.
    
language/diffqg/metrics.py