For a data extraction task (extracting names, dates, and amounts from invoices), what prompt approach MAXIMIZES reliability?
Select an answer to reveal the explanation.
Short Explanation
For extraction, you need a tight spec. Tell Claude exactly which fields to find, their expected format, and the output structure. A schema example removes all ambiguity.
Full Explanation
Reliable data extraction requires explicitly naming all target fields, specifying data types and formats (e.g., 'date as YYYY-MM-DD', 'amount as float in USD'), defining the output structure (JSON with specific keys), providing a schema example, and handling missing values ('use null if not found'). This removes Claude's need to make any decisions about what or how to extract. The option that asks Claude to describe the invoice in its own words produces a narrative description, not structured data. The option that uses a high temperature introduces randomness, which is bad for precise extraction that needs temperature=0. The option that provides the invoice without instructions gives Claude too much discretion about what to extract.