CoolFace
Datasetpublic

KhalfounMehdi/arabic-latin-invoices-synthetic

Synthetic Arabic/Latin Invoices — label-first multimodal dataset A large, perfectly-labeled synthetic invoice dataset for training multimodal invoice-parsing models, with first-class support for Arabic script, mixed Arabic/Latin layouts, and all three numeral glyph systems. Every sample is generated label-first: a structured invoice record is sampled, then rendered to pixels via a headless browser, and bounding boxes are read back from the same DOM — so labels and boxes are… See the full description on the dataset page: https://huggingface.co/datasets/KhalfounMehdi/arabic-latin-invoices-synthetic.

sourceHugging Facecc-by-4.0updated 4mo agoView on Hugging Face
1likes210downloads
Dataset Card

Synthetic Arabic/Latin Invoices — label-first multimodal dataset

A large, perfectly-labeled synthetic invoice dataset for training multimodal invoice-parsing models, with first-class support for Arabic script, mixed Arabic/Latin layouts, and all three numeral glyph systems.

Every sample is generated label-first: a structured invoice record is sampled, then rendered to pixels via a headless browser, and bounding boxes are read back from the same DOM — so labels and boxes are exact by construction, not OCR guesses or human annotations. Realism comes from a label-preserving degradation pipeline applied after the labels are fixed.

Languages & numerals

  • —Scripts: Arabic, English, French, and mixed (e.g. Latin IBAN/SKU inside an Arabic invoice).
  • —Numeral systems (all present, including mixed within one document):
  • —WESTERN 0123456789
  • —ARABIC_INDIC ٠١٢٣٤٥٦٧٨٩ (U+0660–0669; "Indian/Hindi numerals" أرقام هندية)
  • —EXTENDED_ARABIC_INDIC ۰۱۲۳۴۵۶۷۸۹ (U+06F0–06F9; Persian/Urdu)
  • —Arabic separators ٫ (decimal) and ٬ (thousands).

Columns

columndescription
imagethe rendered + degraded invoice image
sample_idunique id
canonicalground-truth label (JSON string): every scalar as {value, raw} (normalized + as-printed)
text_mdMarkdown reconstruction in correct logical (bidi) reading order
boxesJSONL: field- and word-level bounding boxes (pixel coords), carried through degradation
tasksJSONL: ready-made training examples — schema (arbitrary JSON Schema + exact answer), fields, table, raw_text, qa, numerals (system conversion), abstention (null), grounding (bbox 0–1000) — with prompts in ar/en/fr
metafull generation metadata (template, font, tier, ops, …)
profile, primary_lang, numeral_body, numeral_systems, degradation_tier, template, font_family, doc_typesliceable metadata

canonical label shape (abridged)

json
{
  "doc_type": "tax_invoice",
  "numeral_systems": ["WESTERN","ARABIC_INDIC"],
  "invoice_number": {"value": "INV-49119", "raw": "INV-٤٩١١٩"},
  "dates": {"issue": {"value": "2026-11-06", "raw": "٦/١١/٢٠٢٦", "calendar": "gregorian"}},
  "seller": {"name": {...}, "tax_id": {...}, "iban": {...}},
  "line_items": [{"description": {...}, "quantity": {...}, "unit_price": {...}, "line_total": {...}}],
  "totals": {"subtotal": {...}, "tax_total": {...}, "grand_total": {"value": 18691.77, "raw": "١٨,٦٩١.٧٧"}}
}

Diversity

  • —Locale profiles: SA, AE, EG, MA (Arabic+French), IR-style (Persian digits), generic English.
  • —Templates: classic / modern / thermal-receipt, direction-aware, with randomized line-item column subset+order and totals styles.
  • —41 real fonts (28 Arabic) across Naskh / Kufi / Ruqaa / modern-sans / display.
  • —Degradation tiers: clean / light / heavy / photo (background composite, glare, perspective) / scan (binarize, scan-lines, fade). The structured label is invariant to all of these.

Splits

Deterministic by sample_id hash: ~96% train, ~2% validation, ~2% test.

Intended use

Training/evaluating OCR-free invoice parsers: full structured extraction, arbitrary caller-schema extraction, table extraction, raw-text transcription, VQA, numeral-system conversion, abstention, and field grounding. The boxes enable detection/grounding supervision.

Loading

python
from datasets import load_dataset
ds = load_dataset("<your-namespace>/<repo>", split="train")
ex = ds[0]
ex["image"]                       # PIL image
import json
label = json.loads(ex["canonical"])
tasks = [json.loads(l) for l in ex["tasks"].splitlines()]

Provenance & licensing

  • —Content is fully synthetic (no real PII). Company names, tax IDs, IBANs are generated (IBANs carry valid mod-97 check digits but reference no real account).
  • —Dataset released under CC-BY-4.0.
  • —Embedded glyph shapes come from open fonts under the SIL Open Font License (and Apache-2.0 for a few) sourced from the google/fonts project; font files themselves are not redistributed here, only rendered rasterized text.

Limitations

  • —Synthetic distribution; intended to be combined with a small real eval set for sim-to-real.
  • —v1 covers Arabic/English/French; tax-invoice / receipt document types.