基于词义消歧、senti词网和电影评论语料库词频统计的情感分类
sentiment_classifier的Python项目详细描述
使用wsd进行情绪分类
- pip install sentiment_classifier
- Home
- Download
- Github
- Try Online
概述
词义消歧的情感分类器 来自电影评论语料库nltk的统计信息。分为积极和消极两类。
在线演示
要求
在Version 0.5中,将自动安装以下所有要求。如有故障,请手动安装。
- 你一定有Python2.6。
- NLTKhttp://www.nltk.org2.0已安装。
- 努比http://numpy.scipy.org
- 哨兵网http://sentiwordnet.isti.cnr.it
如何安装
shell命令
python setup.py install
脚本使用
shell命令:
senti_classifier -c file/with/review.txt
python用法
shell命令
cd sentiment_classifier/src/senti_classifier/ python senti_classifier.py -c reviews.txt
库使用
from senti_classifier import senti_classifier sentences = ['The movie was the worst movie', 'It was the worst acting by the actors'] pos_score, neg_score = senti_classifier.polarity_scores(sentences) print pos_score, neg_score ... 0.0 1.75
from senti_classifier.senti_classifier import synsets_scores print synsets_scores['peaceful.a.01']['pos'] ... 0.25
历史记录
- 0.6NLTK升级时修复的错误
- 0.5不会自动加载所需的其他数据训练数据。比以前的版本快得多/优化得多。
- 0.4添加了一袋单词作为出现率统计的功能
- 0.3情感分类器第一个应用程序,使用wsd模块