【发布时间】:2019-05-25 06:23:35
【问题描述】:
我刚刚下载了最新的 NLTK 版本及其所有资源。
我看到 could 和 would 没有列为停用词。
但should 被视为停用词。
这是某种已知的错误还是...?
In [7]: import nltk
In [8]: "shouldn't" in nltk.corpus.stopwords.words("english")
Out[8]: True
In [9]: "couldn't" in nltk.corpus.stopwords.words("english")
Out[9]: True
In [10]: "wouldn't" in nltk.corpus.stopwords.words("english")
Out[10]: True
In [11]: "should" in nltk.corpus.stopwords.words("english")
Out[11]: True
In [12]: "could" in nltk.corpus.stopwords.words("english")
Out[12]: False
In [13]: "would" in nltk.corpus.stopwords.words("english")
Out[13]: False
【问题讨论】:
-
这不是错误。这是停用词列表的编译器的一个深思熟虑的决定。该决定可能与(1)这些词在列表所依据的语料库中出现的相对频率有关; (2) 列表的编译者决定它应该由 2,400 个单词组成。
-
@BoarGules 嗯...但从逻辑的角度来看,这没有任何意义,不是吗? “决定它应该由 2,400 个单词组成” >>> 我没听懂。哪个列表应该包含 2400 个单词?停用词列表目前由 179 个词组成。
-
根据 NLTK 文档,Porter 等人 编译的 11 种语言的原始停用词列表为 2400 个单词。没有进一步的参考,我找不到它,我已经看过了。可能 2400 被计算在所有 11 种语言中,而不仅仅是英语。如果你想证明列表内容的合理性,那么你需要在 nltk.org 上询问人们。
标签: python python-3.x nltk