class_docstr: Transforms an input by replacing its tokens with words of mask language
  predicted.
  To accelerate transformation for long text, input single sentence to
  language model rather than whole text.
docstr: :param str masked_model: masked language model to predicate candidates
  :param str device: indicate utilize cpu or which gpu device to run
      neural network
  :param int accrue_threshold: threshold of Bert results to pick
  :param max_sent_size: max_sent_size
  :param int trans_min: Minimum number of character will be augmented.
  :param int trans_max: Maximum number of character will be augmented.
      If None is passed, number of augmentation is calculated via aup_char_p.
      If calculated result from aug_p is smaller than aug_max, will use
      calculated result from aup_char_p. Otherwise, using aug_max.
  :param float trans_p: Percentage of character (per token) will be
      augmented.
  :param list stop_words: List of words which will be skipped from augment
      operation.
docstr_tok: [":","param","str","masked_model",":","masked","language","model","to","predicate","candidates",":","param","str","device",":","indicate","utilize","cpu","or","which","gpu","device","to","run","neural","network",":","param","int","accrue_threshold",":","threshold","of","Bert","results","to","pick",":","param","max_sent_size",":","max_sent_size",":","param","int","trans_min",":","Minimum","number","of","character","will","be","augmented",".",":","param","int","trans_max",":","Maximum","number","of","character","will","be","augmented",".","If","None","is","passed",",","number","of","augmentation","is","calculated","via","aup_char_p",".","If","calculated","result","from","aug_p","is","smaller","than","aug_max",",","will","use","calculated","result","from","aup_char_p",".","Otherwise",",","using","aug_max",".",":","param","float","trans_p",":","Percentage","of","character","(","per","token",")","will","be","augmented",".",":","param","list","stop_words",":","List","of","words","which","will","be","skipped","from","augment","operation","."]
code: def __init__(
      self,
      masked_model=None,
      device=None,
      accrue_threshold=1,
      max_sent_size=100,
      trans_min=1,
      trans_max=10,
      trans_p=0.2,
      stop_words=None,
      islist=False,
      **kwargs,
  ):
      r"""
      :param str masked_model: masked language model to predicate candidates
      :param str device: indicate utilize cpu or which gpu device to run
          neural network
      :param int accrue_threshold: threshold of Bert results to pick
      :param max_sent_size: max_sent_size
      :param int trans_min: Minimum number of character will be augmented.
      :param int trans_max: Maximum number of character will be augmented.
          If None is passed, number of augmentation is calculated via aup_char_p.
          If calculated result from aug_p is smaller than aug_max, will use
          calculated result from aup_char_p. Otherwise, using aug_max.
      :param float trans_p: Percentage of character (per token) will be
          augmented.
      :param list stop_words: List of words which will be skipped from augment
          operation.
  
      """
      super().__init__(
          trans_min=trans_min,
          trans_max=trans_max,
          trans_p=trans_p,
          stop_words=stop_words,
      )
      self.device = (
          self.get_device(device) if device else default_device
      )
      self.max_sent_size = max_sent_size
      self.get_pos = True
      self.accrue_threshold = accrue_threshold
      self.masked_model = (
          masked_model if masked_model else CN_BERT_MODEL_NAME
      )
      self.tokenizer = None
      self.model = None
      self.pos_allowed_token_id = None
      self.islist = islist
  
file_path: textflint/textflint/generation/transformation/UTCN/cn_mlm_suggestion.py
imports: import torch
  from ....common import device
  from ...transformation import CnWordSubstitute
  from ....common.settings import CN_BERT_MODEL_NAME
  from ....common.utils.list_op import trade_off_sub_words
label_desc: Use image node_id 1 to create a new MLMSuggestion object from inherited base classes: CnWordSubstitute with example: obj = MLMSuggestion(masked_model, device, accrue_threshold, max_sent_size, trans_min, trans_max, trans_p, stop_words, islist)