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.
class_docstr_tok: ["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: Precalculate meaningful tokens, filter tokens which is not an alphabetic
  string.
  
  Pre filter would accelerate procedure of verifying pos tags of
  candidates.
docstr_tok: ["Precalculate","meaningful","tokens",",","filter","tokens","which","is","not","an","alphabetic","string",".","Pre","filter","would","accelerate","procedure","of","verifying","pos","tags","of","candidates","."]
code: def pre_calculate_allowed_tokens(self):
      r"""
      Precalculate meaningful tokens, filter tokens which is not an alphabetic
      string.
  
      Pre filter would accelerate procedure of verifying pos tags of
      candidates.
  
      """
      pos_to_token_id_dict = defaultdict(list)
  
      bert_tokens = self.tokenizer.convert_ids_to_tokens(
          list(range(self.tokenizer.vocab_size))
      )
      bert_token_pos = self.processor.get_pos(bert_tokens)
  
      for index, pos in enumerate(bert_token_pos):
          word = bert_tokens[index]
  
          if not word.isalpha() or len(word) == 1:
              continue
  
          pos_to_token_id_dict[pos[1][:2]].append(index)
  
      for pos, indices in pos_to_token_id_dict.items():
          pos_to_token_id_dict[pos] = torch.tensor(
              indices, dtype=torch.long, device=self.device
          )
  
      return pos_to_token_id_dict
  
file_path: textflint/textflint/generation/transformation/UT/mlm_suggestion.py
imports: import torch
  from copy import copy
  from collections import defaultdict
  from ....common import device
  from ...transformation.word_substitute import WordSubstitute
  from ....common.settings import BERT_MODEL_NAME
  from ....common.utils.list_op import trade_off_sub_words
label_desc: Use image node_id 5 for calling the MLMSuggestion obj's underlying member method code with example usage: obj.pre_calculate_allowed_tokens() and returns: pos_to_token_id_dict