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
File details
Details for the file cn-sentiment-measures-1.0.0.dev2.tar.gz
.
File metadata
- Download URL: cn-sentiment-measures-1.0.0.dev2.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 403b2aed25c66f686597398913dce3de7ad931223f608d4d8088802f19db81d5 |
|
MD5 | 027573acadcef15b21df0c89e6a70bd9 |
|
BLAKE2b-256 | f82efda608982ab5e6c0510075c1739d60b6ab69d8bb52a0cfd22312e51fa4b1 |