How alibaba/logics-parsing works
Logics-Parsing-V3 is a vision-language document parser for single pages and long documents. The primary workflow accepts an image, PDF, or image directory; performs sequential, state-recurrent parsing for multi-page inputs; and saves structured parsing outputs. Model weights can be obtained separately from Hugging Face or ModelScope. The README documents capabilities such as hierarchy recovery and cross-page merging, but the single-file implementation excerpt is incomplete, so internal processing links are limited to documented relationships.
Main entry points: inference_v3.py Inference runner · download_model.py Model downloader
Components 11
Document inference
- Page inputs
inference_v3.py - Inference runner
inference_v3.py - Window state
inference_v3.py - Vision-language model
inference_v3.py
Parsing results
- Document structure
inference_v3.py - DSL and Markdown
inference_v3.py
Model weights
- Model downloader
download_model.py - Local weights
download_model.py
Other components
- User
- Hugging Face
- ModelScope
Connections 13
- User → Page inputs: provides pages
README.md - User → Inference runner: starts inference
README.md - Page inputs → Inference runner: parses input
README.md - Inference runner → Window state: carries state
README.md - Inference runner → Vision-language model: infers pages
README.md - Vision-language model → Document structure: recovers structure
README.md - Window state → Document structure: preserves context
README.md - Document structure → DSL and Markdown: emits results
README.md - User → Model downloader: requests weights
README.md - Model downloader → Hugging Face: downloads from
download_model.py - Model downloader → ModelScope: downloads from
download_model.py - Hugging Face → Local weights: provides weights
download_model.py - ModelScope → Local weights: provides weights
download_model.py