code: def pearson_and_spearman(preds, labels):
      """get pearson and spearman correlation"""
      pearson_corr = pearsonr(preds, labels)[0]
      spearman_corr = spearmanr(preds, labels)[0]
      return {
          "pearson": pearson_corr,
          "spearmanr": spearman_corr,
          "corr": (pearson_corr + spearman_corr) / 2,
      }
  
file_path: nlp-architect/nlp_architect/utils/metrics.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  from scipy.stats import pearsonr, spearmanr
  from sklearn.metrics import f1_score
  from collections import defaultdict
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: pearson_and_spearman(preds, labels) and returns: dict