Analyze sentiment

Sentiment analyzer returns a sentiment label (subjective attitude) of the input text as positive (pos), negative (neg), or neutral (neu), with a confidence score between 0 and 1. The sum of the confidence scores for the three sentiment labels for a given document is always equal to one, though only the highest one is returned.

When Sentiment detects entities within your input, it also returns the sentiment for each unique entity in the document. It groups all the relevant sentiment about that entity into one mention, identified by its entityID.

Before analyzing, Sentiment filters out some stop words and punctuation, such as “the” “?” “a” “it”, to increase the accuracy of the assessment. When working with English text, there is also an option to use an alternative, deep neural network sentiment model. To use this model, set the modelType option to DNN. The DNN model may return different scores than the standard model.

Headers

X-RosetteAPI-KeystringRequired

Request

This endpoint expects an object.
contentstringOptional
optionsobjectOptional

Response

OK
documentobject or null
entitieslist of objects or null