code: def load_embed_vocab(self) -> Optional[Dict[str, int]]:
      w2v = KeyedVectors.load_word2vec_format(
          self.w2v_path, **self.w2v_kwargs
      )
  
      token2idx = {"[PAD]": 0, "[UNK]": 1, "[BOS]": 2, "[EOS]": 3}
  
      for token in w2v.index2word:
          token2idx[token] = len(token2idx)
  
      vector_matrix = np.zeros((len(token2idx), w2v.vector_size))
      vector_matrix[1] = np.random.rand(w2v.vector_size)
      vector_matrix[4:] = w2v.vectors
  
      self.embedding_size = w2v.vector_size
      self.w2v_matrix = vector_matrix
      w2v_top_words = w2v.index2entity[:50]
  
      logger.debug("------------------------------------------------")
      logger.debug("Loaded gensim word2vec model's vocab")
      logger.debug("model        : {}".format(self.w2v_path))
      logger.debug("word count   : {}".format(len(self.w2v_matrix)))
      logger.debug("Top 50 words : {}".format(w2v_top_words))
      logger.debug("------------------------------------------------")
  
      return token2idx
  
file_path: Kashgari/kashgari/embeddings/word_embedding.py
imports: from typing import Dict, Any, Optional
  import numpy
  from gensim.models import KeyedVectors
  from tensorflow import keras
  from kashgari.embeddings.abc_embedding import ABCEmbedding
  from kashgari.logger import logger
label_desc: Use image node_id 3 for calling the WordEmbedding obj's underlying member method code with example usage: obj.load_embed_vocab() and returns: token2idx