pysentimentanalyzer.helper

Module Contents

Functions

get_compound_score(text)

Calculates a compound sentiment score from text

get_sentiment(text)

Evaluates the type of sentiment from a given text

get_sentiment_and_score(df, col)

Calculates a compound sentiment score from text

pysentimentanalyzer.helper.get_compound_score(text)[source]

Calculates a compound sentiment score from text

Parameters:

text: str

Input text data as string

Returns:

A numeric sentiment score of the text : (float)

pysentimentanalyzer.helper.get_sentiment(text)[source]

Evaluates the type of sentiment from a given text

Parameters:

text: str

Input text data as string

Returns:

The type of sentiment (positive, negetive or neutral) as a string : (str)

pysentimentanalyzer.helper.get_sentiment_and_score(df, col)[source]

Calculates a compound sentiment score from text

Parameters:

df: pd.DataFrame

A DataFrame

col:

The column name of the text column on which sentiment analysis is done

Returns:

A Pandas DataFrame with numeric sentiment and its corresponding sentiment type added to the DataFrame : (pd.DataFrame)