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

yas*_*232 4 python typeerror nltk stop-words

我正在尝试编写一个 python 程序来使用 nltk 包从句子中删除停用词

from nltk.corpus import stopwords
chachedWords = stopwords.words('english')
Run Code Online (Sandbox Code Playgroud)

下面给出 TypeError: 'LazyCorpusLoader' object is not callable

Tol*_*ZÜN 8

尝试:

from nltk.corpus import stopwords
import nltk
nltk.download("stopwords")
chachedWords = stopwords.words('english')
Run Code Online (Sandbox Code Playgroud)