Examples keep extraction honest
The other way to a trustworthy result is by example. When Claude is reading a messy source and pulling structured data out of it, a few worked examples stop it inventing values that were never there.
Doing this with Claude Code: Examples that keep extraction honest
When you pull a recipe out of a scruffy web page into a clean card, the failure to watch for is invention, a value that was never on the page. Hand Claude a couple of worked examples, this messy source gives this clean card, and it carries across what is actually there instead of guessing a tidy number.
Examples earn their keep here in four ways: keeping it honest, defining the loose terms, handling any layout and getting the empty fields right.
Do not invent, keep it in scope. A recipe says a knob of butter, and the invention is writing 15 grams, a number that was never there. Show that a knob is about a tablespoon, so it extracts what is on the page and stays in scope.
Define the loose terms. Give it a small glossary by example, a drizzle of oil is roughly a tablespoon, a pinch is a quarter teaspoon, so the vague descriptions map to known values instead of its own guesses.
Handle any layout. The same recipe turns up as a blog story, a tidy card and a forum comment. Show it pulled from each, and it learns to find the data by what it is, not where it sits, so a new layout does not throw it.
Get the empty fields right. Show that feeds a family of four fills the serves field, and that an optional garnish left out stays honestly empty, so required fields are filled even when worded oddly and optional ones are not invented.
Back to For developers. The craft around it is Working with AI.