File size: 7,039 Bytes
2e4fd5b
9d83784
 
2e4fd5b
9d83784
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2e4fd5b
9d83784
 
 
 
 
 
 
 
ef9d4bf
9d83784
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ef9d4bf
9d83784
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
---
language:
- th
license: mit
task_categories:
- token-classification
size_categories:
- 10K<n<100K
configs:
- config_name: default
  data_files:
  - split: train
    path: train.jsonl
  - split: dev
    path: dev.jsonl
  - split: test_3a
    path: test_3a.jsonl
  - split: test_3b
    path: test_3b.jsonl
  - split: test_3c
    path: test_3c.jsonl
---

# Thai-Unstructured-Address-Parsing

> **Synthetic Benchmark Dataset for Thai Delivery Address Component Extraction**  
> 12,280 fully annotated JSONL rows spanning 5 disjoint splits designed to stress-test sequence labelers, heuristic parsers, and LLMs under realistic noise, zero-whitespace, and out-of-vocabulary challenges.  
> *Official companion dataset of model [`DuckerMaster/DuckerAddress-Parse-Thai-Base`](https://huggingface.co/DuckerMaster/DuckerAddress-Parse-Thai-Base).*

<p align="center">
  <a href="https://github.com/PlamGG/Thai-Address-Component-Parser">GitHub Repository</a> · <a href="https://huggingface.co/DuckerMaster/DuckerAddress-Parse-Thai-Base">Hugging Face Model Hub</a>
</p>

> [!WARNING]
> **Synthetic-Only Data Notice**  
> All 12,280 samples in this repository are **100% synthetically generated** using programmatic permutations, slot-filling grammars, and noise injection rules. It does not represent actual customer logs. **Do not train models on `test_3b` or `test_3c` splits** as they serve as strict evaluation benchmarks.

---

## Dataset Splits & Overview

The dataset contains **12,280 rows** across 5 distinct splits:

| Split Name | Sample Count | Percentage | Novelty & Challenge Description |
|---|---|---|---|
| **`train`** | 10,000 | 81.43% | 80 seen base templates, standard noise, seen geography lexicon. |
| **`dev`** | 1,000 | 8.14% | Validation holdout on seen templates and seen geography. |
| **`test_3a`** | 600 | 4.89% | **100 Unseen Templates** (0% template overlap with train/dev), seen geography. |
| **`test_3b`** | 600 | 4.89% | **20% Unseen Administrative Lexicon (OOV)** + unseen templates. |
| **`test_3c`** | 80 | 0.65% | **Extreme Stress / Dialects / Pure Chat Negatives** (Gold spans empty). |

---

## Data Schema & Example Records

Each JSONL row contains:
- `text` *(string)*: The raw, unstructured Thai address message (includes punctuation, order codes, shipping instructions).
- `spans` *(list of dicts)*: Character-level boundary annotations with `start`, `end`, `label`, and `text`.
- `normalized` *(dict)*: Cleaned component values with administrative prefixes stripped.
- `metadata` *(dict)*: Template provenance, noise tags, and split identifier.

### Example 1: Standard Delivery Address with Chat Noise
```json
{
  "text": "ส่งให้ คุณสมชาย บ้านเลขที่ 124/5 หมู่ 2 ซอย 8 ถนนพหลโยธิน ต.ประชาธิปัตย์ อ.ธัญบุรี ปทุมธานี 12130 โทร 081-987-6543 (ฝากไว้ป้อมยาม)",
  "spans": [
    {"label": "recipient", "start": 7, "end": 15, "text": "คุณสมชาย"},
    {"label": "house_no", "start": 16, "end": 32, "text": "บ้านเลขที่ 124/5"},
    {"label": "village_no", "start": 33, "end": 39, "text": "หมู่ 2"},
    {"label": "lane_or_alley", "start": 40, "end": 45, "text": "ซอย 8"},
    {"label": "road", "start": 46, "end": 57, "text": "ถนนพหลโยธิน"},
    {"label": "subdistrict", "start": 58, "end": 72, "text": "ต.ประชาธิปัตย์"},
    {"label": "district", "start": 73, "end": 82, "text": "อ.ธัญบุรี"},
    {"label": "province", "start": 83, "end": 91, "text": "ปทุมธานี"},
    {"label": "postal_code", "start": 92, "end": 97, "text": "12130"},
    {"label": "phone_number", "start": 102, "end": 114, "text": "081-987-6543"}
  ],
  "normalized": {
    "recipient": "คุณสมชาย",
    "house_no": "124/5",
    "village_no": "หมู่ 2",
    "lane_or_alley": "ซอย 8",
    "road": "ถนนพหลโยธิน",
    "subdistrict": "ประชาธิปัตย์",
    "district": "ธัญบุรี",
    "province": "ปทุมธานี",
    "postal_code": "12130",
    "phone_number": "0819876543"
  }
}
```

### Example 2: Negative Sample (Test 3C Non-Address Chat)
```json
{
  "text": "ขอเปลี่ยนที่อยู่จัดส่งได้ไหมคะ พอดีพิมพ์ผิด ออเดอร์ TH998218129",
  "spans": [],
  "normalized": {}
}
```

<p align="center">
  <img src="https://huggingface.co/datasets/DuckerMaster/Thai-Unstructured-Address-Parsing/resolve/main/assets/d2_field_presence.png" alt="D2 Field Presence" width="650">
</p>

---

## Generation Methodology & Slicing

1. **Base Lexicons:** Derived from `thailand-geography-data` (MIT License) comprising 7,436 official subdistricts, districts, and provinces.
2. **Train/Test Lexicon Split:** An 80/20 geographic partition was enforced. 20% of subdistricts and districts were strictly reserved for `test_3b`.
3. **Template Engine:** 180 templates were engineered (80 for training, 100 strictly unseen for Test 3A/3B).
4. **Noise Profiles:** Random zero-whitespace compaction, Thai digit replacement (`๑๒๓` -> `123`), order ID injection (`FLASH...`, `KEX...`), and conversational chatter.

<p align="center">
  <img src="https://huggingface.co/datasets/DuckerMaster/Thai-Unstructured-Address-Parsing/resolve/main/assets/d5_test_3c_categories.png" alt="D5 Test 3C Categories" width="700">
</p>

---

## Data Integrity Checksums (SHA-256)

All splits match the cryptographic manifest (`data/manifest.json`):
- `train.jsonl`: `2c954e7d4be3ba983088b9a1a8fa0f14d7a7ffef58a2d1e2fc64fa369ad89b87`
- `dev.jsonl`: `47baee84d0089f66bb6c43e7fb02a8eb2fa8372cb5631c775fa3d1e9dbb5f0a6`
- `test_3a.jsonl`: `08bc443681fe4bf4593f0b2f1559869aebfe301c22d713c23dcae393b89fa5a9`
- `test_3b.jsonl`: `a681c2666a74bbf7b0c80b5c192c7ea21927cb835d0e2d1d033a3d548dd77d54`
- `test_3c.jsonl`: `1e50587db3707c91e704a2fe76918fb52eb73602d33887019f6a6299b9cf956b`

---

## Licensing & Privacy Notice

- **Dataset License:** MIT License.
- **Geographic Data:** `thailand-geography-data` (MIT License). Open government data (roads, condos) users should verify licensing terms directly on `data.go.th`.
- **Privacy & Takedown:** Phone numbers are randomly generated (`08x`, `09x`, `06x`). If a generated number coincides with a real telephone number, please report it via GitHub Issues for immediate deletion within 48 hours (see [SAFETY.md](https://github.com/PlamGG/Thai-Address-Component-Parser/blob/master/SAFETY.md)).

---

## Citation

```bibtex
@misc{duckeraddress_dataset2026,
  author = {DuckerMaster and Contributors},
  title = {Thai-Unstructured-Address-Parsing: A Benchmark Dataset for Thai Delivery Address Parsing},
  year = {2026},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/datasets/DuckerMaster/Thai-Unstructured-Address-Parsing}}
}
```