nerdexam
Databricks

GENERATIVE-AI-ENGINEER-ASSOCIATE · Question #20

A Generative AI Engineer would like an LLM to generate formatted JSON from emails. This will require parsing and extracting the following information: order ID, date, and sender email. Here's a…

The correct answer is B. You will receive customer emails and need to extract date, sender email, and order ID. Return the. Option B is correct because it explicitly instructs the LLM to return structured JSON and specifies the exact schema (fields: order_id, date, sender_email), which maximizes output accuracy and consistency. High-accuracy JSON extraction requires the prompt to: (1) clearly state…

Prompt Engineering

Question

A Generative AI Engineer would like an LLM to generate formatted JSON from emails. This will require parsing and extracting the following information: order ID, date, and sender email. Here’s a sample email:

They will need to write a prompt that will extract the relevant information in JSON format with the highest level of output accuracy. Which prompt will do that?

Options

  • AYou will receive customer emails and need to extract date, sender email, and order ID. You
  • BYou will receive customer emails and need to extract date, sender email, and order ID. Return the
  • CYou will receive customer emails and need to extract date, sender email, and order ID. Return the
  • DYou will receive customer emails and need to extract date, sender email, and order ID. Return the

How the community answered

(34 responses)
  • A
    3% (1)
  • B
    82% (28)
  • C
    3% (1)
  • D
    12% (4)

Explanation

Option B is correct because it explicitly instructs the LLM to return structured JSON and specifies the exact schema (fields: order_id, date, sender_email), which maximizes output accuracy and consistency. High-accuracy JSON extraction requires the prompt to: (1) clearly state the output format is JSON, (2) enumerate the exact field names and structure expected, and optionally (3) include a one-shot example. Vague instructions about 'extracting information' without a specified schema lead to inconsistent key names, formats, and structures across responses. The other options are less specific about the output format or schema.

Topics

#Prompt Engineering#Information Extraction#Structured Data Generation#LLM Application

Community Discussion

No community discussion yet for this question.

Full GENERATIVE-AI-ENGINEER-ASSOCIATE Practice