Questions grounded in the page
Export questions that the page can actually answer
The V2 DocVQA adapter writes exports/docvqa.jsonl. Each record contains a document ID, split, and questions. It always includes a document-type question and adds field questions only when the value is grounded in printed words and page geometry. A field that exists in the internal model but is not rendered by the chosen layout is left out of the extractive question list.
These questions use the pristine source pages and semantics. This is useful for checking an export consumer and for document question-answering experiments, but it is deliberately narrower than a general question authoring system.
Short example
Create a DocVQA-shaped export
Run commands from the folder described in platform setup, and use a new output folder for each example.
Windows PowerShell
& '.\_internal\DocumentGenerator_v2.0_cli.exe' generate --type invoice --count 2 --seed 42 --output output/docvqa-small --export docvqa --validateLinux AppImage
./DocumentGenerator_v2.0.0_Linux-x86_64.AppImage --cli generate --type invoice --count 2 --seed 42 --output output/docvqa-small --export docvqa --validateLinux Flatpak
flatpak run com.docsetgenerator.DocSetGenerator --cli generate --type invoice --count 2 --seed 42 --output output/docvqa-small --export docvqa --validateA generated line follows this shape:
{
"id": "<document-id>",
"split": "train",
"questions": [
{"question_id": "document-type", "question": "What type of document is this?", "answers": ["invoice"], "source": "document_model"},
{"question_id": "field-0", "question": "What is the invoice_number?", "answers": ["INV-123"], "field_label": "Invoice number", "answer_word_ids": ["word-014"], "answer_page_number": 1, "source": "document_model"}
],
"semantics_origin": "document_model"
}
The IDs and values above are illustrative. The generated record is authoritative for the selected seed, layout, and content route.
DocVQA and business fields
Route scalar extraction to the fields task
Coherent business documents carry a separate field schema with names, types, descriptions, and formats. A parser can return those scalar values through the fields evaluator and map its own key names with --field-map. Exact, normalized, and typed matches are reported separately.
These commands use the business invoices in output/invoices-business from the invoice guide. Create the fields bundle and its private oracle:
Windows PowerShell
& '.\_internal\DocumentGenerator_v2.0_cli.exe' evaluate bundle --dataset output/invoices-business --task fields --out handoff/invoice-fieldsLinux AppImage
./DocumentGenerator_v2.0.0_Linux-x86_64.AppImage --cli evaluate bundle --dataset output/invoices-business --task fields --out handoff/invoice-fieldsLinux Flatpak
flatpak run com.docsetgenerator.DocSetGenerator --cli evaluate bundle --dataset output/invoices-business --task fields --out handoff/invoice-fieldsRun your parser on the cases in handoff/invoice-fields and save its values as field-predictions.jsonl (prediction format). Then score them:
Windows PowerShell
& '.\_internal\DocumentGenerator_v2.0_cli.exe' evaluate score --oracle handoff/invoice-fields_oracle --predictions field-predictions.jsonl --out reports/invoice-fieldsLinux AppImage
./DocumentGenerator_v2.0.0_Linux-x86_64.AppImage --cli evaluate score --oracle handoff/invoice-fields_oracle --predictions field-predictions.jsonl --out reports/invoice-fieldsLinux Flatpak
flatpak run com.docsetgenerator.DocSetGenerator --cli evaluate score --oracle handoff/invoice-fields_oracle --predictions field-predictions.jsonl --out reports/invoice-fieldsFor coherent business content, the current DocVQA adapter exports the document-type question, not scalar business-field questions. Grounded field questions are available on other supported routes when the answers are actually printed. Use the evaluation guide for the supported fields workflow.
What validation means
Schema and grounding checks protect the export
Checked
Question records are generated from canonical annotations. Answer word IDs and page references are retained for grounded printed fields, and empty answers are rejected by export validation.
Not checked
A valid JSONL file does not prove that a question is useful for your model, that a parser answers it correctly, or that the document distribution matches a public benchmark.
Limits
Plan for the supported question types
- The adapter is extractive and model-derived. It does not promise broad “answerability” fixtures, conversational questions, reasoning chains, or arbitrary user schemas.
- Unrendered model fields remain metadata and are counted in
quality_report.json; they are not made into answers by inference. - DocVQA and FUNSD use pristine source semantics and geometry. Use LayoutLM or COCO when the delivered image is the model input.
- Generation supports more document types and delivery conditions than parser evaluation. Check the OCR test guide before treating a dataset as scoreable.
Related guides
Pair this export with synthetic invoice data for grounded business fields, FUNSD-shaped records for role/link consumers, and OCR dataset design for reproducible source and split handling.