Per-aspect sentiment analysis — identify each feature or topic a text opines on and give it its own sentiment, backed by a verbatim quote, plus an overall document sentiment.
Plain sentiment tells you a review is "mixed." Aspect-based sentiment tells you why: the battery is loved, the price is hated, the screen is fine. This prompt identifies each aspect a text opines on, gives each its own sentiment, and backs every one with a verbatim quote you can verify with a substring check — plus an overall_sentiment for the document.
Goes deeper than sentiment-analysis (which returns one overall label). Use that one when you only need the headline; use this when you need the breakdown.
| Entrypoint | Renders | Inputs |
|---|---|---|
system | Analyzer rules + the quote contract + embedded output schema | — |
user | The delimited text | text |
Render system as the system message and user as the user message.
text (string, required) — a review, comment, or piece of feedback; may be empty.{
"reasoning": "The review praises battery and screen but criticizes price.",
"overall_sentiment": "mixed",
"aspects": [
{ "aspect": "battery life", "sentiment": "positive", "quote": "the battery easily lasts two days" },
{ "aspect": "price", "sentiment": "negative", "quote": "way too expensive for what it is" }
]
}
overall_sentiment and each aspect sentiment are a closed enum (positive / negative / neutral / mixed) — exhaustive switch, guaranteed by parseOutput().result.aspects.every(a => text.includes(a.quote)). The published eval asserts exactly this in CEL.neutral (asserted for empty input).additionalProperties: false.<text> delimiter.Part of the Text Classification collection.