code: def init_context_word_embs_model(
      model_path,
      model_type,
      device,
      force_reload=False,
      batch_size=32,
      top_k=None,
      silence=True,
      use_custom_api=False,
  ):
      global CONTEXT_WORD_EMBS_MODELS
  
      model_name = "_".join(
          [os.path.basename(model_path), model_type, str(device)]
      )
      if model_name in CONTEXT_WORD_EMBS_MODELS and not force_reload:
          CONTEXT_WORD_EMBS_MODELS[model_name].top_k = top_k
          CONTEXT_WORD_EMBS_MODELS[model_name].batch_size = batch_size
          CONTEXT_WORD_EMBS_MODELS[model_name].silence = silence
          return CONTEXT_WORD_EMBS_MODELS[model_name]
  
      if use_custom_api:
          if model_type == "distilbert":
              model = nml.DistilBert(
                  model_path,
                  device=device,
                  top_k=top_k,
                  silence=silence,
                  batch_size=batch_size,
              )
          elif model_type == "roberta":
              model = nml.Roberta(
                  model_path,
                  device=device,
                  top_k=top_k,
                  silence=silence,
                  batch_size=batch_size,
              )
          elif model_type == "bert":
              model = nml.Bert(
                  model_path,
                  device=device,
                  top_k=top_k,
                  silence=silence,
                  batch_size=batch_size,
              )
          else:
              raise ValueError(
                  "Model type value is unexpected. Only support bert and roberta models."
              )
      else:
          if model_type in ["distilbert", "bert", "roberta", "bart"]:
              model = nml.FmTransformers(
                  model_path,
                  model_type=model_type,
                  device=device,
                  batch_size=batch_size,
                  top_k=top_k,
                  silence=silence,
              )
          else:
              raise ValueError(
                  "Model type value is unexpected. Only support bert and roberta models."
              )
  
      CONTEXT_WORD_EMBS_MODELS[model_name] = model
      return model
  
file_path: nlpaug/nlpaug/augmenter/word/context_word_embs.py
imports: import string
  import os
  import re
  import logging
  from nlpaug.augmenter.word import WordAugmenter
  import nlpaug.model.lang_models
  from nlpaug.util import Action, Doc
label_desc: Use image node_id 1 for calling a global function with example usage: init_context_word_embs_model(model_path, model_type, device, force_reload, batch_size, top_k, silence, use_custom_api) and returns: model, CONTEXT_WORD_EMBS_MODELS