Text Sentiment Analysis

Enable this model configuration to analyze text sentiment based on (Lexical Emotion Analysis) is the response inside the sentiment key

Sentiment Analysis will help you interpret and quantify if the conversation or text is Positive, Very Positive, Negative, Very Negative, or Neutral. It also provides you a measure as to how subjective the conversation is with a subjectivity score.

API Request

Returns the predicted sentiment for a given sentence

POST https://api.marsview.ai/text/sentiment/get_sentiment

Query Parameters

{
    "status": true,
    "error": {},
    "data": {
        "sentence": "I love building things that change things",
        "avg_sentiment": "Very Positive",
        "avg_polarity": 0.5,
        "avg_subjectivity": 0.6,
        "content": [
            {
                "phrase": "I love building things that change things",
                "sentiment": "Very Positive",
                "polarity": 0.5,
                "subjectivity": 0.6
            }
        ]
    },
    "userId": "chandra.sekhar@marsview.ai"
}

Example Curl Request

Shown below is a code snippet to send a request for the sentiment analysis

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

Example Response

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

{
    "status": true,
    "error": {},
    "data": {
        "sentence": "I love building things that change things",
        "avg_sentiment": "Very Positive",
        "avg_polarity": 0.5,
        "avg_subjectivity": 0.6,
        "content": [
            {
                "phrase": "I love building things that change things",
                "sentiment": "Very Positive",
                "polarity": 0.5,
                "subjectivity": 0.6
            }
        ]
    },
    "userId": "chandra.sekhar@marsview.ai"
}

Response Object

Last updated