nerdexam
Databricks

GENERATIVE-AI-ENGINEER-ASSOCIATE · Question #32

A Generative AI Engineer would like an LLM to parse and extract the following information: date, sender email, and order ID. The output should be formatted into JSON. Here's an email sample: They…

The correct answer is C. You will receive customer emails and need to extract date, sender email, and order ID. Return the. For high-accuracy structured data extraction into JSON, the most effective prompt includes: clear task instructions, explicit field names to extract, a concrete example of the expected JSON output (few-shot example), and ideally a defined JSON schema. Option C represents this…

Prompt Engineering for LLM Applications

Question

A Generative AI Engineer would like an LLM to parse and extract the following information: date, sender email, and order ID. The output should be formatted into JSON. Here’s an email sample:

They need a prompt that will extract and output the required information in JSON with the highest level of output accuracy. Which prompt will do that?

Exhibit

GENERATIVE-AI-ENGINEER-ASSOCIATE question #32 exhibit

Options

  • AYou will receive customer emails and need to extract date, sender email, and order ID. Return the
  • 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. You

How the community answered

(22 responses)
  • A
    9% (2)
  • B
    14% (3)
  • C
    73% (16)
  • D
    5% (1)

Explanation

For high-accuracy structured data extraction into JSON, the most effective prompt includes: clear task instructions, explicit field names to extract, a concrete example of the expected JSON output (few-shot example), and ideally a defined JSON schema. Option C represents this best-practice approach by providing a well-structured prompt with a concrete output example, which anchors the model's output format and reduces hallucination or schema deviation. Prompts that only describe the task in prose (without examples or schema) yield lower consistency when strict JSON formatting is required. Providing a concrete output template is the key differentiator for the highest accuracy.

Topics

#Prompt Engineering#Information Extraction#Structured Output#LLM Applications

Community Discussion

No community discussion yet for this question.

Full GENERATIVE-AI-ENGINEER-ASSOCIATE Practice