Code Used
augmenter = naw.SynonymAug(aug_src='wordnet', model_path=None, name='Synonym_Aug', aug_min=1, aug_max=10, aug_p=0.3, lang='eng',
stopwords=stop_words, tokenizer=None, reverse_tokenizer=None, stopwords_regex=None, force_reload=False, verbose=0)
augmenter.augment("What is random swap")
Getting the error
Resource 'corpora/wordnet' not found. Please use the NLTK
Downloader to obtain the resource: >>> nltk.download()
Searched in:
- '/root/nltk_data'
- '/usr/share/nltk_data'
- '/usr/local/share/nltk_data'
- '/usr/lib/nltk_data'
- '/usr/local/lib/nltk_data'
**********************************************************************
I've done everything- Updated the package, reinstalled this even checked this in corpora folder within nltk_data. Nothing is working. Same error comes again and again. Can someone please help me understand what I'm doing incorrectly.
Referred many documentation on this error which mostly talked about issue with the directory path or wordnet not being there. But these also did not help.
Error explains that you have installed nltk package but you've not downloaded 'wordnet' since you're using it in the code.
and it will work .
OR