class_docstr: Transformation controller which applies multi transformations
  to each data sample.
class_docstr_tok: ["Transformation","controller","which","applies","multi","transformations","to","each","data","sample","."]
docstr: :param str task: Indicate which task of your transformation data.
  :param int max_trans: Maximum transformed samples generate by one
      original sample pre Transformation.
  :param int random_seed: random number seed to reproduce generation.
  :param str|list fields: Indicate which fields to apply transformations.
      Multi fields transform just for some special task, like: SM、NLI.
  :param list trans_methods: list of transformations' name.
  :param dict trans_config: transformation class configs, useful
      to control the behavior of transformations.
  :param bool return_unk: Some transformation may generate unk labels,
      s.t. insert a word to a sequence in NER task.
      If set False, would skip these transformations.
  :param list sub_methods: list of subpopulations' name.
  :param dict sub_config: subpopulation class configs, useful
      to control the behavior of subpopulation.
  :param str attack_methods: path to the python file containing
   the Attack instances.
  :param list validate_methods: confidence calculate functions.
docstr_tok: [":","param","str","task",":","Indicate","which","task","of","your","transformation","data",".",":","param","int","max_trans",":","Maximum","transformed","samples","generate","by","one","original","sample","pre","Transformation",".",":","param","int","random_seed",":","random","number","seed","to","reproduce","generation",".",":","param","str|list","fields",":","Indicate","which","fields","to","apply","transformations",".","Multi","fields","transform","just","for","some","special","task",",","like",":","SM\u3001NLI",".",":","param","list","trans_methods",":","list","of","transformations","'","name",".",":","param","dict","trans_config",":","transformation","class","configs",",","useful","to","control","the","behavior","of","transformations",".",":","param","bool","return_unk",":","Some","transformation","may","generate","unk","labels",",","s.t",".","insert","a","word","to","a","sequence","in","NER","task",".","If","set","False",",","would","skip","these","transformations",".",":","param","list","sub_methods",":","list","of","subpopulations","'","name",".",":","param","dict","sub_config",":","subpopulation","class","configs",",","useful","to","control","the","behavior","of","subpopulation",".",":","param","str","attack_methods",":","path","to","the","python","file","containing","the","Attack","instances",".",":","param","list","validate_methods",":","confidence","calculate","functions","."]
code: def __init__(
      self,
      task="UT",
      max_trans=1,
      random_seed=1,
      fields="x",
      trans_methods=None,
      trans_config=None,
      return_unk=True,
      sub_methods=None,
      sub_config=None,
      attack_methods=None,
      validate_methods=None,
      **kwargs,
  ):
      r"""
  
      :param str task: Indicate which task of your transformation data.
      :param int max_trans: Maximum transformed samples generate by one
          original sample pre Transformation.
      :param int random_seed: random number seed to reproduce generation.
      :param str|list fields: Indicate which fields to apply transformations.
          Multi fields transform just for some special task, like: SM、NLI.
      :param list trans_methods: list of transformations' name.
      :param dict trans_config: transformation class configs, useful
          to control the behavior of transformations.
      :param bool return_unk: Some transformation may generate unk labels,
          s.t. insert a word to a sequence in NER task.
          If set False, would skip these transformations.
      :param list sub_methods: list of subpopulations' name.
      :param dict sub_config: subpopulation class configs, useful
          to control the behavior of subpopulation.
      :param str attack_methods: path to the python file containing
       the Attack instances.
      :param list validate_methods: confidence calculate functions.
      """
      self.task = task
      self.max_trans = max_trans
      self.random_seed = random_seed
      self.fields = fields
  
      self.return_unk = return_unk
      # text processor to do nlp preprocess
      self.processor = EnProcessor()
      self.transform_methods = trans_methods
      self.trans_config = trans_config if trans_config else {}
  
      self.sub_methods = sub_methods
      self.sub_config = sub_config if sub_config else {}
      self.attack_methods = attack_methods
      self.validate_methods = validate_methods
  
imports: from tqdm import tqdm
  from abc import ABC
  from itertools import product
  from ...input.dataset import Dataset
  from ...common.utils.seed import set_seed
  from ...common.utils.logger import logger
  from ...common.preprocess import EnProcessor
  from ...common.utils.load import pkg_class_load, load_module_from_file
  from ..transformation import Transformation, Pipeline
  from ..subpopulation import SubPopulation
  from ...common.settings import TASK_TRANSFORMATION_PATH, ALLOWED_TRANSFORMATIONS, TASK_SUBPOPULATION_PATH, ALLOWED_SUBPOPULATIONS
label_desc: Use image node_id 1 to create a new Generator object from inherited base classes: ABC with example: obj = Generator(task, max_trans, random_seed, fields, trans_methods, trans_config, return_unk, sub_methods, sub_config, attack_methods, validate_methods)