Introduction
Motivation
The process of annotating legal texts is often a time-consuming endeavor, difficult to scale up due to its dependence on factors like the specific objectives of the annotation, the complexity of the language used in legal text, and the impact that an incorrect interpretation can have, among others. The importance of annotated legal data has become more prominent to improve the performance of both sub-symbolic and symbolic AI algorithms (Francesconi 2019). For these AI models to be trained effectively, high-quality data is crucial. As a result, good quality semantically annotated legal data has become an objective in its own right.
The literature does point out a gap in methods that are both accurate, economical and efficient in the annotation process, emphasizing the need for streamlined production. Our work aims to increase the tools at disposal to the research and public servant communities by developing a versatile end-to-end data transformation pipeline for legal documents.
Objectives
For the purpose of this project, we lay the ground work for a semantic annotation pipeline that leverages legal ontologies and machine-readable legal resources. Specifically, the work focuses on two strands:
Developing a data transformation pipeline that integrates the Doccano annotation tool (Nakayama et al. 2018) and outputs the annotated documents according to the Lynx specification (Rodríguez-Doncel et al. 2023)
Demonstrating the application of the data transformation pipeline by annotating the Italian Copyright legislation with the Copyright ontology (García and Gil 2006)
Package and make available the data transformation pipeline for reuse, reproducibility and contributions from the open-source community
In summary, we propose a reproducible and general-purpose end-to-end data transformation pipeline which leverages the Doccano annotation tool for the manual semantic annotation of legal texts and provides hooks to their integration in knowledge graphs through the Lynx ontology.
Methodology
The project involves the development of a Python library for end-to-end data processing. By extending the functionality of the Doccano open-source annotation tool (Nakayama et al. 2018), the proposed method allows for enriching the label functionality of the tool with existing ontologies and controlled vocabularies.
Doccano provides a web interface that allows for the integration of both manual annotations and automatic services via APIs. It supports a variety of annotation techniques, for both images and text, but in the context of this work, we extended the named entity recognition functionality by integrating semantic annotation based on existing legal ontologies or controlled vocabularies. By improving the support for Akoma Ntoso (Palmirani and Vitali 2011) documents with Doccano, we can enable the customization of the annotation process as per user requirements.
The annotated documents can then be exported from Doccano in an offset-based format, where ontological classes are represented as entities and properties are represented as relations. Additional processing then takes place to transform the annotated documents into a knowledge graph based on the Lynx specification (Rodríguez-Doncel et al. 2023), that enables the use of such data for powering ML models.
About this document
This thesis is structured as follows:
Chapter 1 presents the theoretical background and previous work on the semantic annotation of legal texts
Chapter 2 provides an overview of the data and tools used during the successful iteration of this project, as well some background information on the legal domain we have decided to tackle (Italian Copyright Legislation).
Finally, in Chapter 3 we describe more in detail the data transformation pipeline, reflect on its potentials and limitations, compare it with other existing tools and propose future research and development work.