小编And*_*aly的帖子

Python 自然语言处理停用词

我只是在用 Python 对 NLP 进行一些研究,我发现了一些奇怪的东西。

关于以下负面推文的审查:

neg_tweets = [('I do not like this car', 'negative'),
          ('This view is horrible', 'negative'),
          ('I feel tired this morning', 'negative'),
          ('I am not looking forward to the concert', 'negative'),<---
          ('He is my enemy', 'negative')]
Run Code Online (Sandbox Code Playgroud)

并通过删除停用词进行一些处理。

clean_data = []
stop_words = set(stopwords.words("english"))

for (words, sentiment) in pos_tweets + neg_tweets:
words_filtered = [e.lower() for e in words.split() if e not in stop_words]
clean_data.append((words_filtered, sentiment))
Run Code Online (Sandbox Code Playgroud)

部分输出是:

 (['i', 'looking', 'forward', 'concert'], 'negative')
Run Code Online (Sandbox Code Playgroud)

我正在努力理解为什么停用词包括“不”,这会影响推文的情绪。

我的理解是停用词在情感方面没有价值。

所以,我的问题是为什么“不”包含在停用词列表中?

python text analysis nltk

5
推荐指数
1
解决办法
1259
查看次数

Javascript匿名函数与无函数

有人可以解释一下

1。onChange= () => console.log("Changed")

2。onChange= console.log("Changed")

我自己看不出有什么区别,那么使用选项1有什么意义?

我在这里使用React。

javascript anonymous-function reactjs

1
推荐指数
1
解决办法
40
查看次数

标签 统计

analysis ×1

anonymous-function ×1

javascript ×1

nltk ×1

python ×1

reactjs ×1

text ×1