Skip to content
IJK

Schema-Driven Extraction: What Comes Back for Each Request

By IJK ·

What the Hugging Face post says the Dharma Field Extractor returns for a requested schema, a field not on the document and a table.

What the extractor takes and returns

The Field Extractor takes a document image and either a request for everything it can find, or an exact schema to fill, and returns structured JSON: typed, field by field, nested where the document nests. [1]

An invoice comes back with every line item as an ordered list, each with its own quantity and value, alongside the totals. [2]

An ID comes back as the fields you'll store, under the names your system already uses for them. [3]

The same checkpoint handles all of it, with no per-type fine-tuning. [4]

Document imageA request or an exact schemaStructured JSONtyped fields, null where the document lacks a value
What goes into the extractor and what comes back?

How it handles a schema

Ask for "service_provider" and "client_company", and those are the exact keys that come back. [5]

Ask for a table and it fills it row by row, column by column, matching each cell to the key it belongs under. [6]

When you send a schema, the output follows it exactly, with the same keys and no extra fields, so it can go straight into the next system. [7]

What it does with a missing field

Ask for a field that isn't on the document, and it returns null instead of inventing a value. [8]

Either way, what comes back is JSON: the fields as keys, the values typed as requested, and null where the document didn't have what you asked for. [9]

Sources

  1. The Dharma AI source says: The Field Extractor takes a document image and either a request for everything it can find, or an exact schema to fill, and returns structured JSON: typed, field by field, nested where the document nests. Dharma Field Extractor
  2. The Dharma AI source says: An invoice comes back with every line item as an ordered list, each with its own quantity and value, alongside the totals. Dharma Field Extractor
  3. The Dharma AI source says: An ID comes back as the fields you'll store, under the names your system already uses for them. Dharma Field Extractor
  4. The Dharma AI source says: The same checkpoint handles all of it, with no per-type fine-tuning. Dharma Field Extractor
  5. The Dharma AI source says: Ask for "service_provider" and "client_company", and those are the exact keys that come back. Dharma Field Extractor
  6. The Dharma AI source says: Ask for a table and it fills it row by row, column by column, matching each cell to the key it belongs under. Dharma Field Extractor
  7. The Dharma AI source says: When you send a schema, the output follows it exactly, with the same keys and no extra fields, so it can go straight into the next system. Dharma Field Extractor
  8. The Dharma AI source says: Ask for a field that isn't on the document, and it returns null instead of inventing a value. Dharma Field Extractor
  9. The Dharma AI source says: Either way, what comes back is JSON: the fields as keys, the values typed as requested, and null where the document didn't have what you asked for. Dharma Field Extractor

Editorial (AI-assisted; automatically checked, not human-reviewed). Each statement is linked to its source; check the source before relying on a detail.

  • document ai
  • extraction
  • json
  • ocr