An enterprise-ready document classification service built with FastAPI that automatically classifies uploaded documents and recommends the optimal processing strategy for Enterprise AI and RAG applications.
- Upload documents through REST API
- Automatic document classification
- Rule-based classifier
- Optional LLM-powered classifier
- OCR detection
- Chunking strategy recommendation
- Metadata recommendation
- Processing pipeline recommendation
- Table extraction recommendation
- Enterprise AI ready
- HR Policies
- Legal Contracts
- Technical Documentation
- Research Papers
- Source Code
- FAQ / Knowledge Base
- Invoices
- General Documents
Document Type Recommended Strategy
Policy Documents Section-based Chunking Legal Contracts Section + Semantic Chunking Technical Documentation Heading-based Chunking Source Code Function/Class Chunking Research Papers Semantic Chunking FAQ Documents Question-Answer Chunking CSV / Excel Table Chunking General Documents Fixed-size Chunking
Enterprise Documents
│
▼
Text Extraction
│
▼
OCR Detection
│
▼
Document Classification
│
▼
Metadata Recommendation
│
▼
Chunking Strategy Recommendation
│
▼
Table Extraction Decision
│
▼
Chunk Generation
│
▼
Embedding Generation
│
▼
Vector Database
- FastAPI
- Python
- OpenAI API (optional)
- Pydantic
git clone https://github.com/<your-username>/document-classifier.git
cd document-classifier
python -m venv venv
source venv/bin/activate
pip install -r requirements.txtuvicorn app.main:app --reloadOpen:
http://127.0.0.1:8000/docs
{
"document_type": "Policy / HR Document",
"recommended_chunking": "Section-based Chunking",
"requires_ocr": false,
"extract_tables": false
}- Layout Detection
- Table Detection
- Local LLM Support
- Batch Processing
- Vector Database Integration
- Evaluation Dashboard
MIT
Jay Ram Singh
Building Enterprise AI Platforms, RAG Systems, Document Intelligence, and LLMOps.