Skip to main content

Emotion

This model tries to determine the emotion conveyed by the writer on a text, using Ekman's list of emotions as potential results.

Although detecting emotion can be very subjective, this model could find patterns after analyzing over 210,000 samples of labeled text of comments made on social media.

Prediction labels

Limits

The maximum length accepted is 512 characters.

EmotionEmojiExample
anger๐Ÿ˜ Oh, how DARE you discuss this in public?
joy๐ŸฅณSheโ€™s like a kewpie doll with them. Precious.
disgust๐ŸคขThat is odd.
fear๐Ÿ˜จHahaha, ok. I was worried there for a second
sadness๐Ÿ˜”You got banned for participating in a brigade.
surprise๐Ÿ˜ฎOh whoops, I misread the original comment
neutral๐Ÿ˜Let me give you a hint: THEY PLAY IN BOSTON!

Invokation

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

Response

{
"prediction": {
"emotion": "joy",
"emoji": "๐Ÿฅณ"
},
"confidence": "0.577",
"time_ms": 989
}
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