Share this article:

Sometimes you need to copy the numbers under a table out of a report PDF sent by a Japanese partner. Sometimes you need to pull text line by line out of scanned Japanese public documents to build a search index. This post is for engineers who want to attach a small Japanese OCR model to that kind of work.

ThakiCloud released a Japanese line OCR model, ThakiOCR-JA-v1, as a research preview under the Apache-2.0 license. It is PaddleOCR-VL-1.6 (0.9B) with one LoRA adapter trained and merged into the original weights. On 2,000 lines taken from 30 Japanese government white-paper PDFs, its character error rate (CER) was 0.0094; the base scored 0.0118.

The short version: we confirmed only that this model is not worse than the base. It passed non-inferiority against margins fixed in advance, but it was not shown to be better than the base.

We also confirmed one regression: it writes the variant glyph 齡 where modern text uses 齢. This post covers what the model takes in and returns, how the numbers came out, and what you should know before using it.

ThakiOCR-JA-v1 title card, CER 0.0094 Main evaluation number for the ThakiOCR-JA-v1 research release (Apache-2.0). Source: the HF model card.

It reads one line image from a horizontal printed Japanese document

The input is a single line image cut from a horizontally written, printed Japanese document. It is not a model that takes a full page and parses the layout. A separate step in front of it has to cut the page into lines.

The caller also has to supply the orientation. The model has no orientation classifier. orientation="upright" is the default and reads the image as is.

With rot_ccw90, the image is treated as a vertical line saved after a 90° counterclockwise rotation, and it is rotated 90° clockwise before OCR. With unknown, nothing is done and the result is tagged orientation_unverified: true. In that case no accuracy is claimed.

Input and output examples per orientation and normalization option The caller passes the orientation and the normalization mode. The strings show the output format only and are not lines from the evaluation set.

The output always carries both raw_text and text. raw_text is the model’s greedy output and is never modified. With the default normalize_mode="raw" the two values are identical.

With normalize_mode="modern_ja", exactly two characters change in text: 齡(U+9F61) becomes 齢(U+9F62) and ·(U+00B7) becomes ・(U+30FB). The default is raw because in older texts or proper nouns the variant glyph can be the correct transcription.

Usage is short too. You need vllm (checked with 0.28.0) and pillow, and because the base model ships remote code you need trust_remote_code=True. Decoding is greedy and the prompt is OCR:. Every number in this post was measured with these settings.

from huggingface_hub import snapshot_download
from inference import ThakiOCRJA          # inference.py from the repo

model_dir = snapshot_download("ThakiCloud/ThakiOCR-JA-v1")
ocr = ThakiOCRJA(model_dir)
res = ocr.recognize(["line.png"], kind="line", orientation="upright", normalize_mode="modern_ja")
print(res[0]["raw_text"], res[0]["text"])

From the command line, run python inference.py line1.png line2.png --model ThakiCloud/ThakiOCR-JA-v1 --kind line --orientation upright.

One LoRA merged into the base; the rotation-augmented model stayed private

Training was simple. We trained a LoRA adapter (r 16, α 32) on PaddleOCR-VL-1.6 for 600 steps with plain cross-entropy SFT. LoRA freezes the original weights and trains only small low-rank matrices. The finished adapter was merged into the original weights across 290 modules, so the release ships a single model.safetensors of 1,917,255,968 bytes.

From the same base we also trained sibling B with rotation augmentation. We did not release it, because its CER in the main evaluation was 0.0148, worse than both the base and v1. All three models share the same decoding settings.

Comparison of base, ThakiOCR-JA-v1 and sibling B All three models use the same decoding settings. v1 merges a LoRA trained with plain cross-entropy SFT into the original weights; sibling B, trained with rotation augmentation, was not released.

There are two training sources. One is the line data from part 1 of the NDL 古典籍 (classical books) OCR dataset from the National Diet Library of Japan (Public Domain Mark), with 500 pages sampled in rotation across books. The other is JSSODa train shard 0 (llm-jp/JSSODa, CC BY 4.0).

