My project uses the NLTK. How can I list the project\'s corpus & model requirements so they can be automatically installed? I don\'t want to click through the nltk
I've managed to install the corpora and models inside a custom directory using the following code:
import nltk
nltk.download(info_or_id="popular", download_dir="/path/to/dir")
nltk.data.path.append("/path/to/dir")
this will install "all" corpora/models inside /path/to/dir, and will let know NLTK where to look for it (data.path.append).
You can't «freeze» the data in a requirements file, but you could add this code to your __init__ besides come code to check if the files are already there.