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
累計下載
1333
星標
-
全站排名
#4,875
全站前 97% · 「辦公效率」前 94%
平台累計安裝累計下載星標評論
ClawHub ↗331202--
SkillHub ↗1591333-—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

可處理掃描件、轉換為 Markdown 或提取結構化欄位。文件會傳送到 Mistral,輸出應放在受控目錄;異常響應可能寫出目標目錄,且應固定 mistralai 版本。 需要 Python、MISTRAL_API_KEY 與經審核固定版本的 SDK。輸出檔名範圍限制修正並驗證前不寫入產物,僅選擇目錄不能消除問題;不確定欄位使用 null,查核擷取品質。

資料釋出於 2026-10-27

可以用來做什麼

  • OCR 掃描 PDF
  • 轉換為 Markdown 或結構化結果

什麼時候用

  • 文件獲准傳送且輸出路徑已檢查時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

先檢查文件傳送授權與輸出越界修正,兩者通過後再擷取表格至核准目錄。

月度資料趨勢

累計下載1333
55897413902026-03 · 累計下載 6152026-05 · 累計下載 8012026-06 · 累計下載 8772026-07 · 累計下載 10322026-08 · 累計下載 11292026-09 · 累計下載 133326-0326-09
星標-
0112026-03 · 星標 -2026-05 · 星標 -2026-06 · 星標 -2026-07 · 星標 -2026-08 · 星標 -2026-09 · 星標 -26-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-091333—-
2026-081129+9.4%-
2026-071032+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),按月更新。口徑說明見資料方法。