Loading...

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.

Execute Sentiment Analysis

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

POST

{api-domain}/baas/v1/project/{project_id}/ml/text-analytics/sentiment-analysis

copy

api-domain
URL
The DC-specific domain to access Catalyst API

project_id
Numerical
The unique ID of the project

Request Headers

Authorization: Zoho-oauthtoken {oauth_token}
content-type: application/json

Optional Headers

CATALYST-ORG: {org_id}

Environment: Development

Scope

ZohoCatalyst.mlkit.READ

Request JSON Properties

document string array
mandatory
The text to be processed for Sentiment Analysis
keywords string array
optional
To 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.

Sample Request
copy

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
copy
  {
  "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
  }
  ]
  }
  ]
  }