This repository serves as a testing ground for various PDF text extraction technologies. It provides a structured environment to evaluate and compare different PDF extraction tools and libraries.
Located in technologies/tika/
- Uses Apache Tika 3.1.0 with Tesseract OCR
- Supports both text-based and scanned PDFs
- Includes JPEG2000 image support
- Primary HTML output with conversion to other formats
⚠️ No native Markdown support (HTML conversion required)
- Part of GPT-4 Vision API
- Pros: High accuracy, native markdown output, good at complex layouts
- Cons: Cloud-based, potential privacy concerns, cost per page
- Status: Released in March 2024
- Enterprise-grade document processing
- Pros: High accuracy, form field detection, table extraction
- Cons: Cloud-based, enterprise pricing, complex setup
- Status: Generally available
- Part of Azure Cognitive Services
- Pros: Good form detection, pre-built models, custom training
- Cons: Cloud-based, requires Azure subscription
- Status: Generally available
- Python-based document processing library
- Pros: Native markdown support, active development, good table handling
- Cons: Still maturing, resource intensive
- Status: Active development, regular releases
- Python bindings for MuPDF
- Pros: Fast, lightweight, good for text-based PDFs
- Cons: Limited OCR capabilities, basic layout analysis
- Status: Stable, actively maintained
- PDFPlumber: Good for table extraction
- PdfMiner.six: Pure Python, good for text extraction
- Camelot: Specialized in table extraction
- Nougat: Scientific paper extraction (by Meta)
- Adobe PDF Services API: Commercial offering with good accuracy
Each PDF extraction technology is evaluated based on the following criteria:
- Cost per individual PDF processing
- Pricing for bulk processing (thousands of PDFs)
- Resource requirements (CPU, memory, storage)
- Processing speed and throughput capabilities
- Text extraction accuracy (compared to original)
- OCR quality for scanned documents
- Handling of different languages and character sets
- Preservation of document structure and formatting
- Markdown output capability for LLM/vector database integration
- Quality of markdown conversion
- Support for other formats (HTML, plain text, JSON)
- Metadata extraction capabilities
- Handling of complex layouts (columns, tables, footnotes)
- Image and diagram extraction
- Form field recognition
- Error handling and recovery
- Performance with corrupted or malformed PDFs
- Docker container availability
- REST API support
- Documentation quality
- Monitoring and logging capabilities
- Error reporting and handling
- Scalability features
- Development activity (commits, releases)
- Community size and engagement
- Issue resolution time
- Long-term maintenance outlook
- Open source availability
- License type and restrictions
- Commercial use terms
- Patent claims and protections
- Data handling practices
- Cloud vs on-premises deployment
- Data retention policies
- Security features and certifications
.
├── documents/ # Test documents
│ ├── scanned/ # Scanned PDF documents
│ ├── text-based/ # Text-based PDF documents
│ └── mixed/ # PDFs with both text and scanned content
├── technologies/ # Different extraction technologies
│ └── tika/ # Apache Tika implementation
└── results/ # Extraction results for comparison
└── tika/ # Tika extraction results
- Docker
- Python 3.x
- pip (Python package manager)
- Navigate to the Tika implementation:
cd technologies/tika- Create a virtual environment and install dependencies:
python3 -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
pip install -r requirements.txt- Start the Tika service:
docker compose up -d- Process PDF files:
python parse_pdf.pyTo add a new PDF extraction technology:
- Create a new directory under
technologies/ - Include all necessary implementation files
- Provide a README with setup and usage instructions
- Ensure the implementation can process files from the
documents/directory - Output results to the corresponding directory under
results/
When adding a new technology or test document:
- Place test documents in the appropriate
documents/subdirectory - Create a new technology directory with a descriptive name
- Include clear setup instructions
- Document any special requirements or limitations
- Add the technology to the list in this README
[Add your license information here]