code: def calc_word_to_sentence_sim_w2v(
      target_word, string_vec, model, max_items_to_test
  ):
      """
  
      Args:
          target_word(str): input target word
          string_vec(list(str)): sentence
          model(gensim.models.Word2Vec): w2v model
          max_items_to_test(int): max number of words
  
      Returns:
          float: top_av, average embedding similarity betewwen target word and words in string vec
          (sentence)
  
      """
      sim_score_vec = []
      i = 0
      for word in string_vec:
          # remove leading white spaces
          word = word.strip()
          if target_word != word:
              sim_score = w2v_similarity_envelope(
                  target_word, word, model
              )
              sim_score_vec.insert(i, sim_score)
              i += 1
          if max_items_to_test > 0:
              if max_items_to_test == i:
                  break
  
      top_av = calc_top_av(sim_score_vec)
      return top_av
  
file_path: nlp-architect/examples/most_common_word_sense/feature_extraction.py
imports: import re
  import nltk
  import numpy
  from numpy import dot
  from numpy.linalg import norm
  from nlp_architect.utils.generic import license_prompt
label_desc: Use image node_id 7 for calling a global function with example usage: calc_word_to_sentence_sim_w2v(target_word, string_vec, model, max_items_to_test) and returns: top_av