# DocVQA Dataset

Canonical source: [DocVQA Dataset](https://docsetgenerator.com/docvqa-dataset)

Guide · DocVQA export

## Create questions with answers grounded in the page

Export supported questions with answers tied to printed text and word geometry. The included CLI evaluator scores scalar extraction through the separate fields task described below.

**Command-line setup**

Guide commands use the tools included with your Windows or Linux download; no separate Python installation is needed. Each guide's command examples show the complete command for the platform you choose. [Open platform setup](https://docsetgenerator.com/getting-started#command-line).

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

Windows PowerShell

```powershell
& '.\_internal\DocumentGenerator_v2.0_cli.exe' generate --type invoice --count 2 --seed 42 --output output/docvqa-small --export docvqa --validate
```

Linux AppImage

```sh
./DocumentGenerator_v2.0.0_Linux-x86_64.AppImage --cli generate --type invoice --count 2 --seed 42 --output output/docvqa-small --export docvqa --validate
```

Linux Flatpak

```sh
flatpak run com.docsetgenerator.DocSetGenerator --cli generate --type invoice --count 2 --seed 42 --output output/docvqa-small --export docvqa --validate
```

A 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](https://docsetgenerator.com/synthetic-invoice-dataset#invoice-example). Create the fields bundle and its private oracle:

Windows PowerShell

```powershell
& '.\_internal\DocumentGenerator_v2.0_cli.exe' evaluate bundle --dataset output/invoices-business --task fields --out handoff/invoice-fields
```

Linux AppImage

```sh
./DocumentGenerator_v2.0.0_Linux-x86_64.AppImage --cli evaluate bundle --dataset output/invoices-business --task fields --out handoff/invoice-fields
```

Linux Flatpak

```sh
flatpak run com.docsetgenerator.DocSetGenerator --cli evaluate bundle --dataset output/invoices-business --task fields --out handoff/invoice-fields
```

Run your parser on the cases in `handoff/invoice-fields` and save its values as `field-predictions.jsonl` ([prediction format](https://docsetgenerator.com/evaluation#evaluation-commands)). Then score them:

Windows PowerShell

```powershell
& '.\_internal\DocumentGenerator_v2.0_cli.exe' evaluate score --oracle handoff/invoice-fields_oracle --predictions field-predictions.jsonl --out reports/invoice-fields
```

Linux AppImage

```sh
./DocumentGenerator_v2.0.0_Linux-x86_64.AppImage --cli evaluate score --oracle handoff/invoice-fields_oracle --predictions field-predictions.jsonl --out reports/invoice-fields
```

Linux Flatpak

```sh
flatpak run com.docsetgenerator.DocSetGenerator --cli evaluate score --oracle handoff/invoice-fields_oracle --predictions field-predictions.jsonl --out reports/invoice-fields
```

For 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](https://docsetgenerator.com/evaluation) 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](https://docsetgenerator.com/layoutlm-training-data) or [COCO](https://docsetgenerator.com/coco-annotations-documents) when the delivered image is the model input.
- Generation supports more document types and delivery conditions than parser evaluation. Check [the OCR test guide](https://docsetgenerator.com/test-documents-for-ocr) before treating a dataset as scoreable.

### Related guides

Pair this export with [synthetic invoice data](https://docsetgenerator.com/synthetic-invoice-dataset) for grounded business fields, [FUNSD-shaped records](https://docsetgenerator.com/funsd-format) for role/link consumers, and [OCR dataset design](https://docsetgenerator.com/ocr-training-data) for reproducible source and split handling.
