The Challenge
An amendment tells you what changed, but rarely gives you the complete, updated regulation. Municipal staff must find the affected provisions, interpret each instruction, and incorporate the changes while preserving the rest of the document.
This prototype explored the path from separate regulations and amendments to a consolidated text that a person can review. The visual example below shows the core task: replacing, adding, or removing a provision without losing the surrounding text.
Amendment examples
In Article 12, the words “15 days” are replaced by “30 days”.
Article 12
Applications must be submitted within 15 days of publication of the public call.
Article 12
Applications must be submitted within 30 days of publication of the public call.
The Technical Solution
A prototype system was developed to explore whether Large Language Models (LLMs) could automate the consolidation of regulations and their amendments, transforming an unstructured legal text processing task into a streamlined digital workflow.
- Intelligent Document Processing Pipeline: The system combines OCR technology to extract text from PDF documents with OpenAI models to analyze, structure, and generate updated consolidated texts. The modular architecture handles the complete workflow: content recognition, text extraction, amendment application, and results visualization.
- Hybrid Approach for Complex Documents: Regulations often contain complex tabular data (merged cells, multi-page tables). The system uses a combined approach: OCR for textual content and specialized LLM processing for tables, converting everything into a structured JSON format before final consolidation.
- Interactive Web Application: The prototype provides a browser-based interface requiring no technical expertise. Users can upload a regulation and its amendments, then view a side-by-side comparison of the original and updated versions, ensuring full transparency in how changes were applied.
Results and Impact
The project successfully demonstrated that LLM technology can transform municipal document management, delivering several concrete benefits:
- Dramatically Faster Processing: Automated consolidation reduces processing time from hours or days to minutes, freeing administrative staff for higher-value work.
- Improved Accuracy and Consistency: The system significantly reduces human error and ensures amendments are applied consistently across all sections of a regulation.
- Enhanced Transparency: The side-by-side comparison view makes all changes immediately visible and verifiable, improving both internal review processes and public accessibility.
This project was developed as part of an EDIH Adria 'Test Before Invest' initiative to explore AI applications in public administration. For more details, you can read the official success story.
