code: def embedding_alignment(
      ref_emb: np.ndarray, hypo_emb: np.ndarray
  ) -> List[float]:
      """
      Return embedding matching alignment for each item in hypo_emb
      ref_emb: list of reference embeddings
      hypo_emb: list oh hypothesises embeddings
      """
      scores = []
      for he in hypo_emb:
          # some embeddings can be empty. For example, for latex-style equations, or empty string
          if len(he) > 0:
              out = [
                  cosine_similarity_scaled(he, re)
                  for re in ref_emb
                  if len(re) > 0
              ]
              if len(out) > 0:
                  scores.append(max(out))
      return scores
  
file_path: ParlAI/projects/roscoe/utils.py
imports: import numpy
  import os
  import pathlib
  from nltk.tokenize import sent_tokenize
  from typing import Callable, Dict, Iterable, List, Tuple
  import torch
label_desc: Use image node_id 4 for calling a global function with example usage: embedding_alignment(ref_emb, hypo_emb) and returns: scores