A Python-based document analysis pipeline that detects, extracts, and summarizes text, tables, and figures from images. The project combines layout detection, OCR, table-to-text conversion, and image captioning, supporting multiple languages.
- Layout detection: Automatically detects Text, Titles, Lists, Tables, and Figures in documents using
layoutparser. - OCR for multiple languages: Extracts text using PaddleOCR (primary) and Tesseract OCR (fallback).
- Language detection: Identifies the language of text regions.
- Table extraction & NL conversion: Converts table images into structured rows and generates natural language summaries.
- Figure captioning: Generates descriptive captions for figures, charts, and images using pre-trained captioning models (e.g., BLIP or similar).
- Extensible pipeline: Modular design allows easy integration of new OCR models, layout models, or caption models.
- JSON output: Saves all extracted segments with bounding boxes, OCR text, language, and NL summaries to a JSON file.
git clone https://github.com/yourusername/document-analyzer.git
cd document-analyzer