class_docstr: Individual fairness perturbation for gender terms and pronouns.
class_docstr_tok: ["Individual","fairness","perturbation","for","gender","terms","and","pronouns","."]
docstr: Perform the perturbations on the provided text.
docstr_tok: ["Perform","the","perturbations","on","the","provided","text","."]
code: def perturb(self, text: str, rng: Random) -> str:
      """Perform the perturbations on the provided text."""
      # Substitute the words
      for word, synonym in self.word_synonym_pairs:
          text = self.substitute_word(text, word, synonym, rng)
  
      return text
  
file_path: H2O/h2o_hf/helm/src/helm/benchmark/augmentations/gender_perturbation.py
imports: from dataclasses import dataclass
  import json
  from random import Random
  import re
  from typing import Dict, List, Optional, Tuple
  from helm.common.general import match_case
  from .perturbation_description import PerturbationDescription
  from .perturbation import Perturbation
label_desc: Use image node_id 5 for calling the GenderPerturbation obj's underlying member method code with example usage: obj.perturb(text, rng) and returns: text