$ show bytedance/Dolphin
Dolphin is a document image parsing tool that uses a two-stage analyze-then-parse approach with a VLM (Qwen2.5-VL). It takes images or PDFs, performs layout analysis to detect elements (text, tables, formulas, code, figures) with reading order, then parses each element in parallel batches. Outputs structured JSON and Markdown with visualized layout. The codebase is well-structured, offering CLI entry points for page-level, element-level, and layout-only parsing. It demonstrates good engineering practices with batching, coordinate mapping, and post-processing for formula/special characters. The core implementation wraps the Hugging Face Qwen2.5-VL model and includes utility modules for layout string parsing, PDF conversion, and markdown generation. The architecture is a CLI application with minimal coupling, making the utility modules potentially reusable across document parsing projects.
The LLM identified 1 files worth highlighting for reuse:
A self-contained MarkdownConverter class that converts structured recognition results (JSON list of elements with labels, bboxes, text) into formatted Markdown. It handles headings, paragraphs, tables, formulas, figures, code, and list items with specialized processing for LaTeX formulas and HTML tables. This module is highly reusable in any document parsing pipeline that produces element-level recognition output, with minimal adaptation needed.