How nanonets/docext works
Project type and purpose
• docext is an open-source, on-premises toolkit for document information extraction and benchmarking.
• It provides:
• A command-line/UI client and REST API for users to submit documents.
• A core extraction library that leverages vision-language models (VLMs) to extract fields, tables, OCR text, etc.
• A benchmarking suite to evaluate VLMs on various document intelligence tasks (KIE, VQA, OCR, tables, classification, confidence calibration, long-document reasoning).
File structure
• Top level:
• Dockerfile & configs/benchmark.yaml for deployment & configuration
• requirement.txt, setup.py for packaging
• EXT_README.md, Troubleshooting.md, CONTRIBUTING docs, .github workflows
• Package “docext”:
• app/ → Application layer: CLI/UI (args.py, ui.py), REST API server (app.py), utility wrappers (utils.py)
• core/ → Extraction engine: client.py (model client abstraction), extract.py (orchestration), prompts.py, confidence.py, config.py
• benchmark/ → Benchmarking suite: tasks.py (benchmark orchestration), metrics/ (various metric calculators), vlm_datasets/ (dataset loaders), utils.py
README for additional insights
• The toolkit runs entirely on-premises, supports multi-page docs, customizable templates, REST API endpoints, and a live leaderboard.
• Dependencies include Python, Docker, vision-language model backends (via core/vllm.py).