AnalyzeSentiment Processor

Part of the GCP Natural Language processor family

This processor takes in an input string and returns information about the sentiment of the text. Sentiment can be thought of as the connotation of the message. This processor will analyze the sentiment of individual sentences as well as the text overall.

The resulting Sentiments are reported with two values: score and magnitude. Per the official documentation:

score ranges from -1.0 (negative sentiment) to 1.0 (positive sentiment) magnitude indicates the overall strength of the emotion (both positive and negative)

This means that, for example, a sentence with a sentiment that has a score of 0.8 and a magnitude of 1.7 means it's a very strongly positive message. Similarly, a sentiment with a score of -0.2 with a magnitude of 0.2 is likely a "lightly" negative message.

The example output is a great example of the strength / sentiment. The message is overall a very positive message, and the output reflects as such.

Properties

All of our Natural Language processors also include these common properties.

This processor does not have any unique properties outside of the common ones.

Data Output

Field Name

Data Type

Description

sentences

array of Sentence

The list of all sentences in the message

language

string

The language code of the language the message is in.

overallSentiment

Sentiment

The sentiment of the message as a whole

Last updated