code: def get_rouge_over_list(prediction, groundtruth):
      def remove_punc(text):
          exclude = set(string.punctuation)
          return "".join(ch for ch in text if ch not in exclude)
  
      if len(remove_punc(prediction)) == 0:
          return 0.0  # during early stages, it might generate nothing?
      # print(prediction)
      rouge = Rouge()
      if type(groundtruth) == list:
          if len(groundtruth) == 0:
              return 0
          return np.max(
              [
                  rouge.get_scores(prediction, gt, avg=True)["rouge-l"][
                      "f"
                  ]
                  for gt in groundtruth
              ]
          )
      return rouge.get_scores(prediction, groundtruth, avg=True)[
          "rouge-l"
      ]["f"]
  
file_path: OpenPrompt/openprompt/utils/crossfit_metrics.py
imports: import numpy
  import string
  import re
  from collections import Counter
  from sklearn.metrics import matthews_corrcoef, f1_score
  from scipy.stats import pearsonr, spearmanr
  from rouge import Rouge
label_desc: Use image node_id 5 for calling a global function with example usage: get_rouge_over_list(prediction, groundtruth) and returns: rouge, str, int, np, int