维德情绪分析。维德(Valence Aware Dictionary and emotion Reasoner)是一个基于词汇和规则的情感分析工具,专门针对社交媒体中表达的情感进行调整,并能很好地处理来自其他领域的文本。

vader-multi的Python项目详细描述


维德情绪分析多语言

维德(Valence Aware Dictionary and emotion Reasoner)是一种基于词汇和规则的情感分析工具,专门针对社交媒体中表达的情感进行调整。在

This version integrates the Google Translate API through the translatte Python library. It requires an active Internet connection in order to work. Text language is automatically detected so it behaves exactly like the original version.

安装

首先卸载原始版本,使其不实例化而不是维德多:

pip uninstall vaderSentiment
pip install vader-multi

极性得分

class vaderSentiment.SentimentIntensityAnalyzer

polarity_scores(text)

返回具有以下键的字典:{'neg': float, 'neu': float, 'pos': float, 'compound': float}

^{pr2}$

示例

>>>fromvaderSentiment.vaderSentimentimportSentimentIntensityAnalyzer>>>analyzer=SentimentIntensityAnalyzer()>>>analyzer.polarity_scores("VADER is VERY SMART, handsome, and FUNNY!!!"){'neg':0.0,'neu':0.233,'pos':0.767,'compound':0.9342}>>>analyzer.polarity_scores("¡¡¡VADER es MUY INTELIGENTE, guapo y DIVERTIDO!!!"){'neg':0.0,'neu':0.27,'pos':0.73,'compound':0.9387}>>>analyzer.polarity_scores("VADER è MOLTO INTELLIGENTE, bello e DIVERTENTE!!!"){'neg':0.0,'neu':0.256,'pos':0.744,'compound':0.9481}>>>analyzer.polarity_scores("VADER est TRÈS SMART, beau et drôle!!!"){'neg':0.0,'neu':0.276,'pos':0.724,'compound':0.9338}>>>analyzer.polarity_scores("Вейдер очень умный, красивый и смешной!!!"){'neg':0.0,'neu':0.314,'pos':0.686,'compound':0.8989}>>>analyzer.polarity_scores("ベイダーは非常にスマートで、ハンサムで面白いです!!!"){'neg':0.0,'neu':0.328,'pos':0.672,'compound':0.882}>>>analyzer.polarity_scores("வேடர் மிகவும் ஸ்மார்ட், அழகான மற்றும் வேடிக்கையானது!!!"){'neg':0.0,'neu':0.314,'pos':0.686,'compound':0.8989}

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在windows上向doclet添加多个sourcepath?   java谷歌地图应用程序   java为以下场景创建正则表达式   Java文件通道异常   Java集合如何将文件对象列表转换为路径对象列表?   多线程生产者/消费者模型使用Java(同步),但始终运行同一线程   java如何为存储在ArrayList中的特定属性设置值?   java一次不能加载多个osm文件   使用java 8将map<String,map<Long,customeObject>>转换为list<customeObject>   java JDK包含哪些脚本语言解释器?   java为什么eclipse在这里生成语法错误?   多线程Javasocket异常:socket已关闭且值为空   java我想在Android活动中创建一个带有图像的可滚动文本列表。我应该用什么?   java实现编译时警告   java根据安卓 SQLite数据库中前一行的相同值递增特定值   java移动迭代器语句使代码可编译   java JVM终身/旧代已达到限制&服务器挂起   为什么我们不能在映射上使用迭代器(Java)?   xml如何映射JAXB中已有的JavaBean