class_docstr: Transforms an input by replacing its number word
  exmaple:
  {
      hypothesis: Mr Zhang has more than 20 students in Fudan university.
      premise: Mr Zhang has 10 students in Fudan university.
      y: contradicition
  }
docstr: Transform text string, this kind of transformation can only produce one
  sample.
  
  :param ~NLISample sample: input data, a NLISample contains 'hypothesis'
      field, 'premise' field and 'y' field
  :param int n: number of generated samples, this transformation can only
      generate one sample
  :return list trans_samples: transformed sample list that only contain
      one sample
docstr_tok: ["Transform","text","string",",","this","kind","of","transformation","can","only","produce","one","sample",".",":","param","~NLISample","sample",":","input","data",",","a","NLISample","contains","'hypothesis'","field",",","'premise","'","field","and","'","y","'","field",":","param","int","n",":","number","of","generated","samples",",","this","transformation","can","only","generate","one","sample",":","return","list","trans_samples",":","transformed","sample","list","that","only","contain","one","sample"]
code: def _transform(self, sample, n=1, **kwargs):
      r"""
      Transform text string, this kind of transformation can only produce one
      sample.
  
      :param ~NLISample sample: input data, a NLISample contains 'hypothesis'
          field, 'premise' field and 'y' field
      :param int n: number of generated samples, this transformation can only
          generate one sample
      :return list trans_samples: transformed sample list that only contain
          one sample
      """
      tokens = sample.get_words("premise")
      flag = False
  
      for num, token in enumerate(tokens):
          if token.isdigit():
              number = int(token)
              if LOWER_YEAR_NUM <= number <= UPPER_YEAR_NUM:
                  continue
              cont_hyp = _get_contradictory_hypothesis(
                  tokens, num, number
              )
              flag = True
              break
  
      if not flag:
          return None
  
      sample = sample.replace_fields(
          ["premise", "y"], [cont_hyp, "contradiction"]
      )
  
      return [sample]
  
file_path: textflint/textflint/generation/transformation/NLI/num_word.py
imports: from ..transformation import Transformation
  from ....common.utils.num_word import _get_contradictory_hypothesis
label_desc: Use image node_id 4 for calling the NumWord obj's underlying member method code with example usage: obj._transform(sample, n) and returns: list, None