How muhammadmaaz200/ai-document-intelligence-system works
This is a Streamlit document-intelligence demo. Users upload a PDF or image, start processing, and receive extracted text, classified document fields, and downloadable JSON, CSV, or Excel results. PDF text is read directly when available, with OCR used for scanned pages; images use OCR. Results and a deduplicated history are held in temporary session state. The architecture is concentrated in app.py; the graph separates its main workflow stages. Evidence is limited to the sampled app.py, so external library internals are not represented.
Main entry points: app.py Format Dispatcher
Components 10
Upload and Processing
- Upload and Process UI
app.py - Format Dispatcher
app.py
Text and Fields
- PDF Text Reader
app.py - PyMuPDF
- Tesseract OCR
- Classification and Fields
app.py
Results and Session
- Session Results and History
app.py - Results Display
app.py - JSON CSV Excel Export
app.py
Other components
- Document User
Connections 12
- Document User → Upload and Process UI: uploads file
app.py - Upload and Process UI → Format Dispatcher: starts processing
app.py - Format Dispatcher → PDF Text Reader: reads PDF
app.py - Format Dispatcher → Tesseract OCR: OCRs image
app.py - PDF Text Reader → PyMuPDF: reads pages
app.py - PDF Text Reader → Tesseract OCR: OCRs scanned pages
app.py - Format Dispatcher → Classification and Fields: extracts fields
app.py - Format Dispatcher → Session Results and History: stores result
app.py - Format Dispatcher → Session Results and History: updates history
app.py - Session Results and History → Results Display: provides result
app.py - Results Display → JSON CSV Excel Export: offers downloads
app.py - Session Results and History → Results Display: provides history
app.py