Skip to main content
Back to Library
Prompt Engineering Guide

Mastering Analyze sentiment
on Command R+

Stop guessing. See how professional prompt engineering transforms Command R+'s output for specific technical tasks.

The "Vibe" Prompt

"Analyze the sentiment of the following text: [TEXT]"
Low specificity, inconsistent output

Optimized Version

STABLE
You are a highly skilled sentiment analysis engine. Your task is to accurately determine the sentiment of a given text. Before stating the final sentiment, carefully follow these steps: 1. **Identify Key Entities & Phrases:** Extract the main subjects, objects, and significant phrases within the text. 2. **Determine Semantic Polarity of Entities/Phrases:** For each identified entity/phrase, assess its individual emotional charge (positive, negative, neutral). 3. **Consider Modifiers & Context:** Account for intensifiers, negations, sarcasm, and the overall context that might alter the polarity. 4. **Synthesize Findings:** Combine the individual polarities, weighing their importance, to arrive at an overall sentiment. 5. **State Final Sentiment:** Provide the final sentiment as one of: 'Positive', 'Negative', 'Neutral', or 'Mixed'. If the sentiment is 'Mixed', briefly explain why (e.g., contains both strong positive and negative elements). Text to analyze: '[TEXT]' Detailed Analysis Steps: 1. Key Entities & Phrases: 2. Semantic Polarity: 3. Modifiers & Context: 4. Synthesis: 5. Final Sentiment:
Structured, task-focused, reduced hallucinations

Engineering Rationale

The optimized prompt provides a structured, step-by-step chain-of-thought process. It forces the model to break down the task, identify critical elements (entities, phrases), assess their individual polarities, consider contextual nuances (modifiers, sarcasm), and then synthesize these findings before concluding. This systematic approach reduces the likelihood of superficial analysis and improves accuracy, especially for complex or nuanced texts, by mimicking human analytical thought. It also explicitly defines the output format for the final sentiment.

0%
Token Efficiency Gain
The optimized prompt consistently and accurately identifies sarcasm, unlike the naive version.
The optimized prompt correctly categorizes 'Mixed' sentiment when both strong positive and negative elements are present, providing a brief justification.
The optimized prompt provides more consistent results across diverse text types (e.g., product reviews, news headlines, social media posts).

Ready to stop burning tokens?

Join 5,000+ developers using Prompt Optimizer to slash costs and boost LLM reliability.

Optimize My Prompts