code: def _extract_QA_result(result):
      text_preds = []
      text_labels = []
      for r in result:
          current_labels = []
          current_preds = []
          if len(r.ground_truth_answer) == 0:
              current_labels.append("no_answer")
          else:
              for a in r.ground_truth_answer:
                  current_labels.append(a["text"])
          text_labels.append(current_labels)
  
          for p in r.prediction:
              current_preds.append(p.answer)
          text_preds.append(current_preds)
  
      return text_preds, text_labels
  
imports: from sentence_transformers import SentenceTransformer
  from sklearn.metrics.pairwise import cosine_similarity
  import numpy
  from farm.evaluation.metrics import top_n_accuracy
label_desc: Use image node_id 2 for calling a global function with example usage: _extract_QA_result(result) and returns: text_preds,  text_labels