code: def get_idx2vec_weights(wv, idx2word):
      idx2vec = {k: wv[v] for k, v in idx2word.items() if v in wv}
  
      # add padding embedding (all zeros) to idx2vec lookup
      idx2vec[pad_idx] = pad_embed
      return idx2vec
  
file_path: singa/examples/qabot/qabot_data.py
imports: import numpy
  import random
  import os
  import urllib
label_desc: Use image node_id 7 for calling a global function with example usage: get_idx2vec_weights(wv, idx2word) and returns: idx2vec