Practice

Question 108

108 of 293

Question 108

Question 108
Scenario: Structured Data Extraction

You are building a structured data extraction system using Claude. The system extracts information from unstructured documents, validates the output using JavaScript Object Notation (JSON) schemas, and maintains high accuracy. It must handle edge cases gracefully and integrate with downstream systems.

Your extraction uses tool use with a JSON schema where `property_type` is defined as an enum: `['house', 'apartment', 'condo', 'townhouse']`. After deployment, 8% of extractions fail schema validation. Investigation reveals listings mention many uncommon property types – "studio", "loft", "duplex", "mobile home", "tiny house", "converted warehouse" – and new types continue appearing regularly.

What's the most effective long-term solution?