gpt4 book ai didi

language-agnostic - 为什么这些词被视为停用词?

转载 作者:行者123 更新时间:2023-11-30 08:23:03 24 4
gpt4 key购买 nike

我没有自然语言处理的正式背景,想知道 NLP 方面的人是否可以对此有所了解。我正在玩NLTK库,我专门研究了这个包提供的停用词函数:

In [80]: nltk.corpus.stopwords.words('english')

Out[80]:

['i', 'me', 'my', 'myself', 'we', 'our', 'ours', 'ourselves', 'you', 'your', 'yours', 'yourself', 'yourselves', 'he', 'him', 'his', 'himself', 'she', 'her', 'hers', 'herself', 'it', 'its', 'itself', 'they', 'them', 'their', 'theirs', 'themselves', 'what', 'which', 'who', 'whom', 'this', 'that', 'these', 'those', 'am', 'is', 'are', 'was', 'were', 'be', 'been', 'being', 'have', 'has', 'had', 'having', 'do', 'does', 'did', 'doing', 'a', 'an', 'the', 'and', 'but', 'if', 'or', 'because', 'as', 'until', 'while', 'of', 'at', 'by', 'for', 'with', 'about', 'against', 'between', 'into', 'through', 'during', 'before', 'after', 'above', 'below', 'to', 'from', 'up', 'down', 'in', 'out', 'on', 'off', 'over', 'under', 'again', 'further', 'then', 'once', 'here', 'there', 'when', 'where', 'why', 'how', 'all', 'any', 'both', 'each', 'few', 'more', 'most', 'other', 'some', 'such', 'no', 'nor', 'not', 'only', 'own', 'same', 'so', 'than', 'too', 'very', 's', 't', 'can', 'will', 'just', 'don', 'should', 'now']

我不明白的是,为什么出现“不”这个词?难道不需要确定句子中的情感吗?例如这样的句子:

I am not sure what the problem is.

一旦删除停用词 not,将句子的含义更改为相反的意思( 我确定问题是什么),

就完全不同了。如果是这种情况,我是否缺少一组何时不使用这些停用词的规则?

最佳答案

停用词列表的概念没有普遍意义,取决于您想要做什么。如果您的任务需要了解短语的极性、情感或类似特征,并且您的方法依赖于检测否定(如您的示例中所示),那么显然您不应该删除“not”作为停用词(请注意,您可能仍然想删除其他非常常见的不相关单词,这些单词将构成您的新停用词列表)。

但是,回答你的问题,大多数情感分析方法都非常肤浅。他们寻找充满情感/情感的单词,而且大多数时候,他们不会尝试对句子进行深入分析。

作为另一个您想要保留停用词的示例:如果您尝试根据作者(作者归属)对文档进行分类或进行文体计量学,那么您绝对应该保留这些功能词,因为它们表征了一个大的特征风格和话语的一部分。

但是,对于许多其他类型的分析(例如词空间模型、文档相似性、搜索等),删除非常常见的功能性单词在计算上(您处理更少的单词)和在某些情况下实际上(您甚至可能删除停用词后可以获得更好的结果)。如果我试图了解某个特定单词经常使用的上下文,我希望看到内容单词,而不是功能单词。 p>

关于language-agnostic - 为什么这些词被视为停用词?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6482046/

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