Skip to content

Instantly share code, notes, and snippets.

@michaelgodshall
Last active March 5, 2016 23:48
Show Gist options
  • Save michaelgodshall/a27821c0d1030a096c12 to your computer and use it in GitHub Desktop.
Save michaelgodshall/a27821c0d1030a096c12 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 textblob.download_corpora
# 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_textblob_corpora ]; then
echo "-----> Running install_textblob_corpora"
chmod +x bin/install_textblob_corpora
bin/install_textblob_corpora
fi
echo "-----> Post-compile done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment