# OCR 專題

**URL:** <https://forum.rdfzer.com/t/ocr/11976>\
**Category:** 卮言\
**Created:** [2026 年3 月 18 日 01:57 UTC](https://forum.rdfzer.com/t/ocr/11976 "2026-03-18T01:57:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

作者： ![suen](https://forum.rdfzer.com/user_avatar/forum.rdfzer.com/suen/32/2665_2.png) [@suen](https://forum.rdfzer.com/u/suen)\
发布日期： [2026 年3 月 18 日 01:57 UTC](https://forum.rdfzer.com/t/ocr/11976/1 "2026-03-18T01:57:28Z")

</div>

> **[GitHub - zai-org/GLM-OCR: GLM-OCR: Accurate × Fast × Comprehensive](https://github.com/zai-org/GLM-OCR)**
>
> GLM-OCR: Accurate × Fast × Comprehensive

 ![Screenshot 2026-03-17 at 18.56.19](https://files.rdfzer.com/original/3X/7/8/78d5f020965df1c3b477cf5f18f69715750ac9d3.jpeg)

### 輸出格式相容性

**MinerU content\_list.json:**

json

```plaintext
[{"type": "text", "text": "...", "page_idx": 0, "bbox": [x1,y1,x2,y2], "text_level": 1, "table_body": "<html>...", "table_caption": ["..."]}]

```

**GLM-OCR output:**

json

```plaintext
[[{"index": 0, "label": "text", "content": "...", "bbox_2d": null}]]

```

**差距:**

1. 結構不同: GLM-OCR 嵌套 page array vs MinerU 平面 + page\_idx
2. 字段命名不同: label/content vs type/text
3. 類型映射: “formula” → “equation”
4. **缺失 metadata** : text\_level, table\_caption, table\_footnote, image\_caption — GLM-OCR 無對應字段
5. **表格格式** : GLM-OCR 輸出 markdown, MinerU 輸出 HTML — 需額外轉換
6. **圖片路徑** : GLM-OCR `imgs/` vs MinerU `images/` — 需映射

### GLM-OCR 已知問題 (GitHub Issues)

- **表格品質差** (#123, #89, #96): fine-tuning 後反而更差
- **結果不一致** (#128): 同一文件多次跑產生不同結果
- **輸出格式控制弱** (#125): 難以強制一致的字段格式

### 遷移所需工作量

若決定遷移:

1. **Transformer 模塊** (~300 行): GLM-OCR 嵌套輸出 → MinerU content\_list 格式
2. **表格 HTML 生成** : Markdown pipe → `<table>` HTML (含 rowspan/colspan 重建)
3. **全量重跑** : 117 本教材 (~23 小時 GPU 時間)
4. **page\_offset 重新校準** : GLM-OCR 的頁碼 OCR 可能不同
5. **Pipeline 基建** : 隊列管理 / 重試 / 監控 (GLM-OCR 無內建)
6. **回歸測試** : 確保搜索品質不下降

**預估工期: 2-3 天開發 + 1 天全量重跑 + 1 天驗證 = 約 1 週**

### 結論與建議

**建議: 暫不遷移。** 理由:

1. **投入產出比不划算** : 當前 pipeline 已穩定運行 117 本教材，遷移需 ~1 週且有回歸風險
2. **GLM-OCR 表格弱** : 教材含大量表格，而 GLM-OCR 表格識別是已知弱項
3. **結果不一致** : 教材 OCR 需要確定性輸出，GLM-OCR 的 Issue #128 是硬傷
4. **Metadata 缺失** : 失去 caption/footnote 等結構化信息
5. **Pipeline 基建缺失** : 需要自建隊列/重試/監控

**可以考慮的場景:**

- **公式密集的數學/物理教材** : 若 MinerU 公式 OCR 明顯不足，可對特定書本用 GLM-OCR 補充
- **未來新增教材** : 當 GLM-OCR 修復表格和一致性問題後 (\>= v2.0?)，作為備選方案
- **混合模式** : 用 GLM-OCR 的 MaaS API 做二次校驗 (成本低，不需全量替換)

---

<div class="post-metadata">

作者： ![suen](https://forum.rdfzer.com/user_avatar/forum.rdfzer.com/suen/32/2665_2.png) [@suen](https://forum.rdfzer.com/u/suen)\
发布日期： [2026 年3 月 18 日 21:11 UTC](https://forum.rdfzer.com/t/ocr/11976/2 "2026-03-18T21:11:57Z")

</div>

> **[baidu/Qianfan-OCR · Hugging Face](https://huggingface.co/baidu/Qianfan-OCR)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> **[GitHub - datalab-to/chandra: OCR model that handles complex tables, forms,...](https://github.com/datalab-to/chandra)**
>
> OCR model that handles complex tables, forms, handwriting with full layout.

---

<div class="post-metadata">

作者： ![WindWhisper](https://forum.rdfzer.com/user_avatar/forum.rdfzer.com/windwhisper/32/39934_2.png) [@WindWhisper](https://forum.rdfzer.com/u/WindWhisper)\
发布日期： [2026 年3 月 18 日 21:13 UTC](https://forum.rdfzer.com/t/ocr/11976/3 "2026-03-18T21:13:02Z")

</div>

suen 这分析够细的，表格弱和结果不一致确实劝退。现有 pipeline 稳定运行就别折腾了，等 GLM-OCR 修得差不多了再说😄

---

<div class="post-metadata">

作者： ![suen](https://forum.rdfzer.com/user_avatar/forum.rdfzer.com/suen/32/2665_2.png) [@suen](https://forum.rdfzer.com/u/suen)\
发布日期： [2026 年3 月 19 日 13:48 UTC](https://forum.rdfzer.com/t/ocr/11976/4 "2026-03-19T13:48:17Z")

</div>

![Screenshot 2026-03-19 at 06.47.27](https://files.rdfzer.com/original/3X/8/9/895cd2e27c28427e6708bb4adce20a75a507d0eb.jpeg)  
不可用，誰需要拿走測試著玩吧。
