QuestionQ98

Prompt Engineering & Structured Output

You are developing a structured data-extraction system with Claude. The system pulls information from unstructured documents, validates its output with JavaScript Object Notation (JSON) schemas, and preserves high accuracy. It must gracefully handle edge cases and integrate with downstream systems.

Your system has operated for 3 weeks, and human reviewers have corrected 847 extractions. Analysis identifies a recurring pattern: when recipes contain informal measurements such as “a handful” or “a splash,” the model either fabricates specific quantities or leaves fields blank—representing 23% of all corrections.

How should this feedback be used to improve extraction accuracy?

Explanation

Few-shot examples that show informal measurements being extracted verbatim provide a direct, targeted correction for the observed error pattern while preserving the source information. Anthropic’s prompting guidance states that relevant, diverse examples improve accuracy and consistency, especially when they cover edge cases.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!