class_docstr: Transforms an input by add adverb word before verb.
class_docstr_tok: ["Transforms","an","input","by","add","adverb","word","before","verb","."]
docstr: Transform text string according transform_field.
  
  :param ~Sample sample: input data, normally one data component.
  :param str field: indicate which field to transform
  :param int n: number of generated samples
  :param kwargs:
  :return list trans_samples: transformed sample list.
docstr_tok: ["Transform","text","string","according","transform_field",".",":","param","~Sample","sample",":","input","data",",","normally","one","data","component",".",":","param","str","field",":","indicate","which","field","to","transform",":","param","int","n",":","number","of","generated","samples",":","param","kwargs",":",":","return","list","trans_samples",":","transformed","sample","list","."]
code: def _transform(self, sample, field="x", n=1, **kwargs):
      r"""
      Transform text string according transform_field.
  
      :param ~Sample sample: input data, normally one data component.
      :param str field: indicate which field to transform
      :param int n: number of generated samples
      :param kwargs:
      :return list trans_samples: transformed sample list.
  
      """
      pos_tags = sample.get_pos(field)
      _insert_indices = self._get_verb_location(pos_tags)
  
      if not _insert_indices:
          return []
  
      insert_words = []
      insert_indices = []
  
      for index in _insert_indices:
          _insert_words = self._get_random_adverbs(n=n)
  
          if _insert_words:
              insert_indices.append(index)
              insert_words.append(_insert_words)
  
      if not insert_words:
          return []
  
      insert_words, insert_indices = trade_off_sub_words(
          insert_words, insert_indices, n=n
      )
      trans_samples = []
  
      # get substitute candidates combinations
      for i in range(len(insert_words)):
          single_insert_words = insert_words[i]
          trans_samples.append(
              sample.insert_field_before_indices(
                  field, insert_indices, single_insert_words
              )
          )
  
      return trans_samples
  
file_path: textflint/textflint/generation/transformation/UT/insert_adv.py
imports: import random
  from ....common.settings import ADVERB_PATH
  from ...transformation import Transformation
  from ....common.utils.load import plain_lines_loader
  from ....common.utils.list_op import trade_off_sub_words
  from ....common.utils.install import download_if_needed
label_desc: Use image node_id 3 for calling the InsertAdv obj's underlying member method code with example usage: obj._transform(sample, field, n) and returns: trans_samples, list, list