code: def load_elmo_for_vocab(mentions):
      """
      Create the embedding using the cache logic in the embedding class
      Args:
          mentions:
  
      Returns:
  
      """
      elmo_embeddings = ElmoEmbedding()
  
      for mention in mentions:
          elmo_embeddings.get_head_feature_vector(mention)
  
      logger.info(
          "Total words/contexts in vocabulary %d",
          len(elmo_embeddings.cache),
      )
      return elmo_embeddings.cache
  
file_path: nlp-architect/nlp_architect/data/cdc_resources/gen_scripts/create_word_embed_elmo_dump.py
imports: import argparse
  import logging
  import os
  import pickle
  from os.path import join
  from nlp_architect.common.cdc.mention_data import MentionData
  from nlp_architect.data.cdc_resources.embedding.embed_elmo import ElmoEmbedding
  from nlp_architect.utils import io
label_desc: Use image node_id 1 for calling a global function with example usage: load_elmo_for_vocab(mentions) and returns: elmo_embeddings