Choose where you’d like to start

Analyse Sentiment

Description

The zoho.ai.analyseSentiment task interprets the given piece of text to predict if it has positive, negative, or neutral emotion. The response of this task also includes the probability percentage of each emotion in the given sentence.

Note: 
  • This task only supports English.
  • The prediction results may not be accurate, which is also the case with any AI prediction. However, we are working on improving this.
  • The prediction results are dynamic. The same script may produce different outcomes at different times based on how much the machine has learned.

Syntax

<response> = zoho.ai.analyseSentiment(<sentence>);

where:

ParamsData typeDescription

<response>

KEY-VALUE

Specifies the predicted sentiment, and the probability percentage of neutral, negative, and positive emotions in the given sentence

<sentence>

TEXT

Specifies the piece of text whose sentiment needs to be interpreted

Example

The following script interprets the sentiment of the given text - The session was intriguing.

response = zoho.ai.analyseSentiment("The session was intriguing.");

where:

response
The KEY-VALUE response that represents the predicted sentiment and the probability of neutral, negative, and positive emotions in the given sentence. Here, the predicted emotion is positive.
"The session was intriguing."
The TEXT that represents the piece of text that needs to be interpreted

Response Format

Success Response

  • The success response will be returned in the following format.

     {
     "Prediction":"Positive",
     "Probability":{"Neutral":"16%","Negative":"50%","Positive":"79%"}
     }

Failure Response

  • The failure response returned for an empty input text will be in the following format.

     {
     "Error Message ":"FAILED"
     }
 

Related Links

Get Started Now

Execute