docstr: Load pretrained word embeddings for initialization
docstr_tok: ["Load","pretrained","word","embeddings","for","initialization"]
code: def load_embeddings(
      self,
      pretrained_word_emb_name="840B",
      pretrained_word_emb_url=None,
      pretrained_word_emb_cache_dir=".vector_cache/",
      dtype=np.float32,
  ):
      """Load pretrained word embeddings for initialization"""
      from .vocab_utils import WordEmbModel
  
      word_model = WordEmbModel(
          pretrained_word_emb_name=pretrained_word_emb_name,
          pretrained_word_emb_url=pretrained_word_emb_url,
          pretrained_word_emb_cache_dir=pretrained_word_emb_cache_dir,
      )
  
      word_list = list(self.symbol2idx.keys())
  
      word_emb, hit, cnt = word_model.get_vecs_by_tokens(
          tokens=word_list, lower_case_backup=self.lower_case
      )
  
      self.embeddings = word_emb.numpy()
      self.embeddings[self.get_symbol_idx(self.pad_token)] = np.zeros(
          word_model.dim
      )
  
imports: from operator import itemgetter
  import numpy
label_desc: Use image node_id 9 for calling the Vocab obj's underlying member method code with example usage: obj.load_embeddings(pretrained_word_emb_name, pretrained_word_emb_url, pretrained_word_emb_cache_dir, dtype) without return types