code: def pearson_and_spearman(preds, labels):
      pearson_corr = pearsonr(preds, labels)[0]
      spearman_corr = spearmanr(preds, labels)[0]
      return {
          "pearson": pearson_corr,
          "spearman": spearman_corr,
          "corr": (pearson_corr + spearman_corr) / 2,
      }
  
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 6 for calling a global function with example usage: pearson_and_spearman(preds, labels) and returns: dict