Skip to content

willf/sentimenticon

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

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

About

Word-based sentiment analyzer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages