MonkeyOCR: Document Parsing with a Structure-Recognition-Relation Triplet Paradigm
MonkeyOCR: Document Parsing with a Structure-Recognition-Relation Triplet Paradigm
Zhang Li, Yuliang Liu, Qiang Liu, Zhiyin Ma, Ziyang Zhang, Shuo Zhang, Zidun Guo, Jiarui Zhang, Xinyu Wang, Xiang Bai
Introduction
MonkeyOCR adopts a Structure-Recognition-Relation (SRR) triplet paradigm, which simplifies the multi-tool pipeline of modular approaches while avoiding the inefficiency of using large multimodal models for full-page document processing.
Compared with the pipeline-based method MinerU, our approach achieves an average improvement of 5.1% across nine types of Chinese and English documents, including a 15.0% gain on formulas and an 8.6% gain on tables.
Compared to end-to-end models, our 3B-parameter model achieves the best average performance on English documents, outperforming models such as Gemini 2.5 Pro and Qwen2.5 VL-72B.
For multi-page document parsing, our method reaches a processing speed of 0.84 pages per second, surpassing MinerU (0.65) and Qwen2.5 VL-7B (0.12).
MonkeyOCR currently does not support photographed documents, but we will continue to improve it in future updates. Stay tuned!
Currently, our model is deployed on a single GPU, so if too many users upload files at the same time, issues like “This application is currently busy” may occur. We're actively working on supporting Ollama and other deployment solutions to ensure a smoother experience for more users. Additionally, please note that the processing time shown on the demo page does not reflect computation time alone—it also includes result uploading and other overhead. During periods of high traffic, this time may be longer. The inference speeds of MonkeyOCR, MinerU, and Qwen2.5 VL-7B were measured on an H800 GPU.
🚀🚀🚀 Chinese Video Tutorial (Thanks to
leo009
for sharing!)
# Make sure in MonkeyOCR directory
python parse.py path/to/your.pdf
# or with image as input
pyhton parse.py path/to/your/image
# Specify output path and model configs path
python parse.py path/to/your.pdf -o ./output -c config.yaml
Output Results
MonkeyOCR generates three types of output files:
Processed Markdown File
(
your.md
): The final parsed document content in markdown format, containing text, formulas, tables, and other structured elements.
Layout Results
(
your_layout.pdf
): The layout results drawed on origin PDF.
Intermediate Block Results
(
your_middle.json
): A JSON file containing detailed information about all detected blocks, including:
Block coordinates and positions
Block content and type information
Relationship information between blocks
These files provide both the final formatted output and detailed intermediate results for further analysis or processing.
4. Gradio Demo
# Prepare your env for gradio
pip install gradio==5.23.3
pip install pdf2image==1.17.0
Our 3B model runs efficiently on NVIDIA RTX 3090. However, when using
LMDeploy
as the inference backend, you may encounter compatibility issues on
RTX 3090 / 4090
GPUs — particularly the following error:
triton.runtime.errors.OutOfResources: out of resource: shared memory
To work around this issue, you can apply the patch below:
python tools/lmdeploy_patcher.py patch
⚠️
Note:
This command will modify LMDeploy's source code in your environment.
To revert the changes, simply run:
You can switch inference backend to
transformers
following the steps below:
Install required dependency (if not already installed):
# install flash attention 2, you can download the corresponding version from https://github.com/Dao-AILab/flash-attention/releases/
pip install flash-attn==2.7.4.post1 --no-build-isolation
Open the
model_configs.yaml
file
Set
chat_config.backend
to
transformers
Adjust the
batch_size
according to your GPU's memory capacity to ensure stable performance
Example configuration:
chat_config:backend:transformersbatch_size:10# Adjust based on your available GPU memory
Benchmark Results
Here are the evaluation results of our model on OmniDocBench. MonkeyOCR-3B uses DocLayoutYOLO as the structure detection model, while MonkeyOCR-3B* uses our trained structure detection model with improved Chinese performance.
1. The end-to-end evaluation results of different tasks.
Click “Parse (解析)” to let the model perform structure detection, content recognition, and relationship prediction on the input document. The final output will be a markdown-formatted version of the document.
Select a prompt and click “Test by prompt” to let the model perform content recognition on the image based on the selected prompt.
Example for formula document
Example for table document
Example for newspaper
Example for financial report
Citing MonkeyOCR
If you wish to refer to the baseline results published here, please use the following BibTeX entries:
@misc{li2025monkeyocrdocumentparsingstructurerecognitionrelation,
title={MonkeyOCR: Document Parsing with a Structure-Recognition-Relation Triplet Paradigm},
author={Zhang Li and Yuliang Liu and Qiang Liu and Zhiyin Ma and Ziyang Zhang and Shuo Zhang and Zidun Guo and Jiarui Zhang and Xinyu Wang and Xiang Bai},
year={2025},
eprint={2506.05218},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2506.05218},
}
Please don’t hesitate to share your valuable feedback — it’s a key motivation that drives us to continuously improve our framework. The current technical report only presents the results of the 3B model. Our model is intended for non-commercial use. If you are interested in larger one, please contact us at
[email protected]
or
[email protected]
.
Runs of echo840 MonkeyOCR-1.2B-0709 on huggingface.co
0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About MonkeyOCR-1.2B-0709 huggingface.co Model
MonkeyOCR-1.2B-0709 huggingface.co
MonkeyOCR-1.2B-0709 huggingface.co is an AI model on huggingface.co that provides MonkeyOCR-1.2B-0709's model effect (), which can be used instantly with this echo840 MonkeyOCR-1.2B-0709 model. huggingface.co supports a free trial of the MonkeyOCR-1.2B-0709 model, and also provides paid use of the MonkeyOCR-1.2B-0709. Support call MonkeyOCR-1.2B-0709 model through api, including Node.js, Python, http.
MonkeyOCR-1.2B-0709 huggingface.co is an online trial and call api platform, which integrates MonkeyOCR-1.2B-0709's modeling effects, including api services, and provides a free online trial of MonkeyOCR-1.2B-0709, you can try MonkeyOCR-1.2B-0709 online for free by clicking the link below.
echo840 MonkeyOCR-1.2B-0709 online free url in huggingface.co:
MonkeyOCR-1.2B-0709 is an open source model from GitHub that offers a free installation service, and any user can find MonkeyOCR-1.2B-0709 on GitHub to install. At the same time, huggingface.co provides the effect of MonkeyOCR-1.2B-0709 install, users can directly use MonkeyOCR-1.2B-0709 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
MonkeyOCR-1.2B-0709 install url in huggingface.co: