Portuguese Legal Document PDF Metadata Extractor

by geek2geeks

249 downloads Not rated yet

About

MCP server for extracting metadata from Portuguese legal documents using advanced PDF processing and database architecture

Explore

- 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

- Python 3.8+
- Required packages:

pip install pdfplumber

The PortugueseLegalPDFExtractor class provides a user-friendly, production-ready interface:

```python
from production_extractor import PortugueseLegalPDFExtractor

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

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.