Guide · Annotation Formats

The FUNSD Format, Explained (and How to Generate More of It)

FUNSD (Form Understanding in Noisy Scanned Documents) is the standard benchmark for form understanding — but it contains only 199 documents. This guide explains the format's structure and how to generate unlimited additional FUNSD-format training data synthetically.

What FUNSD is

FUNSD is a dataset of 199 real scanned forms annotated for form understanding: 149 training and 50 test documents, ~9,700 semantic entities, ~31,500 words. It underpins the standard evaluation for models like LayoutLM, LayoutLMv3, and their successors on two tasks: semantic entity labeling (classify each entity as question, answer, header, or other) and entity linking (connect questions to their answers).

The annotation schema

Each document is a JSON file with a form array. Each entity contains:

{
  "id": 3,
  "label": "question",
  "box": [84, 109, 226, 130],
  "linking": [[3, 4]],
  "words": [
    { "text": "Invoice", "box": [84, 109, 152, 130] },
    { "text": "Number:", "box": [158, 109, 226, 130] }
  ]
}

The 199-document problem

FUNSD is tiny, its forms are all 1980s–90s tobacco-industry documents, and every model has trained against it. Fine-tuning on 149 documents overfits fast, and benchmark scores say little about generalization to modern forms. The fix is synthetic augmentation: generate documents where question/answer/header roles and links are known by construction rather than hand-labeled.

Generating synthetic FUNSD data

DocSet Generator emits FUNSD-format exports for every run: entities with question/answer/header/other roles, semantic links, and word-level boxes — derived from the canonical document model rather than post-hoc labeling, so the annotations are exact even under heavy OCR degradation. Combined with 33 document types and deterministic train/val/test splits, one command produces a FUNSD-compatible corpus orders of magnitude larger than the original, with modern layouts.

Frequently asked questions

Is synthetic FUNSD data a replacement for the real benchmark?

No — evaluate on real FUNSD for comparability with published results. Synthetic FUNSD-format data is for training and augmentation, where the original's 149 training documents are the bottleneck.

Are the bounding boxes in image or PDF coordinates?

FUNSD uses pixel coordinates on the rendered page image. DocSet Generator's FUNSD export follows the same convention, aligned to the clean page images it emits alongside annotations.

Generate this data yourself, locally

DocSet Generator is a $199 one-time desktop app (Windows & Linux) that produces synthetic documents across 33 types with controllable OCR degradation, ground truth, and ML-ready COCO / LayoutLM / FUNSD / DocVQA exports — all offline, with zero real PII.