After exclusions there are 46,102 training lines: 41,828 lines from 465 NDL books and 4,274 from JSSODa. Evaluation pages, test splits, and duplicates by text and perceptual hash were removed before training. No AI Hub data and no private data were used.

Non-inferior on 2,000 white-paper lines, not shown to be better

The main evaluation set is gov_ja_v2: 2,000 lines from 30 white-paper PDFs (2024 editions) from five public sources, 931 of which contain digits. The sources are the Cabinet Office white papers on the aging society and on persons with disabilities, the Ministry of the Environment, MEXT science and technology, and the MIC information and communications white paper.

CER is counted after NFKC normalization with whitespace removed. The 95% confidence intervals come from a paired cluster bootstrap over the 30 PDFs (B = 1000).

CER bars for three models v1 has a lower CER than the base, but the 95% CI of the difference [−0.0060, +0.0008] includes zero. Non-inferiority passed; superiority was not shown.

Model CER Digit F1 Digit hallucination rate (lines)
PaddleOCR-VL-1.6 (base) 0.0118 0.9956 0.0075
ThakiOCR-JA-v1 0.0094 0.9973 0.0009
Sibling B (not released) 0.0148 0.9908 0.0009

Digit F1 matches 1,463 runs of consecutive digits against the reference. The digit hallucination rate is the share of the 1,069 digit-free lines in which the model produced a digit. v1 scored 0.0009 here, lower than the base’s 0.0075.

The comparison hinges on the confidence interval of the difference. Against the base, the CER difference is −0.0024 [−0.0060, +0.0008] and the digit F1 difference is +0.0017 [−0.0025, +0.0068].

Non-inferiority passed on all three criteria: the CER upper bound is below +0.01, the digit F1 lower bound is above −0.02, and the hallucination-rate upper bound is below +0.01. But both intervals include zero, so we cannot say it is better than the base. Against sibling B, the CER difference is −0.0054 [−0.0110, −0.0016], which excludes zero.

The decision rules, margins, and bootstrap settings were registered before any number was computed and were not changed afterwards. Still, these are observations on a single evaluation set: five sources and 30 PDFs.

We fixed the reference labels before reading the numbers

The references came from the PDF text layer. The first pixel-level audit, which does not use any model output, found that 5.6% of lines did not match their cropped images. Most of the mismatches were table rules, shaded boxes, or characters from neighboring lines inside the image.

There were also footnote marks (※5, *23) visible in the image but missing from the text. Because the audit fell short of the pre-set threshold, the first evaluation was marked inconclusive.

The correction was rule-based and never looked at model names or predictions. It restored characters missing from a font’s ToUnicode map (2 lines), merged short footnote marks attached to the same line (27 lines), and erased vector decorations and neighboring-line pixels outside the line’s own glyphs (90 lines).

No line was dropped or replaced, and the 2,000 lines and source mix are unchanged. The audit pass rate rose from 0.944 to 0.979, above the 0.95 threshold.

We also measured how the correction affected scores. In CER terms it was −0.0002 for the base, −0.0017 for v1, and +0.0005 for sibling B, and every interval included zero. Digit F1 rose by about +0.003 for all three models and moved the same way for each, so the comparison did not change. Even so, this is an evaluation with corrected references, not an untouched independent test.

The aging-society white paper shows a 齢 to 齡 regression

Split by source, the results differ from source to source. On the MEXT source CER fell from 0.0188 to 0.0067, and on the MIC source it fell from 0.0157 to 0.0099 with an interval that excludes zero.

On the Cabinet Office aging-society white paper (433 lines), however, CER rose from 0.0042 for the base to 0.0100 for v1. The difference is +0.0058 [+0.0020, +0.0099], an interval that excludes zero, so this is a confirmed regression.

CER bars for the aging-society white paper source v1 raw output is worse than the base (Δ +0.0058, CI [+0.0020, +0.0099]). The modern_ja value was measured post hoc on the set that first exposed the substitution, so it is optimistic.

The regression is explained by a character substitution. In the aging-society white paper, the model wrote the variant 齡 for 37 of 42 occurrences of 齢. Across all sources that is 50 times, against 0 for the base. It also wrote the middle dot ・(U+30FB) as ·(U+00B7) (46 times, base 11).

