Skip to main content

Sentiment Analysis

Analyze text to identify sentiment as negative, neutral, or positive using natural language processing.

Identifying sentiment expressed in text whether they’re negative, neutral, or positive.

Group
Negative
Neutral
Positive

Identifying sentiment expressed in text​

POST https://api.aigen.online/ainlp/sentiment/v1

Request Body​

NameTypeDescription
text*String
{
"group_count": 1,
"group_detail": [
{
"group_name": "Positive",
"rank": 1,
"score": 0.82
}
],
"status": "success"
}

Example code​

import requests
import json

api = "https://api.aigen.online/ainlp/sentiment/v1"
headers = {"x-aigen-key": "<key>", "content-type": "application/json"}
data = json.dumps({"text": "ai สามารถช่วยแก้ปัญหาต่าง ๆ ได้"})

res = requests.post(api, data=data, headers=headers)
print(res.json())