Databricks Generative AI Engineer Associate Question 7
Single answerYou are designing a prompt for a generative AI model in Databricks to extract specific details from customer reviews, including the customer's name, product purchased, and a sentiment score formatted as JSON. Which of the following prompts is most likely to elicit a correctly formatted response?
- A
Extract the details from the customer review and return the information in any format.
- B
Please summarize the review.
- C
Extract the customer's name, product purchased, and sentiment score from the review. Format the response as: {"name": "
", "product": " ", "sentiment": }. - D
Identify key entities in the review and provide a sentiment analysis score.
Show answer and explanation
Correct answer: C
Explanation
When designing prompts for generative AI models, it is important to clearly specify both the information required and the format for the response. Option 3 is the only prompt that provides both the details to extract and the exact JSON format, ensuring a structured and accurate response.
- A. Incorrect.
This option does not specify the required format for the response, making it unlikely to elicit the desired JSON output.
- B. Incorrect.
Summarizing the review does not fulfill the requirement to extract and format the specific details as JSON.
- C. Correct.
This option explicitly specifies the required details to extract and provides the exact JSON format for the response, making it the best choice to elicit the desired output.
- D. Incorrect.
While this option asks for key entities and sentiment analysis, it does not specify a structured format for the output, which may lead to unstructured responses.