-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding post-compile for nltk heroku support
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# bin/install_nltk_data | ||
#!/usr/bin/env bash | ||
|
||
source $BIN_DIR/utils | ||
|
||
echo "-----> Starting nltk data installation" | ||
|
||
# Assumes NLTK_DATA environment variable is already set | ||
# $ heroku config:set NLTK_DATA='/app/nltk_data' | ||
|
||
# Install the nltk data | ||
# NOTE: The following command installs the wordnet corpora, | ||
# so you may want to change for your specific needs. | ||
# See http://www.nltk.org/data.html | ||
python -m nltk.downloader wordnet | ||
python -m nltk.downloader punkt | ||
python -m nltk.downloader hmm_treebank_pos_tagger | ||
python -m nltk.downloader maxent_treebank_pos_tagger | ||
python -m nltk.downloader maxent_ne_chunker | ||
python -m nltk.downloader stopwords | ||
|
||
# If using Textblob, use this instead: | ||
# python -m textblob.download_corpora lite | ||
|
||
# Open the NLTK_DATA directory | ||
cd ${NLTK_DATA} | ||
|
||
# Delete all of the zip files | ||
find . -name "*.zip" -type f -delete | ||
|
||
echo "-----> Finished nltk data installation" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# bin/post_compile | ||
#!/usr/bin/env bash | ||
|
||
if [ -f bin/install_nltk_data ]; then | ||
echo "-----> Running install_nltk_data" | ||
chmod +x bin/install_nltk_data | ||
bin/install_nltk_data | ||
fi | ||
|
||
echo "-----> Post-compile done" |