Designing extraction schemas
How to define the fields Droqify extracts from a document type: field types, validation, generating a schema from a sample, assigning it and reading confidence.
A schema tells Droqify what to pull out of a given kind of document. It is the contract between your documents and your downstream systems, so it is worth a little care at the start.
What a schema is
A schema is a named list of fields for one document type, for example an invoice, a medical record or a claim form. When a document is classified as that type, Droqify extracts each field and stores the values alongside the source text. The Schemas area of the portal lists your schemas, lets you open one, and lets you build or edit one in the schema builder.
Fields and types
Each field has:
- a name (the machine key, such as
invoice_number) and a label (what people see); - a type: string, number, date, boolean, array or object;
- a required flag, an optional default value and a description that guides the extraction;
- an optional validation rule, such as a pattern or a range;
- an index flag, which makes the field usable for filtering and for smart folders.
Write descriptions as you would brief a new colleague. “Total amount due including tax, as printed in the totals box” extracts better than “total”.
Generate a schema from a sample document
- Upload a representative document of the type you want to capture.
- Start schema generation for that document from its detail page. The job runs asynchronously, like other processing.
- When it finishes, open the proposed schema and read every field. Remove fields you do not need, fix types, and add validation.
- Save the schema.
For files that contain several document types, such as a scanned bundle, multi-type analysis can classify page ranges and propose a schema for each.
Generated schemas are a starting point. Always review them against two or three real samples before relying on them.
Assign a schema to documents
Droqify matches a classified document to an existing schema automatically. When no schema matches, the document is flagged. From the flagged documents list you can assign a schema, validate a schema against the document, reprocess it, or dismiss it. You can also assign a schema from the document itself. After a new schema is created, flagged documents of that type can be reprocessed against it automatically.
Extraction modes and confidence
By default Droqify extracts per field: each field is a separate model call, which favours precision on long or messy documents. A batched mode, which extracts all fields of a schema in one call, exists as an option but is not the default.
Each extraction carries a confidence value. Use it to decide what needs a person to look at it. Low-confidence results are what a review queue is for; see the guide on setting up human review.
Practical tips
- Start small. Ten well-defined fields beat sixty vague ones.
- Make a field required only if downstream systems truly cannot proceed without it.
- Use a validation rule for fields with a known format, such as policy numbers or dates.
- Mark the fields your team searches by as indexes, so they appear in filters.
- Test on your own documents, including poor scans. Accuracy depends on your documents, so measure it on a sample you choose.
- Corrections your reviewers make are reused as examples within your own tenant only.
Do I have to write a schema by hand?
What happens to a document that matches no schema?
Does a schema change affect documents already processed?
Want help setting this up?
Our team can walk through it on your documents.