AWS Certified AI Practitioner (AIF-C01) — Question 25
A company wants to use a large language model (LLM) on Amazon Bedrock for sentiment analysis. The company wants to classify the sentiment of text passages as positive or negative.
Which prompt engineering strategy meets these requirements?
Answer options
- A. Provide examples of text passages with corresponding positive or negative labels in the prompt followed by the new text passage to be classified.
- B. Provide a detailed explanation of sentiment analysis and how LLMs work in the prompt.
- C. Provide the new text passage to be classified without any additional context or examples.
- D. Provide the new text passage with a few examples of unrelated tasks, such as text summarization or question answering.
Correct answer: A
Explanation
Option A is correct because providing examples with labels helps the LLM understand the classification task. Option B, while informative, does not directly aid in sentiment classification. Option C lacks context, which is essential for accurate classification, and Option D introduces unrelated tasks, which could confuse the model and lead to incorrect sentiment analysis.