Sentiment Analysis
Analyzes the input text for sentiment, emotion, and/or sarcasm.#
/lmkit/v1/analyze-sentimentPerforms text analysis on the provided input using the specified or default model. Each analyser can be independently enabled: sentiment classification (Positive, Negative, or Neutral), emotion detection (Happiness, Anger, Sadness, Fear, or Neutral), and sarcasm detection (true/false). By default, only sentiment analysis is enabled. Each result includes an associated confidence score. At least one analyser must be enabled. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/ for status and results.
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
model | string | The identifier of the language model to be used for analysis. If not provided, the default model is used. |
inputrequired | string | The text to analyze. |
enable_sentiment | boolean | When true, performs sentiment classification (Positive, Negative, or Neutral). Defaults to true. |
sentiment_neutral_support | boolean | When true, enables 3-way sentiment classification (Positive, Negative, Neutral). When false, uses 2-way classification (Positive, Negative). Only applies when enable_sentiment is true. Defaults to false. |
enable_emotion | boolean | When true, performs emotion detection (Happiness, Anger, Sadness, Fear, Neutral). Defaults to false. |
emotion_neutral_support | boolean | When true, includes 'Neutral' in the emotion categories (5-way). When false, uses 4-way classification. Only applies when enable_emotion is true. Defaults to true. |
enable_sarcasm | boolean | When true, performs sarcasm detection. Defaults to false. |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 202 | Accepted | |
| 400 | Bad Request | |
| 500 | application/json | Internal Server Error |
| 404 | Not Found |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/analyze-sentiment" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "",
"input": "",
"enable_sentiment": true,
"sentiment_neutral_support": false,
"enable_emotion": false
}'