If you want to follow along, make sure you have the correct packages installed and download the associated data for nltk
pip install nltk
to download only tools/data used in this lesson:
python -m nltk.downloader stopwords porter_test vader_lexicon tagsets punkt wordnet
Alternatively, this will download ~2gb of data, but should ensure all components of nltk work if you’re interested in exploring other functionalities of nltk:
python -m nltk.downloader all
Also save this text as book.txt in a place you can easily access:
https://www.gutenberg.org/cache/epub/3070/pg3070.txt
If you’d like to follow along in Jupyter Notebook, do the following: