Loading…
Loading…
A Korean/English text-line recognizer (8.93 M parameters, CTC, trained from scratch) released as a research preview. It reads one cropped text line and returns its transcription. It does not find text on a page; pair it with a line detector or layout model.
Korean card: MODEL_CARD.ko.md carries the same facts in Korean.
Status: research preview, not a product release. Under our own preregistered gates this model was judged A1_GEN2_NO_GO: it passed four of five gates and failed gate I4 (date tokens). Production use is NO-GO. We publish it so the work can be inspected and reused for research, not because it met our bar. We make no claim of state-of-the-art accuracy.
pip install torch numpy pillow safetensors
python inference.py line.png # one or more line images
python inference.py --demo # renders an English line and reads it back
from inference import ThakiOCR
ocr = ThakiOCR(".", device="cpu")
print(ocr.recognize(["line1.png", "line2.png"]))
inference.py is self-contained (torch, numpy, Pillow, safetensors). It holds a vendored copy of the network, the preprocessing and the greedy CTC decoder. The vendored network was checked against the training code on the released weights before upload (maximum logit difference below 1e-4, identical argmax).
| File | Content |
|---|---|
model.safetensors |
fp32 weights (state_dict only, no optimizer state) |
config.json |
architecture, preprocessing and decoding settings, provenance hashes |
vocab.json |
14,250 characters; CTC index i maps to chars[i-1], index 0 is blank |
inference.py |
standalone model code, preprocessing, greedy CTC decoding, CLI |
LICENSE |
Apache-2.0 (code and weights) |
NOTICE |
data attribution (CC BY 4.0, SIL OFL 1.1 fonts, AI Hub) and what is not included |
max(8, round(w*48/h)); lines wider than 2048 px after resizing are rejected rather than squeezed. Pixels are scaled to [-1, 1] (x/127.5 - 1). A batch is right-padded with white to a multiple of 16.heads field in config.json is unused by this local-mixing variant.₩ (U+FFE6) and ₩ (U+20A9) stay different characters.₩ and ¥, plus 96 characters that occur at least three times in the training labels.Each independent set was opened exactly once, after training and selection, under preregistered gates that were not changed afterwards. Exact-string metrics after NFC. Single run, single seed. "A" is ThakiOCR-KOEN-V1-Dense (2.13 M); "S1" is an internal 2.13 M model: A fine-tuned on AI Hub 71299 Training crops with an auxiliary spacing loss.
| Set | What it is | Metric | This model | A | S1 |
|---|---|---|---|---|---|
| Symbol test | 5,991 self-generated synthetic lines, new namespace, no text overlap with training | critical-token strict exact | 94.2% | 40.2% | 35.7% |
| Symbol test | same | CER | 0.40% | 10.38% | 12.91% |
| Real holdout, lines | 70 text lines from one held-out volume of AI Hub 71299 Training (evaluation only) | CER | 0.89% | 6.33% | 1.60% |
| Real holdout, all | 526 crops (456 words + 70 lines) from the same volume | CER | 1.11% | 8.48% | 2.50% |
| Real holdout, all | same | rows with digits, exact | 98.7% | 94.6% | 97.3% |
| Real holdout, all | same | date tokens exact | 3 / 4 | 4 / 4 | 4 / 4 |
Preregistered gates: I1 critical-token exact (pass), I2 won-sign family exact 99.9% (pass), I3 real-line CER below S1 (pass), I4 digits and dates on the real holdout (fail: dates 3 of 4), I5 size and CPU latency, 13.3 ms median per line (pass).
The symbol test was generated by our own renderer for the characters this model targets, so it measures exactly the skill we trained for and overstates accuracy on ordinary documents. The real holdout comes from the same dataset family as part of the training data.
YYYY. M.DD); the model dropped that space (YYYY.M.DD). Dates with inner spaces are a known weakness. On the internal real-document development sets, date-token exact was only 45% to 69%.₩ versus ₩. The two won signs look almost the same in the fonts we used. On the symbol test, strict currency exact is 81.0%, but if the two signs are treated as the same currency it is 99.9%: 427 rows swapped one for the other (301 ₩ read as ₩, 126 ₩ read as ₩). If your use needs the exact code point, do not rely on this model for it; if you only need the currency meaning, map both to KRW in post-processing (do not apply NFKC to whole strings, which also rewrites characters such as ①).Research on Korean/English line recognition, especially symbol fidelity (currency signs, circled numbers, masked digits), inside a larger document pipeline. Not for unattended reading of financial, legal or identity documents.
Code and weights: Apache-2.0 (see LICENSE). Data attribution: NVIDIA OCR-Synthetic-Multilingual-v1 (CC BY 4.0); fonts under SIL OFL 1.1 for synthetic rendering; AI Hub dataset 71299 (Training split) used for training under the AI Hub usage policy, not redistributed. Details in NOTICE.