当前位置:网站首页>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 .
边栏推荐
- Unity小组工程实践项目《最强外卖员》策划案&纠错文档
- Uni app learning 1 bottom menu and parent-child components
- QT:QSS自定义QTableView实例
- 2021-09-22
- Preliminary knowledge of Neural Network Introduction (pytorch)
- Flink -- built in function (all)
- Numpy quick start (III) -- array advanced operation
- Extern keyword
- The story of a 30-year-old tester struggling, even lying flat is extravagant
- Weight decay (pytorch)
猜你喜欢
Data captured
C project - dormitory management system (1)
UI interface design related knowledge (I)
使用ML.NET+ONNX预训练模型整活B站经典《华强买瓜》
Model selection for neural network introduction (pytorch)
带你走进云原生数据库界扛把子Amazon Aurora
Programming examples of stm32f1 and stm32subeide -tm1637 drives 4-bit 7-segment nixie tubes
Pour vous amener dans le monde des bases de données natives du cloud
Knowledge map enhancement recommendation based on joint non sampling learning
Unity learning notes: online game pixel Adventure 1 learning process & error correction experience
随机推荐
Install yolov3 (Anaconda)
Leetcode skimming ---217
[untitled]
Unity learning notes: personal learning project "crazy genius Edgar" error correction document
Leetcode skimming ---367
Flink chain conditional source code analysis
7、 Data definition language of MySQL (2)
Large scale e-commerce project - environment construction
帶你走進雲原生數據庫界扛把子Amazon Aurora
[roast & brain hole] Some Thoughts on the bullet screen interactive game of Wei Shu Wu Three Kingdoms when visiting station B
Programming examples of stm32f1 and stm32subeide -tm1637 drives 4-bit 7-segment nixie tubes
How to monitor the incoming and outgoing traffic of the server host?
【吐槽&脑洞】关于逛B站时偶然体验的弹幕互动游戏魏蜀吴三国争霸游戏的一些思考
Softmax regression (pytorch)
Bid -- service commitment -- self summary
The story of a 30-year-old tester struggling, even lying flat is extravagant
Leetcode skimming ---263
Strategic management of project organization
[untitled] numpy learning
Chiyou (), a specific mythical image, is also gradually abstracted as a dramatic character type "Jing". "Jing", born in Dan Dynasty and ugly at the end, is the earliest "profession" in Chinese drama