code: def __init__(self, words, tg, onepass=False):
      self.tg = tg
      self.words = words
      self.cache = {}
      self.mask = self.tg.bert_tokenizer.mask_token
      self.array = np.array(words, "|U80")
      self.onepass = onepass
      self.pr = np.zeros(len(self.words))
      for i in range(len(words)):
          a = self.array.copy()
          a[i] = self.mask
          s = " ".join(a)
          w, p = self.probs(s)[0]
          self.pr[i] = min(0.5, dict(zip(w, p)).get(words[i], 0.01))
  
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 1 to create a new SentencePerturber object  with example: obj = SentencePerturber(words, tg, onepass)