Fast, accurate OCR with correctness assessment.
docs: point OCR API links at the official cloud docs
hezhihui4371c57300b9
diff --git a/README.md b/README.mdindex b6283fe..d5951f9 100644--- a/README.md+++ b/README.md@@ -161,7 +161,7 @@ If you have already cloned this repository, you can use `./docs/SKILL_en.md` andUse the Free API to access MiniCPM-OCR 1.0 recognition and MiniCPM-OCR Jev quality scoring.-[MiniCPM-OCR 1.0 API example](./docs/minicpm_ocr_api_en.md)  ·  [MiniCPM-OCR Jev API example](./docs/minicpm_ocr_jev_api_en.md)+[MiniCPM-OCR 1.0 API docs](https://platform.modelbest.ai/console/docs/api/document-parse)  ·  [MiniCPM-OCR Jev API example](./docs/minicpm_ocr_jev_api_en.md)<a id="手动部署"></a>diff --git a/README_zh.md b/README_zh.mdindex ed54d4f..7465122 100644--- a/README_zh.md+++ b/README_zh.md@@ -159,7 +159,7 @@ Read and execute https://github.com/OpenBMB/MiniCPM-OCR/blob/main/docs/SKILL_jev通过免费API接入 MiniCPM-OCR 1.0 的识别能力和 MiniCPM-OCR Jev 的质量判别能力。-[MiniCPM-OCR 1.0 调用示例](./docs/minicpm_ocr_api_zh.md)  ·  [MiniCPM-OCR Jev 调用示例](./docs/minicpm_ocr_jev_api_zh.md)+[MiniCPM-OCR 1.0 API 文档](https://platform.modelbest.cn/console/docs/api/document-parse)  ·  [MiniCPM-OCR Jev 调用示例](./docs/minicpm_ocr_jev_api_zh.md)<a id="手动部署"></a>diff --git a/docs/minicpm_ocr_1dot0_en.md b/docs/minicpm_ocr_1dot0_en.mdindex e7a18b1..20ce13e 100644--- a/docs/minicpm_ocr_1dot0_en.md+++ b/docs/minicpm_ocr_1dot0_en.md@@ -11,7 +11,7 @@- 🏆 **SOTA document parsing**: MiniCPM-OCR 1.0 achieves a **SOTA score of 93.68 on Real5-OmniDocBench**, a benchmark for real-world document parsing, and demonstrates leading parsing capabilities on OmniDocBench v1.6, Wild-OmniDocBench, and olmOCR-Bench. It supports Chinese and English documents and PDFs, handling both standard documents and challenging capture conditions, including scans, curved pages, photographs, skewed pages, and recaptured documents.- ⚡ **Efficient inference.** With DSpark decoding acceleration ([**DSpark-BF16**](https://huggingface.co/openbmb/MiniCPM-OCR-1.0-DSpark), [**DSpark-GGUF**](https://huggingface.co/openbmb/MiniCPM-OCR-1.0-DSpark-gguf)), MiniCPM-OCR 1.0 improves **end-to-end processing efficiency by 55%**. Its throughput is approximately **1.49×** that of PaddleOCR-VL-1.6 and **3.62×** that of MinerU2.5 Pro, reducing the time needed for large-scale document parsing.- 🔍 **General recognition and information extraction**: MiniCPM-OCR 1.0 achieves a **SOTA score of 54.7 on OCRBench v2**, demonstrating strong general OCR capabilities. It **also supports key information extraction (KIE)**, extracting relevant document content for downstream information management and automated processing.-- 🛠️ **Easy deployment and development**: MiniCPM-OCR 1.0 supports **vLLM, SGLang, llama.cpp, and Ollama from day one**, with multiple chip platforms and quantized versions available at release. It **supports further fine-tuning** and provides a **[pip SDK](https://pypi.org/project/minicpm-ocr/)** and a **[full-featured API](./minicpm_ocr_api_en.md)** for application integration and customization. You can also **[get started quickly with SKILL.md](./SKILL_en.md)**. Try the Online Demo ([CN](https://platform.modelbest.cn/console/playground/document-parse) / [Global](https://platform.modelbest.ai/console/playground/document-parse)) to explore parsing results.+- 🛠️ **Easy deployment and development**: MiniCPM-OCR 1.0 supports **vLLM, SGLang, llama.cpp, and Ollama from day one**, with multiple chip platforms and quantized versions available at release. It **supports further fine-tuning** and provides a **[pip SDK](https://pypi.org/project/minicpm-ocr/)** and a **[full-featured API](https://platform.modelbest.ai/console/docs/api/document-parse)** for application integration and customization. You can also **[get started quickly with SKILL.md](./SKILL_en.md)**. Try the Online Demo ([CN](https://platform.modelbest.cn/console/playground/document-parse) / [Global](https://platform.modelbest.ai/console/playground/document-parse)) to explore parsing results.## Usage@@ -27,7 +27,7 @@ If you have already cloned this repository, you can use `./docs/SKILL_en.md` dir### Free API-Use the Free API to access MiniCPM-OCR 1.0 recognition. See the [API example](./minicpm_ocr_api_en.md).+Use the Free API to access MiniCPM-OCR 1.0 recognition. See the [API docs](https://platform.modelbest.ai/console/docs/api/document-parse).### Local Deploymentdiff --git a/docs/minicpm_ocr_1dot0_zh.md b/docs/minicpm_ocr_1dot0_zh.mdindex fac392e..2a032a1 100644--- a/docs/minicpm_ocr_1dot0_zh.md+++ b/docs/minicpm_ocr_1dot0_zh.md@@ -11,7 +11,7 @@- 🏆 **SOTA 的文档解析能力**:MiniCPM-OCR 1.0 在真实场景文档解析评测 **Real5-OmniDocBench 上取得 93.68 的 SOTA 成绩**,并在 OmniDocBench v1.6、Wild-OmniDocBench 和 olmOCR-Bench 等评测中展现领先的解析能力。模型支持中英双语文档与 PDF 解析,兼顾标准文档和复杂采集条件,在扫描、弯曲、拍照、倾斜及翻拍等场景下保持稳定表现。- ⚡ **高效推理。** 基于 DSpark 解码加速([**DSpark-BF16**](https://huggingface.co/openbmb/MiniCPM-OCR-1.0-DSpark)、[**DSpark-GGUF**](https://huggingface.co/openbmb/MiniCPM-OCR-1.0-DSpark-gguf)),MiniCPM-OCR 1.0 的**端到端处理效率提升 55%**。其处理吞吐量约为 PaddleOCR-VL-1.6 的 **1.49 倍**、MinerU2.5 Pro 的 **3.62 倍**,降低大规模文档解析的时间开销。- 🔍 **通用识别与信息抽取**:MiniCPM-OCR 1.0 在 **OCRBench v2 上取得 54.7 的 SOTA** 成绩,具备扎实的通用 OCR 能力;**同时支持关键信息抽取(KIE)**,可根据业务需求提取文档中的关键内容,支持后续信息整理与自动化处理。-- 🛠️ **部署与开发友好**:MiniCPM-OCR 1.0 首日**适配 vLLM、SGLang、llama.cpp 和 Ollama**,同步提供多芯片适配与多种量化版本。模型**支持二次微调**,提供 **[pip SDK](https://pypi.org/project/minicpm-ocr/)** 和 **[功能完备的 API](./minicpm_ocr_api_zh.md)**,方便应用集成与定制开发,也可 **[通过 SKILL.md 快速上手](./SKILL.md)**;同时提供在线体验([国内](https://platform.modelbest.cn/console/playground/document-parse) / [海外](https://platform.modelbest.ai/console/playground/document-parse)),方便用户查看解析效果。+- 🛠️ **部署与开发友好**:MiniCPM-OCR 1.0 首日**适配 vLLM、SGLang、llama.cpp 和 Ollama**,同步提供多芯片适配与多种量化版本。模型**支持二次微调**,提供 **[pip SDK](https://pypi.org/project/minicpm-ocr/)** 和 **[功能完备的 API](https://platform.modelbest.cn/console/docs/api/document-parse)**,方便应用集成与定制开发,也可 **[通过 SKILL.md 快速上手](./SKILL.md)**;同时提供在线体验([国内](https://platform.modelbest.cn/console/playground/document-parse) / [海外](https://platform.modelbest.ai/console/playground/document-parse)),方便用户查看解析效果。## 使用方式@@ -27,7 +27,7 @@ Read and execute https://github.com/OpenBMB/MiniCPM-OCR/blob/main/docs/SKILL.md### 免费 API-通过免费 API 接入 MiniCPM-OCR 1.0 的识别能力,见 [API 调用示例](./minicpm_ocr_api_zh.md)。+通过免费 API 接入 MiniCPM-OCR 1.0 的识别能力,见 [API 文档](https://platform.modelbest.cn/console/docs/api/document-parse)。### 本地部署diff --git a/docs/minicpm_ocr_api_en.md b/docs/minicpm_ocr_api_en.mddeleted file mode 100644index e33eec2..0000000--- a/docs/minicpm_ocr_api_en.md+++ /dev/null@@ -1,89 +0,0 @@-# MiniCPM-OCR 1.0 API Calls--[← Back to README](../README.md#api) · [中文](./minicpm_ocr_api_zh.md) · [MiniCPM-OCR Jev API calls](./minicpm_ocr_jev_api_en.md)--Use the OpenAI-compatible Chat Completions API to send an image and a recognition prompt to an enabled MiniCPM-OCR 1.0 service, then read the recognized content from the response. You only need the service URL, API key, and model name; no model download or inference environment setup is required.--## Endpoint and Authentication--| Setting | Description |-| :--- | :--- |-| `OCR_BASE_URL` | API base URL supplied by the service, including `/v1` but excluding `/chat/completions` |-| `OCR_API_KEY` | API key with OCR service access, sent as `Authorization: Bearer <API_KEY>` |-| `OCR_MODEL` | OCR model ID supplied by the service; it must match the server's model name |--**The official hosted OCR endpoint, access signup page, and model ID are still to be added.** These examples follow the repository's existing OpenAI-compatible recognition interface. Replace all placeholders with the configuration provided by your service before use.--```bash-export OCR_BASE_URL="<API base URL supplied by the service, including /v1>"-export OCR_API_KEY="<your API key>"-export OCR_MODEL="<OCR model ID supplied by the service>"-```--Recognition requests use `POST ${OCR_BASE_URL}/chat/completions` with a JSON body. First, check which models the key can access:--```bash-curl -fsS "${OCR_BASE_URL%/}/models" \- -H "Authorization: Bearer ${OCR_API_KEY}"-```--Confirm that the returned `data` list contains an `id` matching `OCR_MODEL` before sending a recognition request.--## Python Example--Install the client and save the PNG image to recognize as `sample.png`:--```bash-pip install openai-```--```python-import base64-import os-from pathlib import Path--from openai import OpenAI--client = OpenAI(- api_key=os.environ["OCR_API_KEY"],- base_url=os.environ["OCR_BASE_URL"].rstrip("/"),-)-image_base64 = base64.b64encode(Path("sample.png").read_bytes()).decode("utf-8")--response = client.chat.completions.create(- model=os.environ["OCR_MODEL"],- messages=[- {- "role": "user",- "content": [- {- "type": "image_url",- "image_url": {"url": f"data:image/png;base64,{image_base64}"},- },- {"type": "text", "text": "Text Recognition:"},- ],- }- ],- temperature=0.01,- top_p=0.001,- max_tokens=2048,- stream=False,-)--print(response.choices[0].message.content)-print("finish_reason:", response.choices[0].finish_reason)-```--The recognized content is in `choices[0].message.content`. If `finish_reason` is `length`, the result may be truncated. Adjust `max_tokens` according to the context and output lengths supported by the service.--## Text, Tables, and Formulas--Replace the example's prompt according to the region type:--| Content | Prompt |-| :--- | :--- |-| Text | `Text Recognition:` |-| Table | `Table Recognition:` |-| Formula | `Formula Recognition:` |--This example recognizes a single image region; the raw table output format depends on the model service you use. For layout analysis, cropping, reading-order reconstruction, and Markdown export from a complete PDF or page, see the [SDK document parsing tutorial](./minicpm_ocr_tutorial_en.md#4-parse-documents). To score recognition quality, see the [MiniCPM-OCR Jev API guide](./minicpm_ocr_jev_api_en.md).diff --git a/docs/minicpm_ocr_api_zh.md b/docs/minicpm_ocr_api_zh.mddeleted file mode 100644index 2c89098..0000000--- a/docs/minicpm_ocr_api_zh.md+++ /dev/null@@ -1,89 +0,0 @@-# MiniCPM-OCR 1.0 API 调用--[← 返回首页](../README_zh.md#api) · [English](./minicpm_ocr_api_en.md) · [MiniCPM-OCR Jev API 调用](./minicpm_ocr_jev_api_zh.md)--通过 OpenAI 兼容的 Chat Completions 接口,将图片和识别提示词发送给已开通的 MiniCPM-OCR 1.0 服务,读取返回的识别结果。调用方只需准备服务地址、API Key 和模型名,无需下载模型或配置推理环境。--## 接口与鉴权--| 配置 | 说明 |-| :--- | :--- |-| `OCR_BASE_URL` | 服务提供的 API 基础地址,包含 `/v1`,不包含 `/chat/completions` |-| `OCR_API_KEY` | 已开通 OCR 服务的 API Key,通过 `Authorization: Bearer <API_KEY>` 发送 |-| `OCR_MODEL` | 服务提供的 OCR 模型 ID,需与服务端名称一致 |--**在线 OCR 服务的正式地址、开通入口和模型 ID 待补充。** 以下示例依据仓库现有的 OpenAI 兼容识别接口整理;使用前请将占位值替换为服务方提供的配置。--```bash-export OCR_BASE_URL="<服务提供的 API 基础地址,含 /v1>"-export OCR_API_KEY="<你的 API Key>"-export OCR_MODEL="<服务提供的 OCR 模型 ID>"-```--识别请求使用 `POST ${OCR_BASE_URL}/chat/completions`,请求体为 JSON。可先检查当前 Key 能访问的模型:--```bash-curl -fsS "${OCR_BASE_URL%/}/models" \- -H "Authorization: Bearer ${OCR_API_KEY}"-```--确认返回的 `data` 列表中包含 `OCR_MODEL` 对应的 `id`,再发送识别请求。--## Python 调用示例--安装客户端,将需要识别的 PNG 图片保存为 `sample.png`:--```bash-pip install openai-```--```python-import base64-import os-from pathlib import Path--from openai import OpenAI--client = OpenAI(- api_key=os.environ["OCR_API_KEY"],- base_url=os.environ["OCR_BASE_URL"].rstrip("/"),-)-image_base64 = base64.b64encode(Path("sample.png").read_bytes()).decode("utf-8")--response = client.chat.completions.create(- model=os.environ["OCR_MODEL"],- messages=[- {- "role": "user",- "content": [- {- "type": "image_url",- "image_url": {"url": f"data:image/png;base64,{image_base64}"},- },- {"type": "text", "text": "Text Recognition:"},- ],- }- ],- temperature=0.01,- top_p=0.001,- max_tokens=2048,- stream=False,-)--print(response.choices[0].message.content)-print("finish_reason:", response.choices[0].finish_reason)-```--识别内容位于 `choices[0].message.content`。如果 `finish_reason` 为 `length`,结果可能被截断,应结合服务允许的上下文和输出长度调整 `max_tokens`。--## 文本、表格与公式--按区域类型替换示例中的提示词:--| 识别内容 | 提示词 |-| :--- | :--- |-| 文本 | `Text Recognition:` |-| 表格 | `Table Recognition:` |-| 公式 | `Formula Recognition:` |--此示例用于单个图像块的识别;表格原始返回格式以所接入的模型服务为准。完整 PDF 或整页文档的版面分析、切块、阅读顺序恢复与 Markdown 导出,见 [SDK 文档解析教程](./minicpm_ocr_tutorial.md#4-解析文档)。识别结果的质量评分见 [MiniCPM-OCR Jev API 调用说明](./minicpm_ocr_jev_api_zh.md)。diff --git a/docs/minicpm_ocr_jev_api_en.md b/docs/minicpm_ocr_jev_api_en.mdindex 6ea4276..7434151 100644--- a/docs/minicpm_ocr_jev_api_en.md+++ b/docs/minicpm_ocr_jev_api_en.md@@ -1,6 +1,6 @@# MiniCPM-OCR Jev API Calls-[← Back to README](../README.md#api) · [中文](./minicpm_ocr_jev_api_zh.md) · [MiniCPM-OCR 1.0 API calls](./minicpm_ocr_api_en.md)+[← Back to README](../README.md#api) · [中文](./minicpm_ocr_jev_api_zh.md) · [MiniCPM-OCR 1.0 API docs](https://platform.modelbest.ai/console/docs/api/document-parse)Use the OpenAI-compatible Chat Completions API to assign a quality score from 0 to 1 to an existing OCR candidate, or to pick the highest-scoring candidate for one image region. The API does not recognize the image again and does not rewrite the text. You provide the service URL, API key, model name, original region image, and candidate text; the service renders the text.@@ -422,4 +422,4 @@ When the settings are not a JSON object:If only some items in a batch fail, retry just those items. Every retry is a new call and may add usage. Do not write the API key or the full image encoding into logs. See the platform docs for [error codes](https://platform.modelbest.cn/console/docs/errors) and [rate limits and retries](https://platform.modelbest.cn/console/docs/rate-limits).-This page describes the hosted Chat Completions API. The Docker image uses a different, flat request body; the two are not interchangeable. See the [Docker image API](./minicpm_ocr_jev_docker_api_en.md). To recognize a region before scoring it, see [MiniCPM-OCR 1.0 API calls](./minicpm_ocr_api_en.md).+This page describes the hosted Chat Completions API. The Docker image uses a different, flat request body; the two are not interchangeable. See the [Docker image API](./minicpm_ocr_jev_docker_api_en.md). To recognize a region before scoring it, see the [MiniCPM-OCR 1.0 API docs](https://platform.modelbest.ai/console/docs/api/document-parse).diff --git a/docs/minicpm_ocr_jev_api_zh.md b/docs/minicpm_ocr_jev_api_zh.mdindex b0029d6..28b6cce 100644--- a/docs/minicpm_ocr_jev_api_zh.md+++ b/docs/minicpm_ocr_jev_api_zh.md@@ -1,6 +1,6 @@# MiniCPM-OCR Jev API 调用-[← 返回首页](../README_zh.md#api) · [English](./minicpm_ocr_jev_api_en.md) · [MiniCPM-OCR 1.0 API 调用](./minicpm_ocr_api_zh.md)+[← 返回首页](../README_zh.md#api) · [English](./minicpm_ocr_jev_api_en.md) · [MiniCPM-OCR 1.0 API 文档](https://platform.modelbest.cn/console/docs/api/document-parse)通过 OpenAI 兼容的 Chat Completions 接口,对已有 OCR 候选结果给出 0–1 质量分,或从同一图像块的多个候选中选出分数最高的一条。接口不重新识别,也不改写文本。调用方准备服务地址、API Key、模型名、区域原图和候选文本即可;文本渲染图由服务端生成。@@ -422,4 +422,4 @@ HTTP 200 表示请求已处理。条目状态在 `verdict` 或 `verdicts` 里,批量请求只有部分条目失败时,只重试失败条目。每次重试都是新的调用,可能产生额外用量。不要在日志里记录 API Key 或完整图片编码。更多说明见 [错误码](https://platform.modelbest.cn/console/docs/errors) 和 [限速与重试](https://platform.modelbest.cn/console/docs/rate-limits)。-本页描述云端 Chat Completions 接口。Docker 镜像使用另一套扁平请求体,两者不能互换,见 [Docker 镜像 API](./minicpm_ocr_jev_docker_api_zh.md)。先识别再评分时,见 [MiniCPM-OCR 1.0 API 调用](./minicpm_ocr_api_zh.md)。+本页描述云端 Chat Completions 接口。Docker 镜像使用另一套扁平请求体,两者不能互换,见 [Docker 镜像 API](./minicpm_ocr_jev_docker_api_zh.md)。先识别再评分时,见 [MiniCPM-OCR 1.0 API 文档](https://platform.modelbest.cn/console/docs/api/document-parse)。diff --git a/sdk/README.pypi.md b/sdk/README.pypi.mdindex f352fe7..52358ba 100644--- a/sdk/README.pypi.md+++ b/sdk/README.pypi.md@@ -157,7 +157,7 @@ If you have already cloned this repository, you can use `./docs/SKILL_en.md` andUse the Free API to access MiniCPM-OCR 1.0 recognition and MiniCPM-OCR Jev quality scoring.-[MiniCPM-OCR 1.0 API example](https://github.com/OpenBMB/MiniCPM-OCR/blob/main/docs/minicpm_ocr_api_en.md)  ·  [MiniCPM-OCR Jev API example](https://github.com/OpenBMB/MiniCPM-OCR/blob/main/docs/minicpm_ocr_jev_api_en.md)+[MiniCPM-OCR 1.0 API docs](https://platform.modelbest.ai/console/docs/api/document-parse)  ·  [MiniCPM-OCR Jev API example](https://github.com/OpenBMB/MiniCPM-OCR/blob/main/docs/minicpm_ocr_jev_api_en.md)<a id="手动部署"></a>