当前位置: 首页 > Skill >

mineru precision extract PDF、Document、Images

mineru precision extract PDF、Document、Images

0.2.1 2026.11.20 浏览:171
获取Skill文件查看使用说明
作者:周舟许可证:
本文目录展开

Precision Document Extraction with mineru-open-api

Full-featured document extraction with table/formula recognition, OCR, multi-format output, batch processing, and web crawling.

Why use extract?

  • Table recognition — accurately extracts tables from PDFs and images
  • Formula recognition — preserves mathematical formulas as LaTeX
  • Multi-format output — Markdown, HTML, LaTeX, DOCX, JSON
  • Model selection — choose vlm for highest accuracy or pipeline for zero-hallucination
  • Batch processing — process hundreds of files in one command
  • Web crawling — convert web pages to structured Markdown
  • All file formats — PDF, images, DOC, DOCX, PPT, PPTX, HTML
  • Higher limits — much larger file size and page count than quick mode
  • 80+ languages — full language coverage across all script families

Installation

npm install -g mineru-open-api

Or via Go (macOS/Linux):

go install github.com/opendatalab/MinerU-Ecosystem/cli/mineru-open-api@latest

Verify installation

mineru-open-api version

Authentication

Create a token at https://mineru.net/apiManage/token, then configure:

mineru-open-api auth                         # Interactive token setup
export MINERU_TOKEN="your-token"             # Or set via environment variable

Token resolution order: --token flag > MINERU_TOKEN env > ~/.mineru/config.yaml.

Quick start

mineru-open-api extract report.pdf                         # Markdown to stdout
mineru-open-api extract report.pdf -o ./out/               # Save to directory
mineru-open-api extract report.pdf -f md,html,docx -o ./   # Multi-format
mineru-open-api extract report.pdf --model vlm -o ./out/   # High-accuracy mode
mineru-open-api extract *.pdf -o ./results/                # Batch extract
mineru-open-api crawl https://example.com/article          # Web page → Markdown

Supported input formats

Format Supported
PDF (.pdf) Yes
Images (.png, .jpg, .jpeg, .jp2, .webp, .gif, .bmp) Yes
Word (.doc, .docx) Yes
PowerPoint (.ppt, .pptx) Yes
HTML (.html) Yes
URLs (remote files) Yes

Commands

extract — Precision extraction

mineru-open-api extract <file-or-url> [...] [flags]

Examples

mineru-open-api extract report.pdf                         # Markdown to stdout
mineru-open-api extract report.pdf -f html                 # HTML to stdout
mineru-open-api extract report.pdf -o ./out/               # Save to directory
mineru-open-api extract report.pdf -o ./out/ -f md,docx    # Multiple formats
mineru-open-api extract report.pdf -f latex -o ./out/      # LaTeX output
mineru-open-api extract report.pdf --model vlm -o ./out/   # High-accuracy mode
mineru-open-api extract report.pdf --ocr -o ./out/         # OCR for scanned docs
mineru-open-api extract report.pdf --language en -o ./out/ # Specify language
mineru-open-api extract report.pdf --pages "1-10" -o ./out/  # Page range
mineru-open-api extract *.pdf -o ./results/                # Batch extract
mineru-open-api extract --list files.txt -o ./results/     # Batch from file list
mineru-open-api extract https://example.com/doc.pdf        # Extract from URL
cat doc.pdf | mineru-open-api extract --stdin -o ./out/    # From stdin

extract flags

Flag Short Default Description
--output -o (stdout) Output path (file or directory)
--format -f md Output formats: md, json, html, latex, docx (comma-separated)
--model (auto) Model: vlm, pipeline, html (see below)
--ocr false Enable OCR for scanned documents
--formula true Enable/disable formula recognition
--table true Enable/disable table recognition
--language ch Document language
--pages (all) Page range, e.g. 1-10,15
--timeout 900/1800 Timeout in seconds (single/batch)
--list Read input list from file (one path per line)
--concurrency 0 Batch concurrency (0 = server default)

Model comparison: vlm vs pipeline

vlm pipeline
Parsing accuracy Higher — better at complex layouts, mixed content Standard
Hallucination risk May produce hallucinated text in rare cases No hallucination — biggest advantage
Best for Academic papers, complex tables, intricate layouts General documents where fidelity matters most

When the user values accuracy and the document has complex formatting, suggest --model vlm. When the user prioritizes reliability and no-hallucination guarantee, suggest --model pipeline (or omit --model to use auto).

crawl — Web page extraction

Fetch web pages and convert to structured Markdown.

