当前位置:网站首页>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 .
边栏推荐
- Multi-Task Feature Learning for Knowledge Graph Enhanced Recommendation
- What happened to those who focused on automated testing?
- How to hide cvxpy warnings: warn: a- > P (column pointers) not strictly increasing, column x empty?
- FileNotFoundError: Could not find module ‘... dll‘ (or one of its dependencies).
- ThreadLocal principle and usage scenario
- QT:QSS自定义 QStatusBar实例
- Classification (data consolidation and grouping aggregation)
- Install yolov3 (Anaconda)
- QT:QSS自定义 QMenuBar实例
- How to monitor the incoming and outgoing traffic of the server host?
猜你喜欢
![[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)

Cache routing component

面试官:Redis中列表的内部实现方式是什么?

有些能力,是工作中学不来的,看看这篇超过90%同行

Weight decay (pytorch)

Entropy method to calculate weight

缓存路由组件

Class-Variant Margin Normalized Softmax Loss for Deep Face Recognition

Unity学习笔记:个人学习项目《疯狂天才埃德加》纠错文档

如何监测服务器主机的进出流量?
随机推荐
项目组织战略管理
Weight decay (pytorch)
如何监测服务器主机的进出流量?
Leetcode skimming ---35
测试Leader应该做哪些事
Flink--Chain的条件源码分析
现在零基础转行软件测试还OK吗?
多路IO转接——前导
UI interface design related knowledge (I)
Numpy quick start (IV) -- random sampling and general functions
Flink--自定义函数
Day 7 small exercise
Programming examples of stm32f1 and stm32subeide -tm1637 drives 4-bit 7-segment nixie tubes
Bidding website architecture project progress -- Network Security
How to hide cvxpy warnings: warn: a- > P (column pointers) not strictly increasing, column x empty?
What happened to those who focused on automated testing?
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
MySQL -- index principle + how to use
Install yolov3 (Anaconda)
Numpy quick start (II) -- Introduction to array (creation of array + basic operation of array)