How to do it

We proceed with the recipe as follows:

  1. The core of NLTK can be installed using pip:
pip install nltk
  1. Some processes, such as those we will use, require an additional download of various data sets that they use to perform various analyses. They can be downloaded by executing the following:
import nltknltk.download()showing info https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/index.xml
  1. On a Mac, this actually pops up the following window:
The NTLK GUI

Select install all and press the Download button.  The tools will begin to download a number of data sets.  This can take a while, so grab a coffee or beer and check ...

Get Python Web Scraping Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.