NLTK停用词返回错误“LazyCorpusLoader不可调用”

时间:2017-02-18 23:05:06

标签: python nltk typeerror stop-words

我正在尝试编写一个python程序,使用nltk包

从句子中删除停用词
from nltk.corpus import stopwords
chachedWords = stopwords.words('english')

以下内容为TypeError: 'LazyCorpusLoader' object is not callable

1 个答案:

答案 0 :(得分:3)

尝试:

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