A toolkit for estimating Chinese sentiment scores with multiple measures.
Project description
Chinese Sentiment Measures
A toolkit for estimating Chinese sentiment scores with multiple measures.
pip install cn-sentiment-measures
Measures
- Absolute Proportional Difference - APD. Bounds: [-1, 1]
- Relative Proportional Difference - RPD. Bounds: [-1, 1]
- Logit scale - LC. Bounds: [-infinity, +infinity]
Improved versions of the above measures by integrating degree words are marked with _with_degree
in the toolkit.
Examples
from cn_sentiment_measures.sentiment_measures import SentimentMeasures
sm = SentimentMeasures()
word_list=["我","今天","很","高兴"]
print("Here are measure values with normal measures!")
print('APD = ',sm.APD(word_list))
print('RPD = ',sm.RPD(word_list))
print('LS = ',sm.LS(word_list))
print()
print("Here are measure values optimized by using adverb words!")
print('APD* = ',sm.APD_with_degree(word_list))
print('RPD* = ',sm.RPD_with_degree(word_list))
print('LS* = ',sm.LS_with_degree(word_list))
License
The project is provided by Donghua Chen.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for cn-sentiment-measures-1.0.0.dev4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3286d27f6fe38d2cc1a47173cbb07e27787762bf97965145bacc5e3f4b802005 |
|
MD5 | a45a7c38d5d72e0a21d8e72606133345 |
|
BLAKE2b-256 | 557c528b9ee25cca926ddb84deb04ccfede54e0fc9dcb8d84900401892cc5e34 |