From 0414f719e9d39d69997b2c2d1f3f1f1ddefd9ad7 Mon Sep 17 00:00:00 2001 From: Kalyan Chakravarthy Date: Sat, 14 Sep 2024 15:50:15 +0530 Subject: [PATCH] parameter: number_of_lines -> max_lines. --- langtest/transform/robustness.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/langtest/transform/robustness.py b/langtest/transform/robustness.py index 6805e7abd..36fd36ffd 100644 --- a/langtest/transform/robustness.py +++ b/langtest/transform/robustness.py @@ -1948,7 +1948,7 @@ def transform( sample_list: List[Sample], prob: Optional[float] = 1.0, count: int = 1, - number_of_lines: int = 3, + max_lines: int = 3, ) -> List[Sample]: """Transforms the given sample list by adding new lines to the input text. @@ -1957,6 +1957,7 @@ def transform( prob (Optional[float]): The probability controlling the proportion of samples to be perturbed. Defaults to 0.2. count: Number of variations to create. + max_lines: Maximum number of lines to add. Returns: List[Sample]: The transformed list of samples with new lines added. @@ -2002,7 +2003,7 @@ def add_new_lines(text: str) -> Tuple[str, List[Transformation]]: perturbed_word = token["word"] if i in transformed_indices: - perturbed_word += "\n" * max(1, random.randint(1, number_of_lines)) + perturbed_word += "\n" * max(1, random.randint(1, max_lines)) transformations.append( Transformation( original_span=Span(