https://github.com/willf/sentimenticon
Word-based sentiment analyzer
https://github.com/willf/sentimenticon
Last synced: 11 months ago
JSON representation
Word-based sentiment analyzer
- Host: GitHub
- URL: https://github.com/willf/sentimenticon
- Owner: willf
- Created: 2015-04-20T16:40:50.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-04-20T20:47:58.000Z (about 11 years ago)
- Last Synced: 2024-12-01T13:45:29.767Z (over 1 year ago)
- Language: Python
- Size: 277 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
The sentiment module provides methods for returning word-level and
average word sentiment scores, currently for English only.
The sentiment data is from the article Temporal Patterns of Happiness and Information in a Global Social Network: Hedonometrics and Twitter
Peter Sheridan Dodds, Kameron Decker Harris, Isabel M. Kloumann, Catherine A. Bliss, and Christopher M. Danforth
Sentiments range from -1.0 to 1.0, where -1.0 is the most unfavorable, and 1.0 is the most favorable.
In addition, a Sentiment object can be inspected for the original values from the Hedonometrics paper.
Examples::
>>> from sentimenicon import sentiment
>>> a = sentiment.Analyzer
>>> print a.word_sentiment("happy")
>>> print a.word_sentiment("terrorist")
>>> print a.average_word_sentiment("I love a happy friend".lower().split(" "))
>>> s = a.sentiment_object("happy")