gpt4 book ai didi

python - NLTK - 缺少停用词 - 英语

转载 作者:太空宇宙 更新时间:2023-11-04 01:58:39 41 4
gpt4 key购买 nike

我刚刚下载了最新的 NLTK 版本及其所有资源。

我看到 couldwould 没有被列为停用词。但是 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

最佳答案

这本身不是错误。什么是停用词和什么不是停用词总是有点模糊。出于某种原因,制作该列表的人遗漏了“应该”——也许它有充分的根据,也许不是——但无论如何你应该能够将它添加到你自己项目的语料库中,看看它是否为你的项目提供更好的结果任务。

无论如何,这似乎值得在他们的 github issues 上提出来.

关于python - NLTK - 缺少停用词 - 英语,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56227576/

41 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com