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?

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.