Instructions to use tssandor/indonesian-text-normalizer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tssandor/indonesian-text-normalizer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tssandor/indonesian-text-normalizer")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("tssandor/indonesian-text-normalizer") model = AutoModelForSeq2SeqLM.from_pretrained("tssandor/indonesian-text-normalizer", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tssandor/indonesian-text-normalizer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tssandor/indonesian-text-normalizer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tssandor/indonesian-text-normalizer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tssandor/indonesian-text-normalizer
- SGLang
How to use tssandor/indonesian-text-normalizer with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "tssandor/indonesian-text-normalizer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tssandor/indonesian-text-normalizer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "tssandor/indonesian-text-normalizer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tssandor/indonesian-text-normalizer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tssandor/indonesian-text-normalizer with Docker Model Runner:
docker model run hf.co/tssandor/indonesian-text-normalizer
MerahModels — Indonesian Texting Normalizer
Turn messy Indonesian texting (bahasa gaul, alay, WhatsApp & marketplace shorthand) into clean, readable Indonesian — fast, offline, and on plain CPU.
An Apache-2.0, CPU-ready dual-mode text normalizer by MerahModels.
What This Model Does
Everyday Indonesian messages on WhatsApp, marketplace chats (Tokopedia/Shopee), and customer support are packed with vowel-dropped shorthand (bsk, ga, bs, krn), number-2 reduplications (org2, hati2), merged words (gatau, dirumah), stretched spelling (makasiiihh), and Jaksel Indonesian–English mixing.
Flat dictionary lookup tables (kamus alay) break on real text because the same abbreviation means completely different words depending on context — bkn can mean bukan ("not") or bikin ("make"), sm can mean sama ("with"), semua ("all"), or semoga ("hopefully"), and dr can mean dari ("from"), dokter ("doctor"), or daripada ("than"). Dictionaries also corrupt entities like flight numbers (GA-412 → TIDAK-412) and honorifics (dr. Agus → dari. Agus). On the other hand, calling a hosted LLM for every chat message is slow and expensive.
This model reads the full sentence on plain CPU in tens of milliseconds and rewrites it cleanly in two controllable modes — no system prompt required, just a short prefix:
<norm>(Clean Readable Indonesian): Expands shorthand,2-reduplications, merged words, and stretched spellings while keeping casual tone (gue,lu,banget,nih,dong,kak) and intentional English (Jaksel) words intact.<formal>(Standard Bahasa Baku): Rewrites informal Indonesian into polite, standard Bahasa Baku (gw/gue/aku → saya,lu → Anda/kamu,bgt → sangat,lg → sedang,udh → sudah), matching theSTIF-Indonesiaformal register.
| What the input looks like | Mode | Reconstructed output (int8 ONNX + production guard) |
|---|---|---|
bsk gw ga bs mampir k bengkel krn lg ribet bgt sm pindahan, maaf yaa |
<norm> |
Besok gue tidak bisa mampir ke bengkel karena sedang ribet banget sama pindahan, maaf ya |
bsk gw ga bs mampir k bengkel krn lg ribet bgt sm pindahan, maaf yaa |
<formal> |
Besok saya tidak dapat mampir ke bengkel karena sedang sangat rumit dengan pindahan, mohon maaf |
sm peserta udah hadir, sm acaranya lancar ya pak, pulang sm rekan kerja |
<norm> |
Semua peserta sudah hadir, semoga acaranya lancar ya Pak, pulang dengan rekan kerja |
bkn sy yg bkn kesalahan invoice itu, tlg cek ulang resi JNE90817263 ya kak |
<formal> |
Bukan saya yang menyebabkan kesalahan invoice tersebut, mohon periksa ulang resi JNE90817263 ya, Kak |
literally msh nunggu review design dr tim product nih, otw balik 🚗💨🙏 |
<norm> |
Literally masih nunggu review design dari tim product nih, otw balik 🚗💨🙏 |
TOLONG CEK PESANAN SY KRN BLM SAMPE D RUMAH |
<norm> |
Mohon cek pesanan saya karena belum sampai di rumah |
SELECT order_id, status FROM shipments WHERE weight_kg <= 25; |
<norm> / <formal> |
SELECT order_id, status FROM shipments WHERE weight_kg <= 25; (unchanged) |
(All showcase examples above were authored outside both benchmark suites and all prompt templates.)
Why Use It
- Fast on plain CPU (no GPU needed): Ships as a 160.22 MiB (
168.01 MB) dynamicint8ONNX export with KV-cache (onnx/) alongside full PyTorch (safetensors) weights (69.23Mparameters). Runs in~23 msp50 on an idle Apple Silicon laptop CPU (36.1 msp50 under heavy shared CPU load) at4threads. - Disambiguates by context instead of flat regex: Reaches
92.63%(176/190) accuracy across 19 ambiguous Indonesian shorthand keys on the held-out suite — vs.37.89%for the MIT regex+dictionary baseline and33.93%for zero-shotQwen3-1.7Bon dev. - Beats classical baselines on real human customer-service text: Scores
75.85chrF++ /53.62BLEU on untouched humanSTIF-Indonesiatest(+3.15 chrF++/+6.06 BLEUover the MIT baseline, 5,000-resample paired bootstrap win rate1.0000). - Production safety wrapper included in the companion repo: Pairs the neural weights with deterministic chunking, entity/currency/date/time/code/URL/emoji preservation, and SQL/CLI/code pass-through (
tssandor/indonesian-text-normalizer), achieving100.0%(194/194) verbatim entity preservation and0.00%(0/70) identity false-edits on the holdout suite. - Apache-2.0 open weights and open benchmark: Published alongside the Apache-2.0 holdout + dev benchmark suite at
tssandor/indonesian-text-normalizer-bench.
Where It Fits (and When Not to Use It)
- Great for: Preprocessing Indonesian chats before search/RAG indexing, CRM/helpdesk normalization, analytics/classification pipelines, and cleaning noisy user inputs offline on CPU.
- Use the companion guard (
IndonesianNormalizer) in production: Raw seq2seq inference handles single short messages (<= 320tokens) well, but multi-sentence chats, payments, URLs, emojis, and code/SQL snippets should go throughIndonesianNormalizer. - Not a regional-language translator: Covers mainstream Indonesian texting, Jakarta/Jaksel slang, and common everyday borrowings, but is not a Javanese, Sundanese, or Balinese translator.
Quickstart
1. Standalone Python ONNX Runtime (optimum[onnxruntime] — Zero Repo Files)
Runs directly against this Hugging Face repository on plain CPU (no PyTorch checkpoint download required):
import onnxruntime as ort
from optimum.onnxruntime import ORTModelForSeq2SeqLM
from transformers import AutoTokenizer
REPO = "tssandor/indonesian-text-normalizer"
sess_opts = ort.SessionOptions()
sess_opts.intra_op_num_threads = 4
sess_opts.inter_op_num_threads = 1
tokenizer = AutoTokenizer.from_pretrained(REPO)
model = ORTModelForSeq2SeqLM.from_pretrained(
REPO,
subfolder="onnx",
provider="CPUExecutionProvider",
session_options=sess_opts,
encoder_file_name="encoder_model.onnx",
decoder_file_name="decoder_model.onnx",
decoder_with_past_file_name="decoder_with_past_model.onnx",
)
def normalize_raw(text: str, mode: str = "norm") -> str:
enc = tokenizer(
f"<{mode}> {text.strip()}",
max_length=320,
truncation=True,
return_token_type_ids=False,
return_tensors="pt",
)
cap = min(224, max(int(len(text.split()) * 3.5) + 40, int(len(text.encode("utf-8")) * 1.2) + 32))
out = model.generate(**enc, max_new_tokens=cap, do_sample=False, num_beams=1)
return tokenizer.decode(out[0], skip_special_tokens=True).strip()
print(normalize_raw("bsk gw ga bs mampir k bengkel krn lg ribet bgt sm pindahan, maaf yaa", mode="norm"))
print(normalize_raw("bkn sy yg bkn kesalahan invoice itu, tlg cek ulang resi JNE90817263 ya kak", mode="formal"))
2. Python — PyTorch (transformers)
import torch
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
REPO = "tssandor/indonesian-text-normalizer"
tokenizer = AutoTokenizer.from_pretrained(REPO)
model = AutoModelForSeq2SeqLM.from_pretrained(REPO).eval()
text = "sm peserta udah hadir, sm acaranya lancar ya pak, pulang sm rekan kerja"
enc = tokenizer(f"<norm> {text}", max_length=320, truncation=True, return_tensors="pt")
with torch.no_grad():
out = model.generate(**enc, max_new_tokens=128, do_sample=False, num_beams=1)
print(tokenizer.decode(out[0], skip_special_tokens=True))
3. Production Guarded API & Local Two-Textbox Test Page (Recommended)
Clone the companion code repository tssandor/indonesian-text-normalizer for the deterministic IndonesianNormalizer wrapper (chunking, verbatim masking, SQL/CLI/code bypass, and protected-span post-verification) and the local two-textbox web test page:
from normalizer import IndonesianNormalizer
norm = IndonesianNormalizer("tssandor/indonesian-text-normalizer", num_threads=4)
print(norm.normalize("bsk gw ga bs mampir k bengkel krn lg ribet bgt sm pindahan, maaf yaa", mode="norm"))
print(norm.normalize("bsk gw ga bs mampir k bengkel krn lg ribet bgt sm pindahan, maaf yaa", mode="formal"))
# Launch the local two-textbox test page at http://127.0.0.1:8785
uv run --extra eval python demo_server.py
JavaScript /
@huggingface/transformersstatus: Not supported in v0.1. Testing with@huggingface/transformers@4.3.2confirmed that the JS Unigram tokenizer does not implementbyte_fallback(mapping emojis to<unk>) and requires a merged decoder export. Python ONNX Runtime (optimum[onnxruntime]) and PyTorch (transformers) are the verified v0.1 runtimes; JS/WASM support is tracked for v0.2.
Technical Details & Benchmarks
Model Summary
- Architecture: Vocab-pruned
google/mt5-small(8encoder /8decoder layers,d_model=512,d_ff=1024,69.23Mparameters,tie_word_embeddings=false). - Tokenizer: 24,576-token SentencePiece Unigram vocabulary with native
ByteFallback(pruned from 250,100 strictly on Indonesian + English training tokens, ASCII, and 256 byte tokens; fp32 hidden-state pruning parity verified at0.0max diff indata/mt5_id_en_tok_v5/parity_check.json). - Artifacts in this repo:
onnx/(T5-safe dynamicQUInt8,/wo/FFN output projections excluded — 8 nodes × 3 graphs):160.22 MiB(168.01 MB) (encoder_model.onnx42.27 MiB,decoder_model.onnx60.50 MiB,decoder_with_past_model.onnx57.46 MiB).- Root PyTorch checkpoint (
model.safetensors):264.10 MiB(276.93 MB) fp32 weights +tokenizer.json(1.77 MiB) +spiece.model(594 KiB).
- Latency (
4CPU threads, Apple Silicon Mac, holdout 5–30w slice):- Guarded ONNX (
int8):36.1 msp50 generation-only under shared host CPU contention (37.3 msmean,52.7 msp95 across418non-bypassed calls /209distinct sources;36.0 msp50 e2e across442calls incl.24bypassed;1.877 ms/step,0.543 ms/UTF-8 byteover9,565generated decoding steps;~23 msp50 on an idle laptop, consistent with the22.9 msidle raw ONNX run). - Raw ONNX (
int8vsfp32idle):22.9 msp50 (int8) vs.41.8 msp50 (fp32,492.74 MiB).
- Guarded ONNX (
1. Holdout Suite (tssandor/indonesian-text-normalizer-bench holdout, 460 Calls = 230 Sources × 2 Modes)
Frozen read-only (0o444, SHA-256 BLIND_MANIFEST.json) prior to v05 training and physically excluded from the Colab training upload. Covers all 19 ambiguous shorthand keys (gold self-check: 189/190) plus ALL-CAPS, Title-Case, emojis, 360–520 char paragraphs, extreme amounts (Rp 100000000000, $180.49), full-width URLs, NFKC symbols (m², ½, ™, <s>50rb</s>), and SQL/CLI/code/Arabic identity cases.
Holdout independence disclosure:
blind_ambiguous(190,v05scores176/190 = 92.63%, source-cluster 95% CI[87.37%, 96.84%], fp3292.11%) andblind_whatsapp_jaksel(130) are freshly authored unseen contexts.blind_fidelity_and_identity(140) shares procedural generator families withbuild_v5_package.py,2of its35identity sources also appear in wrapper unit tests, and16identity sources (32/70identity calls;38generated) are handled by the conservative wrapper bypass.build_v5_package.pyreaddata/eval_blind/solely for pre-training decontamination.
System (4 CPU threads) |
Params | ONNX Size (MiB / MB) |
Mac CPU p50 (gen non-byp / e2e all; p95) |
blind_ambiguous (190) |
blind_wa_jaksel <norm> / <formal> |
Jaksel EN (79) |
Entity Canon / Verbatim (194, unexp) |
Identity False-Edit (70) |
|---|---|---|---|---|---|---|---|---|
MIT Regex + Dict (baseline.py) |
0 | — | < 1 ms | 37.89% | 85.53 / 54.40 | 97.47% | 91.75% / 90.72% (4) |
25.71% (18/70) |
v05-mt5-small-pruned Guarded (this model, int8) |
69.2M | 160.22 / 168.01 | **36.1 gen (418c) / 36.0 e2e (442c, 24 byp; 52.3 p95)**† |
92.63% (176/190) |
91.30 / 67.86 | 92.41% | 100.0% / 100.0% (0) |
0.00% (0/70) |
v05-mt5-small-pruned Raw (int8) |
69.2M | 160.22 / 168.01 | 22.9 gen / 23.1 e2e (442c; 32.9 p95) |
92.63% (176/190) |
90.73 / 67.33 | 92.41% | 93.81% / 93.81% (8)* |
12.86% (9/70) |
v05-mt5-small-pruned Raw (fp32) |
69.2M | 492.74 / 516.68 | 41.8 gen / 42.0 e2e (442c; 60.8 p95) |
92.11% (175/190) |
91.09 / 67.80 | 93.67% | 93.81% / 93.81% (8)* |
12.86% (9/70) |
v02-byt5-small Guarded (internal teacher, int8) |
300M | 666.85 / 699.24 | 219.0 gen (418c) / 220.2 e2e (442c, 24 byp; 332.4 p95)† |
91.05% (173/190) |
90.06 / 67.64 | 98.73% | 100.0% / 99.48% (0) |
0.00% (0/70) |
v03-mbart-bbpe-8e3d Guarded (internal edge, int8) |
39.9M | 78.29 / 82.09 | **20.5 gen (418c) / 20.6 e2e (442c, 24 byp; 35.5 p95)**† |
82.63% (157/190) |
88.75 / 62.02 | 98.73% | 100.0% / 100.0% (0) |
0.00% (0/70) |
*On raw unguarded v05 (182/194), the 12 misses are 8 SentencePiece NFKC rewrites (https://example.id/A?x=①, 45 m², ½, Studio™), 2 lost <s>50rb</s> tags, and 2 dropped 40rb replacement prices (mid-sentence drop after unmasked <s>50rb</s> on blind_fid_024). Guarded IndonesianNormalizer eliminates all 12 with 0 fallbacks across all 460 calls. †Refreshed guarded runs were timed under shared host CPU contention; idle Apple Silicon laptop p50 is ~`23 msforv05, ~161 msforv02, and ~13 msforv03`, consistent with the idle raw runs.
2. Untouched Human test_stif_real (363 MIT Pairs) & Legacy Dev/Regression Suite (dev, 624 Items — Non-Blind)
test_stif_real(363official MIT pairs fromharyoa/stif-indonesiatest, detokenized):75.85chrF++ /53.62BLEU guarded (75.81 / 53.50raw) —+3.15 chrF++(95% CI: [+2.26, +4.11]) /+6.06 BLEU([+4.44, +7.76], 5,000-resample bootstrap win rate1.0000) over the MIT regex+dict baseline (72.70 / 47.56), and+1.71([+0.77, +2.70], win rate0.9998) even with case and punctuation completely stripped.
| System | Latency (5–30w, gen non-byp / e2e all, 4 thr) |
test_stif_real Detok chrF++ / BLEU |
Dev ambiguous (224) |
Dev wa_jaksel <norm> / <formal> (EN) |
Dev Entity Canon / Verbatim (296, unexp) |
Dev Identity False-Edit (100) |
|---|---|---|---|---|---|---|
MIT Regex + Dict (baseline.py) |
< 1 ms | 72.70 / 47.56 | 37.95% | 86.28 / 49.13 (97.76%) | 93.24% / 90.54% (4) |
12.00% (12/100) |
Qwen/Qwen3-0.6B (0-shot, GPU) |
GPU | 46.26 / 18.43 | 9.82% | 56.83 / 38.23 (77.61%) | 96.62% / 91.22% (12) |
53.00% (53/100) |
Qwen/Qwen3-1.7B (0-shot, GPU) |
GPU | 54.50 / 24.19 | 33.93% | 69.06 / 50.02 (91.04%) | 95.61% / 92.23% (13) |
24.00% (24/100) |
v05-mt5-small-pruned Guarded (int8) |
**38.1 gen (969c) / 38.5 e2e (971c, 2 byp)**† |
75.85 / 53.62 (win 1.0000 vs base) |
89.73% | 90.22 / 62.55 (93.28%) | 100.0% / 100.0% (0) |
0.00% (0/100) |
v05-mt5-small-pruned Raw (int8) |
24.0 gen / 24.2 e2e (971c) |
75.81 / 53.50 (win 1.0000 vs base) |
89.73% | 90.22 / 62.55 (93.28%) | 100.0% / 99.32% (0) |
1.00% (1/100) |
v02-byt5-small Raw (int8) |
173.6 gen / 176.9 e2e (971c) |
73.77 / 49.42 (win 0.9902 vs base) |
91.52% | 90.43 / 65.17 (97.76%) | 99.66% / 99.66% (0) |
0.00% (0/100) |
v03-mbart-bbpe-8e3d Raw (int8) |
13.2 gen / 13.4 e2e (971c) |
70.39 / 45.03 | 86.61% | 87.70 / 56.47 (97.01%) | 96.96% / 94.93% (8) |
8.00% (8/100) |
Preservation Scope (Guarded vs. Raw)
- Deterministically verified by
IndonesianNormalizer(companion reponormalizer.py+metrics.py): signed & prefix/suffix currencies (-Rp 20.000,Rp 100000000000,$180.49,100 USD,¥1200,€1200, uppercaseRM 12), numeric & month-name dates (1 Mar 2027,31/12/2027), times with combined time-of-day + timezone (jam 7 malam WIB,7 malam WIB,jam 7WIB,jam 7mlm→jam 7 malam), phone numbers, case-preserved order/tracking IDs & universal digit-bearing alphanumeric codes (JNE90817263,JP1234567890,HEMAT50,123jkt,081234567890jkt,12aB,4G,HEMAT2,Ab2,A12,B7; lowercase & Title-Case Indonesian2-reduplications liketemen2ku/Sama2/Hati2remain normalizable unless introduced bykode/voucher/kupon), standalone>=4-letter ALL-CAPS tokens in mixed-case text (kodenya HEMATBGT,kupon diskonnya SERBUHEMAT,pswd wifinya RUMAHKITA) &kode/voucher/kupon-introduced codes in both mixed-case and ALL-CAPS shouting (taking precedence over shorthand/reduplication rules, including stacked introducers and short codes likePAKE KODE VOUCHER BSK YA KAK,PAKE KODE VOUCHER ONGKIR YA KAK,kode voucher Hemat2), uppercase Indonesian license plates (in mixed-case textAB 4321 KLorplat/nopol/stnk-introduced in ALL-CAPS shoutingCEK PLAT AB 4321 HR YA KAK; unintroduced plates in ALL-CAPS shouting are not masked), URLs (including Unicode/full-width paths), emails,@handles, HTML/special tags (<div ...>,</s>), numbers + dosage/quantity/duration units (2 mgvs2 g,5 kmvs5 meter,2 jam 5 menit,10mnt,5km,4jam,3org,2 juta,-5), non-ASCII/accented words (São,Łódź,¿,¡), emojis, and NFKC symbols (m²,½,™). Violations trigger fallback-to-source (default) orNormalizationGuardError(on_guard_failure="raise"). - Model-normalized (not deterministically verified without NER): unannotated free-text personal names, street addresses, and semantic paraphrases are trained for fidelity but are not regex-verifiable by the post-guard.
- Conservative pass-through: common SQL statements (
SELECT ...,SELECT upper(...),SHOW TABLES;,TRUNCATE TABLE ..., etc.), CommonMark fenced Markdown code blocks (0–3 leading spaces, matching backtick/tilde char & length), CLI commands (requiring syntax signals for ambiguous words likecat/return/helm), code statements (print(...),console.log(...),if ...:,class FooBar:), pure HTML lines, non-Latin lines, multi-space quoted literals ('A B'), and overlength unbroken tokens pass through unchanged.
Training Data, Split Hygiene Disclosure & Quantization
Trained for 6 epochs (data/train_pkg_v5/: 214,490 total rows, 184,436 literal distinct (mode, source, target) triples, 184,072 literal distinct (mode, source) pairs [178,415 normalized triples], 4,405 val rows; bf16, AdamW lr=4e-4, cosine warmup 6%, batch_size=64, best_val_loss=0.2099):
- Layer 1 (MIT Human Anchor):
haryoa/stif-indonesia(train, 1,922 pairs, MIT;2×weighted across raw + detok) +haryoa/indo-collex(MIT). - Layer 2 (Empirical + Back-Translation + Mined Ambiguity):
HuggingFaceFW/fineweb-2(ind_Latn, ODC-By 1.0 database license; subject to Common Crawl Terms of Use & ODC-By §2.4 — passages are used solely for training/distillation and are not redistributed) corrupted via IndoCollex (31,597pairs), STIF reverse back-translator (12,352pairs), and9,259ambiguous shorthand contexts mined fromfineweb_id_clean.jsonl. - Layer 3 (Apache-2.0 Teacher + Procedural Hardening & Augmentations):
Qwen/Qwen3-32B-AWQ/Qwen/Qwen3-32B-FP8(Apache-2.0) validated triplets (48,694upweighted rows after leak filtering), procedural entity hardening (3,888), clean identity twins (13,298ID,7,678EN fromHuggingFaceFW/fineweb-eduODC-By 1.0,1,038procedural SQL/CLI/code), ALL-CAPS (3,018) & Title-Case (3,005) augmentations, 300–480 char multi-sentence paragraphs (3,719), and everyday slang (136). - Sequence-Level Knowledge Distillation:
68,537entity-verified dual-mode pseudo-labels fromv02-byt5-smallonfineweb_id_distill.jsonl.
Historical
train_pkg_v5split-hygiene disclosure: Exact source, target, and cluster-string overlap betweentrain.jsonlandval.jsonlis0, and exact overlap with alldata/evalanddata/eval_blindrows is0. Post-training independent review identified four residual artifacts inv05's packaged training set: (1) inconsistent cluster-prefix stripping across layers (dom_vsfwdom_/fwen_) left213shared FineWeb hostnames (1,015/4,405val rows) and18,221KD rows sharing hostnames withfineweb_id_clean.jsonl, (2)50concatenated long-paragraph augmentations contained a validation target sentence that was later pruned standalone, (3) a word-count fuzzy prefilter missed1STIF test substring (stif_test_0312preceded by a greeting, ratio83.67, upweighted2×) andls -la /var/logvs/var/log/nginx(83.33), and (4)PACKAGE_MANIFEST.jsonrecorded pre-pruningtrain_unique_rows: 185255instead of post-pruning184,436. All four issues are fixed inbuild_v5_package.pyfor v0.2;v05weights were not retrained.
T5-Safe ONNX Quantization & Parity: Exported via the single canonical exporter (infer_onnx.py --export-model-dir, manifest in onnx_export_manifest.json), excluding only the gated-GELU FFN output projections (/wo/, 8 nodes per graph) from dynamic QUInt8 quantization. This reduces ONNX graph size from 492.74 MiB (516.68 MB) fp32 to 160.22 MiB (168.01 MB) int8 and speeds up Mac CPU latency from 41.8 ms to 22.9 ms p50 (raw idle; 36.1 ms guarded under shared host load). Dynamic QUInt8 changes exact string output on 12.97% (128/987) of data/eval rows compared to PyTorch bf16/fp32 (with slightly higher STIF 75.81/53.50 vs 75.50/53.04 and slightly higher holdout disambiguation 92.63% vs fp32 92.11%); it is not bit-exact with fp32.
Limitations & Known Failure Modes
- Input length & chunking: Trained on inputs up to ~480 chars (
max_length=320tokens). The raw model degrades if given unbounded text; always useIndonesianNormalizer(which splits lines into<= 220-char chunks) for multi-sentence messages. - Short 2–4 word fragments: Very short incomplete fragments (e.g.,
sy blm) can occasionally prompt model-side continuation beyond the input words; the guard passes these when no protected entity or repetition rule is violated. - Unverified semantic / free-text edits: While deterministic guards protect numbers, signed/prefix/suffix currencies, dates, times + time-of-day + timezones, order/tracking/alphanumeric codes,
kode/voucher/kupon-introduced & standalone mixed-case ALL-CAPS codes, uppercase license plates in mixed-case text orplat/nopol/stnk-introduced in ALL-CAPS shouting (unintroduced plates in ALL-CAPS shouting are not masked), URLs, emails, and non-ASCII spans, the underlying seq2seq model can still produce occasional semantic errors on unguarded prose — for example,dl(dulu) over-mapped to tenggat waktu in<formal>,gppinverted in certain long formal complaints,lusa gw plgadding lebih awal,diskon 50% s/d ...substituting Konfirmasi, casual English phrases (ok thanks) edited in<formal>, or casual<norm>shiftinggue/lotoaku/kamuon already-clean input. - Rare sentence-initial English words in
<norm>:v05preserves92.41%(73/79) of holdout Jaksel English tokens (93.28%on dev). - Guard trade-off: When
IndonesianNormalizerdetects a protected-span violation, repetition/clause loop, or leaked placeholder, defaulton_guard_failure="fallback"returns the original chunk unmodified (or raisesNormalizationGuardErrorwithon_guard_failure="raise").
License & Attribution
Apache-2.0 — see LICENSE and NOTICE. Code, documentation, and local test page live at github.com/tssandor/indonesian-text-normalizer; Apache-2.0 benchmark slices live at huggingface.co/datasets/tssandor/indonesian-text-normalizer-bench.
- Downloads last month
- 247
Model tree for tssandor/indonesian-text-normalizer
Base model
google/mt5-smallDatasets used to train tssandor/indonesian-text-normalizer
HuggingFaceFW/fineweb-2
tssandor/indonesian-text-normalizer-bench
Evaluation results
- Ambiguous Shorthand Disambiguation Accuracy on tssandor/indonesian-text-normalizer-benchself-reported92.630
- WhatsApp/Jaksel <norm> chrF++ on tssandor/indonesian-text-normalizer-benchself-reported91.300
- WhatsApp/Jaksel <formal> chrF++ on tssandor/indonesian-text-normalizer-benchself-reported67.860
- Verbatim Entity Preservation (Guarded) on tssandor/indonesian-text-normalizer-benchself-reported100.000
- Identity False-Edit Rate (Guarded) on tssandor/indonesian-text-normalizer-benchself-reported0.000
- Detokenized chrF++ (Guarded) on haryoa/stif-indonesiatest set self-reported75.850
- Detokenized BLEU (Guarded) on haryoa/stif-indonesiatest set self-reported53.620