id string | record_id string | variant string | split string | doc_type string | invoice_type_code string | layout string | numeral_system string | template_family string | template_id string | fonts list | image image | width int32 | height int32 | page int32 | n_pages int32 | qr_bbox list | canonical string | fields list | field_links list | line_items list | words list | doc_qa list | degradation dict | synthetic bool | generator dict | review_status string | license string | provenance_version string | image_sha256 string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sei-000000-clean-p0 | sei-000000 | clean | train | credit_note | 381 | bilingual_stacked | arabic_indic | CDN04 | CDN04:lateef:notosans:shuffled:iso:62 | [
"Lateef@4.400",
"Noto Sans@2.015"
] | 1,240 | 1,754 | 0 | 2 | null | "{\"allowances\": [], \"amount_in_words\": {\"ar\": \"فقط سبعة آلاف وسبعمائة وأ(...TRUNCATED) | [{"entity_id":"e3","field_id":"BT-27","role":"value","text_raw":"شركة خط الإتقان للش(...TRUNCATED) | [{"from_entity":"e13","to_entity":"e14","type":"ar_en_label"},{"from_entity":"e13","to_entity":"e12"(...TRUNCATED) | [{"row":1,"cells":[{"col":"desc","header_field_id":"BT-153","text_raw":"تذكرة سفر دولية(...TRUNCATED) | [{"word_id":"w0","text":"شركة","bbox":[1154.739990234375,43.75,1193.1199951171875,89.05999755859(...TRUNCATED) | [{"qid":"sei-000000-q0","question_ar":"ما الرقم الضريبي للمورد؟","question_en":(...TRUNCATED) | null | true | {"name":"saudi-einvoice-synth","version":"0.1.0","git_sha":"3d896716e4a633958bae8fbcc93287d55599dadd(...TRUNCATED) | machine_validated | cc-by-4.0 | v0.1.0 | 7120c3d3c529e3ed30d437e219c750c10c04a4b4edbba6af7fce76c67e469dee | |
sei-000000-scan-p0 | sei-000000 | scan | train | credit_note | 381 | bilingual_stacked | arabic_indic | CDN04 | CDN04:lateef:notosans:shuffled:iso:62 | [
"Lateef@4.400",
"Noto Sans@2.015"
] | 1,240 | 1,754 | 0 | 2 | null | "{\"allowances\": [], \"amount_in_words\": {\"ar\": \"فقط سبعة آلاف وسبعمائة وأ(...TRUNCATED) | [{"entity_id":"e3","field_id":"BT-27","role":"value","text_raw":"شركة خط الإتقان للش(...TRUNCATED) | [{"from_entity":"e13","to_entity":"e14","type":"ar_en_label"},{"from_entity":"e13","to_entity":"e12"(...TRUNCATED) | [{"row":1,"cells":[{"col":"desc","header_field_id":"BT-153","text_raw":"تذكرة سفر دولية(...TRUNCATED) | [{"word_id":"w0","text":"شركة","bbox":[1127.8599853515625,48.95000076293945,1165.8299560546875,9(...TRUNCATED) | [{"qid":"sei-000000-q0","question_ar":"ما الرقم الضريبي للمورد؟","question_en":(...TRUNCATED) | {"library":"saudi_einvoice_synth.degrade","version":"0.1.0","pipeline":"scan","params":"{\"angle\": (...TRUNCATED) | true | {"name":"saudi-einvoice-synth","version":"0.1.0","git_sha":"3d896716e4a633958bae8fbcc93287d55599dadd(...TRUNCATED) | machine_validated | cc-by-4.0 | v0.1.0 | c31f2ec036924ce8d58344d53fbd607423d417c93389004c185c36929017c2da | |
sei-000000-photo-p0 | sei-000000 | photo | train | credit_note | 381 | bilingual_stacked | arabic_indic | CDN04 | CDN04:lateef:notosans:shuffled:iso:62 | [
"Lateef@4.400",
"Noto Sans@2.015"
] | 1,240 | 1,754 | 0 | 2 | null | "{\"allowances\": [], \"amount_in_words\": {\"ar\": \"فقط سبعة آلاف وسبعمائة وأ(...TRUNCATED) | [{"entity_id":"e3","field_id":"BT-27","role":"value","text_raw":"شركة خط الإتقان للش(...TRUNCATED) | [{"from_entity":"e13","to_entity":"e14","type":"ar_en_label"},{"from_entity":"e13","to_entity":"e12"(...TRUNCATED) | [{"row":1,"cells":[{"col":"desc","header_field_id":"BT-153","text_raw":"تذكرة سفر دولية(...TRUNCATED) | [{"word_id":"w0","text":"شركة","bbox":[1122.6600341796875,74.86000061035156,1158.25,117.58999633(...TRUNCATED) | [{"qid":"sei-000000-q0","question_ar":"ما الرقم الضريبي للمورد؟","question_en":(...TRUNCATED) | {"library":"saudi_einvoice_synth.degrade","version":"0.1.0","pipeline":"photo","params":"{\"attempt\(...TRUNCATED) | true | {"name":"saudi-einvoice-synth","version":"0.1.0","git_sha":"3d896716e4a633958bae8fbcc93287d55599dadd(...TRUNCATED) | machine_validated | cc-by-4.0 | v0.1.0 | 933dd481c764f8fd481b097b402e60f7d925979aa00dc7660ddd8eac8cd4ef2e | |
sei-000000-low_ink-p0 | sei-000000 | low_ink | train | credit_note | 381 | bilingual_stacked | arabic_indic | CDN04 | CDN04:lateef:notosans:shuffled:iso:62 | [
"Lateef@4.400",
"Noto Sans@2.015"
] | 1,240 | 1,754 | 0 | 2 | null | "{\"allowances\": [], \"amount_in_words\": {\"ar\": \"فقط سبعة آلاف وسبعمائة وأ(...TRUNCATED) | [{"entity_id":"e3","field_id":"BT-27","role":"value","text_raw":"شركة خط الإتقان للش(...TRUNCATED) | [{"from_entity":"e13","to_entity":"e14","type":"ar_en_label"},{"from_entity":"e13","to_entity":"e12"(...TRUNCATED) | [{"row":1,"cells":[{"col":"desc","header_field_id":"BT-153","text_raw":"تذكرة سفر دولية(...TRUNCATED) | [{"word_id":"w0","text":"شركة","bbox":[1157.1600341796875,45.400001525878906,1195.6800537109375,(...TRUNCATED) | [{"qid":"sei-000000-q0","question_ar":"ما الرقم الضريبي للمورد؟","question_en":(...TRUNCATED) | {"library":"saudi_einvoice_synth.degrade","version":"0.1.0","pipeline":"low_ink","params":"{\"angle\(...TRUNCATED) | true | {"name":"saudi-einvoice-synth","version":"0.1.0","git_sha":"3d896716e4a633958bae8fbcc93287d55599dadd(...TRUNCATED) | machine_validated | cc-by-4.0 | v0.1.0 | b783c6c1cb86030b42c878d5cd280ea1eacd01cc48d5e6c87af303722e260a7e | |
sei-000000-clean-p1 | sei-000000 | clean | train | credit_note | 381 | bilingual_stacked | arabic_indic | CDN04 | CDN04:lateef:notosans:shuffled:iso:62 | [
"Lateef@4.400",
"Noto Sans@2.015"
] | 1,240 | 1,754 | 1 | 2 | [
46.880001068115234,
624.3699951171875,
277.8599853515625,
855.3499755859375
] | "{\"allowances\": [], \"amount_in_words\": {\"ar\": \"فقط سبعة آلاف وسبعمائة وأ(...TRUNCATED) | [{"entity_id":"e204","field_id":"BT-27","role":"value","text_raw":"شركة خط الإتقان لل(...TRUNCATED) | [{"from_entity":"e206","to_entity":"e207","type":"ar_en_label"},{"from_entity":"e206","to_entity":"e(...TRUNCATED) | [] | [{"word_id":"w0","text":"شركة","bbox":[1166.8699951171875,50.0,1193.1199951171875,81.25],"polygo(...TRUNCATED) | [{"qid":"sei-000000-q0","question_ar":"ما الرقم الضريبي للمورد؟","question_en":(...TRUNCATED) | null | true | {"name":"saudi-einvoice-synth","version":"0.1.0","git_sha":"3d896716e4a633958bae8fbcc93287d55599dadd(...TRUNCATED) | machine_validated | cc-by-4.0 | v0.1.0 | 8a0672d4305d057f00b0b292b176d2e29fa3567b38feb0bcdf1bf77f35314863 | |
sei-000000-scan-p1 | sei-000000 | scan | train | credit_note | 381 | bilingual_stacked | arabic_indic | CDN04 | CDN04:lateef:notosans:shuffled:iso:62 | [
"Lateef@4.400",
"Noto Sans@2.015"
] | 1,240 | 1,754 | 1 | 2 | [
41.83000183105469,
632.2100219726562,
272.6600036621094,
863.030029296875
] | "{\"allowances\": [], \"amount_in_words\": {\"ar\": \"فقط سبعة آلاف وسبعمائة وأ(...TRUNCATED) | [{"entity_id":"e204","field_id":"BT-27","role":"value","text_raw":"شركة خط الإتقان لل(...TRUNCATED) | [{"from_entity":"e206","to_entity":"e207","type":"ar_en_label"},{"from_entity":"e206","to_entity":"e(...TRUNCATED) | [] | [{"word_id":"w0","text":"شركة","bbox":[1159.6800537109375,57.939998626708984,1185.9200439453125,(...TRUNCATED) | [{"qid":"sei-000000-q0","question_ar":"ما الرقم الضريبي للمورد؟","question_en":(...TRUNCATED) | {"library":"saudi_einvoice_synth.degrade","version":"0.1.0","pipeline":"scan","params":"{\"angle\": (...TRUNCATED) | true | {"name":"saudi-einvoice-synth","version":"0.1.0","git_sha":"3d896716e4a633958bae8fbcc93287d55599dadd(...TRUNCATED) | machine_validated | cc-by-4.0 | v0.1.0 | 708f913286ac16cc115f4365e05e85feef4760bdbf4c132d9b2c1b0da2758a83 | |
sei-000000-photo-p1 | sei-000000 | photo | train | credit_note | 381 | bilingual_stacked | arabic_indic | CDN04 | CDN04:lateef:notosans:shuffled:iso:62 | [
"Lateef@4.400",
"Noto Sans@2.015"
] | 1,240 | 1,754 | 1 | 2 | [
138.6199951171875,
643.969970703125,
346.95001220703125,
856.5399780273438
] | "{\"allowances\": [], \"amount_in_words\": {\"ar\": \"فقط سبعة آلاف وسبعمائة وأ(...TRUNCATED) | [{"entity_id":"e204","field_id":"BT-27","role":"value","text_raw":"شركة خط الإتقان لل(...TRUNCATED) | [{"from_entity":"e206","to_entity":"e207","type":"ar_en_label"},{"from_entity":"e206","to_entity":"e(...TRUNCATED) | [] | [{"word_id":"w0","text":"شركة","bbox":[1078.5799560546875,192.92999267578125,1099.0999755859375,(...TRUNCATED) | [{"qid":"sei-000000-q0","question_ar":"ما الرقم الضريبي للمورد؟","question_en":(...TRUNCATED) | {"library":"saudi_einvoice_synth.degrade","version":"0.1.0","pipeline":"photo","params":"{\"attempt\(...TRUNCATED) | true | {"name":"saudi-einvoice-synth","version":"0.1.0","git_sha":"3d896716e4a633958bae8fbcc93287d55599dadd(...TRUNCATED) | machine_validated | cc-by-4.0 | v0.1.0 | ef2b4b3a5e0f46c70784479107c6b21c1137761dcf5dc15cfa31b397658f086d | |
sei-000000-low_ink-p1 | sei-000000 | low_ink | train | credit_note | 381 | bilingual_stacked | arabic_indic | CDN04 | CDN04:lateef:notosans:shuffled:iso:62 | [
"Lateef@4.400",
"Noto Sans@2.015"
] | 1,240 | 1,754 | 1 | 2 | [
45.88999938964844,
625.7100219726562,
277.7799987792969,
857.5999755859375
] | "{\"allowances\": [], \"amount_in_words\": {\"ar\": \"فقط سبعة آلاف وسبعمائة وأ(...TRUNCATED) | [{"entity_id":"e204","field_id":"BT-27","role":"value","text_raw":"شركة خط الإتقان لل(...TRUNCATED) | [{"from_entity":"e206","to_entity":"e207","type":"ar_en_label"},{"from_entity":"e206","to_entity":"e(...TRUNCATED) | [] | [{"word_id":"w0","text":"شركة","bbox":[1163.6199951171875,47.7599983215332,1189.989990234375,79.(...TRUNCATED) | [{"qid":"sei-000000-q0","question_ar":"ما الرقم الضريبي للمورد؟","question_en":(...TRUNCATED) | {"library":"saudi_einvoice_synth.degrade","version":"0.1.0","pipeline":"low_ink","params":"{\"angle\(...TRUNCATED) | true | {"name":"saudi-einvoice-synth","version":"0.1.0","git_sha":"3d896716e4a633958bae8fbcc93287d55599dadd(...TRUNCATED) | machine_validated | cc-by-4.0 | v0.1.0 | f0a6691143a0d9baa8d628fb0357e3adf215a743b2a3914fe52b4813d9873443 | |
sei-000002-clean-p0 | sei-000002 | clean | train | simplified_tax_invoice | 388 | receipt_80mm | western | THS10 | THS10:cairo:cairo:en_first:iso:18 | [
"Cairo@3.130",
"Cairo@3.130",
"IBM Plex Mono@2.3"
] | 640 | 1,489 | 0 | 1 | [
150,
1010.1099853515625,
489.989990234375,
1350.0999755859375
] | "{\"allowances\": [], \"amount_in_words\": {\"ar\": \"فقط ألف وخمسمائة وتسعون ر(...TRUNCATED) | [{"entity_id":"e2","field_id":"custom:trade_name","role":"value","text_raw":"مخبز سفينة ا(...TRUNCATED) | [{"from_entity":"e12","to_entity":"e13","type":"ar_en_label"},{"from_entity":"e13","to_entity":"e11"(...TRUNCATED) | [{"row":1,"cells":[{"col":"desc","header_field_id":"BT-153","text_raw":"بسبوسة علبة صغي(...TRUNCATED) | [{"word_id":"w0","text":"مخبز","bbox":[392.1199951171875,116.30000305175781,453.17999267578125,1(...TRUNCATED) | [{"qid":"sei-000002-q0","question_ar":"ما إجمالي ضريبة القيمة المضافة؟","(...TRUNCATED) | null | true | {"name":"saudi-einvoice-synth","version":"0.1.0","git_sha":"3d896716e4a633958bae8fbcc93287d55599dadd(...TRUNCATED) | machine_validated | cc-by-4.0 | v0.1.0 | 03d22f058610ba17657bf3c1fbc48f864e5382e7f5517ea99785e12e54bbe604 | |
sei-000002-scan-p0 | sei-000002 | scan | train | simplified_tax_invoice | 388 | receipt_80mm | western | THS10 | THS10:cairo:cairo:en_first:iso:18 | [
"Cairo@3.130",
"Cairo@3.130",
"IBM Plex Mono@2.3"
] | 640 | 1,489 | 0 | 1 | [
146.89999389648438,
1000.5399780273438,
486.8900146484375,
1340.530029296875
] | "{\"allowances\": [], \"amount_in_words\": {\"ar\": \"فقط ألف وخمسمائة وتسعون ر(...TRUNCATED) | [{"entity_id":"e2","field_id":"custom:trade_name","role":"value","text_raw":"مخبز سفينة ا(...TRUNCATED) | [{"from_entity":"e12","to_entity":"e13","type":"ar_en_label"},{"from_entity":"e13","to_entity":"e11"(...TRUNCATED) | [{"row":1,"cells":[{"col":"desc","header_field_id":"BT-153","text_raw":"بسبوسة علبة صغي(...TRUNCATED) | [{"word_id":"w0","text":"مخبز","bbox":[377.489990234375,116.16000366210938,438.510009765625,173.(...TRUNCATED) | [{"qid":"sei-000002-q0","question_ar":"ما إجمالي ضريبة القيمة المضافة؟","(...TRUNCATED) | {"library":"saudi_einvoice_synth.degrade","version":"0.1.0","pipeline":"scan","params":"{\"angle\": (...TRUNCATED) | true | {"name":"saudi-einvoice-synth","version":"0.1.0","git_sha":"3d896716e4a633958bae8fbcc93287d55599dadd(...TRUNCATED) | machine_validated | cc-by-4.0 | v0.1.0 | 10643e3812908f92c9d93e4358fe1af32ac7f0f681a89b3b6c725ca6db4fd20f |
Synthetic Saudi E-Invoices, Receipts and Bilingual Forms
By Bayanat Labs · version 0.1.0 · CC BY 4.0 · fully synthetic
Saudi-style tax invoices, simplified tax invoices (thermal receipts), credit and debit notes, quotations, proforma invoices and bilingual business forms, for research on OCR, key information extraction and document question answering. Every document starts as a generated record whose amounts reconcile exactly. The record is rendered in Arabic and English in one of 60 template families, labelled with pixel boxes for every printed field, and given bilingual question-answer pairs. Tax documents also have UBL 2.1 XML in the ZATCA e-invoice format and a TLV QR code.
| What | Count |
|---|---|
| Generated records | 25,000 |
| Clean page images | 34,517 |
| Degraded variant images (three per clean page; not separate documents) | 103,551 |
| XML documents | 22,450 |
| Doc-QA pairs | 125,789 |
| Template families | 60 |
The files come to 36.52 GB. Space: sample browser with box overlays. Code: generator, validators and converters (Apache-2.0).
Everything in it was generated
No real invoice, receipt or form went into this dataset. Every party, identifier, product and amount was generated. Every page carries the footer "Synthetic research sample — not a valid tax invoice". It is for research; it is not for producing, validating or submitting real tax invoices. No file was ever sent to a ZATCA system.
- VAT numbers have the form
3999999999NNNN3, the 15-digit format the XML rules require. No register was consulted, so a match with a real registration cannot be ruled out; anyone can report one to hello@bayanatlabs.com. Vendor documentation for the ZATCA sandbox gives the number 399999999900003, which has the same form and is not used here. - IBANs have the Saudi layout (
SA, two check digits, 20 digits), with check digits chosen so that the mod-97 check fails. - Commercial registration numbers are 10 digits starting with
99. Saudi office codes start with 1 to 5 and unified national numbers with 7. No table of allocated prefixes is published, so this prefix is our reading of the published formats. - National ID and Iqama numbers, on a few individual buyers, are 10 digits whose last digit fails the Luhn check.
- Export buyer identifiers are
EXPplus 8 digits, a pattern of this project; no register was consulted. - Phone numbers are
+966 52or+966 15numbers, ranges not allocated in the Saudi numbering plan as published in the libphonenumber metadata. - E-mail addresses and websites sit under the reserved
.exampledomain. - Postal codes, building numbers and additional numbers are random digits, not matched to the city or district.
- Organisation names are built from word parts and compared with organisation, business and brand names from Wikidata (Jaro-Winkler 0.92 after normalisation); a match is dropped. A generated name can still match a small real business; report it to hello@bayanatlabs.com.
- Person names are random combinations of Arabic given and family names. Full names were compared with the names of people from Wikidata, through the Bayanat Labs Arabic Entity Atlas and Arab-World Wikidata Slice, in Arabic and English, and exact matches after normalisation were removed. A generated name can still match a real person, and anyone can report it to hello@bayanatlabs.com. The records draw only from a fixed pool of 40,000 full names, in
src/saudi_einvoice_synth/data/person_pool.jsonin the code repository. - City and district names are real, from a gazetteer. Streets are generated combinations of words.
- Signatures are test signatures with a self-generated key, not valid for submission. ZATCA has not endorsed this dataset.
Load
pip install datasets pillow huggingface_hub
from datasets import load_dataset
pages = load_dataset("Bayanat-Labs/saudi-einvoice-synth", "pages", split="test", streaming=True)
row = next(iter(pages))
row["image"], row["variant"], row["fields"][0]
xml = load_dataset("Bayanat-Labs/saudi-einvoice-synth", "xml", split="train", streaming=True)
qa = load_dataset("Bayanat-Labs/saudi-einvoice-synth", "doc_qa", split="train", streaming=True)
The whole pages config is about 32.2 GB, so streaming or single Parquet files are the practical way in. Converters to COCO and to FUNSD/XFUND-style JSON are in the code repository:
pip install "saudi-einvoice-synth[package] @ git+https://github.com/Bayanat-Labs/saudi-einvoice-synth@v0.1.0"
hf download Bayanat-Labs/saudi-einvoice-synth data/pages/test/shard-00000-b00-000.parquet --repo-type dataset --local-dir .
saudi-einvoice-synth to-coco data/pages/test/shard-00000-b00-000.parquet coco.json
Configs and counts
| Config | One row is | Train | Validation | Test | Total | Files |
|---|---|---|---|---|---|---|
pages |
one page image, clean or degraded, with its labels | 108,356 | 12,784 | 16,928 | 138,068 | 32.2 GB |
xml |
one XML document, its hash chain values, QR and validation result | 17,585 | 2,250 | 2,615 | 22,450 | 0.34 GB |
doc_qa |
one question with its answer and evidence | 98,745 | 12,607 | 14,437 | 125,789 | 0.12 GB |
source |
one record's HTML and born-digital PDF | 19,628 | 2,504 | 2,868 | 25,000 | 3.8 GB |
Records, clean pages and degraded variants, always separately:
| Split | Records | Clean pages | Degraded variant images |
|---|---|---|---|
| train | 19,628 | 27,089 | 81,267 |
| validation | 2,504 | 3,196 | 9,588 |
| test | 2,868 | 4,232 | 12,696 |
| all | 25,000 | 34,517 | 103,551 |
| Document type | Records | Clean pages | Degraded variant images |
|---|---|---|---|
| Standard tax invoice | 10,050 | 17,492 | 52,476 |
| Simplified tax invoice | 8,700 | 8,700 | 26,100 |
| Credit note | 2,419 | 3,248 | 9,744 |
| Debit note | 1,281 | 1,733 | 5,199 |
| Quotation | 804 | 1,282 | 3,846 |
| Proforma invoice | 546 | 862 | 2,586 |
| Payment voucher | 350 | 350 | 1,050 |
| Receipt voucher | 350 | 350 | 1,050 |
| Vendor registration | 250 | 250 | 750 |
| Expense claim | 250 | 250 | 750 |
| Media | Records | Clean pages | Degraded variant images |
|---|---|---|---|
| A4, 1240 x 1754 px | 15,600 | 25,117 | 75,351 |
| Receipt, 80 mm, 640 px wide | 5,600 | 5,600 | 16,800 |
| Receipt, 58 mm, 464 px wide | 3,800 | 3,800 | 11,400 |
Degraded variants are scan (34,517) and photo (34,517) on every page, low_ink (25,117) on A4 pages and thermal_faded (9,400) on receipts. Each is one 3 x 3 homography plus photometric effects (fading, streaks, shadow, lighting, blur, noise, JPEG at quality 85-88). The same geometry moves the boxes, and the parameters and homography are stored in the row. Clean pages are PNG. 8,427 records have more than one page, the longest 8. Numeral systems by record: Western 15,001, Arabic-Indic 5,033, mixed 4,966.
Splits and template families
There are 60 template families: 25 A4 standard invoices, 15 thermal simplified invoices, 6 A4 and 2 thermal credit and debit notes, 6 quotation and proforma, and 6 bilingual business forms. Within a family each record draws its own fonts, label wording and order, numeral system, date format and colours.
- 10 families occur only in test: A4S22, A4S23, A4S24, A4S25, BFM06, CDN06, CDN08, QPF06, THS14, THS15.
- 5 families occur only in validation: A4S20, A4S21, BFM05, CDN05, THS13.
- The other 45 occur in all three splits, spread by seller.
- 2 of the 16 Arabic font families occur only in test: Harmattan and Markazi Text.
- 1,985 generated sellers, 0 of them in more than one split; 0 records have variants in more than one split. Only sellers are kept apart by split: buyers and people are drawn from pools shared by all splits, so the same name can occur in more than one split.
The test split is released whole; there is no hidden test split.
Schema
pages
| Column | Meaning |
|---|---|
id, record_id |
Page id <record>-<variant>-p<page> and the record it belongs to |
variant, page, n_pages |
clean, scan, photo, low_ink or thermal_faded; page index; pages in the record |
split, doc_type, invoice_type_code, layout, numeral_system, template_family, template_id, fonts |
What was rendered |
image, width, height, image_sha256 |
The image and its size in pixels and hash |
fields |
Every printed field: entity_id, field_id (BT-xx, KSA-x or custom), role (key, value, header, other), text_raw as printed in logical order, value_norm, text_norm, lang, bbox [x0, y0, x1, y1], polygon, line_boxes, word_ids, link_group, cell. entity_id is unique per page, not per record The bbox of a field that wraps is the union of its line_boxes and can cover neighbouring fields; use line_boxes for exact lines. |
field_links |
key_value and ar_en_label links between fields |
line_items |
Table rows with cells, each with its header field, text, value and box |
words |
Words with boxes in reading order |
doc_qa, qr_bbox |
The record's questions with boxes on this page; the QR code's box. Here evidence_bbox holds only this page's boxes and is not index-aligned with evidence_field_ids and evidence_pages, which keep all pages; use the doc_qa config for aligned lists, in clean-page coordinates |
canonical |
The generated record as JSON: parties, dates, lines, totals, payment. On a vendor registration form seller is the organisation whose form it is, and the registering company in the form's fields is form.party. Fonts, numeral system and template_id are in the row's own columns |
degradation |
Pipeline, parameters and homography (null on clean pages) |
generator |
Generator name, version, commit, seed, template id and fonts; its llm_model, llm_revision and prompt_sha256 are null: the generator calls no model when it builds a record |
provenance_version, synthetic, review_status, license |
Always v0.1.0, true, machine_validated and cc-by-4.0 |
xml: record_id, split, doc_type, invoice_type_code, invoice_subtype, template_family, xml, xml_sha256, invoice_hash, icv, pih, qr_base64, qr_tlv (tags 1-9), validation (status, xsd, rules_version, errors, warnings, sdk_run, sdk_version), signature_note, synthetic, license.
doc_qa: qid, record_id, page_ids, split, doc_type, template_family, question_ar, question_en, answer, answer_type, answer_text_ar, answer_text_en, abstain, qtype, evidence_field_ids, evidence_pages, evidence_bbox, license. 23,789 of the 125,789 questions ask about a field the document does not have, and the right answer is to abstain. Answers are in the form the record holds, whichever language the question is read in: 23,371 of the 102,000 answered questions have an answer with Arabic letters (names of parties, item names, reasons and purposes). Each question has a single answer: a quantity question names an item that is on one line only (0 exceptions), and a highest-price question is asked only when one item has the highest price (0 exceptions). The evidence of a question about the number of lines is the printed number of the last line when the table numbers its lines, and otherwise the description box of every line.
source: record_id, split, doc_type, template_family, n_pages, html, html_sha256, pdf, pdf_sha256, license.
What was checked, and the limits
Each shard passed the checks below before it was committed, and the release-wide figures were then computed again on the released rows. Results are in meta/gates_summary.json, counts in meta/stats.json, checksums in SHA256SUMS and MANIFEST.json.
The ZATCA SDK was not run. The download page of the ZATCA Compliance and Enablement Toolbox requires accepting terms and conditions, which this project did not do. What was run instead: schema validation against the OASIS UBL 2.1 Invoice-2 XSDs, and a separate check of the published KSA business rules (ZATCA Electronic Invoice XML Implementation Standard, version of 19 May 2023), written for this project and cited by rule id. All 22,450 XML documents pass both, read again from the released rows (0 with errors). Passing them says nothing about what the SDK or a ZATCA system would report. Every row records sdk_run: false. The invoice hash follows the ZATCA Security Features Implementation Standard, and each generated seller has its own ICV counter and previous-invoice-hash chain (0 broken links in 22,450 documents).
| Check | Result |
|---|---|
| Arithmetic: line, allowance, charge, VAT-breakdown and document totals, on released rows | 24,050 records with amounts, 0 failures |
| QR code read back from the clean page image equals the XML value | 22,450 of 22,450 clean pages |
| QR read rate on degraded images (reported, not required), with a second try at 2x when the first fails | scan 99.97%, photo 96.53%, low ink 96.60%, faded thermal 94.52% |
| Identifiers: the rules above on every party of every record, on released rows | 25,000 records, 0 violations |
| Identifier-shaped strings in printed labels, XML, questions and HTML outside those rules | 0 |
| Organisation names compared with names in Wikidata; a small real business can still match | 13,065 Arabic and 13,048 English names, 0 matches |
| Printed person names outside the fixed pool | 22,920 names, 0 outside it |
| Printed full names equal to a person's name in that comparison (exact after normalisation) | 0 of 17,286 distinct names; the most used name occurs 6 times |
| Every printed character covered by a declared font | 0 records with a fallback glyph |
| Near-duplicate records (MinHash over the content fields, threshold 0.9, whole release) | 0 pairs in 25,000 records |
| Image SHA-256 across all shards | 0 duplicates in 138,068 images |
| Value boxes outside the image frame, on all variants | 0 of 9,775,548 including QR code boxes (9,685,748 excluding them) |
| Links along sellers' chains that go backward in time | 0 of 20,474 |
generator.git_sha in every row is the commit of its shard, as given under "Generator commits" below |
0 rows name another |
QR time limit. The decoder has a limit of 60 seconds per image with one retry, because it can loop for ever on a degraded image. An image that runs out of time counts as unread in the degraded read rates above. This happened to one image; the count comes from the shards' QR check times, by the rule in meta/gates_summary.json. The limit was added during the run and applies from shard 9; the QR check of each earlier shard took at most 4.7 s in all, so no image there came near it.
OCR check on boxes. Tesseract 5 with the tessdata_best ara and eng models reads every value box (excluding QR code boxes) on clean pages. It takes the best of up to ten settings per box (page segmentation mode, padding, scaling) and the character error rate must be at most 10% on at least 98% of boxes. 2,010,936 of 2,031,409 boxes pass (98.99%). This leaves out 390,028 boxes written in Arabic-Indic digits, which the ara models do not read (one setting reads 2.1% of them at 10% or less); those boxes only get an ink check, and all 2,421,437 value boxes (excluding QR code boxes) contain ink. So the check shows that boxes sit on readable text in a best case; it does not measure what an OCR engine reads at one setting, which the reference baseline below does.
PDF text check. The text that the born-digital PDF holds inside each value box (excluding QR code boxes) equals the label for values written without Arabic letters: 1,931,870 of 1,931,870. Those are digits, dates, amounts, identifiers and Latin text, where a bidi error would reorder runs. Over all 2,421,437 values the rate is 94.82%, and 74.37% for the 489,567 values with Arabic letters, because the Arabic text layer of the source PDFs is not reliable in some fonts. In the Noto Kufi, Naskh and Sans Arabic families, where many shaped glyphs have no Unicode mapping, all values read back at 80.0%, 80.0% and 80.0%. Use the labels, not the PDF text layer, as the Arabic text.
Rebuilds. Images need not rebuild byte for byte. Shard 30 (500 of 25,000 records) was built twice from the same commit. Of its 2,792 images, 68 differ, from 17 clean pages and their variants; the largest box shift is 0.9 px, and 0.0 px on value boxes. 0 of 500 PDFs are identical, because each embeds its creation time. In that comparison 500 of 500 records, 449 of 449 XML documents and QR codes and 500 of 500 HTML files are identical. The comparison covers that shard only.
Line amounts and discounts. In 26 of the 60 template families the line table has no discount column, so a discounted line prints its amount after the discount and the discount itself is not printed. Quantity times price then differs from the printed amount: 11,521 of those families' 78,171 lines (5,537 of their 10,200 records). The discount is in the canonical record and in the XML.
Items and wording. 18,413 of 167,056 lines carry an item from outside the seller's sector, about one line in nine, so an item can look out of place for its seller. Quotations use the invoice wording for their number and, on some templates, their date.
Second draws. 73 seeds use a second draw: 71 were drawn again to remove near-duplicates of a record with a lower seed, and two because the first draw's table did not fit the page. Each keeps its id, family, split and date slot. They are listed in src/saudi_einvoice_synth/data/redraws.json in the code repository.
Generator commits. Rows name the commit that built them: shards 0-32 name 3d89671, shards 33-37 name fb4fb69 and shards 38-49 name 6b2ac8b. All three are in the history of tag v0.1.0. The later commits add only a time limit in the QR check, those two second draws and documentation, and tag v0.1.0 reproduces the records of every shard. A record reproduces only when records are generated from seed 0 in seed order, because each seller's chain runs across shards; the code repository's README gives the commands.
Review status. review_status is machine_validated on every row: the labels passed these scripted checks, and no reviewer has gone through them. The Arabic text has not yet been reviewed by a native Arabic writer; the English governs.
What the release holds. The four configs above. There is no print-and-scan subset: degraded variants are simulated, and the gap to real scans and to real invoices has not been measured. Field values, catalogue items and questions come from written lexicons and rules.
Reference baseline
A reference on a sample, not a product and not a benchmark of Tesseract in general: Tesseract 5.5.3 with the tessdata_fast ara and eng models, CPU only, on a fixed sample of 1,000 validation and test records drawn with seed 20261102 across all shards (323 from families also in train, 677 from families only in validation or test). The record ids are in meta/baseline_sample.json and the results in meta/baseline_results.json.
| Variant | Value boxes | Mean CER, all | Mean CER, no Arabic-Indic digits | Share CER at most 10%, no Arabic-Indic digits |
|---|---|---|---|---|
| clean | 97,435 | 0.210 | 0.103 | 88.0% |
| scan | 97,435 | 0.231 | 0.125 | 84.1% |
| photo | 97,435 | 0.289 | 0.192 | 72.4% |
| low_ink (A4 only) | 82,858 | 0.200 | 0.093 | 88.3% |
| thermal_faded (receipts only) | 14,577 | 0.279 | 0.168 | 77.9% |
Field extraction: Tesseract on page 1 of tax invoices, simplified invoices and credit and debit notes, then rules for five fields (invoice number, issue date, seller VAT number, total with VAT, VAT total). Micro F1:
| Variant | Pages | All | Families also in train | Families only in validation or test |
|---|---|---|---|---|
| clean | 910 | 0.705 | 0.698 | 0.709 |
| scan | 910 | 0.699 | 0.694 | 0.700 |
| photo | 910 | 0.584 | 0.575 | 0.589 |
| low_ink (A4 only) | 572 | 0.639 | 0.600 | 0.652 |
| thermal_faded (receipts only) | 338 | 0.781 | 0.787 | 0.778 |
F1 by field:
| Variant | Invoice number | Issue date | Seller VAT number | Total with VAT | VAT total |
|---|---|---|---|---|---|
| clean | 0.951 | 0.774 | 0.678 | 0.515 | 0.559 |
| scan | 0.953 | 0.778 | 0.649 | 0.508 | 0.550 |
| photo | 0.813 | 0.699 | 0.553 | 0.431 | 0.360 |
Field extraction reads page 1 only. Totals are on a later page for 213 of 572 A4 documents, where those two fields cannot score, so the gap between A4 and receipts below is in large part this design choice and not OCR quality. On clean pages of documents with totals on page 1, F1 is 0.761 over all five fields and 0.677 for total with VAT; on A4 alone it is 0.724 with totals on page 1 and 0.519 with totals on a later page.
The same pages by media, because low_ink and thermal_faded cover different documents:
| Media | clean | scan | photo | low_ink or thermal_faded |
|---|---|---|---|---|
| A4 | 0.649 | 0.642 | 0.562 | 0.639 |
| Receipts | 0.800 | 0.793 | 0.623 | 0.781 |
Read these with care. Nothing was trained: a difference between seen and unseen families reflects layouts and fonts, not generalisation. The extraction rules were written for these layouts by the author of the generator, so the figures say little about real invoices. 95% bootstrap intervals, resampling records, are in meta/baseline_results.json.
Attribution and licence
The data is licensed CC BY 4.0 (LICENSE). Cite Bayanat Labs and link this page.
- City and district names come from the Bayanat Labs Arabic Gazetteer (CC BY 4.0), which takes place names from GeoNames (CC BY 4.0) and Wikidata (CC0).
- Organisation names and full person names were compared with names from Wikidata (CC0), through the Bayanat Labs Arabic Entity Atlas and Arab-World Wikidata Slice.
- Fonts: the 16 Arabic families and their Latin companions are under the SIL Open Font License 1.1, unmodified. They are in the code repository with each family's
OFL.txt; versions and hashes are in itsNOTICEandconfig/fonts.json. - The ZATCA Electronic Invoice XML Implementation Standard, Security Features Implementation Standard and E-Invoice Data Dictionary are cited, and no part of them is in this dataset beyond the field ids, codes and rule ids the format requires.
The sources and versions of what went into the build are in meta/PROVENANCE.jsonl.
Citation
@misc{bayanatlabs_saudi_einvoice_synth_2026,
title = {Synthetic Saudi E-Invoices, Receipts and Bilingual Forms},
author = {{Bayanat Labs}},
year = {2026},
note = {Version 0.1.0. Fully synthetic},
url = {https://huggingface.co/datasets/Bayanat-Labs/saudi-einvoice-synth}
}
Contact
Questions, corrections, or anything that resembles a real party: hello@bayanatlabs.com
العربية
The Arabic text has not yet been reviewed by a native Arabic writer; the English governs.
فواتير إلكترونية وإيصالات ونماذج سعودية اصطناعية ثنائية اللغة من بيانات لابز، بترخيص CC BY 4.0. مجموعة بيانات اصطناعية بالكامل لأبحاث التعرف الضوئي على الحروف واستخراج المعلومات والأسئلة والأجوبة على المستندات. يبدأ كل مستند بسجل افتراضي تتطابق مبالغه تمامًا، ويُعرض بالعربية والإنجليزية في واحدة من عائلات القوالب البالغ عددها 60، ويُوسم بإحداثيات كل حقل مطبوع وبأزواج أسئلة وأجوبة ثنائية اللغة. وللمستندات الضريبية ملف XML وفق UBL 2.1 بصيغة الفوترة الإلكترونية لهيئة الزكاة والضريبة والجمارك ورمز QR بصيغة TLV.
| العدد | |
|---|---|
| السجلات الافتراضية | 25,000 |
| صور الصفحات النظيفة | 34,517 |
| صور النسخ المتدهورة (ثلاث لكل صفحة نظيفة، وليست مستندات مستقلة) | 103,551 |
| ملفات XML | 22,450 |
| أزواج الأسئلة والأجوبة | 125,789 |
جميع الأطراف والمعرفات والمنتجات والمبالغ مولَّدة، وتحمل كل صفحة التذييل «عينة اصطناعية لأغراض البحث — ليست فاتورة ضريبية». والبيانات مخصصة للبحث، وليست لإنتاج فواتير ضريبية حقيقية أو التحقق منها أو تقديمها. وأسماء الأشخاص تركيبات عشوائية من أسماء شخصية وأسماء عائلات عربية. وقورنت الأسماء الكاملة بأسماء الأشخاص المأخوذة من ويكي بيانات، بالعربية والإنجليزية، وحُذف ما طابقها تمامًا بعد التوحيد. وقد يطابق الاسم المولَّد مع ذلك شخصًا حقيقيًا، ويمكن لأي شخص الإبلاغ عنه عبر hello@bayanatlabs.com. وأرقام ضريبة القيمة المضافة بالصيغة 3999999999NNNN3، وهي صيغة الخمسة عشر رقمًا التي تتطلبها قواعد XML. ولم يُرجع إلى أي سجل، فلا يمكن استبعاد مطابقتها لتسجيل حقيقي، ويمكن لأي شخص الإبلاغ عن ذلك عبر hello@bayanatlabs.com. وأرقام الآيبان لا تجتاز فحص الخانة، والبريد الإلكتروني والمواقع تحت النطاق المحجوز .example. أما أسماء المدن والأحياء فحقيقية من معجم جغرافي.
حدود ما فُحص:
- لم تُشغَّل حزمة أدوات هيئة الزكاة والضريبة والجمارك (SDK)، لأن صفحة تنزيلها تتطلب الموافقة على الشروط والأحكام. وما شُغّل بدلًا منها هو التحقق من مخططات OASIS UBL 2.1 وفحص منفصل لقواعد الأعمال السعودية المنشورة كُتب لهذا المشروع. والتوقيعات اختبارية بمفتاح مُولَّد ذاتيًا، وغير صالحة للتقديم.
- يستخدم فحص التعرف الضوئي نماذج
tessdata_bestويأخذ أفضل نتيجة من عشرة إعدادات كحد أقصى لكل مربع: 2,010,936 من أصل 2,031,409 من المربعات (98.99%). ولا يشمل المربعات المكتوبة بالأرقام العربية الهندية وعددها 390,028، ولا يُجرى لها إلا فحص الحبر. - يغطي فحص نص PDF القيم المكتوبة دون حروف عربية (1,931,870 من 1,931,870). وتبلغ النسبة على كل القيم 94.82%، لأن طبقة النص العربي في ملفات PDF المصدرية غير موثوقة في بعض الخطوط.
- لا يُعاد بناء الصور مطابقةً بايتًا ببايت بالضرورة: من 2,792 صورة في الجزء الذي بُني مرتين، تختلف 68 صورة، ويتضمن كل ملف PDF وقت إنشائه. وتغطي تلك المقارنة 500 سجل، وتفاصيلها في القسم الإنجليزي.
- في 26 من أصل 60 عائلة قوالب لا يضم جدول البنود عمود خصم، فيُطبع مبلغ البند بعد الخصم ولا يُطبع الخصم نفسه: 11,521 من أصل 78,171 بندًا في تلك العائلات (5,537 من أصل 10,200 سجلًا). والخصم موجود في السجل
canonicalوفي XML. - نحو بند من كل تسعة مأخوذ من خارج قطاع البائع (18,413 من أصل 167,056)، فقد يبدو الصنف في غير موضعه. وتستخدم عروض الأسعار صياغة الفاتورة لرقمها، ولتاريخها في بعض القوالب.
- يستخدم 73 بذرة سحبًا ثانيًا: 71 لإزالة التكرار القريب، و2 لأن جدول السحب الأول لم يتسع في الصفحة. وهي مذكورة في
src/saudi_einvoice_synth/data/redraws.jsonفي مستودع الشيفرة. - لقارئ رمز QR حد زمني قدره 60 ثانية لكل صورة مع إعادة محاولة واحدة، وتُحسب الصورة التي ينفد وقتها غير مقروءة في معدلات القراءة على النسخ المتدهورة. وعدد الصور التي حدث لها ذلك: 1.
- تذكر الصفوف الإيداع الذي بناها: الأجزاء 0-32 تذكر
3d89671، والأجزاء 33-37 تذكرfb4fb69، والأجزاء 38-49 تذكر6b2ac8b، وكلها في تاريخ الوسمv0.1.0. ولا تضيف الإيداعات اللاحقة سوى حد زمني في فحص QR وسحبين ثانيين ووثائق، ويعيد الوسمv0.1.0إنتاج سجلات كل الأجزاء. - حالة الوسوم
machine_validated. ولا يضم الإصدار نسخًا مطبوعة وممسوحة فعليًا، ولا قسم اختبار مخفيًا.
خط الأساس المرجعي (Tesseract بنماذج tessdata_fast) على عينة ثابتة من 1,000 سجل من التحقق والاختبار، وليس على كامل الإصدار: F1 لخمسة حقول 0.705 على الصفحات النظيفة و0.584 على نسخ التصوير. ولا يُقرأ إلا الصفحة الأولى، والمجاميع في صفحة لاحقة في 213 من أصل 572 مستند A4، فلا يمكن أن يسجل هذان الحقلان فيها نتيجة. وهو مرجع وليس منتجًا.
pip install datasets pillow huggingface_hub
from datasets import load_dataset
pages = load_dataset("Bayanat-Labs/saudi-einvoice-synth", "pages", split="test", streaming=True)
للتواصل: hello@bayanatlabs.com
- Downloads last month
- 226
