code: def squad_v1_exact_match(
      y_true: List[List[str]], y_predicted: List[str]
  ) -> float:
      """Calculates Exact Match score between y_true and y_predicted
          EM score uses the best matching y_true answer:
              if y_pred equal at least to one answer in y_true then EM = 1, else EM = 0
          Skips examples without an answer.
      Args:
          y_true: list of correct answers (correct answers are represented by list of strings)
          y_predicted: list of predicted answers
      Returns:
          exact match score : float
      """
      EM_total = 0
      count = 0
      for ground_truth, prediction in zip(y_true, y_predicted):
          if len(ground_truth[0]) == 0:
              # skip empty answers
              continue
          count += 1
          EMs = [
              int(normalize_answer(gt) == normalize_answer(prediction))
              for gt in ground_truth
          ]
          EM_total += max(EMs)
      return 100 * EM_total / count if count > 0 else 0
  
file_path: DeepPavlov/deeppavlov/metrics/squad_metrics.py
imports: import re
  import string
  from collections import Counter
  from typing import List
  from deeppavlov.core.common.metrics_registry import register_metric
label_desc: Use image node_id 2 for calling a global function with example usage: squad_v1_exact_match(y_true, y_predicted) and returns: unknown