OpenClaw:面向业务流程的智能体操作系统架构解析
2026/6/24 23:22:49
Dolphin-v2是一款增强型通用文档解析模型,在原始Dolphin基础上实现显著提升。该模型通过采用具备文档类型感知能力的双阶段架构及可扩展锚点提示技术,能够无缝处理任何类型的文档——无论是数字原生文件还是拍摄图像。
由于文档类型多样且包含文本段落、图表、公式、表格和代码块等复杂交织的元素,文档图像解析具有挑战性。Dolphin-v2通过文档类型感知的两阶段方法应对这些挑战:
海豚模型在各类页面级和元素级解析任务中展现出优异性能,其轻量化架构与并行解析机制确保了卓越的运行效率。
| Model | Size | Overall↑ | TextEdit↓ | FormulaCDM↑ | TableTEDS↑ | TableTEDS-S↑ | Read OrderEdit↓ |
|---|---|---|---|---|---|---|---|
| Dolphin | 0.3B | 74.67 | 0.125 | 67.85 | 68.70 | 77.77 | 0.124 |
| Dolphin-1.5 | 0.3B | 85.06 | 0.085 | 79.44 | 84.25 | 88.06 | 0.071 |
| Dolphin-v2 | 3B | 89.78 | 0.054 | 87.63 | 87.02 | 90.48 | 0.054 |
克隆仓库:
gitclone https://github.com/ByteDance/Dolphin.gitcdDolphin安装依赖项:
pipinstall-r requirements.txt下载Dolphin-v2的预训练模型:
访问我们的Huggingface 模型卡片,或通过以下方式下载模型:
# Download the model from Hugging Face Hubgitlfsinstallgitclone https://huggingface.co/ByteDance/Dolphin-v2 ./hf_model# Or use the Hugging Face CLIpipinstallhuggingface_hub huggingface-cli download ByteDance/Dolphin-v2 --local-dir ./hf_modelDolphin 提供两种推理框架,支持两种解析粒度:
# Process a single document imagepython demo_page.py --model_path ./hf_model --save_dir ./results\--input_path ./demo/page_imgs/page_1.png# Process a single document pdfpython demo_page.py --model_path ./hf_model --save_dir ./results\--input_path ./demo/page_imgs/page_6.pdf# Process all documents in a directorypython demo_page.py --model_path ./hf_model --save_dir ./results\--input_path ./demo/page_imgs# Process with custom batch size for parallel element decodingpython demo_page.py --model_path ./hf_model --save_dir ./results\--input_path ./demo/page_imgs\--max_batch_size8# Process element images (specify element_type: table, formula, text, or code)python demo_element.py --model_path ./hf_model --save_dir ./results\--input_path\--element_type[table|formula|text|code]# Process a single document imagepython demo_layout.py --model_path ./hf_model --save_dir ./results\--input_path ./demo/page_imgs/page_1.png\# Process a single PDF documentpython demo_layout.py --model_path ./hf_model --save_dir ./results\--input_path ./demo/page_imgs/page_6.pdf\# Process all documents in a directorypython demo_layout.py --model_path ./hf_model --save_dir ./results\--input_path ./demo/page_imgs征集错误案例:如果您遇到模型表现不佳的案例,我们将非常感激您能在issue中分享。我们正在持续优化改进模型。
我们要感谢以下为本工作提供灵感和参考的开源项目:
如果您认为本代码对您的研究有所帮助,请使用以下BibTeX条目。
@article{feng2025dolphin, title={Dolphin: Document Image Parsing via Heterogeneous Anchor Prompting}, author={Feng, Hao and Wei, Shu and Fei, Xiang and Shi, Wei and Han, Yingdong and Liao, Lei and Lu, Jinghui and Wu, Binghong and Liu, Qi and Lin, Chunhui and others}, journal={arXiv preprint arXiv:2505.14059}, year={2025} }