NFKC normalization does not unify either pair. Sibling B shows the same pattern, so the cause is the fine-tuning, not the reference correction. The classical-book (古典籍) part of the training data contains many older glyph forms, which may be the cause, but we have not verified that.

The modern_ja normalization is a workaround for this regression, not a fix. Measured separately on the same set, v1 CER becomes 0.0075, a difference of −0.0043 [−0.0077, −0.0015] against the base. On the aging-society source it becomes 0.0035 (base 0.0042). These are not registered results, though.

Both mappings were chosen after seeing the errors on this set, so the numbers are optimistic and do not show that the regression goes away on other documents. Applying the same mapping to the base and sibling B outputs as well gives a base CER of 0.0115 and an overall difference of −0.0040 [−0.0073, −0.0013].

On the MIC source, CER improved but digit F1 dropped slightly, from 1.0000 to 0.9944.

Five things to know before using it

First, orientation. On a set of vertical lines with mixed orientation, feeding rotated vertical lines as is gave a CER of 0.176, while specifying rot_ccw90 gave 0.071. If your pipeline has no orientation information, an earlier step has to decide it and pass it in.

Second, it is for line images only. Page-level parsing, multi-column reading order, and full vertical-writing pages are not claimed.

Third, digits and symbols are not guaranteed. Digit F1 on this set is high at 0.9973 but not perfect, and on one source digits got slightly worse.

Fourth, it is not a multilingual model. Korean and English were not training targets. On a small Korean and English control line set, CER was already high for the base, and there was no difference large enough to claim this model is better. Do not use it for those two languages.

Fifth, do not read the in-distribution numbers as evidence of generalization. On NDL part 2 (1,500 lines) CER went from 0.1194 for the base to 0.0460, and on JSSODa test (400 lines) from 0.0495 to 0.0061. These look like large gains, but those sets share the training distribution, so they mean something different.

In Paxis document automation, keep the raw output next to the normalized one

When you automate document work with Paxis, OCR is the first step that fills in values. Because this is a 0.9B line OCR model, it is worth considering a setup that processes Japanese documents inside the customer environment. Throughput is not in the model card, so it has to be measured in that environment. When you put this model in that slot, it is safest to keep its output format as designed, with raw_text and text separated.

Keep raw_text as the audit record and use the modern_ja text for search or field extraction. That way the record shows where 齡 was turned into 齢, and cases where the variant is correct, such as proper nouns, can be reverted. The orientation step and the line-cropping step should also sit explicitly in the same flow.

Closing

ThakiOCR-JA-v1 reached CER 0.0094 on 2,000 Japanese government white-paper lines and was non-inferior to the base at 0.0118. Superiority was not shown, and the aging-society white paper confirmed a regression in which 齢 is written as 齡. That is why this model is a research preview: the “v1” in the name marks the first research release, not a guarantee of production quality.

To try it yourself, cut a few hundred horizontal lines from your own documents and run them side by side with the base. Save both the raw_text and the modern_ja results, and start by counting the 齡/齢 and ·/・ differences. That tells you right away whether this regression shows up in your documents.

Sources and data

  • Model: ThakiCloud/ThakiOCR-JA-v1 (Apache-2.0, research preview). Every number in this post comes from this repository’s model cards (README.md, MODEL_CARD.ko.md).
  • Base model: PaddlePaddle/PaddleOCR-VL-1.6 @ 132c45f5.
  • Training data: NDL 古典籍 OCR dataset part 1 (National Diet Library of Japan, Public Domain Mark) and JSSODa (llm-jp/JSSODa, CC BY 4.0, arXiv:2511.15059).
  • The model repository contains no datasets, PDFs, or cropped evaluation images. The figures in this post show only numbers and format examples.
  • Previous post: ThakiOCR G2M: Can a Line OCR Grow to Japanese and Chinese?

Share this article:

Tags: japanese, lora, ocr, paddleocr-vl, research-preview, thakiocr

Categories:

Updated: