Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kennethjmyers/d2ec6f53e141bbd46b9d to your computer and use it in GitHub Desktop.
Save kennethjmyers/d2ec6f53e141bbd46b9d to your computer and use it in GitHub Desktop.
How to Install Texblob NLTK Corpora on Heroku
#!/usr/bin/env bash
# Put this file in the `bin` directory at the root of your project
source $BIN_DIR/utils
echo "-----> Starting corpora installation"
# Assumes NLTK_DATA environment variable is already set
# $ heroku config:set NLTK_DATA='/app/nltk_data'
# Install the default corpora to NLTK_DATA directory
python -m nltk.downloader all
# Open the NLTK_DATA directory
cd ${NLTK_DATA}
# Delete all of the zip files in the NLTK DATA directory
find . -name "*.zip" -type f -delete
echo "-----> Finished corpora installation"
#!/usr/bin/env bash
# Put this file in the `bin` directory at the root of your project
if [ -f bin/install_nltk_corpora ]; then
echo "-----> Running install_nltk_corpora"
chmod +x bin/install_nltk_corpora
bin/install_nltk_corpora
fi
echo "-----> Post-compile done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment