当前位置:网站首页>Snownlp emotion analysis
Snownlp emotion analysis
2022-07-03 10:51:00 【Bai Yanling】
I wrote a blog before , Analysis of Douban short review , At that time, it was a classification problem , The prediction is that the user will give the movie a star rating , In fact, it can also be used snownlp Make emotional analysis of the essay .
Emotion analysis is to use some methods and techniques to identify and extract the emotional color in the original material , This blog post mainly introduces how to use snownlp Do emotional analysis .
data Some screenshots of are as follows :
from snownlp import SnowNLP
import matplotlib.pyplot as plt
import numpy as np
#snownlp in sentiments It means that this sentence represents the probability of positive emotion .
sentimentslist = []
for i in data["short"]:
s = SnowNLP(i)
sentimentslist.append(s.sentiments)
plt.hist(sentimentslist, bins = np.arange(0, 1, 0.01), facecolor = 'g')
plt.xlabel('Sentiments Probability')
plt.ylabel('Quantity')
plt.title('Analysis of Sentiments')
plt.show()
The following figure is a histogram of the frequency of each emotion score segment :
We can pick some short reviews to see their scores :


Feeling snownlp The bag is quite accurate , Interested friends can learn .
边栏推荐
- QT:QSS自定义 QTreeView实例
- Flink-- custom function
- Extern keyword
- Pytoch has been installed, but vs code still displays no module named 'torch‘
- Classification (data consolidation and grouping aggregation)
- A detailed explanation of vector derivative and matrix derivative
- .Net Core-做一个微信公众号的排队系统
- Programming examples of stm32f1 and stm32subeide -tm1637 drives 4-bit 7-segment nixie tubes
- Unity learning notes: personal learning project "crazy genius Edgar" error correction document
- “测试人”,有哪些厉害之处?
猜你喜欢

MySQL reports an error "expression 1 of select list is not in group by claim and contains nonaggre" solution

Bidding website architecture project progress -- Network Security

软件测试——Redis数据库

Pour vous amener dans le monde des bases de données natives du cloud

Unity小组工程实践项目《最强外卖员》策划案&纠错文档

QT:QSS自定义 QTreeView实例

6、 Data definition language of MySQL (1)

How does MySQL find the latest data row that meets the conditions?
![[combinatorial mathematics] pigeon's nest principle (simple form of pigeon's nest principle | simple form examples of pigeon's nest principle 1, 2, 3)](/img/77/fcb4f9739a5171ee58771d041f4d72.jpg)
[combinatorial mathematics] pigeon's nest principle (simple form of pigeon's nest principle | simple form examples of pigeon's nest principle 1, 2, 3)

Some abilities can't be learned from work. Look at this article, more than 90% of peers
随机推荐
有些能力,是工作中学不来的,看看这篇超过90%同行
Cache routing component
QT:QSS自定义 QProgressBar实例
QT:QSS自定义QToolBar和QToolBox实例
Buy health products for parents
Multi-Task Feature Learning for Knowledge Graph Enhanced Recommendation
Adaptive Propagation Graph Convolutional Network
7、 Data definition language of MySQL (2)
ThreadLocal principle and usage scenario
Weight decay (pytorch)
Take you into the cloud native database industry, Amazon Aurora
[untitled]
QT:QSS自定义 QSpinBox实例
Some abilities can't be learned from work. Look at this article, more than 90% of peers
Nuget add reference error while installing packages
snownlp情感分析
Numpy quick start (II) -- Introduction to array (creation of array + basic operation of array)
Promoted, colleagues become subordinates and don't cooperate with work
C language project: student achievement system
What happened to those who focused on automated testing?