Word-based sentiment analyzer
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
sentimenticon
.gitignore
README.md
requirements.txt
setup.py

README.md

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")