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

    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
    
deeppavlov/metrics/fmeasure.py