Text Emotion Analysis

The Emotion Analysis model will help you understand and interpret emotions in a conversation or text. It is designed to understand human conversation in the form of free text and is designed after the emotion wheel.

Emotion Types

Types of Emotions detected by enabling this model configuration in the Speech Analytics API:

Admiration Amusement Anger Annoyance Approval Caring Confusion Curiosity Desire Disappointment Disapproval Disgust Embarrassment Excitement Fear Gratitude Grief Joy Love Nervousness Optimism Pride Realization Relief Remorse Sadness Surprise Neutral

API Request

Returns the predicted emotion for a given sentence

POST https://api.marsview.ai/text/emotion/get_emotion

Query Parameters

{
    "status": true,
    "error": {},
    "data": {
        "text": "I love building things that change things",
        "labels": [
            {
                "value": "LOVE",
                "confidence": 0.9979714751243591
            }
        ]
    },
    "userId": "chandra.sekhar@marsview.ai"
}

Example Curl Request

Shown below is a code snippet to send a sample request to the emotion analysis

curl --location --request POST 'https://api.marsview.ai/text/emotion/get_emotion' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jwtToken": "Insert JWT token Key",
    "sentence": "Insert your sentence for emotion detection here",
    "userId"  : "demo@marsview.ai"
}'

Example Response

Shown below is a sample JSON response from the above request.

{
    "status": true,
    "error" : {},
    "data"  : {
        "text": "I love building things that change things",
        "labels": [
            {
                "value": "LOVE",
                "confidence": 0.9979714751243591
            }
        ]
    },
    "userId": "chandra.sekhar@marsview.ai"
}

Response Object

Last updated