Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 738
yashgarg1232 Avatar asked Jan 04 '23 12:01

yashgarg1232


1 Answers

Try:

from nltk.corpus import stopwords
import nltk
nltk.download("stopwords")
chachedWords = stopwords.words('english')
like image 164
Tolgahan ÜZÜN Avatar answered Jan 16 '23 21:01

Tolgahan ÜZÜN