> For the complete documentation index, see [llms.txt](https://docs.cherryai.com.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cherryai.com.cn/docs/zhong-wen-fan-ti/knowledge-base/document-preprocessing.md).

# 文檔預處理

知識庫文件預處理用嚟喺向量化前對 PDF / 圖片等非文字內容做 OCR 同結構解析，等知識庫可以正確檢索到呢啲資料。

### 配置 OCR 服務商

打開 `設定 → 文件處理`，依次配置：

* **系統 OCR**：macOS 用戶開箱即用（無需配置）；Windows 需手動選擇 OCR 引擎
* **文件處理服務商**：預設 `MinerU`，可填寫 `API Key` + `API Host`（預設 `https://mineru.net`）；亦可切換為 Tesseract / Paddle OCR / OpenVINO / 第三方 Provider

<figure><img src="/files/3bbdf3713d7f858e6786325856968743f3820b0d" alt=""><figcaption></figcaption></figure>

撳「獲取 API KEY」後會喺瀏覽器打開申請地址，撳「立即申請」填寫表單後攞到 API KEY，然後將佢填入 API KEY 欄位。

<figure><img src="/files/24c080abfed80363793e87cde495d991e8a006f5" alt=""><figcaption></figcaption></figure>

### 喺知識庫中啟用文件預處理

<figure><img src="/files/4c28e2e87977fbc6ad7cdede3766f0ff68e22e55" alt=""><figcaption></figcaption></figure>

喺已建立嘅知識庫設定中打開 **文件預處理** 開關，就可以喺新增文件時自動使用上一步配置嘅 OCR Provider。

### 上傳文件

<figure><img src="/files/38aa796403014131abdf5595978344748f397b1f" alt=""><figcaption></figcaption></figure>

> 可以透過右上角搜尋對知識庫結果進行檢查

### 喺對話中使用

<figure><img src="/files/4678cfdc68aa168d841cc7e10fc71dbe8dfe60fa" alt=""><figcaption></figcaption></figure>

> 知識庫使用 Tips：使用**能力較強**嘅模型時，可以將知識庫搜尋模式改做意圖識別；意圖識別可以更準確、更加廣泛咁描述你嘅問題。

### 開啟知識庫意圖識別

<figure><img src="/files/d847195844d49fea78baf7c3e8c5517a9ac32cb6" alt=""><figcaption></figcaption></figure>

***

### 💡 獲取幫助同提交反饋

如果您喺配置或使用過程中遇到任何疑問、Bug 或有功能改進建議，請參考 [反饋同建議](/docs/zhong-wen-fan-ti/question-contact/suggestions.md) 入面提供嘅官方渠道。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cherryai.com.cn/docs/zhong-wen-fan-ti/knowledge-base/document-preprocessing.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
