Skip to main content

Sentiment

Similar to the Emotions API, this model tries to determine the general sentiment of a given text based on how it was written.

Prediction labels

Limits

The maximum length accepted is 512 characters.

EmotionEmojiExample
positiveโž•this was an incredible achievement
negativeโž–this wasn't an incredible achievement
neutral๐ŸŸฐthis is just a text

Invokation

curl -L -G 'http://api.textkit.ai/detect/sentiment' \
--data-urlencode 'text=yeah, man! Go!' \
--header 'X-API-Key: your_api_key_here'

Response

{
"prediction": {
"sentiment": "positive",
"emoji": "โž•"
},
"confidence": "0.942",
"time_ms": 778
}
FieldMeaning
predictionThe predicted label. See above for reference
confidenceValue between 0 and 1 that indicates how confident the model is
time_msTime in milliseconds the model took to predict the label. It does not account for the network round trip time between request and response