class_docstr: Canonical robustness perturbation that composes several perturbations.
  These perturbations are chosen to be reasonable.
class_docstr_tok: ["Canonical","robustness","perturbation","that","composes","several","perturbations",".","These","perturbations","are","chosen","to","be","reasonable","."]
code: def perturb(self, text: str, rng: Random) -> str:
      # 1) Preserve word identity
  
      # Lowercase the words
      text = self.lowercase_perturbation.perturb(text, rng)
  
      # 2) Preserve well-formedness
  
      # Contractions
      text = self.contraction_perturbation.perturb(text, rng)
  
      # 3) Perturb words (might make things a bit ill-formed)
  
      # Misspellings
      text = self.misspelling_perturbation.perturb(text, rng)
  
      # 4) Change spaces around words
  
      # Insert extra spaces between words
      text = self.space_perturbation.perturb(text, rng)
  
      return text
  
file_path: H2O/h2o_hf/helm/src/helm/benchmark/augmentations/mild_mix_perturbation.py
imports: from random import Random
  from .perturbation_description import PerturbationDescription
  from .perturbation import Perturbation
  from .lowercase_perturbation import LowerCasePerturbation
  from .contraction_expansion_perturbation import ContractionPerturbation
  from .space_perturbation import SpacePerturbation
  from .misspelling_perturbation import MisspellingPerturbation
label_desc: Use image node_id 3 for calling the MildMixPerturbation obj's underlying member method code with example usage: obj.perturb(text, rng) and returns: text