LM-Kit OneDocs2026.8.10lm-kit.com
AI Analysis

Sentiment Analysis

Analyzes the input text for sentiment, emotion, and/or sarcasm.#

POST/lmkit/v1/analyze-sentiment

Performs 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 ·

PropertyTypeDescription
modelstring

The identifier of the language model to be used for analysis. If not provided, the default model is used.

inputrequiredstring

The text to analyze.

enable_sentimentboolean

When true, performs sentiment classification (Positive, Negative, or Neutral). Defaults to true.

sentiment_neutral_supportboolean

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_emotionboolean

When true, performs emotion detection (Happiness, Anger, Sadness, Fear, Neutral). Defaults to false.

emotion_neutral_supportboolean

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_sarcasmboolean

When true, performs sarcasm detection. Defaults to false.

Responses

StatusTypeDescription
200

OK

202

Accepted

400

Bad Request

500application/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
}'