code: def unmask(self, text_with_mask):
      torch = self.torch
      tokenizer = self.bert_tokenizer
      model = self.bert
      encoded = np.array(
          tokenizer.encode(text_with_mask, add_special_tokens=True)
      )
      input_ids = torch.tensor(encoded)
      masked = (
          (input_ids == self.bert_tokenizer.mask_token_id)
          .numpy()
          .nonzero()[0]
      )
      to_pred = torch.tensor([encoded], device=self.device)
      with torch.no_grad():
          outputs = model(to_pred)[0]
      ret = []
      for i in masked:
          v, top_preds = torch.topk(outputs[0, i], 500)
          words = tokenizer.convert_ids_to_tokens(top_preds)
          v = np.array([float(x) for x in v])
          ret.append((words, v))
      return ret
  
imports: from .None import utils
  from .None import anchor_base
  from .None import anchor_explanation
  import numpy
  import json
  import os
  import string
  import sys
  from io import open
  import numpy
label_desc: Use image node_id 2 for calling the TextGenerator obj's underlying member method code with example usage: obj.unmask(text_with_mask) and returns: ret