当前位置:网站首页>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 .
边栏推荐
- [roast & brain hole] Some Thoughts on the bullet screen interactive game of Wei Shu Wu Three Kingdoms when visiting station B
- QT:QSS自定义 QScrollBar实例
- Softmax regression (pytorch)
- Buy health products for parents
- Unity学习笔记:联网游戏Pixel Adventure 1学习过程&纠错心得
- Redis 笔记 01:入门篇
- Leetcode skimming ---367
- Leetcode skimming ---202
- Mysql--索引原理+如何使用
- QT:QSS自定义QToolButton实例
猜你喜欢

Unity group engineering practice project "the strongest takeaway" planning case & error correction document

Bidding website architecture project progress -- Network Security

How to make a blood bar in the game

Some abilities can't be learned from work. Look at this article, more than 90% of peers

Que se passe - t - il ensuite pour ceux qui se sont concentrés sur les tests automatisés?

Uni app learning 1 bottom menu and parent-child components

How does MySQL find the latest data row that meets the conditions?

QT:QSS自定义QTableView实例

现在零基础转行软件测试还OK吗?

8、 Transaction control language of MySQL
随机推荐
Unity group engineering practice project "the strongest takeaway" planning case & error correction document
Common scenarios in which Seata distributed transactions fail and do not take effect (transactions do not rollback)
Flink <-->JDBC的使用介绍+with参数
Take you into the cloud native database industry, Amazon Aurora
Leetcode skimming ---10
sqlmap基本使用方法
[untitled]
[SQL] an article takes you to master the operations related to query and modification of SQL database
Numpy quick start (IV) -- random sampling and general functions
Bid -- service commitment -- self summary
Mysql5.7 installation and configuration tutorial (Graphic ultra detailed version)
C language project: student achievement system
Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported
Adaptive Propagation Graph Convolutional Network
那些一门心思研究自动化测试的人,后来怎样了?
Install yolov3 (Anaconda)
8、 Transaction control language of MySQL
分组函数之rollup、cube函数、grouping sets函数
C语言项目:学生成绩系统
What happened to those who focused on automated testing?