Analyse Sentiment
Table of Contents
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.
- 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:
Params | Data type | Description |
<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 session was intriguing."
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"
}