class_docstr: Augmenter that leverage TF-IDF statistics to insert or substitute word.
  
  :param str model_path: Downloaded model directory. Either model_path or model is must be provided
  :param str action: Either 'insert or 'substitute'. If value is 'insert', a new word will be injected to random
      position according to TF-IDF calculation. If value is 'substitute', word will be replaced according
      to TF-IDF calculation
  :param int top_k: Controlling lucky draw pool. Top k score token will be used for augmentation. Larger k, more
      token can be used. Default value is 5. If value is None which means using all possible tokens.
  :param float aug_p: Percentage of word will be augmented.
  :param int aug_min: Minimum number of word will be augmented.
  :param int aug_max: Maximum number of word will be augmented. If None is passed, number of augmentation is
      calculated via aup_p. If calculated result from aug_p is smaller than aug_max, will use calculated result
      from aug_p. Otherwise, using aug_max.
  :param list stopwords: List of words which will be skipped from augment operation.
  :param str stopwords_regex: Regular expression for matching words which will be skipped from augment operation.
  :param func tokenizer: Customize tokenization process
  :param func reverse_tokenizer: Customize reverse of tokenization process
  :param str name: Name of this augmenter
  
  >>> import nlpaug.augmenter.word as naw
  >>> aug = naw.TfIdfAug(model_path='.')
code: def _get_aug_idxes(self, tokens):
      aug_cnt = self.generate_aug_cnt(len(tokens))
      word_idxes = self.pre_skip_aug(tokens)
      word_idxes = self.skip_aug(word_idxes, tokens)
  
      if len(word_idxes) == 0:
          if self.verbose > 0:
              exception = WarningException(
                  name=WarningName.OUT_OF_VOCABULARY,
                  code=WarningCode.WARNING_CODE_002,
                  msg=WarningMessage.NO_WORD,
              )
              exception.output()
          return None
      if len(word_idxes) < aug_cnt:
          aug_cnt = len(word_idxes)
  
      aug_probs = self.model.cal_tfidf(word_idxes, tokens)
      aug_idxes = []
  
      # It is possible that no token is picked. So re-try
      retry_cnt = 3
      possible_idxes = word_idxes.copy()
      for _ in range(retry_cnt):
          for i, p in zip(possible_idxes, aug_probs):
              if self.prob() < p:
                  aug_idxes.append(i)
                  possible_idxes.remove(i)
  
                  if len(possible_idxes) == aug_cnt:
                      break
  
      # If still cannot pick up, random pick index regrardless probability
      if len(aug_idxes) < aug_cnt:
          aug_idxes.extend(
              self.sample(possible_idxes, aug_cnt - len(aug_idxes))
          )
  
      aug_idxes = self.sample(aug_idxes, aug_cnt)
  
      return aug_idxes
  
file_path: nlpaug/nlpaug/augmenter/word/tfidf.py
imports: from nlpaug.augmenter.word import WordAugmenter
  from nlpaug.util import Action, Doc, WarningException, WarningName, WarningCode, WarningMessage
  import nlpaug.model.word_stats
label_desc: Use image node_id 3 for calling the TfIdfAug obj's underlying member method code with example usage: obj._get_aug_idxes(tokens) and returns: aug_idxes, None