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

supports custom proportions for augument #506

Merged

Conversation

chakravarthik27
Copy link
Collaborator

Checklist:

  • I've added Google style docstrings to my code.
  • I've used pydantic for typing when/where necessary.
  • I have linted my code
  • I have added tests to cover my changes.

@chakravarthik27 chakravarthik27 added the ⭐ Feature Indicates new feature requests label Jun 7, 2023
@chakravarthik27 chakravarthik27 self-assigned this Jun 7, 2023
@chakravarthik27
Copy link
Collaborator Author

Now, the user can pass Dict or List for custom_proportions while doing augmentation in the harness.

I've included for you the example with the Dict variable. In case, augmentation takes place on selected test names as well as it's values in the range of 0 to 1.

custom_props = {'add_typo': 0.8, 'american_to_british': 0.1}

harness.augment(input_path='../nlptest/data/conll/sample.conll', output_path='./augmentated.conll', 
                custom_proportions=custom_props,
                inplace=True)

I've included for you the example with the List variable. In case only, augmentation takes place on selected test names.

custom_props = ['add_typo', 'american_to_british'] 

harness.augment(input_path='../nlptest/data/conll/sample.conll', output_path='./augmentated.conll', 
                custom_proportions=custom_props,
                inplace=True)

@chakravarthik27 chakravarthik27 linked an issue Jun 7, 2023 that may be closed by this pull request
@ArshaanNazir ArshaanNazir merged commit 1d9f055 into release/1.5.0 Jun 9, 2023
4 checks passed
@ArshaanNazir ArshaanNazir deleted the feature/control-augmentation-proportions branch June 17, 2023 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐ Feature Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need a way to control augmentation proportions
2 participants