code: def squad_f1(preds, labels):
      f1_scores = []
      n_docs = len(preds)
      for i in range(n_docs):
          best_pred = preds[i][0]
          best_f1 = max(
              [squad_f1_single(best_pred, label) for label in labels[i]]
          )
          f1_scores.append(best_f1)
      return np.mean(f1_scores)
  
imports: import logging
  import numpy
  import torch
  from functools import reduce
  from scipy.stats import pearsonr, spearmanr
  from seqeval.metrics import classification_report
  from seqeval.metrics import f1_score
  from sklearn.metrics import matthews_corrcoef, f1_score, mean_squared_error, r2_score, classification_report
  from farm.utils import flatten_list
label_desc: Use image node_id 11 for calling a global function with example usage: squad_f1(preds, labels) and returns: np