Tristan Manchester

Mistral PDF OCR

办公效率v1.0.0
作者:Tristan Manchester更新于 2026-05-11extracting-mistral-ocr@clawhub_tristanmanchester/extracting-mistral-ocr
PDF 处理#OCR#Document#PDF

据 AlphaMoat 统计,截至 2026-09,Mistral PDF OCR 累计下载 1,333 次、获 0 个星标,在全部 5,078 个 AI 技能中排名第 4,875 位,在「办公效率」分类(435 个)中排名第 405 位。

累计安装
159
累计下载
1,333
星标
-
全站排名
#4,875
全站前 97% · 「办公效率」前 94%
平台累计安装累计下载星标评论
ClawHub ↗331,202--
SkillHub ↗1591,333-—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

可处理扫描件、转换为 Markdown 或提取结构化字段。文档会发送到 Mistral,输出应放在受控目录;异常响应可能写出目标目录,且应固定 mistralai 版本。 需要 Python、MISTRAL_API_KEY 和经审核固定版本的 SDK。输出文件名范围约束修复并验证前不写产物,仅选择目录不能消除问题;不确定字段用 null,核实提取质量。

资料发布于 2026-10-27

可以用来做什么

  • OCR 扫描 PDF
  • 转换为 Markdown 或结构化结果

什么时候用

  • 文档获准发送且输出路径已检查时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

先检查文档发送授权和输出越界修复,两者通过后再提取表格到批准目录。

月度数据趋势

累计下载1,333
5589741,3902026-03 · 累计下载 6152026-05 · 累计下载 8012026-06 · 累计下载 8772026-07 · 累计下载 1,0322026-08 · 累计下载 1,1292026-09 · 累计下载 1,33326-0326-09
星标-
0112026-03 · 星标 -2026-05 · 星标 -2026-06 · 星标 -2026-07 · 星标 -2026-08 · 星标 -2026-09 · 星标 -26-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-091,333—-
2026-081,129+9.4%-
2026-071,032+17.7%-
2026-06877+9.5%-
2026-05801—-
2026-03615—-

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

3.1 KB · ClawHub v1.0.0
---
name: extracting-mistral-ocr
description: >-
  Extracts text, tables, and images from PDFs (including scanned PDFs) using the Mistral OCR API.
  Use when user asks to OCR a PDF/image, extract text from a PDF, parse a scanned document,
  convert a PDF to Markdown, or extract structured fields from a document.
compatibility: >-
  Requires network access and a MISTRAL_API_KEY environment variable. Expects Python 3.9+ and the mistralai package.
allowed-tools: "Read,Write,Bash(python:*)"
metadata:
展开全部(共 80 行)
  author: generated-by-chatgpt
  version: 0.1.0
  api: mistral
  default-model: mistral-ocr-latest
---

# Mistral OCR PDF extraction

## Quick start (default)

Run the bundled script to OCR a local PDF and write Markdown + JSON outputs:

```bash
python {baseDir}/scripts/mistral_ocr_extract.py --input path/to/file.pdf --out out/ocr
```

Output directory layout:

- `combined.md` (all pages concatenated)
- `pages/page-000.md` (per-page markdown)
- `raw_response.json` (full OCR response)
- `images/` (decoded embedded images, if requested)
- `tables/` (separate tables, if requested)

## Workflow

1. **Pick input mode**
   - **Local PDF** (most common): upload via Files API, then OCR via `file_id`.
   - **Public URL**: OCR directly via `document_url`.

2. **Choose output fidelity** (defaults are safe for RAG)
   - Keep `table_format=inline` unless the user explicitly wants tables split out.
   - Set `--include-image-base64` when the user needs figures/diagrams extracted.
   - Use `--extract-header/--extract-footer` if header/footer noise hurts downstream search.

3. **Run OCR**
   - Use `scripts/mistral_ocr_extract.py` to produce a deterministic on-disk artefact set.

4. **(Optional) Structured extraction from the whole document**
   - If the user wants fields (invoice totals, contract parties, etc.), provide an annotation prompt.
   - The OCR API can return a document-level `document_annotation` in addition to page markdown.

   Example:

   ```bash
   python {baseDir}/scripts/mistral_ocr_extract.py \
     --input invoice.pdf \
     --out out/invoice \
     --annotation-prompt "Extract supplier_name, invoice_number, invoice_date (ISO-8601), currency, total_amount. Return JSON." \
     --annotation-format json_object
   ```

## Decision rules

- **If the PDF is local and not publicly accessible**, upload it (the script does this automatically).
- **If the PDF URL is private or requires authentication**, do not pass it as `document_url`; upload instead.
- **If output quality is critical**, prefer `table_format=html` for downstream parsing over brittle regex.

## Common failure modes

- **Missing `MISTRAL_API_KEY`**: set it in the environment before running.
- **URL OCR fails**: the URL likely is not publicly accessible; upload the file.
- **Large files**: upload supports large files, but very large PDFs may need page selection (`--pages`) or batch processing.

## References

- API + parameters: `references/mistral_ocr_api.md`
- Output mapping rules (placeholders to extracted images/tables): `references/output_mapping.md`
- Example annotation prompts for common document types: `references/annotation_prompts.md`

「办公效率」分类下的热门技能

Tristan Manchester 的其他技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。