code: def __init__(
      self,
      model_path="bert-base-uncased",
      model_type="bert",
      top_k=None,
      device="cuda",
      max_length=300,
      batch_size=32,
      silence=True,
  ):
      super().__init__(
          device, model_type=model_type, top_k=top_k, silence=silence
      )
      try:
          from transformers import pipeline
      except ModuleNotFoundError:
          raise ModuleNotFoundError(
              "Missed transformers library. Install transfomers by `pip install transformers`"
          )
  
      self.max_length = max_length
      self.batch_size = batch_size
      self.model_path = model_path
      device = self.convert_device(device)
      top_k = top_k if top_k else 5
  
      if silence:
          # Transformers thrown an warning regrading to weight initialization. It is expected
          orig_log_level = logging.getLogger(
              "transformers." + "modeling_utils"
          ).getEffectiveLevel()
          logging.getLogger(
              "transformers." + "modeling_utils"
          ).setLevel(logging.ERROR)
          self.model = pipeline(
              "fill-mask", model=model_path, device=device, top_k=top_k
          )
          logging.getLogger(
              "transformers." + "modeling_utils"
          ).setLevel(orig_log_level)
      else:
          self.model = pipeline(
              "fill-mask", model=model_path, device=device, top_k=top_k
          )
  
file_path: nlpaug/nlpaug/model/lang_models/fill_mask_transformers.py
imports: import logging
  from nlpaug.model.lang_models import LanguageModels
label_desc: Use image node_id 1 to create a new FmTransformers object from inherited base classes: LanguageModels with example: obj = FmTransformers(model_path, model_type, top_k, device, max_length, batch_size, silence)