Q51 — AWS AIF-C01 Ch.2
Question 51 of 100 | ← Chapter 2
A company wants to perform sentiment analysis using a large language model (LLM) on Amazon Bedrock, classifying text passages as positive or negative. Which prompt engineering strategy meets this requirement?
- A. Provide several example text passages labeled with their corresponding positive or negative sentiment in the prompt, followed by the new passage to classify. ✓
- B. Explain sentiment analysis and how LLMs work in detail within the prompt.
- C. Provide only the new text passage to classify, without any additional context or examples.
- D. Include several unrelated task examples in the prompt, such as text summarization or question answering.
Correct Answer: A. Provide several example text passages labeled with their corresponding positive or negative sentiment in the prompt, followed by the new passage to classify.
Explanation
When using a large language model (LLM) on Amazon Bedrock for sentiment analysis—classifying text as positive or negative—an effective prompt must guide the model clearly. Providing labeled examples (e.g., passages tagged with 'positive' or 'negative') in the prompt leverages few-shot learning, helping the LLM infer the task structure and improve classification accuracy for new passages. Thus, option A is the correct prompt engineering strategy.