code: def ner_f1(y_true, y_predicted):
      """
      Calculates F1 measure for Named Entity Recognition task.
  
      Args:
          y_true: list of true values
          y_predicted: list of predicted values
  
      Returns:
          F1 score
  
      Alias:
          ner_f1
      """
      y_true = list(chain(*y_true))
      y_predicted = list(chain(*y_predicted))
      results = precision_recall_f1(
          y_true, y_predicted, print_results=True
      )
      f1 = results["__total__"]["f1"]
      return f1
  
file_path: DeepPavlov/deeppavlov/metrics/fmeasure.py
imports: import itertools
  from collections import OrderedDict
  from itertools import chain
  from logging import getLogger
  import numpy
  from sklearn.metrics import f1_score
  from deeppavlov.core.common.metrics_registry import register_metric
label_desc: Use image node_id 1 for calling a global function with example usage: ner_f1(y_true, y_predicted) and returns: f1