mineru-open-api crawl https://example.com/article              # Markdown to stdout
mineru-open-api crawl https://example.com/article -f html      # HTML to stdout
mineru-open-api crawl https://example.com/article -o ./out/    # Save to file
mineru-open-api crawl url1 url2 -o ./pages/                    # Batch crawl
mineru-open-api crawl --list urls.txt -o ./pages/              # Batch from file list

crawl flags

Flag Short Default Description
--output -o (stdout) Output path
--format -f md Output formats: md, json, html (comma-separated)
--timeout 900/1800 Timeout in seconds (single/batch)
--list Read URL list from file (one per line)
--stdin-list false Read URL list from stdin
--concurrency 0 Batch concurrency

auth — Authentication management

mineru-open-api auth              # Interactive token setup
mineru-open-api auth --verify     # Verify current token is valid
mineru-open-api auth --show       # Show current token source and masked value

Supported --language values

Values are organized by script/language family — each value covers all languages in its group.

Standalone language packs

Value Included languages 说明
ch Chinese, English, Chinese Traditional 中英文(默认值)
ch_server Chinese, English, Chinese Traditional, Japanese 繁体、手写体
en English 纯英文
japan Chinese, English, Chinese Traditional, Japanese 日文为主
korean Korean, English 韩文
chinese_cht Chinese, English, Chinese Traditional, Japanese 繁体中文为主
ta Tamil, English 泰米尔文
te Telugu, English 泰卢固文
ka Kannada 卡纳达文
el Greek, English 希腊文
th Thai, English 泰文

Language family packs

Value Script/Family Included languages
latin Latin script (拉丁语系) French, German, Afrikaans, Italian, Spanish, Bosnian, Portuguese, Czech, Welsh, Danish, Estonian, Irish, Croatian, Uzbek, Hungarian, Serbian (Latin), Indonesian, Occitan, Icelandic, Lithuanian, Maori, Malay, Dutch, Norwegian, Polish, Slovak, Slovenian, Albanian, Swedish, Swahili, Tagalog, Turkish, Latin, Azerbaijani, Kurdish, Latvian, Maltese, Pali, Romanian, Vietnamese, Finnish, Basque, Galician, Luxembourgish, Romansh, Catalan, Quechua
arabic Arabic script (阿拉伯语系) Arabic, Persian, Uyghur, Urdu, Pashto, Kurdish, Sindhi, Balochi, English
cyrillic Cyrillic script (西里尔语系) Russian, Belarusian, Ukrainian, Serbian (Cyrillic), Bulgarian, Mongolian, Abkhazian, Adyghe, Kabardian, Avar, Dargin, Ingush, Chechen, Lak, Lezgin, Tabasaran, Kazakh, Kyrgyz, Tajik, Macedonian, Tatar, Chuvash, Bashkir, Malian, Moldovan, Udmurt, Komi, Ossetian, Buryat, Kalmyk, Tuvan, Sakha, Karakalpak, English
east_slavic East Slavic (东斯拉夫语系) Russian, Belarusian, Ukrainian, English
devanagari Devanagari script (天城文语系) Hindi, Marathi, Nepali, Bihari, Maithili, Angika, Bhojpuri, Magahi, Santali, Newari, Konkani, Sanskrit, Haryanvi, English

Global flags

Flag Short Description
--token API token (overrides env and config)
--base-url API base URL (for private deployments)
--verbose -v Verbose mode, print HTTP details

Output behavior

  • No -o flag: result goes to stdout; status/progress messages go to stderr
  • With -o flag: result saved to file/directory; progress messages on stderr
  • Batch mode (extract/crawl): requires -o to specify output directory
  • Binary formats (docx): cannot output to stdout, must use -o
  • Markdown output includes extracted images saved alongside the .md file

Agent guidelines

When using this skill on behalf of the user:

  • Quote file paths that contain spaces or special characters with double quotes. Example: mineru-open-api extract "report 01.pdf".
  • Don't run commands blindly on errors — explain the exit code and troubleshooting steps.
  • Installation questions ("mineru 怎么安装") should be answered with the install instructions above.
  • For stdout mode (no -o), only one text format can be output at a time. If the user wants multiple formats, suggest adding -o.
  • If the user hasn't authenticated yet, guide them to create a token at https://mineru.net/apiManage/token and run mineru-open-api auth.

Default output directory

When the user does NOT specify -o, generate a default output directory:

