Murphy Sentiment Classification

class murphy.classification.sentiments.Sentiments[source]

Bases: object

classmethod multiple_sentiment_analysis(text: str)Dict[str, float][source]

Returns the sentiment using all implemented models as a dictionary

Parameters

text – text to run sentiment analysis on

Returns

key pair values of name of the sentiment function and their estimations

static sentiment_analysis_nltk(text: str)float[source]

Run sentiment analysis using the library NLTK. Runs default sentiment on vader lexicon Works based on bag of words and positive and negative word lookups

Parameters

text – text to be analyzed

Returns

sentiment compound for given text

static sentiment_analysis_textblob(text: str)float[source]

Run sentiment analysis using the library textblob. Returns default sentiment Works similar to NLTK’s sentiment analysis, but includes subjectivity analysis

Parameters

text – text to be analyzed

Returns

sentiment for given text