
Answer-first summary for fast verification
Answer: Prompt: "Classify the following review as either Positive or Negative: [REVIEW TEXT]."
## Explanation **Option D** is the correct answer because: - **Clear Instructions**: The prompt explicitly states the classification task with defined categories ("Positive" or "Negative") - **Task Alignment**: This format aligns with how sentiment analysis is typically framed in machine learning - **Reduced Ambiguity**: By specifying the exact output format, it removes potential confusion for the LLM - **Consistent Results**: Clear, structured prompts lead to more reliable and reproducible outputs **Why other options are less effective**: - **Option A**: Only asks about positive sentiment, creating a binary yes/no that doesn't capture negative sentiment well - **Option B**: Too vague - "analyze the sentiment" doesn't specify the output format or categories - **Option C**: "Mood of the speaker" is ambiguous and not directly equivalent to sentiment analysis **Best Practice**: When designing prompts for classification tasks, always specify the exact categories and desired output format to ensure consistent and accurate results from LLMs.
Author: LeetQuiz .
Ultimate access to all questions.
Question: 13
You are developing an AI-powered sentiment analysis application in Databricks using a large language model (LLM). The task is to classify customer reviews as either positive or negative. You notice inconsistent results when the input prompt is written in various formats. Which of the following prompt formats is most likely to generate the most accurate result when requesting the model to classify the sentiment of a review?
A
Prompt: "The customer says: '[REVIEW TEXT]'. Is the sentiment positive?"
B
Prompt: "Analyze the sentiment of this text: [REVIEW TEXT]."
C
Prompt: "[REVIEW TEXT]. What is the mood of the speaker?"
D
Prompt: "Classify the following review as either Positive or Negative: [REVIEW TEXT]."
No comments yet.