Portuguese Legal Document PDF Metadata Extractor
About
MCP server for extracting metadata from Portuguese legal documents using advanced PDF processing and database architecture
Details
- Author
- geek2geeks
- Downloads
- 249
- Categories
- Other
Jump to
- High accuracy: 100% confidence, 96.84% exact match rate
- Two extractor variants: production-ready and robust core engine
- Works with or without ground truth data for confidence scoring
- Clear field classification: missing vs. legitimately empty fields
- Batch processing with detailed summaries and progress reporting
- Command line interface with flexible options and quiet mode
Install with Python 3.8+ and pip install pdfplumber. Use via the CLI: python production_extractor.py "pdfs/document.pdf" -o "results/" for single files, or python production_extractor.py "pdfs/" -g "ground_truth/ground_truth.json" -o "results/" for batch processing with ground truth validation. The PortugueseLegalPDFExtractor class also offers a programmatic API for single or batch extraction.
Portuguese Legal Document PDF Metadata Extractor
A robust Python tool for extracting structured metadata from Portuguese legal document PDFs, specifically designed for European Case Law Identifier (ECLI) formatted documents.
π Features
- High Accuracy: 100% confidence score with 96.84% exact match rate
- Production Ready: Two extractor variants optimized for different use cases
- Robust Error Handling: Comprehensive validation and error recovery
- Flexible Confidence Scoring: Works with or without ground truth data
- User-Friendly Interface: Clear progress reporting and detailed feedback
- Field Classification: Distinguishes between missing and legitimately empty fields
π Project Structure
βββ production_extractor.py # Production-ready extractor with user-friendly interface
βββ robust_extractor.py # Core robust extraction engine
βββ run_test1.py # Test runner for batch processing
βββ ground_truth/ # Ground truth data for validation
β βββ ground_truth.json
βββ pdfs/ # Input PDF documents
β βββ test1/ # Test subset
β βββ *.pdf # Legal documents
βββ IMPROVEMENTS_SUMMARY.md # Performance improvements documentation
βββ README.md # This file
π§ Installation
Prerequisites
- Python 3.8+
- Required packages:
pip install pdfplumber
Setup
1. Clone or download the project files
2. Install dependencies:
pip install pdfplumber
3. Ensure your PDF files are in the
pdfs/ directory
π Usage
Basic Usage with Production Extractor
The PortugueseLegalPDFExtractor class provides a user-friendly, production-ready interface:
```python
from production_extractor import PortugueseLegalPDFExtractor
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



