Apify Store OCR Actors 的直排中日文 OCR 基準測試
Vertical Chinese and Japanese OCR: a benchmark of Apify Store OCR Actors
Domiq Data 對 Apify Store 四款 OCR 工具進行直排繁體中文基準測試,四款工具的 CER 為 83.2% 至 99.3%,作者的開源管線為 2.3%。
Most OCR tools can't read a vertical Chinese page
We ran four popular OCR tools from the Apify Store on scanned Traditional Chinese pages set in vertical columns. Their character error rates ran from 83% to 99%: the output was unusable. Tables fared little better, at 19% to 94%.
Vertical text (直書 in Chinese, 縦書き in Japanese) is still everywhere: Taiwanese and Hong Kong books and newspapers, Japanese novels, old legal and family records. Tables are everywhere too. Yet most OCR pipelines assume lines run left to right.
So we built a small benchmark with exact ground truth, measured the tools, and then built an open-source pipeline that gets 2.3% on the same vertical pages and 0.5% on the tables.
How the benchmark works
Every page is rendered from known text, so the ground truth is exact and nobody had to transcribe anything by hand.
- Text. Only sources that are public domain or not copyrightable: Taiwan and PRC statutes (laws are excluded from copyright in both), and Japanese works by Natsume Soseki, Mori Ogai, Akutagawa Ryunosuke and Higuchi Ichiyo first published before 1931. Table cells are synthetic.
- Layout. 16 A4 pages at 150 dpi: horizontal Traditional Chinese, Simplified Chinese and Japanese; vertical Traditional Chinese and Japanese (columns right to left); and Traditional Chinese tables with ruled cells. Several CJK fonts and sizes.
- "Scanning". Each page gets a small random rotation, blur, noise, uneven brightness and JPEG compression, like a cheap office scan.
- Metric. Character error rate (CER): edit distance between the output and the truth, divided by the length of the truth, after Unicode NFKC normalization and with all whitespace removed. Reading order counts: a page read in the wrong column order scores badly even if every character is right.
The pages, ground truth and scripts are on GitHub under CC0, so anyone can rerun the numbers: paulexi/cjk-ocr-benchmark.
Results
On the 10 Chinese pages, the open-source pipeline scores 0.6% CER; the four Store Actors score 25% to 87%.
| Category (Chinese pages) | Our pipeline | Best Store Actor | Worst Store Actor |
|---|---|---|---|
| Traditional Chinese, horizontal | 0.3% | 1.6% | 98.1% |
| Simplified Chinese, horizontal | 0.1% | 0.1% | 56.7% |
| Traditional Chinese, vertical | 2.3% | 83.2% | 99.3% |
| Traditional Chinese, tables | 0.5% | 19.3% | 93.7% |
| All 10 Chinese pages | 0.6% | 25.0% | 86.7% |
On ordinary horizontal Chinese, the best Store tools are about as good as ours. The gap is in vertical text and tables. For the tables, all three came back with the right number of rows and columns and 97% of cells exactly right.
Japanese. Our pipeline scores 1.9% on horizontal and 3.3% on vertical pages. Most of the remaining horizontal errors are old-form kanji (爲, 隱, 奧) read as their modern forms. We replaced the Japanese pages on 27 November 2026 so that every text is public domain in both Japan and the US. On the earlier Japanese set, the Store Actors scored 34% to 75% (horizontal) and 88% to 99% (vertical); we have not rerun them on the new set yet.
Google Lens. We also tried an Actor built on Google Lens on six pages. Lens is slightly better on ordinary horizontal text (0.2% vs 0.3% on a Traditional Chinese page) and read our earlier Japanese vertical page perfectly. It scored 37% on the Traditional Chinese vertical page (ours: 0.9%), returns no table structure, and sends your documents to Google.
Full per-tool tables: RESULTS.md.
Why vertical pages fail, and what fixed them
The recognisers themselves are mostly fine; direction and order are the problem. A horizontal-only pipeline treats each vertical column as a sideways line, or stitches columns together in the wrong order. Five things made the difference:
- Detect the orientation first. Run text detection only (RapidOCR with the PP-OCRv6 detector). If most detected regions are tall and narrow, the page is vertical. This costs well under a second and avoids recognising the page twice.
-
Use a model trained on vertical text. Horizontal pages go to the PP-OCRv6 recognizer. Vertical pages go to Tesseract's
jpn_vert,chi_tra_vertorchi_sim_vertmodels in single-block mode, which already read columns from right to left. - Detect the language cheaply. Kana make Japanese obvious. For Chinese, count characters that exist only in Traditional or only in Simplified script, using OpenCC's conversion tables. A model that reads both scripts sometimes returns a stray 项目 on a Traditional page; we convert only characters that cannot belong to the page's script, so 里 and 后, which are valid in both, are never touched.
- Rebuild reading order and tables from the boxes. Group boxes into lines after correcting for the page's tilt, then cluster cell positions into columns to emit CSV. Turning off the detector's dilation step kept adjacent table cells from merging into one box.
- Measure the box, not its bounding rectangle. Our own bug, found by the benchmark: on a page tilted by about 2°, the bounding rectangle of a full-width line is taller than the gap between lines, so two lines merged into one. Using the detected box's own height fixed it: that page went from 41% CER to 3%.
Everything runs on CPU: about 5 CPU-seconds per page, under 1 GB of memory.
Try it, or rerun the numbers
- Rerun the benchmark: pages, ground truth and scoring scripts are at paulexi/cjk-ocr-benchmark. Results for any other OCR engine are welcome as an issue or pull request.
- Use the pipeline without installing anything: it is packaged as CJK Document OCR — Vertical Text & Tables on the Apify Store. Give it image or PDF links; it returns text in reading order, the detected orientation and language, and tables as CSV. Files are processed inside the run and are not sent to any third-party OCR service. A ready-made example runs two of the benchmark's vertical pages.
Disclosure: we built and publish that Actor, and it charges per page ($6 per 1,000 pages; PDF pages that already contain text are free). The benchmark is independent of it: anyone can run any engine against the same pages.
來源:DEV Community · dev.to