A full-stack web application for processing documents using IBM's Docling library with AI-powered analysis and Q&A capabilities.
- Document Processing: Upload and process various document formats (PDF, DOCX, PPTX, XLSX, HTML, Images)
- Advanced OCR: Text extraction from images and scanned documents
- AI Analysis: Document scoring for AI readiness, content quality, and search optimization
- Q&A System: Interactive questions and answers about processed documents
- Multiple Export Formats: Download results as Markdown, JSON, or HTML
- Modern UI: Responsive web interface with dark mode support
- Frontend: HTML/CSS/JavaScript with Tailwind CSS
- Backend: FastAPI server with Docling integration
- Processing: IBM Docling for document conversion and analysis
- Python 3.8 or higher
- pip (Python package installer)
-
Clone or download this repository
-
Navigate to the Backend directory:
cd Backend -
Run the startup script:
python start_server.py
This script will:
- Install all required dependencies
- Set up Docling and its dependencies
- Start the FastAPI server
-
Access the application:
- Open your browser and go to:
http://localhost:8000 - API documentation:
http://localhost:8000/docs
- Open your browser and go to:
-
Upload a Document:
- Drag and drop a file or click to select
- Supported formats: PDF, DOCX, PPTX, XLSX, HTML, Images (PNG, TIFF, JPEG)
-
Configure Processing Options:
- Choose export format (Markdown, JSON, Plain Text)
- Set processing threads
- Enable/disable OCR and table structure detection
- Configure enrichment features (code understanding, formula extraction, etc.)
-
Process the Document:
- Click "Extract Information"
- Wait for processing to complete (progress indicator will show)
-
View Results:
- Download processed results as a ZIP file
- Get AI readiness scores
- Ask questions about the document content
The backend provides a REST API with the following main endpoints:
POST /api/upload- Upload and process documentsGET /api/status/{doc_id}- Check processing statusGET /api/download/{doc_id}- Download resultsPOST /api/score/{doc_id}- Get document scoringPOST /api/qa/{doc_id}- Document Q&ADELETE /api/cleanup/{doc_id}- Clean up temporary files
- Export Format: Choose output format (Markdown, JSON, Text)
- Threading: Number of CPU threads for processing
- OCR Settings: Engine selection (EasyOCR, Tesseract) and language
- Enrichment Features:
- Code Understanding: Analyze code blocks
- Formula Understanding: Extract mathematical formulas
- Picture Classification: Classify images and diagrams
- Picture Description: Generate image descriptions
- OCR Enhancement: Improve text extraction quality
- Auto Deskew: Correct rotated or skewed text
- Noise Reduction: Remove image noise
- Contrast Enhancement: Improve text visibility
The system provides three scoring metrics:
- AI Readiness (0-100): How well-structured the document is for machine processing
- Content Quality (0-100): Text clarity, grammar, and coherence
- Search Readiness (0-100): Keyword usage and searchability
-
Server Won't Start:
- Check if Python 3.8+ is installed
- Ensure port 8000 is not in use
- Run
python start_server.pyfrom the Backend directory
-
Document Processing Fails:
- Check file format is supported
- Ensure file is not corrupted
- Try reducing processing threads if memory issues occur
-
Dependencies Issues:
- Try installing requirements manually:
pip install -r requirements.txt - Check Python version compatibility
- Try installing requirements manually:
If the startup script doesn't work, install dependencies manually:
# Install core dependencies
pip install fastapi uvicorn[standard] python-multipart pydantic
# Install Docling
pip install docling
# Start server
python api_server.py├── Backend/
│ ├── api_server.py # Main FastAPI application
│ ├── start_server.py # Startup script
│ ├── requirements.txt # Python dependencies
│ └── docling/ # Docling library (cloned)
├── Frontend/
│ └── Frontend.html # Web interface
└── README.md # This file
- Backend: Modify
api_server.pyto add new endpoints - Frontend: Update
Frontend.htmlfor UI changes - Processing: Extend Docling integration in the API server
This project integrates with IBM's Docling library. Please check Docling's license terms for commercial usage.
For issues related to:
- Document processing: Check Docling documentation
- Web interface: Review browser console for errors
- API errors: Check server logs and
/docsendpoint