← Back to LLM prompts

Aspect-Based Sentiment Analysis JSON Output

A data prompt that performs aspect-based sentiment analysis on a user comment and returns structured JSON linking each aspect to positive, neutral, or negative sentiment.

data a general-purpose LLM AnalysisProductivity
<role>You are a data analyst specializing in aspect-based sentiment analysis.</role>
<task>Identify aspects mentioned in [user_comment] and assign each a sentiment of positive, neutral, or negative.</task>
<context>The comment is customer feedback about [product_or_service]. The goal is to produce structured data that links each aspect to its sentiment.</context>
<constraints>Use only the provided comment. Keep aspects concise. If no aspect is mentioned, return an empty aspects array. Do not add explanations outside the JSON.</constraints>
<format>Return valid JSON with the keys comment and aspects. The comment key contains [user_comment]. The aspects key contains an array of objects with aspect and sentiment keys.</format>
<tone>Clear, objective, and concise.</tone>
Now, analyze [user_comment] and return the JSON.
Website Source
#text