I\'m trying to use NLTK for my NLP learning in Python.
Certain package called \"panlex_lite\" keeps giving me error so I tried using the following:
Here's a "dirty" hack:
$ rm /Users/Harshil/nltk_data/corpora/panlex_lite.zip
$ rm -r /Users/Harshil/nltk_data/corpora/panlex_lite
$ python
>>> import nltk
>>> dler = nltk.downloader.Downloader()
>>> dler._update_index()
>>> dler._status_cache['panlex_lite'] = 'installed' # Trick the index to treat panlex_lite as it's already installed.
>>> dler.download('all')
Also, try earthy
:
pip install earthy
TL;DR:
import earthy
path_to_nltk_data = '/home/yourusername/nltk_data/'
earthy.download('all', path_to_nltk_data) # Excludes the third party (non-NLTK) packages.
To download panlex_lite
exclusively:
import earthy
earthy.download('panlex_lite', path_to_nltk_data)
To download all third-party datasets not natively hosted on nltk_data
github:
import earthy
earthy.download('third_party', path_to_nltk_data')