A modern web application for automated insurance claim form processing using AI-powered document analysis.
- Document Upload: Support for PDF and image files (PNG, JPG, JPEG)
- OCR Processing: Automatic text extraction from scanned documents using EasyOCR
- AI Analysis: Structured data extraction using Google Gemini API
- Web Interface: Clean, responsive web interface for easy document processing
- Real-time Processing: Live status updates during document analysis
- Multiple API Keys: Automatic rotation between multiple Gemini API keys for better reliability
- Backend: FastAPI, Python 3.11+
- Frontend: HTML5, CSS3, JavaScript
- OCR: EasyOCR, pdf2image
- AI: Google Generative AI (Gemini)
- Document Processing: PyPDF2, Pillow
- Deployment: Docker, Docker Compose
- Python 3.11 or higher
- Google AI Studio API key
- poppler-utils (for PDF processing)
brew install popplersudo apt-get install poppler-utilsgit clone <repository-url>
cd insurance-claim-processor
./setup.shCreate the API key file:
mkdir -p envs
echo "API_KEY_1=your_gemini_api_key_here" > envs/.env.gemini_keyGet your API key from Google AI Studio
./run.shThe application will be available at http://localhost:8000
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtpython app.pydocker-compose up --builddocker-compose -f docker-compose.yml up -dThe system supports multiple Gemini API keys for better reliability. Add additional keys to the environment file:
API_KEY_1=your_first_api_key
API_KEY_2=your_second_api_key
API_KEY_3=your_third_api_keyKeys are automatically rotated when quotas are exceeded.
GET /- Main application interface
POST /upload- Process uploaded claim documentGET /demo-data- Get sample claim dataGET /api-status- Check API service status
POST /process-claim- Process claim data directlyPOST /upload-claim- Upload and process claim filePOST /process-claim-async- Asynchronous claim processing
- PDF: Both text-based and scanned documents
- Images: PNG, JPG, JPEG formats
- Maximum file size: 10MB
├── app.py # Main web application
├── claim_api_service.py # REST API service
├── main.py # Core processing engine
├── processors/
│ ├── ocr_engine.py # OCR processing
│ └── claim_processor.py # AI claim analysis
├── templates/ # Web interface templates
├── requirements.txt # Python dependencies
├── Dockerfile # Container configuration
└── docker-compose.yml # Multi-container setup
API_KEY_1,API_KEY_2,API_KEY_3- Gemini API keysHOST- Server host (default: 0.0.0.0)PORT- Server port (default: 8000)
envs/.env.gemini_key- API key configuration file
python -m pytest tests/black .
flake8 .OCR not working: Ensure poppler is installed and EasyOCR dependencies are available.
API quota exceeded: Add additional API keys or wait for quota reset (24 hours for free tier).
PDF processing errors: Verify pdf2image and poppler installation.
Application logs are available in the console output. Set log level using:
export LOG_LEVEL=DEBUG
python app.py- PDF Processing: 20-300 seconds depending on document size and complexity
- OCR Accuracy: 85-95% for clear scanned documents
- AI Processing: 2-10 seconds per document
- Concurrent Users: Supports multiple simultaneous uploads
This project is licensed under the MIT License.
For technical support or feature requests, please create an issue in the project repository.