Fixed the impact on punctuation marks during full-width to half-width conversion of letters and numbers
Fixed caption matching inaccuracies in certain scenarios
Fixed formula span loss issues in certain scenarios
2025/02/24 1.2.0 released. This version includes several fixes and improvements to enhance parsing efficiency and accuracy:
Performance Optimization
Increased classification speed for PDF documents in auto mode.
Parsing Optimization
Improved parsing logic for documents containing watermarks, significantly enhancing the parsing results for such documents.
Enhanced the matching logic for multiple images/tables and captions within a single page, improving the accuracy of image-text matching in complex layouts.
Bug Fixes
Fixed an issue where image/table spans were incorrectly filled into text blocks under certain conditions.
Resolved an issue where title blocks were empty in some cases.
2025/01/22 1.1.0 released. In this version we have focused on improving parsing accuracy and efficiency:
Model capability upgrade (requires re-executing the model download process to obtain incremental updates of model files)
The layout recognition model has been upgraded to the latest doclayout_yolo(2501) model, improving layout recognition accuracy.
The formula parsing model has been upgraded to the latest unimernet(2501) model, improving formula recognition accuracy.
Performance optimization
On devices that meet certain configuration requirements (16GB+ VRAM), by optimizing resource usage and restructuring the processing pipeline, overall parsing speed has been increased by more than 50%.
Parsing effect optimization
Added a new heading classification feature (testing version, enabled by default) to the online demo(mineru.net/huggingface/modelscope), which supports hierarchical classification of headings, thereby enhancing document structuring.
2025/01/10 1.0.1 released. This is our first official release, where we have introduced a completely new API interface and enhanced compatibility through extensive refactoring, as well as a brand new automatic language identification feature:
New API Interface
For the data-side API, we have introduced the Dataset class, designed to provide a robust and flexible data processing framework. This framework currently supports a variety of document formats, including images (.jpg and .png), PDFs, Word documents (.doc and .docx), and PowerPoint presentations (.ppt and .pptx). It ensures effective support for data processing tasks ranging from simple to complex.
For the user-side API, we have meticulously designed the MinerU processing workflow as a series of composable Stages. Each Stage represents a specific processing step, allowing users to define new Stages according to their needs and creatively combine these stages to customize their data processing workflows.
Enhanced Compatibility
By optimizing the dependency environment and configuration items, we ensure stable and efficient operation on ARM architecture Linux systems.
We have deeply integrated with Huawei Ascend NPU acceleration, providing autonomous and controllable high-performance computing capabilities. This supports the localization and development of AI application platforms in China. Ascend NPU Acceleration
Automatic Language Identification
By introducing a new language recognition model, setting the lang configuration to auto during document parsing will automatically select the appropriate OCR language model, improving the accuracy of scanned document parsing.
2024/11/22 0.10.0 released. Introducing hybrid OCR text extraction capabilities,
Significantly improved parsing performance in complex text distribution scenarios such as dense formulas, irregular span regions, and text represented by images.
Combines the dual advantages of accurate content extraction and faster speed in text mode, and more precise span/line region recognition in OCR mode.
2024/11/15 0.9.3 released. Integrated RapidTable for table recognition, improving single-table parsing speed by more than 10 times, with higher accuracy and lower GPU memory usage.
2024/11/06 0.9.2 released. Integrated the StructTable-InternVL2-1B model for table recognition functionality.
2024/10/31 0.9.0 released. This is a major new version with extensive code refactoring, addressing numerous issues, improving performance, reducing hardware requirements, and enhancing usability:
Refactored the sorting module code to use layoutreader for reading order sorting, ensuring high accuracy in various layouts.
Refactored the paragraph concatenation module to achieve good results in cross-column, cross-page, cross-figure, and cross-table scenarios.
Refactored the list and table of contents recognition functions, significantly improving the accuracy of list blocks and table of contents blocks, as well as the parsing of corresponding text paragraphs.
Refactored the matching logic for figures, tables, and descriptive text, greatly enhancing the accuracy of matching captions and footnotes to figures and tables, and reducing the loss rate of descriptive text to near zero.
Added multi-language support for OCR, supporting detection and recognition of 84 languages.For the list of supported languages, see OCR Language Support List.
Added memory recycling logic and other memory optimization measures, significantly reducing memory usage. The memory requirement for enabling all acceleration features except table acceleration (layout/formula/OCR) has been reduced from 16GB to 8GB, and the memory requirement for enabling all acceleration features has been reduced from 24GB to 10GB.
Optimized configuration file feature switches, adding an independent formula detection switch to significantly improve speed and parsing results when formula detection is not needed.
Added the self-developed doclayout_yolo model, which speeds up processing by more than 10 times compared to the original solution while maintaining similar parsing effects, and can be freely switched with layoutlmv3 via the configuration file.
Upgraded formula parsing to unimernet 0.2.1, improving formula parsing accuracy while significantly reducing memory usage.
Due to the repository change for PDF-Extract-Kit 1.0, you need to re-download the model. Please refer to How to Download Models for detailed steps.
MinerU is a tool that converts PDFs into machine-readable formats (e.g., markdown, JSON), allowing for easy extraction into any format.
MinerU was born during the pre-training process of InternLM. We focus on solving symbol conversion issues in scientific literature and hope to contribute to technological development in the era of large models.
Compared to well-known commercial products, MinerU is still young. If you encounter any issues or if the results are not as expected, please submit an issue on issue and attach the relevant PDF.
Output text in human-readable order, suitable for single-column, multi-column, and complex layouts.
Preserve the structure of the original document, including headings, paragraphs, lists, etc.
Extract images, image descriptions, tables, table titles, and footnotes.
Automatically recognize and convert formulas in the document to LaTeX format.
Automatically recognize and convert tables in the document to HTML format.
Automatically detect scanned PDFs and garbled PDFs and enable OCR functionality.
OCR supports detection and recognition of 84 languages.
Supports multiple output formats, such as multimodal and NLP Markdown, JSON sorted by reading order, and rich intermediate formats.
Supports various visualization results, including layout visualization and span visualization, for efficient confirmation of output quality.
Supports running in a pure CPU environment, and also supports GPU(CUDA)/NPU(CANN)/MPS acceleration
Compatible with Windows, Linux, and Mac platforms.
Quick Start
If you encounter any installation issues, please first consult the FAQ.
If the parsing results are not as expected, refer to the Known Issues.
There are three different ways to experience MinerU:
[!WARNING]
Pre-installation Notice—Hardware and Software Environment Support
To ensure the stability and reliability of the project, we only optimize and test for specific hardware and software environments during development. This ensures that users deploying and running the project on recommended system configurations will get the best performance with the fewest compatibility issues.
By focusing resources on the mainline environment, our team can more efficiently resolve potential bugs and develop new features.
In non-mainline environments, due to the diversity of hardware and software configurations, as well as third-party dependency compatibility issues, we cannot guarantee 100% project availability. Therefore, for users who wish to use this project in non-recommended environments, we suggest carefully reading the documentation and FAQ first. Most issues already have corresponding solutions in the FAQ. We also encourage community feedback to help us gradually expand support.
Operating System
Linux after 2019
Windows 10 / 11
macOS 11+
CPU
x86_64 / arm64
x86_64(unsupported ARM Windows)
x86_64 / arm64
Memory Requirements
16GB or more, recommended 32GB+
Storage Requirements
20GB or more, with a preference for SSD
Python Version
3.10(Please make sure to create a Python 3.10 virtual environment using conda)
3. Modify the Configuration File for Additional Configuration
After completing the 2. Download model weight files step, the script will automatically generate a magic-pdf.json file in the user directory and configure the default model path.
You can find the magic-pdf.json file in your 【user directory】.
[!TIP]
The user directory for Windows is "C:\Users\username", for Linux it is "/home/username", and for macOS it is "/Users/username".
You can modify certain configurations in this file to enable or disable features, such as table recognition:
[!NOTE]
If the following items are not present in the JSON, please manually add the required items and remove the comment content (standard JSON does not support comments).
{// other config"layout-config":{"model":"doclayout_yolo"// Please change to "layoutlmv3" when using layoutlmv3.},"formula-config":{"mfd_model":"yolo_v8_mfd","mfr_model":"unimernet_small","enable":true// The formula recognition feature is enabled by default. If you need to disable it, please change the value here to "false".},"table-config":{"model":"rapid_table",// Default to using "rapid_table", can be switched to "tablemaster" or "struct_eqtable"."sub_model":"slanet_plus",// When the model is "rapid_table", you can choose a sub_model. The options are "slanet_plus" and "unitable""enable":true,// The table recognition feature is enabled by default. If you need to disable it, please change the value here to "false"."max_time":400}}
Using GPU
If your device supports CUDA and meets the GPU requirements of the mainline environment, you can use GPU acceleration. Please select the appropriate guide based on your system:
If your device uses Apple silicon chips, you can enable MPS acceleration for certain supported tasks (such as layout detection and formula detection).
You can enable MPS acceleration by setting the device-mode parameter to mps in the magic-pdf.json configuration file.
{// other config"device-mode":"mps"}
[!TIP]
Since the formula recognition task cannot utilize MPS acceleration, you can disable the formula recognition feature in tasks where it is not needed to achieve optimal performance.
You can disable the formula recognition feature by setting the enable parameter in the formula-config section to false.
Derived projects include secondary development projects based on MinerU by project developers and community developers,
such as application interfaces based on Gradio, RAG based on llama, web demos similar to the official website, lightweight multi-GPU load balancing client/server ends, etc.
These projects may offer more features and a better user experience.
For specific deployment methods, please refer to the Derived Project README
Reading order is determined by the model based on the spatial distribution of readable content, and may be out of order in some areas under extremely complex layouts.
Vertical text is not supported.
Tables of contents and lists are recognized through rules, and some uncommon list formats may not be recognized.
Code blocks are not yet supported in the layout model.
Comic books, art albums, primary school textbooks, and exercises cannot be parsed well.
Table recognition may result in row/column recognition errors in complex tables.
OCR recognition may produce inaccurate characters in PDFs of lesser-known languages (e.g., diacritical marks in Latin script, easily confused characters in Arabic script).
Some formulas may not render correctly in Markdown.
This project currently uses PyMuPDF to achieve advanced functionality. However, since it adheres to the AGPL license, it may impose restrictions on certain usage scenarios. In future iterations, we plan to explore and replace it with a more permissive PDF processing library to enhance user-friendliness and flexibility.
@misc{wang2024mineruopensourcesolutionprecise,
title={MinerU: An Open-Source Solution for Precise Document Content Extraction},
author={Bin Wang and Chao Xu and Xiaomeng Zhao and Linke Ouyang and Fan Wu and Zhiyuan Zhao and Rui Xu and Kaiwen Liu and Yuan Qu and Fukai Shang and Bo Zhang and Liqun Wei and Zhihao Sui and Wei Li and Botian Shi and Yu Qiao and Dahua Lin and Conghui He},
year={2024},
eprint={2409.18839},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2409.18839},
}
@article{he2024opendatalab,
title={Opendatalab: Empowering general artificial intelligence with open datasets},
author={He, Conghui and Li, Wei and Jin, Zhenjiang and Xu, Chao and Wang, Bin and Lin, Dahua},
journal={arXiv preprint arXiv:2407.13773},
year={2024}
}
Star History
Magic-doc
Magic-Doc Fast speed ppt/pptx/doc/docx/pdf extraction tool
We found that magic-pdf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Bybit's $1.46B hack by North Korea's Lazarus Group pushes 2025 crypto losses to $1.6B in just two months, already surpassing all of 2024's $1.49B total.
OpenSSF has published OSPS Baseline, an initiative designed to establish a minimum set of security-related best practices for open source software projects.
Michigan TypeScript founder Dimitri Mitropoulos implements WebAssembly runtime in TypeScript types, enabling Doom to run after processing 177 terabytes of type definitions.