code: def get_metrics(gt: List[str], pred: List[str], pool: bool = True):
      metrics = defaultdict(list)
      if pool:
          with Pool() as p:
              _metrics = p.starmap(
                  compute_metrics, iterable=zip(pred, gt)
              )
      else:
          _metrics = [compute_metrics(p, g) for p, g in zip(pred, gt)]
      for m in _metrics:
          for key, value in m.items():
              metrics[key].append(value)
      return dict(metrics)
  
file_path: nougat/nougat/metrics.py
imports: import argparse
  from multiprocessing import Pool
  import re
  from pathlib import Path
  from collections import defaultdict
  from typing import List
  import numpy
  import nltk
  from nltk import edit_distance
  from tqdm import tqdm
  import orjson
label_desc: Use image node_id 4 for calling a global function with example usage: get_metrics(gt, pred, pool) and returns: dict