Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does nltk.download("wordnet") accomplish

I wanted to know what nltk.download() do. Also, if I add "wordnet" as an argument, then what happens. Is wordnet like some dataset or something, I would like more clarification on that.

like image 678
SarthakJain Avatar asked Oct 28 '25 05:10

SarthakJain


1 Answers

The argument to nltk.download() is not a file or module, but a resource id that maps to a corpus, machine-learning model or other resource (or collection of resources) to be installed in your NLTK_DATA area. You can see a list of the available resources, and their IDs, at http://www.nltk.org/nltk_data/ .

You can use the special id "book" (as in nltk.download("book")) to download all resources mentioned in the nltk book; that's handy if you don't want to keep stopping your explorations to download missing resources.

Calling nltk.dowload() without an argument pops up an interactive browser window (if it can) that you can use to browse and select resources for download.

like image 77
alexis Avatar answered Oct 31 '25 08:10

alexis