docstr: Calculate cosine similarity for each ground truth and retrieved/generated pair for a given question
docstr_tok: ["Calculate","cosine","similarity","for","each","ground","truth","and","retrieved\/generated","pair","for","a","given","question"]
code: def calculate_cosine_similarities(
      self,
      gt_embeddings: List[List[float]],
      test_embeddings: List[List[float]],
  ):
      """Calculate cosine similarity for each ground truth and retrieved/generated pair for a given question"""
  
      return [
          self._calculate_cosine_similarity(
              context_embedding, retrieved_context_embedding
          )
          for context_embedding, retrieved_context_embedding in zip(
              gt_embeddings, test_embeddings
          )
      ]
  
imports: import ast
  from collections import defaultdict
  from typing import List
  import nltk
  import pandas
  from nltk import word_tokenize
  from nltk.translate.bleu_score import sentence_bleu
  from nltk.translate.meteor_score import meteor_score
  from rouge_score import rouge_scorer
  from scipy.spatial import distance
  from mindsdb.integrations.handlers.writer_handler.settings import WriterHandlerParameters
  from mindsdb.utilities import log
label_desc: Use image node_id 12 for calling the WriterEvaluator obj's underlying member method code with example usage: obj.calculate_cosine_similarities(gt_embeddings, test_embeddings) and returns: unknown