Reputation: 71
I downloaded the nltk (book) using the code: import nltk nltk.download()
however when I try to test the nltk data using the below code, it won't work: from nltk.corpus import brown brown.words()
Upvotes: 0
Views: 1279
Reputation: 3730
In the NLTK Window, navigate to the "Corpora" tab and check that brown
has been installed. It should be highlighted green with status set to "installed" (see image below). Next check that you can find the unzipped brown
folder in C:\Users\User\AppData\Roaming\nltk_data
. Finally, assuming everything is present and working (i.e. you're not receiving any errors) when running the code, you will not be seeing any output in PyCharm without calling print
. Instead, try this:
import nltk
from nltk.corpus import brown
nltk.download()
print(brown.words())
# Output
>>> ['The', 'Fulton', 'County', 'Grand', 'Jury', 'said', ...]
Upvotes: 1