Classify the overall sentiment of text (positive / negative / neutral / mixed) with a rationale and confidence score. Strict JSON output.
Classify the overall sentiment of a piece of text — positive, negative, neutral, or mixed — and get back a strict JSON object with a one-line rationale and a confidence score.
Built for product reviews, support messages, social posts, survey free-text, and any place you need a fast, structured read on tone.
| Entrypoint | Renders | Inputs |
|---|---|---|
system | The classifier instructions + embedded output schema | — |
user | The delimited text block to analyze | text (string) |
Render system as the system message and user as the user message.
text (string, required) — the text to analyze. A sentence to a few paragraphs works best.parseOutput() returns:
{
"rationale": "Praises the battery life and screen with no complaints.",
"sentiment": "positive",
"confidence": 0.94
}
rationale comes before sentiment by design. Models that emit the label first tend to rationalize it after the fact; reasoning-first measurably improves accuracy. The system prompt pins this key order.sentiment is one of positive / negative / neutral / mixed. mixed is reserved for genuinely contrasting sentiment of similar weight — not mostly-positive text with a minor caveat.confidence is the model's self-reported certainty. ⚠️ LLM confidence is not calibrated — treat it as a rough signal for routing/triage, not a probability.{{{text}}}) so &, <, " in user text are never HTML-escaped.neutral with low confidence (specified, not left to chance).additionalProperties: false, closed enum, confidence bounded 0–1.Verified by local render against realistic input. Suggested default model claude-sonnet-4-6 at temperature: 0 (carried in version metadata — override per call as you like).