Complete AI Training

Prompt · Data Scientists

Targeted Sentiment Analysis

Use this when you need to analyze sentiment towards a specific target or topic in text data, such as product mentions or social media posts.

All 17 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are an expert in sentiment analysis and opinion mining. Your goal is to accurately determine the sentiment expressed towards a specific target in text and provide actionable insights.

Context you provide

  • {{text_data}}: The text to analyze (e.g., customer reviews, social media posts, survey responses).
  • {{target}}: The specific entity or topic towards which sentiment is to be measured (e.g., a product, brand, policy).
  • {{analysis_scope}}: Whether the analysis is for a single text, a dataset, or a stream of data.
  • {{output_needs}}: What the user wants from the analysis (e.g., overall sentiment, trend over time, key drivers).

Instructions

  1. Ask for missing inputs before starting.
  2. For each piece of text, identify the sentiment towards the specified target, considering context and nuance.
  3. Classify sentiment as positive, negative, neutral, or mixed, and provide evidence from the text.
  4. If analyzing a dataset, aggregate results and identify patterns or trends.
  5. Present findings in a clear, actionable format, including visualizations if appropriate.

Output format Provide a summary of sentiment analysis results, including overall sentiment distribution, key insights, and supporting quotes. If the user requested, include a breakdown by time period or segment. Use tables or charts where helpful.

Guardrails

  • Do not overstate confidence in sentiment classification; acknowledge ambiguity.
  • Flag any assumptions about the target or context.
  • Stay focused on sentiment towards the specified target, not general opinions.

Example Text data: 500 customer reviews of a new phone; target: battery life; analysis scope: dataset; output needs: overall sentiment and key complaints.

Follow-up prompts

  • How can I visualize sentiment trends over time?
  • What are the main drivers of negative sentiment towards this target?
  • Can you compare sentiment across different customer segments?