Skip to content

Conversation

@igopalakrishna
Copy link

This fixes an issue where nltk.pos_tag() internally triggers a LookupError due to attempting to load the non-existent resource averaged_perceptron_tagger_eng. The fix avoids this by directly using PerceptronTagger() without the lang='eng' parameter, and re-instantiates it after downloading the tagger model if necessary. Verified in Google Colab, this resolves the common synonym augmentation crash encountered by many users when using nlpaug with WordNet-based augmenters. The change is backward-compatible with existing usage.

@igopalakrishna
Copy link
Author

Happy to adjust anything if needed. Thanks for reviewing!

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

Successfully merging this pull request may close these issues.

1 participant