Chinese Sentiment Analysis base on dictionary and rules.
> pip3 install git+https://github.com/bung87/bixin
from bixin import predict
text ="幸福每时每刻都会像路边的乞丐一样出现在你面前。要是你觉得你所梦想的幸福不是这样的,因而断言你的幸福已死亡,你只接受符合你的原则和心愿的幸福,那么你就会落得不幸。"
predict(text)
#3.0364366448542537
predict
will load dictionary data at first time,to load it manually use predict.classifier.initialize()
Test with 6226 taged corpus mixed up with shopping reviews 、Sina Weibo tweets 、hotel reviews 、news and financial news
accuracy: 0.827771
Notice:neutral texts are all ignored.
details about dataset https://github.com/bung87/bixin/wiki
> pip3 install -e ".[dev]" git+https://github.com/bung87/bixin
./dictionaries dictionaries from vary sources ./data processed dictionaries through ./scripts/tagger.py ./scripts/release_data.py release data to package
./scripts/score.py
all data archives: https://github.com/bung87/bixin/releases/tag/v0.0.1
run accuray testing with all .txt files under test_data directory sentence per line end with a space and a tag n or p