code: def round_f1(y_true, y_predicted):
      """
      Calculates F1 (binary) measure.
  
      Args:
          y_true: list of true values
          y_predicted: list of predicted values
  
      Returns:
          F1 score
  
      Alias:
          f1
      """
      try:
          predictions = [np.round(x) for x in y_predicted]
      except TypeError:
          if set(y_true) | set(y_predicted) in (
              {"True"},
              {"False"},
              {"False", "True"},
          ):
              y_true = [y == "True" for y in y_true]
              predictions = [y == "True" for y in y_predicted]
          else:
              raise RuntimeError(
                  f"Unexpectible type for {y_true} and {predictions}"
              )
  
      return f1_score(y_true, predictions)
  
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 5 for calling a global function with example usage: round_f1(y_true, y_predicted) and returns: f1_score