我刚刚下载了NLTK的最新版本及其所有资源。
我看到could和would没有被列为停用词。但should被视为一个停用词。
这是某种已知的bug还是...?
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发布于 2019-05-21 05:38:37
它本身并不是一个bug。什么是停用词,什么不是停用词,总是有些模糊。列出该列表的人出于某种原因遗漏了“应该”--也许它是有根据的,也许不是--但不管怎样,你应该能够将它添加到你自己项目的语料库中,看看它是否能为你的任务提供更好的结果。
无论如何,这似乎值得在他们的github issues上提出。
发布于 2019-05-25 06:23:35
哦,实际上,这非常有趣!
乔尔·诺斯曼曾仔细查看过停用词,发现了一些令人不安的结果。请参阅https://aclweb.org/anthology/papers/W/W18/W18-2502/
同意Ethan McCue的观点,这绝对是应该在NLTK的github问题跟踪器上进行修补/解决的问题。
https://stackoverflow.com/questions/56227576
复制相似问题