python - NLTK 停用词返回错误 "LazyCorpusLoader is not callable"

标签 python nltk typeerror stop-words

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

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

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

最佳答案

尝试:

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

关于python - NLTK 停用词返回错误 "LazyCorpusLoader is not callable",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42321701/

相关文章:

python - 导入错误 Python : No module named 'card'

python - Manim,无变换的 ReplacementTransform

python - 更新已使用 theano.tensor.cast() 转换的变量

python - 在 Python 中加速 Stanford 依赖解析

javascript - angularjs ngIf 的类型错误问题

python - 类型错误:在 Pandas DataFrame 上使用 dask 时无法腌制 _thread._local 对象

python - 将基于索引的列添加到 Pandas 中的数据框

nltk - 如何在 Google Colab 上安装模型/下载包?

python - NLTK:如何列出解析树的所有成对相邻子树(以特定非终结符为根)

python - 列表可以转换为整数吗