Datasets:
Card: banner, samples grid, examples, quick start
Browse files- README.md +145 -11
- assets/banner.png +3 -0
- assets/example-photo.jpg +3 -0
- assets/example-tax-invoice.png +3 -0
- assets/example-transfer-slip.png +3 -0
- assets/samples-grid.png +3 -0
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 |
-
|
| 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 |
+

|
| 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 |
+

|
| 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 |
+

|
| 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 |
+

|
| 142 |
+
|
| 143 |
+
**Phone photo** (`photos`). The labels are those of the clean render, whatever the angle, light, blur and JPEG noise.
|
| 144 |
+
|
| 145 |
+

|
| 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
|
assets/example-photo.jpg
ADDED
|
Git LFS Details
|
assets/example-tax-invoice.png
ADDED
|
Git LFS Details
|
assets/example-transfer-slip.png
ADDED
|
Git LFS Details
|
assets/samples-grid.png
ADDED
|
Git LFS Details
|