Portuguese Legal Document PDF Metadata Extractor
@geek2geeks
MCP server for extracting metadata from Portuguese legal documents using advanced PDF processing and database architecture
Overview
What is Portuguese Legal Document PDF Metadata Extractor?
A robust tool for extracting structured metadata from Portuguese legal document PDFs, specifically designed for European Case Law Identifier (ECLI) formatted documents. It provides high accuracy extraction with two extractor variants, confidence scoring, and field classification—suitable for legal document processing and validation.
How to use Portuguese Legal Document PDF Metadata Extractor?
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.
Key features of Portuguese Legal Document PDF Metadata Extractor
- 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
Use cases of Portuguese Legal Document PDF Metadata Extractor
- Batch extract metadata from a directory of Portuguese legal PDFs
- Validate extracted metadata against a ground truth JSON for quality assurance
- Extract ECLI identifiers and structured case information for legal research
- Process and organize court documents with consistent field ordering
FAQ from Portuguese Legal Document PDF Metadata Extractor
What are the runtime requirements?
Python 3.8 or newer and the pdfplumber package. No other dependencies are required.
Does it require ground truth data to function?
No. Ground truth is optional—without it the tool uses heuristic-based scoring; with it, accuracy-based scoring is used.
What performance can I expect?
Overall confidence of 100%, exact match rate of 96.84% (153/158 populated fields), and processing speed of ~2‑3 seconds per document.
How does it handle missing or empty fields?
It distinguishes between fields that are legitimately empty and those that are missing due to extraction errors, assigning separate classification.
What extraction methods does it use?
Primary method is table‑based extraction; if that fails, a coordinate‑based fallback is used. The tool also leverages discovered patterns like fixed relative positions and consistent field sequence.