~/MinerU-Skill/<name>_<hash>/
  • <name>: derived from the source, then sanitized (replace spaces and shell-unsafe characters with _, collapse consecutive _).
    • For URLs: last path segment (e.g. https://arxiv.org/pdf/2509.22186 → 2509.22186)
    • For local files: filename without extension (e.g. report.pdf → report)
  • <hash>: first 6 characters of MD5 hash of the full original source.
echo -n "source" | md5sum | cut -c1-6   # Linux
echo -n "source" | md5 | cut -c1-6      # macOS

When the user specifies -o: use the user's path as-is.

Skill upgrade = CLI upgrade

When the user asks to upgrade this skill, re-install the CLI first:

npm install -g mineru-open-api@latest

Exit codes

Code Meaning Recovery
0 Success —
1 General API or unknown error Check network; retry; use --verbose
2 Invalid parameters / usage error Check command syntax and flag values
3 Authentication error Create or refresh token at https://mineru.net/apiManage/token, then run mineru-open-api auth
4 File too large or page limit exceeded Split the file or use --pages
5 Extraction failed Document may be corrupted; try a different --model
6 Timeout Increase with --timeout; large files may need 1600+ seconds

Troubleshooting

  • "no API token found": Run mineru-open-api auth or set MINERU_TOKEN env variable. Create token at https://mineru.net/apiManage/token.
  • Timeout on large files: Increase with --timeout 1600
  • Batch fails partially: Check stderr for per-file status; succeeded files are still saved
  • Binary format to stdout: Use -o flag; docx cannot stream to stdout
  • Private deployment: Use --base-url https://your-server.com/api
  • Extraction quality is poor: Try --model vlm for complex layouts, or --ocr for scanned documents
  • Tables not extracted correctly: Try --model vlm for better table recognition

Reporting Issues

  • Skill issues: Open an issue at https://github.com/opendatalab/MinerU-Ecosystem/tree/main/cli
  • CLI issues: Open an issue at https://github.com/MinerU-Extract/mineru-document-extractor

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,033
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,016
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,012
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,012
Skill 文件
  • SKILL.md
    • Precision Document Extraction with mineru-open-api
    • Why use extract?
    • Installation
      • Verify installation
    • Authentication
    • Quick start
    • Supported input formats
    • Commands
      • extract — Precision extraction
        • Examples
        • extract flags
        • Model comparison: vlm vs pipeline
      • crawl — Web page extraction
        • crawl flags
      • auth — Authentication management
    • Supported --language values
      • Standalone language packs
      • Language family packs
    • Global flags
    • Output behavior
    • Agent guidelines
      • Default output directory
      • Skill upgrade = CLI upgrade
    • Exit codes
    • Troubleshooting
    • Reporting Issues
  • 项目或源文件

相关 Skill

更多
file-to-pdf file-to-pdf 将各类文件批量转换为 PDF 格式。支持 Office 文档(Word/Excel/PowerPoint)、图片(JPG/PNG/BMP/GIF/WebP/TIFF)、HTML 网页、Markdown 文件和纯文本文件。当用户要求将文件转为 PDF、导出 PDF、把图片合并成 PDF、或批量转换文档格式时触发此技能。This skill should be used when users ask to convert files to PDF, export to PDF, merge images into a PDF, or batch convert documents to PDF format.
PDF 结构化抽取·带证据溯源 PDF 结构化抽取·带证据溯源 从图片型、扫描型、混合型或原生文本 PDF 中提取可审计的结构化字段,并把字段证据确定性映射回原始 PDF 页码、页标签、bbox、原文和证据截图。用于合同、报告、手册、表单、研究资料等需要自定义 JSON Schema 和逐字段溯源的 PDF 抽取任务;默认以 MinerU 为主解析器、Docling 为必装交叉复核器,PaddleOCR 为可选补充解析器。
自动从中间空白处切割A3试卷a3-pdf-splitter 自动从中间空白处切割A3试卷a3-pdf-splitter 智能A3试卷PDF切分工具,自动识别空白位置将A3试卷PDF转换为A4格式。适用场景:切分A3试卷、A3转A4、PDF切分、试卷打印、拆分试卷PDF。
PDF Utils PDF Utils PDF Utils 支持对图像型 PDF 进行 OCR 识别、从文本或 OCR 结果中提取 arXiv ID,以及合并、拆分、渲染等可脚本化的 PDF 处理任务。
PDF 智能阅读助手 Pro PDF 智能阅读助手 Pro PDF文档智能阅读助手 — 提取文本/表格/图片,OCR识别扫描件,结合LLM进行智能总结、关键信息提取、问答。支持加密PDF、大文件分页、批量处理、Markdown导出。轻量OCR优先,路径安全校验。