def score_batch(
      self, paired_annos: List[annotation.PairedAnnotation]
  ) -> Iterable[ScoredPair]:
    """Scores multiple annotations at once, useful for batching model calls.

    Note this method does not handle batching, and the length of the list will
    be used as the batch size.

    Args:
      paired_annos: A single batch of annotations to score.

    Yields:
      ScoredPair objects consisting of the annotation with metrics populated.
        Note that bleurt and qsim might be None if the models were not loaded.
    """
    labels = [_normalize_and_get_label(anno) for anno in paired_annos]
    nones = [None] * len(paired_annos)
    bleurts = (
        self.batch_bleurt(paired_annos)
        if self.bleurt_scorer is not None
        else nones
    )
    qsims = (
        self.qsim_model.are_paired_annos_duplicate(paired_annos)
        if self.qsim_model is not None
        else nones
    )
    for i, paired_anno in enumerate(paired_annos):
      rouge = self.get_rouge_L(paired_anno)
      f1 = self.get_f1(paired_anno)
      score = Score(rouge, f1, labels[i], bleurts[i], qsims[i])
      yield ScoredPair(score, paired_anno)
Scores multiple annotations at once, useful for batching model calls.

    Note this method does not handle batching, and the length of the list will
    be used as the batch size.

    Args:
      paired_annos: A single batch of annotations to score.

    Yields:
      ScoredPair objects consisting of the annotation with metrics populated.
        Note that bleurt and qsim might be None if the models were not loaded.
    
language/diffqg/metrics.py