code: def per_token_accuracy(y_true, y_predicted):
      y_true = list(itertools.chain(*y_true))
      y_predicted = itertools.chain(*y_predicted)
      examples_len = len(y_true)
      correct = sum([y1 == y2 for y1, y2 in zip(y_true, y_predicted)])
      return correct / examples_len if examples_len else 0
  
file_path: DeepPavlov/deeppavlov/metrics/accuracy.py
imports: import itertools
  import re
  from logging import getLogger
  from typing import List
  import numpy
  from deeppavlov.core.common.metrics_registry import register_metric
label_desc: Use image node_id 8 for calling a global function with example usage: per_token_accuracy(y_true, y_predicted) and returns: unknown