Sentiment Analysis

Zia Sentiment Analysis is a part of Text Analytics that processes textual content to recognize the tone of the message, and the sentiments conveyed through it. It analyses each sentence in the text to determine if its tone is Positive, Negative, or Neutral. It then determines the tone of the overall text as one of the these three sentiments, based on the sentiments recognized in each sentence.

The response also returns the confidence scores for each sentence and the overall text, to showcase the accuracy of the analysis.

API Description

You can use this API to perform Sentiment Analysis on a block of text of upto 1500 characters in a single request. You must pass the text in the JSON body of the request, as shown in the sample request.

You can also pass optional keywords for the text. This will enable Sentiment Analysis to process only those sentences that contain these keywords, and determine their sentiments. Other sentences will be ignored.

Request Details

Request URL

https://api.catalyst.zoho.com/baas/v1/project/{project_id}/ml/text-analytics/sentiment-analysis

project_id - The unique ID of the project

Request Headers

Authorization: Zoho-oauthtoken 1000.910***************************16.2f****************************57
Content-Type: application/json

Request Method

POST

Scope

scope=ZohoCatalyst.mlkit.READ

Request JSON Properties

Parameter NameData TypeMandatoryDescription
documentString ArrayYesThe text to be processed for Sentiment Analysis
keywordsString ArrayNoTo perform Sentiment Analysis only on the sentences containing these keywords

Response Details

The response contains the result of individual sentence analysis and the overall text analysis as Positive, Negative, or Neutral, along with the overall confidence score of each analysis. The confidence score lies in the range of 0 to 1.

SDK documentation

Sentiment Analysis- Java SDK

Sentiment Analysis- Node.js SDK

Sample Request


				curl -X POST \
https://api.catalyst.zoho.com/baas/v1/project/4000000006007/ml/text-analytics/sentiment-analysis \
-H "Authorization: Zoho-oauthtoken 1000.910***************************16.2f****************************57" \
-H "Content-Type: application/json" \
-d '{
"document": ["I love the design of the new model."],
"keywords":["design"]
}'			

Sample Response


				{
"status":"success",
"data":[
     {
      "sentiment_prediction":[
                {
                 "document_sentiment":"Positive",
                 "sentence_analytics":[
                      {
                      "sentence":"I love the design of the new model",
                      "sentiment":"Positive",
                      "confidence_scores":{
                      "negative":0.0,
                      "neutral":0.0,
                      "positive":1.0
                           }
                     }
                  ],
               "keyword":"design",
               "overall_score":1.0
               }
            ]
         }
    ]
}