DuckerAddress-Parse-Thai-Base (v1.4.0)
Research Prototype: Lightweight Cascaded Hybrid Thai Address Component Parser
An ultra-fast, CPU-only 5-stage sequential hybrid pipeline (Sanitizer + Regex + GeoThai Trie + Linear-chain CRF + Normalizer) optimized for high-throughput Thai delivery address parsing.
Official companion model of datasetDuckerMaster/Thai-Unstructured-Address-Parsing.
GitHub Repository · Hugging Face Dataset Hub
Synthetic Data Disclaimer
All benchmark results and performance metrics reported here were evaluated exclusively on synthetic datasets (12,280 samples total) generated by rule-based and template generators. The model has not yet been evaluated on real-world production field data. Performance on real-world messy text, unstandardized dialects, or out-of-lexicon slang may be lower than reported.
Test 3C Behavioral Caution: False Positive Rate 80.0%
This model is strictly an Address Component Parser, not an Address Intent Classifier. On Test 3C (80 samples of noise and chat), the model exhibits an 80.0% False Positive rate (64/80 samples) because it aggressively binds numeric patterns (e.g., timestamps, prices) to address fields. Never pipe raw user chat messages directly into this model without an upstream intent filter.
Model Highlights
- Model Size:
0.52 MB(address_crf.crfsuite), ultra-compact memory footprint $\le 85\text{ MB}$. - CPU Execution: Runs on single-thread general-purpose x86_64 CPU without GPU or CUDA dependencies.
- Latency Profile: Mean 2.41 ms, Median 2.24 ms, p95 3.88 ms, p99 4.37 ms per sample (measured via
scripts/benchmark_latency.pywith 50 warm-up runs and 400 test iterations). Users are encouraged to run the reproduction script locally. - Phone Leak Guarantee: Zero phone numbers leaked into non-phone fields (0.00% observed across $N=1,280$ test samples).
Performance & Benchmarks
Evaluated across 3 distinct synthetic test splits with 95% Confidence Intervals (Bootstrap 1,000 resamples for F1; Wilson score interval for EM):
| Split Name | Sample Count | Challenge Description | Strict Macro-F1 (95% CI) | Full-Address EM (95% CI) | Phone Leak Error |
|---|---|---|---|---|---|
| Test 3A | 600 | 100 Unseen Templates (Seen Lexicon) | 0.9626 [0.9552, 0.9696] | 81.33% [78.02%, 84.25%] | 0.00% (0 / 600) |
| Test 3B | 600 | 20% Unseen Administrative Lexicon (OOV) | 0.9046 [0.8936, 0.9156] | 55.00% [51.00%, 58.94%] | 0.00% (0 / 600) |
| Test 3C | 80 | Stress & Negative Chat Noise | N/A* | 20.00% [12.70%, 30.05%] | 0.00% (0 / 80) |
* In Test 3C, ground-truth spans are completely empty ($TP=0$), rendering F1 mathematically undefined (reported as N/A).
Usage
1. Installation
The package and its native extensions (python-crfsuite, rapidfuzz) are available as pre-built binary wheels:
git clone https://github.com/PlamGG/Thai-Address-Component-Parser.git
cd Thai-Address-Component-Parser
pip install -r requirements.txt
2. Python Inference Snippet
from src.pipeline import DuckerAddressPipeline
pipeline = DuckerAddressPipeline()
raw_text = "ส่งให้ คุณสมชาย บ้านเลขที่ 124/5 หมู่ 2 ซอย 8 ถนนพหลโยธิน ต.ประชาธิปัตย์ อ.ธัญบุรี ปทุมธานี 12130 โทร 081-987-6543 (ฝากไว้ป้อมยาม)"
result = pipeline.parse(raw_text)
# 1. Normalized 10 components (Canonical output for databases)
print("=== Normalized Components ===")
for field, value in result["normalized"].items():
if value is not None:
print(f" {field:15s}: {value}")
# 2. Exact Character Spans (Exact bounding coordinates for UI highlighting)
print("\n=== Exact Character Spans ===")
for span in result["spans"]:
print(f" {span['label']:15s} [{span['start']:2d}:{span['end']:2d}] -> '{span['text']}'")
Actual Execution Output
=== Normalized Components ===
recipient : คุณสมชาย
house_no : 124/5
village_no : หมู่ 2
lane_or_alley : ซอย 8
road : ถนนพหลโยธิน
subdistrict : ประชาธิปัตย์
district : ธัญบุรี
province : ปทุมธานี
postal_code : 12130
phone_number : 0819876543
=== Exact Character Spans ===
recipient [ 7:15] -> 'คุณสมชาย'
house_no [16:32] -> 'บ้านเลขที่ 124/5'
village_no [33:39] -> 'หมู่ 2'
lane_or_alley [40:45] -> 'ซอย 8'
road [46:57] -> 'ถนนพหลโยธิน'
subdistrict [58:72] -> 'ต.ประชาธิปัตย์'
district [73:82] -> 'อ.ธัญบุรี'
province [83:91] -> 'ปทุมธานี'
postal_code [92:97] -> '12130'
phone_number [102:114] -> '081-987-6543'
Intended Uses & Limitations
Intended Uses
- High-throughput extraction of Thai delivery addresses from social commerce / e-commerce order notes.
- Low-latency batch parsing running locally or on-premise without GPU resources.
Out-of-Scope & Limitations
- Non-address text rejection: As shown in Test 3C (M4), non-address conversational text must be filtered before reaching this pipeline.
- Unseen Lexicon Drops: In Test 3B, unseen subdistricts and roads drop to ~0.70 F1 due to contiguous token boundary ambiguity (M3, M5).
- International Addresses: Only Thailand geographic structures are supported.
Ethical Considerations & Privacy (PDPA)
Delivery addresses, personal names, and phone numbers are Personally Identifiable Information (PII) under Thailand's PDPA.
- Training Data: 100% synthetically generated. Random phone numbers generated may coincidentally match real numbers; see the Takedown Policy in SAFETY.md.
- Recommended Deployment: Process data inside self-hosted VPCs and apply PII masking prior to storing raw text logs.
Citation
@misc{duckeraddress2026,
author = {DuckerMaster and Contributors},
title = {DuckerAddress-Parse-Thai: A Lightweight Hybrid Benchmark for Thai Delivery Address Parsing},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/DuckerMaster/DuckerAddress-Parse-Thai-Base}}
}
Contact
For questions, issue reports, or dataset collaboration, please open an issue on the GitHub Repository.
Dataset used to train DuckerMaster/DuckerAddress-Parse-Thai-Base
Evaluation results
- Strict Macro-F1 on Thai-Unstructured-Address-Parsing (Test 3A)self-reported0.963
- Full-Address Exact Match on Thai-Unstructured-Address-Parsing (Test 3A)self-reported81.330
- Strict Macro-F1 on Thai-Unstructured-Address-Parsing (Test 3B)self-reported0.905
- Full-Address Exact Match on Thai-Unstructured-Address-Parsing (Test 3B)self-reported55.000