Skip to content

willf/sentimenticon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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