botnick commited on
Commit
23c4846
·
verified ·
1 Parent(s): 6836154

Card: banner, samples grid, examples, quick start

Browse files
README.md CHANGED
@@ -51,6 +51,8 @@ dataset_info:
51
  dtype: string
52
  ---
53
 
 
 
54
  # Netra Thai Accounting Synth
55
 
56
  Rendered images of **synthetic** Thai accounting documents, each with two labels that come from the same draw as
@@ -74,6 +76,11 @@ document was scanned, photographed or transcribed to make this dataset.
74
  The dataset was made to train and evaluate [Netra-2B](https://huggingface.co/botnick/Netra-2B), a Thai
75
  accounting-document reader.
76
 
 
 
 
 
 
77
  ## สรุปภาษาไทย
78
 
79
  ชุดข้อมูลภาพเอกสารบัญชีภาษาไทย **สังเคราะห์ทั้งหมด** 12,189 ภาพ (ใบแจ้งหนี้ ใบเสนอราคา ใบเสร็จรับเงิน ใบสำคัญจ่าย
@@ -86,6 +93,143 @@ accounting-document reader.
86
  ใช้สำหรับเทรนและทดสอบโมเดล OCR/KIE เอกสารไทยเท่านั้น คะแนนบนชุดนี้ไม่ใช่ตัววัดความแม่นยำบนเอกสารจริง
87
  สัญญาอนุญาต CC BY-SA 4.0
88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  ## Configs and counts
90
 
91
  Rows per `doc_type`. The splits are the ones the generators wrote; validation documents never appear in train.
@@ -142,17 +286,7 @@ tax invoices. Validation is a random 5% drawn by document.
142
  | `kie` | string or null | JSON object (see below). Parse with `json.loads`. Set on every row of this release |
143
  | `source_set` | string | `synth` (forms), `synth2` (accounting) or `synth3` (photos) |
144
 
145
- ```python
146
- import json
147
- from datasets import load_dataset
148
-
149
- ds = load_dataset("botnick/Netra-Thai-Accounting-Synth", "accounting", split="validation")
150
- row = ds[0]
151
- row["image"] # PIL image
152
- print(row["ocr_text"][:300])
153
- kie = json.loads(row["kie"])
154
- print(kie["doc_type"], kie["date"], kie["total"])
155
- ```
156
 
157
  ### `ocr_text`
158
 
 
51
  dtype: string
52
  ---
53
 
54
+ ![Netra Thai Accounting Synth: synthetic Thai accounting documents (an A4 quotation, a tax invoice, a phone photo of a POS slip and a mobile-banking transfer slip) with a callout mapping printed values to KIE JSON fields: 11-11-2568 to "date": "2025-11-11", (สาขาที่ 00004) to "branch": "00004", 24,770.50 to "total": 24770.5](assets/banner.png)
55
+
56
  # Netra Thai Accounting Synth
57
 
58
  Rendered images of **synthetic** Thai accounting documents, each with two labels that come from the same draw as
 
76
  The dataset was made to train and evaluate [Netra-2B](https://huggingface.co/botnick/Netra-2B), a Thai
77
  accounting-document reader.
78
 
79
+ **Contents:** [Samples](#samples) · [Quick start](#quick-start) · [Examples](#examples) ·
80
+ [Configs and counts](#configs-and-counts) · [Fields](#fields) · [How it was made](#how-it-was-made) ·
81
+ [Intended use](#intended-use) · [Privacy](#privacy) · [Attribution and licence](#attribution-and-licence) ·
82
+ [Relation to Netra-2B](#relation-to-netra-2b) · [Citation](#citation)
83
+
84
  ## สรุปภาษาไทย
85
 
86
  ชุดข้อมูลภาพเอกสารบัญชีภาษาไทย **สังเคราะห์ทั้งหมด** 12,189 ภาพ (ใบแจ้งหนี้ ใบเสนอราคา ใบเสร็จรับเงิน ใบสำคัญจ่าย
 
93
  ใช้สำหรับเทรนและทดสอบโมเดล OCR/KIE เอกสารไทยเท่านั้น คะแนนบนชุดนี้ไม่ใช่ตัววัดความแม่นยำบนเอกสารจริง
94
  สัญญาอนุญาต CC BY-SA 4.0
95
 
96
+ ## Samples
97
+
98
+ One validation image per `doc_type`, as stored in the dataset (photos keep their background, angle and noise).
99
+
100
+ ![Grid of twelve synthetic samples, one per doc_type. forms: invoice ใบแจ้งหนี้, quotation ใบเสนอราคา, receipt ใบเสร็จรับเงิน, payment voucher ใบสำคัญจ่าย. accounting: tax invoice ใบกำกับภาษีเต็มรูป, abbreviated tax invoice (POS slip) ใบกำกับภาษีอย่างย่อ, debit/credit note ใบเพิ่มหนี้/ใบลดหนี้, billing note ใบวางบิล, withholding-tax certificate (50 ทวิ), mobile-banking transfer slip สลิปโอนเงิน. photos: phone photo of a tax invoice, phone photo of a POS slip](assets/samples-grid.png)
101
+
102
+ ## Quick start
103
+
104
+ ```python
105
+ import json
106
+ from datasets import load_dataset
107
+
108
+ ds = load_dataset("botnick/Netra-Thai-Accounting-Synth", "accounting", split="validation")
109
+
110
+ row = ds[0]
111
+ row["image"] # PIL image
112
+ print(row["id"], row["doc_type"])
113
+ print(row["ocr_text"][:300]) # page text as Markdown
114
+
115
+ kie = json.loads(row["kie"]) # kie is stored as a JSON string
116
+ print(kie["doc_type"], kie["date"], kie["total"])
117
+ for item in kie["items"]:
118
+ print(item["desc"], item["amount"])
119
+ ```
120
+
121
+ Configs: `forms` (default), `accounting`, `photos`. Splits: `train`, `validation`. To keep one document type, filter
122
+ on the `doc_type` column:
123
+
124
+ ```python
125
+ slips = ds.filter(lambda r: r["doc_type"] == "transfer_slip")
126
+ ```
127
+
128
+ ## Examples
129
+
130
+ Each figure shows a validation image next to its labels. The text and JSON in the figures are copied from the row;
131
+ long lines are shortened with `…`.
132
+
133
+ **Tax invoice** (`accounting`). The Buddhist-era date 11-11-2568 becomes `"2025-11-11"`, amounts become JSON
134
+ numbers, the buyer's branch "(สาขาที่ 00004)" becomes `"00004"` and the seller's head office `"00000"`.
135
+
136
+ ![Synthetic delivery order / tax invoice with two line items and a total of 24,770.50 baht, shown with an excerpt of its ocr_text (Markdown) and of its kie JSON](assets/example-tax-invoice.png)
137
+
138
+ **Transfer slip** (`accounting`). Masked names and account numbers stay masked as printed; the bank code `BAY` is
139
+ expanded to the full Thai bank name; fields the slip does not have are `null`.
140
+
141
+ ![Synthetic mobile-banking bill-payment slip of 4,200.00 baht, shown with its complete ocr_text and every key of its kie JSON](assets/example-transfer-slip.png)
142
+
143
+ **Phone photo** (`photos`). The labels are those of the clean render, whatever the angle, light, blur and JPEG noise.
144
+
145
+ ![Simulated phone photo of a POS abbreviated tax invoice on a dark background, shown with an excerpt of its ocr_text and kie JSON](assets/example-photo.jpg)
146
+
147
+ The row behind the transfer-slip figure, `synth2/transfer_slip_00050` (config `accounting`, split `validation`):
148
+
149
+ `ocr_text`
150
+
151
+ ```markdown
152
+ # ทำรายการสำเร็จ
153
+
154
+ 18 เม.ย. 69 13:59 น.
155
+
156
+ BAY
157
+ น.ส. โศภิตา สรxxx
158
+ BAY
159
+ xxx-xxx838-4
160
+
161
+ RK
162
+ บริษัท โรงงานนันทริกา บิวตี้ จำกัด
163
+ Biller ID: 021540928422247
164
+
165
+ จำนวน: 4,200.00 บาท
166
+ ค่าธรรมเนียม: 0.00 บาท
167
+ Ref 1 85284386
168
+ เลขที่อ้างอิง 840948077437CTF03941
169
+ ```
170
+
171
+ `kie`, after `json.loads`, pretty-printed
172
+
173
+ ```json
174
+ {
175
+ "doc_type": "transfer_slip",
176
+ "doc_title": "ทำรายการสำเร็จ",
177
+ "doc_no": "840948077437CTF03941",
178
+ "book_no": null,
179
+ "date": "2026-04-18",
180
+ "time": "13:59",
181
+ "due_date": null,
182
+ "seller": null,
183
+ "buyer": null,
184
+ "payer": {
185
+ "name": "น.ส. โศภิตา สรxxx",
186
+ "tax_id": null,
187
+ "branch": null,
188
+ "address": null,
189
+ "phone": null
190
+ },
191
+ "payee": {
192
+ "name": "บริษัท โรงงานนันทริกา บิวตี้ จำกัด",
193
+ "tax_id": null,
194
+ "branch": null,
195
+ "address": null,
196
+ "phone": null
197
+ },
198
+ "items": [],
199
+ "subtotal": null,
200
+ "discount": null,
201
+ "vat_base": null,
202
+ "vat_rate": null,
203
+ "vat": null,
204
+ "vat_included": null,
205
+ "wht_rate": null,
206
+ "wht": null,
207
+ "total": 4200,
208
+ "net_paid": 4200,
209
+ "amount_in_words": null,
210
+ "currency": "THB",
211
+ "ref_doc_no": null,
212
+ "ref_date": null,
213
+ "payment": {
214
+ "method": "bill_payment",
215
+ "from_bank": "ธนาคารกรุงศรีอยุธยา",
216
+ "from_bank_code": "BAY",
217
+ "from_account": "xxx-xxx838-4",
218
+ "to_bank": null,
219
+ "to_bank_code": null,
220
+ "to_account": null,
221
+ "promptpay_id": null,
222
+ "promptpay_type": null,
223
+ "biller_id": "021540928422247",
224
+ "ref1": "85284386",
225
+ "ref2": null,
226
+ "fee": 0,
227
+ "memo": null
228
+ },
229
+ "extra": null
230
+ }
231
+ ```
232
+
233
  ## Configs and counts
234
 
235
  Rows per `doc_type`. The splits are the ones the generators wrote; validation documents never appear in train.
 
286
  | `kie` | string or null | JSON object (see below). Parse with `json.loads`. Set on every row of this release |
287
  | `source_set` | string | `synth` (forms), `synth2` (accounting) or `synth3` (photos) |
288
 
289
+ Loading code is in [Quick start](#quick-start); a complete row is shown under [Examples](#examples).
 
 
 
 
 
 
 
 
 
 
290
 
291
  ### `ocr_text`
292
 
assets/banner.png ADDED

Git LFS Details

  • SHA256: 0ac45b602df8f79d0fceda20348f0f3a8ad7bdea3b8fa2b98c2dc709f3197349
  • Pointer size: 131 Bytes
  • Size of remote file: 387 kB
assets/example-photo.jpg ADDED

Git LFS Details

  • SHA256: 7aae59c6b7868db6dea47332b4ebebe180caca5eaa2668b5e7e512c3e9af609d
  • Pointer size: 131 Bytes
  • Size of remote file: 200 kB
assets/example-tax-invoice.png ADDED

Git LFS Details

  • SHA256: d5309ca4ccc4c09bfc996219d3dc110fc3254057145d202c8083e76cda230e93
  • Pointer size: 131 Bytes
  • Size of remote file: 441 kB
assets/example-transfer-slip.png ADDED

Git LFS Details

  • SHA256: fd2b0a268a4a2d2d707fa8f61dbcf6450f3f4eda2466ec8c62b196cc86c4f8ca
  • Pointer size: 131 Bytes
  • Size of remote file: 404 kB
assets/samples-grid.png ADDED

Git LFS Details

  • SHA256: 58eae61106f26f1ba13d6bc7d130b25b673da3eeb23d464c5b95a2042e2d7eb7
  • Pointer size: 132 Bytes
  • Size of remote file: 1.19 MB