Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Installing NLTK

NLTK (Natural Language ToolKit) is a light-weight (but still quite powerful) NLP tool. You can learn more about it from the NLTK website and the NLTK book.

This short notebook will get you to install and download all the components of NLTK. You only need to run it once, if you are on your own device.

After you have run it, the only thing you’ll have to do in the future is import it on any notebook you want to use it in, by running line 2 (import nltk) in the notebook where you use NLTK.

You can also install it from the command line, following the instructions for your operating system: https://www.nltk.org/install.html

!pip install nltk
import nltk

After you run the next cell, two things may happen (either is fine):

  • You’ll get a cell listing all the downloads it’s doing and it’ll finish saying something like “Done downloading”. You’re done! Shut down this notebook.

  • You’ll see a pop-up window appear. If it doesn’t pop up, just look for an open window on your system. Click download and wait until it’s done. When it’s done, close that window and shut down this notebook.

nltk.download('all')