nltk Getting started with nltk NLTK's download function


You can install NLTK over pip (pip install nltk).After it is installed, many components will not be present, and you will not be able to use some of NLTK's features.

From your Python shell, run the function to select which additional packages you want to install using UI. Alternatively, you can use python -m nltk.downloader [package_name].

  • To download all packages available.'all')

  • To download specific package.'package-name')

  • To download all packages of specific folder.
import nltk

dwlr = nltk.downloader.Downloader()

# chunkers, corpora, grammars, help, misc, 
# models, sentiment, stemmers, taggers, tokenizers
for pkg in dwlr.packages():
    if pkg.subdir== 'taggers':

  • To download all packages except Corpora Folder.
import nltk

dwlr = nltk.downloader.Downloader()

for pkg in dwlr.corpora():
    dwlr._status_cache[] = 'installed''all')