Prompt Engineering Guide
Mastering Analyze sentiment
on Mixtral 8x22B
Stop guessing. See how professional prompt engineering transforms Mixtral 8x22B's output for specific technical tasks.
The "Vibe" Prompt
"Analyze the sentiment of the following text: [TEXT]"
Low specificity, inconsistent output
Optimized Version
You are a highly analytical AI specialized in sentiment analysis. Your task is to determine the sentiment of the provided text. Follow these steps:
1. Read the text carefully.
2. Identify keywords, phrases, and their emotional connotations (positive, negative, neutral).
3. Consider the overall context and potential for irony or sarcasm.
4. Synthesize your findings to assign a primary sentiment label (Positive, Negative, Neutral) and a confidence score (0-100).
5. Briefly explain your reasoning, highlighting the key elements that led to your conclusion.
Text to analyze: "[TEXT]"
Output in JSON format:
{
"sentiment": "[Sentiment Label]",
"confidence": [Confidence Score],
"reasoning": "[Explanation]"
}
Structured, task-focused, reduced hallucinations
Engineering Rationale
The optimized prompt leverages a chain-of-thought approach, guiding the model through a structured analytical process. It explicitly defines the AI's role and steps for analysis, which helps in identifying nuances like irony. By requesting a JSON output with a confidence score and reasoning, it encourages a more deliberate and transparent analysis, reducing ambiguity. This structure ensures a consistent and high-quality output, especially beneficial for complex sentiment identification.
0%
Token Efficiency Gain
The optimized prompt consistently provides a sentiment label (Positive, Negative, Neutral).
The optimized prompt includes a confidence score between 0 and 100.
The optimized prompt provides a clear and concise reasoning for the sentiment, referencing parts of the input text.
Ready to stop burning tokens?
Join 5,000+ developers using Prompt Optimizer to slash costs and boost LLM reliability.
Optimize My Prompts