code: def rouge(refs, preds):
      """
      Returns `t5` style ROUGE scores. See the related implementation:
      https://github.com/google-research/text-to-text-transfer-transformer/blob/3d10afd51ba97ac29eb66ae701eca274488202f7/t5/evaluation/metrics.py#L68
  
      :param refs:
          A `list` of reference `strs`.
      :param preds:
          A `list` of predicted `strs`.
      """
      rouge_types = ["rouge1", "rouge2", "rougeLsum"]
      scorer = rouge_scorer.RougeScorer(rouge_types)
      # Add newlines between sentences to correctly compute `rougeLsum`.
  
      def _prepare_summary(summary):
          summary = summary.replace(" . ", ".\n")
          return summary
  
      # Accumulate confidence intervals.
      aggregator = scoring.BootstrapAggregator()
      for ref, pred in zip(refs, preds):
          ref = _prepare_summary(ref)
          pred = _prepare_summary(pred)
          aggregator.add_scores(scorer.score(ref, pred))
      result = aggregator.aggregate()
      return {
          type: result[type].mid.fmeasure * 100 for type in rouge_types
      }
  
imports: import os
  import pathlib
  import re
  import collections
  import functools
  import inspect
  import sys
  from typing import List, Union
  import torch
  from omegaconf import OmegaConf
  import sacrebleu
  from rouge_score import rouge_scorer, scoring
label_desc: Use image node_id 14 for calling a global function with example usage: rouge(refs, preds) and returns: unknown, summary