Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BackTranslationAugmenter produces an incorrect number of transformations #800

Open
aemartinez opened this issue Aug 25, 2024 · 0 comments
Open

Comments

@aemartinez
Copy link

Describe the bug
Calling the augment function of a BackTranslationAugmenter produces a list with a length that appears to be non-deterministic, sometimes not matching the value of the transformations_per_example initialization parameter.

To Reproduce
Run the following code:

import textattack
augmenter = textattack.augmentation.recipes.BackTranslationAugmenter(transformations_per_example=5)
s = "You are in the kitchen."
ls = augmenter.augment(s)
print(len(ls))

Expected behavior
Expected output: 5
Actual output: 3

System Information (please complete the following information):

  • OS: MacOS Sonoma 14.6.1
  • Library versions: torch==2.3.1, transformers==4.42.4
  • Textattack version: textattack==0.3.10
  • Full pip freeze output: https://pastebin.com/VPt7JdRY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant