Skip to main content

Analyse sentiment

Read how positive or negative a text is, overall and sentence by sentence (Cloud Natural Language).

Command in the Google Cloud AI toolkit · id ooa.google_ai/language_sentiment · 3 inputs (1 required), 5 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
SessionStringNogoogle_aiName of the session opened by Connect.
TextStringYesThe text to read, at most 1,000,000 bytes.
LanguageStringNoLanguage of the text, e.g. en, de or ja. Leave empty to detect it.

Outputs​

OutputTypeWhat it is
sentimentStringpositive (score 0.25 or more), negative (-0.25 or less) or neutral.
scoreNumberFrom -1 (negative) to 1 (positive).
magnitudeNumberHow strong the feeling is overall, from 0 up.
languageStringLanguage of the text, as given or detected.
sentencesTableColumns: text, score, magnitude.