code: def evaluate_caption_scores(
      ground_truths_filtered,
      predictions_filtered,
      iou_thresholds=(0.3, 0.5, 0.7, 0.9),
      scorers=None,
  ):
      """Compute the mean NLP metrics over the given IOU thresholds.
  
      Args:
       ground_truths_filtered: Filtered list of ground truth captions for each
        threshold.
       predictions_filtered: Matching list of predicted captions for each threshold.
       iou_thresholds: A list of thresholds for IOU to average over.
       scorers: A dictionary of scorers.
  
      Returns:
       metrics: dictionary with mean captioning score across the threshold set.
      """
  
      if scorers is None:
          scorers = {}
  
      # Compute the caption metrics.
      metrics = collections.defaultdict(list)
      for scorer_name, scorer in scorers.items():
          for threshold in iou_thresholds:
              # Handle the case where we have no overlapping truths
              if not ground_truths_filtered[str(threshold)]:
                  metrics[scorer_name].append(0.0)
              elif not predictions_filtered[str(threshold)]:
                  metrics[scorer_name].append(0.0)
              else:
                  score = scorer.compute_score(
                      ground_truths_filtered[str(threshold)],
                      predictions_filtered[str(threshold)],
                  )
                  score = np.nan_to_num(score[0])
                  metrics[scorer_name].append(score)
  
      # Aggregate the caption metrics.
      for key, value in metrics.items():
          metrics[key] = np.mean(value)
  
      return metrics
  
imports: import collections
  import logging
  import random
  import re
  import string
  import numpy
  from scenic.projects.vid2seq.metrics.cider import Cider
  from scenic.projects.vid2seq.metrics.meteor import Meteor
  from scenic.projects.vid2seq.metrics.ptbtokenizer import PTBTokenizer
label_desc: Use image node_id 8 for calling a global function with example usage: evaluate_caption_scores(ground_truths_filtered, predictions_filtered, iou_thresholds, scorers) and returns: metrics