class_docstr: TransformerEmbedding is based on bert4keras.
  The embeddings itself are wrapped into our simple embedding interface so that they can be used like any other embedding.
class_docstr_tok: ["TransformerEmbedding","is","based","on","bert4keras",".","The","embeddings","itself","are","wrapped","into","our","simple","embedding","interface","so","that","they","can","be","used","like","any","other","embedding","."]
code: def load_embed_vocab(self) -> Optional[Dict[str, int]]:
      token2idx: Dict[str, int] = {}
      with codecs.open(self.vocab_path, "r", "utf8") as reader:
          for line in reader:
              token = line.strip()
              self.vocab_list.append(token)
              token2idx[token] = len(token2idx)
      top_words = [k for k, v in list(token2idx.items())[:50]]
      logger.debug("------------------------------------------------")
      logger.debug("Loaded transformer model's vocab")
      logger.debug(f"config_path       : {self.config_path}")
      logger.debug(f"vocab_path      : {self.vocab_path}")
      logger.debug(f"checkpoint_path : {self.checkpoint_path}")
      logger.debug(f"Top 50 words    : {top_words}")
      logger.debug("------------------------------------------------")
  
      return token2idx
  
file_path: Kashgari/kashgari/embeddings/transformer_embedding.py
imports: import codecs
  import json
  from typing import Dict, List, Any, Optional
  from bert4keras.models import build_transformer_model
  from kashgari.embeddings.abc_embedding import ABCEmbedding
  from kashgari.logger import logger
label_desc: Use image node_id 3 for calling the TransformerEmbedding obj's underlying member method code with example usage: obj.load_embed_vocab() and returns: token2idx