o12d10
o12d10

Reputation: 798

NLTK stopwords returns error "LazyCorpusLoader is not callable"

I am trying to write a python program to remove stopword from a sentence using nltk package

from nltk.corpus import stopwords
chachedWords = stopwords.words('english')

the following gives TypeError: 'LazyCorpusLoader' object is not callable

Upvotes: 4

Views: 3588

Answers (1)

Try:

from nltk.corpus import stopwords
import nltk
nltk.download("stopwords")
chachedWords = stopwords.words('english')

Upvotes: 9

Related Questions