Dhurgh's picture
Initial commit
410242f
|
Raw
History Blame Contribute Delete
3.01 kB

πŸš€ Quick Start - Run in 3 Steps

Step 1: Install Requirements

pip install -r requirements.txt

For Windows users (OCR support):

  1. Download Tesseract from: https://github.com/UB-Mannheim/tesseract/wiki
  2. Run the installer
  3. Add to PATH or set in code

Step 2: Start the Server

python main.py

You should see:

INFO:     Uvicorn running on http://0.0.0.0:8000

Step 3: Open Dashboard

Visit in your browser:

http://localhost:8000/dashboard

🎯 What You Can Do

Upload Documents

  • Click "πŸ“€ Upload Document"
  • Select an image or text file
  • Results appear automatically

Extract Data

  • Click "βœ‚οΈ Extract from Text"
  • Paste your document text
  • Click "Extract Data"

View Results

  • See extracted fields with confidence scores
  • Check data quality metrics
  • View document classification

Monitor Jobs

  • Track processing status
  • View system statistics
  • Check success rates

πŸ“Š API Quick Reference

Extract from Text

curl -X POST "http://localhost:8000/extract" \
  -H "Content-Type: application/json" \
  -d '{"text": "Invoice #123 for $500"}'

Upload File

curl -X POST "http://localhost:8000/upload" \
  -F "file=@document.pdf"

Batch Process

curl -X POST "http://localhost:8000/batch" \
  -H "Content-Type: application/json" \
  -d '{"documents": [{"text": "Doc 1"}, {"text": "Doc 2"}]}'

Get Job Status

curl http://localhost:8000/jobs/{job_id}

🐍 Python Usage

import asyncio
from app.pipeline import DocumentProcessingPipeline

async def main():
    pipeline = DocumentProcessingPipeline()
    
    result = await pipeline.process_document(
        document_id="doc_001",
        text="Invoice #123 Amount: $500.00"
    )
    
    print(f"Type: {result.classification.document_type}")
    print(f"Confidence: {result.classification.confidence:.2%}")
    print(f"Fields: {len(result.extraction.extracted_fields)}")
    print(f"Quality: {result.validation.data_quality_score:.2%}")

asyncio.run(main())

πŸ§ͺ Run Examples

python examples.py

This will show you:

  • Single document processing
  • Batch processing
  • Custom field extraction
  • Data validation

🐳 Docker Alternative

# Build image
docker build -t doc-intelligence .

# Run container
docker run -p 8000:8000 -v ./uploads:/app/uploads doc-intelligence

# Visit http://localhost:8000/dashboard

βš™οΈ Configuration

Create .env file if needed:

API_PORT=8000
DATABASE_URL=sqlite:///./documents.db
OCR_LANG=eng
LOG_LEVEL=INFO

βœ… Verify Installation

# Check health
curl http://localhost:8000/health

# Should return: {"status":"healthy",...}

πŸ“š Full Documentation

See QUICKSTART.md for detailed guide or app/README.md for complete documentation.


πŸŽ‰ You're all set! Open http://localhost:8000/dashboard to get started!