Skip to content

About

To asses PDF readyness for Ingestion

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Docling Document Processing System

A full-stack web application for processing documents using IBM's Docling library with AI-powered analysis and Q&A capabilities.

Features

  • 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

Architecture

  • Frontend: HTML/CSS/JavaScript with Tailwind CSS
  • Backend: FastAPI server with Docling integration
  • Processing: IBM Docling for document conversion and analysis

Quick Start

Prerequisites

  • Python 3.8 or higher
  • pip (Python package installer)

Installation & Running

  1. Clone or download this repository

  2. Navigate to the Backend directory:

    cd Backend
  3. 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
  4. Access the application:

    • Open your browser and go to: http://localhost:8000
    • API documentation: http://localhost:8000/docs

Usage

Processing Documents

  1. Upload a Document:

    • Drag and drop a file or click to select
    • Supported formats: PDF, DOCX, PPTX, XLSX, HTML, Images (PNG, TIFF, JPEG)
  2. 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.)
  3. Process the Document:

    • Click "Extract Information"
    • Wait for processing to complete (progress indicator will show)
  4. View Results:

    • Download processed results as a ZIP file
    • Get AI readiness scores
    • Ask questions about the document content

API Endpoints

The backend provides a REST API with the following main endpoints:

  • POST /api/upload - Upload and process documents
  • GET /api/status/{doc_id} - Check processing status
  • GET /api/download/{doc_id} - Download results
  • POST /api/score/{doc_id} - Get document scoring
  • POST /api/qa/{doc_id} - Document Q&A
  • DELETE /api/cleanup/{doc_id} - Clean up temporary files

Configuration Options

Processing Options

  • 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 Options

  • OCR Enhancement: Improve text extraction quality
  • Auto Deskew: Correct rotated or skewed text
  • Noise Reduction: Remove image noise
  • Contrast Enhancement: Improve text visibility

Document Scoring

The system provides three scoring metrics:

  1. AI Readiness (0-100): How well-structured the document is for machine processing
  2. Content Quality (0-100): Text clarity, grammar, and coherence
  3. Search Readiness (0-100): Keyword usage and searchability

Troubleshooting

Common Issues

  1. Server Won't Start:

    • Check if Python 3.8+ is installed
    • Ensure port 8000 is not in use
    • Run python start_server.py from the Backend directory
  2. Document Processing Fails:

    • Check file format is supported
    • Ensure file is not corrupted
    • Try reducing processing threads if memory issues occur
  3. Dependencies Issues:

    • Try installing requirements manually: pip install -r requirements.txt
    • Check Python version compatibility

Manual Installation

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

Development

Project Structure

├── 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

Adding Features

  1. Backend: Modify api_server.py to add new endpoints
  2. Frontend: Update Frontend.html for UI changes
  3. Processing: Extend Docling integration in the API server

License

This project integrates with IBM's Docling library. Please check Docling's license terms for commercial usage.

Support

For issues related to:

  • Document processing: Check Docling documentation
  • Web interface: Review browser console for errors
  • API errors: Check server logs and /docs endpoint

About

To asses PDF readyness for Ingestion

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages