Code language

Sentiment

Sentiment detection using a vocabulary or neural-network based approach.

POSThttp://analytics.eventregistry.org/api/v1/sentiment

BodyJSON, with Content-Type: application/json. GET with query parameters also works.

Examples

Sentiment with the vocabulary-based method

Use the vocabulary based approach to detecting the sentiment mentioned in the input text.

REST request
Sentiment with the neural network method

Use the neural-network based approach to detecting the sentiment mentioned in the input text.

REST request

How it works

Compute the sentiment expressed in the text. Depending on your preference you can use the vocabulary based approach, which assigns sentiment based on the sentiment values that are preassigned to individual words, or the neural-network based approach.

The returned response contains an average sentiment of the text as well as sentence by sentence sentiment. The sentiment will range between -1 (very negative) and 1 (very positive).

Please note that the sentiment classification only works on documents in English language.

Parameters

Send them in the JSON body; the same names work as GET query parameters.

Core

4
apiKeyRequired
string
Your API key
textRequired
string
The text that will be used to calculate sentiment.
method
string
Approach used for detecting sentiment. The text that will be used to calculate sentiment.

Default: vocabulary

Values: vocabulary rnn

sentences
integer
Number of sentences on which to compute the sentiment.

Default: 10

Response

Example output is a real response; Output schema lists the fields the endpoint can return.

200 · application/json