Chapter 1 Semantic annotation

The maturation of digital technologies has opened up countless new opportunities for legal activities. Across the years, they have enabled for improved methodologies for handling, exploring, analyzing and implementing legal resources, greatly impacting the legal sector at different levels (Katz, Dolin, and Bommarito 2021; Sharma et al. 2021). In this context, the field of legal informatics has thrived, with more and more scholars focusing on the different aspects of innovative legal technologies, from the development of legal ontologies and semantic annotation of legal texts, to automated regulatory compliance checks and enhanced legal reasoning (Katz, Dolin, and Bommarito 2021; Loutsaris and Charalabidis 2020; Victor Rodriguez-Doncel 2023).

This was largely enabled by the development of new ways of storing legal information, which allowed for an easier retrieval and reuse of the legal concepts present in the natural language texts such as the competent jurisdiction, temporal elements, and deontic rules (Sharma et al. 2021; Loutsaris and Charalabidis 2020).

1.1 What is semantic annotation?

Among the array of techniques that have emerged in recent years, a prominent approach involves semantically annotating legal texts (Soavi et al. 2022b; Nazarenko, Lévy, and Wyner 2021; Tang et al. 2020; Ghijsen et al. 2013). This technique entails "connecting these texts with established ontologies by to identifying concepts from that ontology that are relevant to the document or that are referred to by it, as well as identifying specific passages in the document where the concepts in question are mentioned" (Brank, Leban, and Grobelnik 2018).. In other words, semantic annotation can be defined as the process of mapping texts to ontologies, enabling further processing by machines based on meaning instead of syntax (Kiryakov et al. 2003).

According to Adebayo, Di Caro, and Boella (2018) semantic annotation can be formalized "as a 4-tuple (a, b, c, d), where a is the subject of the annotation, b is the object of the annotation, c is the predicate which defines the type of relationship between a and b, while d signifies the context in which the annotation is made."

1.1.1 Benefits of semantic annotation

Semantically annotating legal texts has several advantages. In particular, it can power the retrieval of legal documents using detailed natural language queries. Traditional annotation-based retrieval systems rely on word matching and they often fall short in supporting complex legal query types. With a semantic understanding of query sentences and legal annotations, retrieval can become more precise and efficient (Soavi et al. 2022a).

Additionally, semantic annotations minimizes the ambiguity of the meaning of legal terms by making them explicitly defined (Soavi et al. 2022a). However, this is often complex to achieve, as in many cases legislators draft legislation which is "ambiguous-by-design" in order to strike a deal.

Moreover, semantic annotations could be reused in data-intensive applications downstream. An example of such applications is Kantoorbelasting, a proof-of-concept of the Flemish Government that leverages semantically annotated municipal regulations to enable citizens to estimate the taxes on commercial buildings depending on the city they plan to set their business in (Digitaal Vlaanderen 2023). Automated compliance checks are also another well-explored use-case (Kiyavitskaya et al. 2006). Among many, a notable example is the Lynx project, focused on enhancing access to digital regulatory compliance documents that target SMEs. The pilot developed regulatory compliance assurance services in three areas: contract compliance, labour law and fossil fuels (Victor Rodriguez-Doncel 2023). These applications are built on top of the semantic information contained in the legal corpora, thus increasing the integration among legal resources and the business logic and data access layers of the IT systems involved (Digitaal Vlaanderen 2023; Victor Rodriguez-Doncel 2023).

1.1.2 Challenges of semantic annotation

However, annotating legal documents is a complex task due to the discursive nature of legal information. This is often referred to as the "natural language barrier," which involves translating natural language sentences into semantic interpretations (Ceci et al. 2012; Soavi et al. 2022a). Transforming these texts into solid formal specifications often requires a multi-step process with multiple iterations that ideally would need to be validated by the legislators (Soavi et al. 2022a).

Additionally, as mentioned above, legal resources often purposefully leave room for diverse and/or conflicting interpretations, so that the issue is dealt in secondary legislation such as implementing acts or by the competent judicial court.

Finally, achieving high-level semantic meanings in the legal domain often requires integrating extracted relations with external legal knowledge sources, which can be vast and varied.

1.3 An overview of semantic annotations techniques

So far, we have explored some considerations that needs to be taken into account when establishing an annotation strategy. However, we have not dwelt yet into how the annotation itself can take place and the role of automated systems in supporting or carrying out the annotation effort. Broadly speaking, the techniques that have been employed for this task can be subdivided in three main categories: manual annotation, assisted or semi-automated annotation, and automated annotation.

1.3.1 Manual Annotation

Legal texts, as repositories of historical, cultural, and social contexts, require an interpretative finesse that automated approaches often lack. Because of this, semantic annotation requires the support of legal scholars and domain experts who engage in a meticulous examination of the texts. Through this process, they assign relevant semantic tags or metadata based on their expertise, interpretation and understanding of the legal text (Nazarenko, Lévy, and Wyner 2018; Governatori 2005).

The main advantage of manual annotation lies in its precision. The complexity of the legal language often elude computational algorithms. As a result, manual annotation ensures that annotations encompass both the overt and covert meanings enshrined within legal provisions. Furthermore, as mentioned above, certain legal provisions or judgments can be open to multiple, potentially conflicting interpretations (Stegmeier et al. 2021).

While the meticulous nature of manual annotation underscores its strength, it is simultaneously a source of limitation. The time and effort it demands make it less viable for managing extensive databases of legal documents, a concern amplified in an era characterized by exponential digital expansion (Nazarenko, Lévy, and Wyner 2018).

Nazarenko, Lévy, and Wyner (2021) worked on a methodology to semantically annotate legal documents. They introduce a coarse-grained, interpretation-neutral annotation layer to enrich legal texts, striking a balance between traditional statistical retrieval and full textual rule formalization. Their methodology is exemplified through the semantic annotation of the French version of the GDPR, utilizing the Core Legal Annotation Language (CLAL) formalized in XML, establishing a gold standard for future semantic annotations in the legal domain.

Another issue with manual annotation is that, although it enriches the depth of analysis, it introduces an element of subjectivity. Given the interpretational diversity among annotators, disparities in annotations can arise, particularly when dealing with multiple experts (Stegmeier et al. 2021).

In light of its reliance on human expertise, manual annotation necessitates substantial resources, both in terms of time and specialized knowledge. This, in turn, can render it less tenable for projects constrained by limited resources or stringent timelines.

1.3.2 Semi-automated or assisted annotation

Semi-automated annotation seeks to strike a balance between human expertise and the speed of automated tools. Generally, by using this approach, computational tools propose initial annotations, which are subsequently reviewed and refined by human experts. By amalgamating human judgment with computational speed, semiautomatic annotation offers an efficient means of annotating texts, ensuring a harmonious blend of accuracy and efficiency.

Soavi et al. (2022b) developed a tool named "ContrattoA" that semi-automatically conducts semantic annotation of legal contract text leveraging a domain ontology. To achieve this, they first leveraged lexical patterns to recognize some ontological concepts in the legal text. Then, the effectiveness of these patterns was evaluated in an empirical study where one group of subjects was asked to annotate legal text manually, while a second group edited the annotations generated by ContrattoA. Subsequently, they focused on the core contract concepts of obligation and power where the results from the first iteration were mixed. Using an extended set of sample contracts, new lexical patterns were derived. These patterns were shown to significantly improve the performance of ContrattoA.

Ceci et al. (2012), worked on designing a system to assist human experts in the annotation of normative modifications. As in the previous example, the automated system proposes a label, which is then validated or modified by the human annotator.

1.3.3 Automated annotation

The domain of legal texts presents unique challenges for automated semantic annotation due to its intricate language, layered references, and the high stakes involved in accurate interpretation. The most salient advantage of automatic annotation is its speed. Algorithms can process vast volumes of data at rates unattainable by humans. Yet, the very strength of automatic annotation is also its weakness. The absence of human oversight can lead to misinterpretations, especially given the nuanced and context-sensitive nature of legal language. Algorithms, while efficient, often lack the depth to fully grasp the multifaceted interpretations inherent in legal provisions at the current state of technology. Over the years, several researchers have delved into the task of automating various aspects of legal text processing.

Palmirani, Brighi, and Massini (2003) worked on the automatic extraction of normative references in legal texts from the Italian acquis. They claimed that standardized legal documents, marked up under uniform formats and structures, can facilitate a seamless integration between distinct legal texts, making them easier to reference, find, and process. A significant contribution of their work lies in the identification and marking of various components of legal texts, such as partitions (paragraphs, articles and sections), and the normative references they contain. Their project sought to craft a model adept at recognizing, understanding, and normalizing these normative references, a step forward in ensuring semantic interoperability among various legal information systems.

Recognizing the magnitude and intricacy of legal documents, C. Biagioli et al. (2005) emphasized the need for automated tools that can support the annotation process. They worked on the identification of regulatory provisions by detecting actors, rights, obligations and other entities integral to the legal discourse. They structured their approach in two steps: a provision identification module, that detects and classifies fragments of normative texts automatically based on their provision type, and an argument extraction module, that extracts the associated arguments from these provisions. They encountered several challenges tied to the unique lexicon and structure of the legal language, as they often carry weighty consequences.

Zeni et al. (2008, 2013) worked on automating the annotation of the Stanca law on web accessibility by adapting the Cerno framework in the Italian language. This framework provides a structured method, encompassing the identification of specific text fragments in regulatory documents, constructing a cohesive semantic model from these annotations, and subsequently transforming this model into distinct functional and non-functional requirements by focusing on concepts of obligations, rights, anti-rights, actor, and others.

Asooja et al. (2015) focused on creating an automated approach for annotating financial regulations. Their aim was to enrich a formal ontology using segments from legislative texts. The method employed not only domain-centric semantics but also general ones, and integrated deontic logic for prescriptive clauses. Their technique utilized a multi-label classification strategy, powered by several binary classifiers. This system was trained using provision types manually annotated by subject matter experts, adopting a supervised learning approach.

Adebayo, Di Caro, and Boella (2018) leveraged the TextTiling algorithm, enhancing it with Latent Dirichlet Allocation (LDA) for refined topic modeling. By integrating Semantic Textual Similarity principles, legal texts are segmented to mirror inherent subtopics. Their aim was to semantically connect concept descriptors with topical segments across a document. Their methodology unfolds in three stages: topical document segmentation, concept profiling, and mapping of concepts to segments.

Humphreys et al. (2020) harness advanced techniques to automate the semantic annotation of legal documents, specifically focusing on extracting norms and their elements. Central to their approach is combination of paraphrasing tools within unsupervised information extraction systems to produce semantically cohesive components from natural language. They applied Semantic Role Labeling (SRL) to identify and annotate specific elements such as "Situation", "Result", and "Condition" in legal texts. These annotated roles are then systematically mapped to slots in legal ontologies.

In Sleimi et al. (2020), an automated system that utilizes NLP and ML to extract designated metadata from texts was developed. They tested the system’s effectiveness through two case studies centered on Luxembourgish legislation. The outcomes were encouraging: precision rates reached 97.2% and 82.4%, with recall at 94.9% and 92.4%. This evaluation was anchored on 200 randomly selected statements from traffic laws. Their approach could be divided into three components: semantic metadata extraction (at both phrase and statement levels) and a named entity recognition algorithm used to identify the agents involved (Commission, Directorate-General for Financial Stability, and Union 2021).

In the study by Savelka (2023), the use of generative pre-trained transformers (GPT) was explored for the semantic annotation of short text snippets from various legal documents. While there have been discussions regarding the potential applications of this technology in the legal domain, a thorough analysis was missing, especially concerning sentence-level semantic annotation in zero-shot learning settings. Savelka (2023)’s research addressed this gap, evaluating the LMM’s ability to annotate small batches of short text snippets based solely on concise definitions of the semantic types. The results showed that the GPT model performed in zero-shot settings across different document types, achieving \(F_1\) scores of 73% on court opinions, 86% for contracts, and 54% for statutes and regulations.

1.4 Conclusion

The complex nature of legal resources, rich in subtle linguistic patterns and vague language, compels a well-though approach to semantic annotation. While manual annotation offers a depth unattainable by machines, it often falls short in scalability. On the other hand, while automatic annotation offers unparalleled speed, it sometimes lacks the finesse required for precise interpretation. Semi-automatic annotation, on the other hand, offers a promising middle ground.

As the domain of legal informatics evolves, a holistic understanding of these techniques is imperative. Future endeavors in this realm will undoubtedly seek to further harmonize the strengths of each method, paving the way for more refined, efficient, and accurate semantic annotations.

In conclusion, the semantic annotation of legal texts remains an evolving field, characterized by diverse methodologies and techniques. These methodologies, while differing in their approaches, collectively underscore the significance of structured, systematic, and semantically rich representation of legal texts for enhanced accessibility, interpretation, and applicability.

References

Adebayo, Kolawole John, Luigi Di Caro, and Guido Boella. 2018. “Towards Annotation of Legal Documents with Ontology Concepts.” In AI Approaches to the Complexity of Legal Systems, edited by Ugo Pagallo, Monica Palmirani, Pompeu Casanovas, Giovanni Sartor, and Serena Villata, 337–49. Cham: Springer International Publishing.
Asooja, Kartik, Georgeta Bordea, Gabriela Vulcu, Leona O’Brien, Angelina Espinoza, Elie Abi-Lahoud, Paul Buitelaar, and Tom Butler. 2015. “Semantic Annotation of Finance Regulatory Text Using Multilabel Classification.” LeDA-SWAn (to Appear, 2015) 8.
Athan, Tara, Guido Governatori, Monica Palmirani, Adrian Paschke, and Adam Zachary Wyner. 2014. “Legal Interpretations in LegalRuleML.” In SW4LAW+DC@JURIX. https://api.semanticscholar.org/CorpusID:6394084.
Bench-Capon, T. J. M., and F. P. Coenen. 1992. “Isomorphism and Legal Knowledge Based Systems.” Artificial Intelligence and Law 1. https://doi.org/10.1007/BF00118479.
Biagioli, C., E. Francesconi, A. Passerini, S. Montemagni, and C. Soria. 2005. “Automatic Semantics Extraction in Law Documents.” In Proceedings of the 10th International Conference on Artificial Intelligence and Law, 133–40. ICAIL ’05. New York, NY, USA: Association for Computing Machinery. https://doi.org/10.1145/1165485.1165506.
Brank, Janez, Gregor Leban, and Marko Grobelnik. 2018. “Semantic Annotation of Documents Based on Wikipedia Concepts.” Informatica (Slovenia) 42. https://api.semanticscholar.org/CorpusID:46897249.
Ceci, Marcello, Leonardo Lesmo, Alessandro Mazzei, Monica Palmirani, and Daniele P. Radicioni. 2012. “Semantic Annotation of Legal Texts Through a FrameNet-Based Approach.” Lecture Notes in Computer Science, 245–55. https://doi.org/10.1007/978-3-642-35731-2_17.
Commission, European, Financial Services Directorate-General for Financial Stability, and Capital Markets Union. 2021. Implementing Dictionaries of Regulatory Concepts and Reporting Obligations by Assisted Machine Learning – Final Report. Publications Office. https://doi.org/doi/10.2874/771121.
Digitaal Vlaanderen. 2023. “Kantoorbelasting — Kantoorbelasting.aeco.cloud.” https://kantoorbelasting.aeco.cloud/.
Francesconi, Enrico, and Andrea Passerini. 2007. “Automatic Classification of Provisions in Legislative Texts.” Artificial Intelligence and Law 15: 1–17. https://api.semanticscholar.org/CorpusID:14103998.
Ghijsen, Mattijs, Jeroen van der Ham, Paola Grosso, Cosmin Dumitru, Hao Zhu, Zhiming Zhao, and Cees de Laat. 2013. “A Semantic-Web Approach for Modeling Computing Infrastructures.” Computers & Electrical Engineering 39 (8): 2553–65. https://doi.org/https://doi.org/10.1016/j.compeleceng.2013.08.011.
Governatori, Guido. 2005. “Representing Business Contracts in RuleML.” Int. J. Cooperative Inf. Syst. 14: 181–216. https://api.semanticscholar.org/CorpusID:14683474.
Humphreys, Llio, Guido Boella, Luigi Di Caro, Livio Robaldo, Leon van der Torre, Sepideh Ghanavati, and Robert Muthuri. 2020. “Populating Legal Ontologies Using Semantic Role Labeling.” In Proceedings of the Twelfth Language Resources and Evaluation Conference, 2157–66. Marseille, France: European Language Resources Association. https://aclanthology.org/2020.lrec-1.264.
Jones, Andrew J. I., and Marek J. Sergot. 1992. “Deontic Logic in the Representation of Law: Towards a Methodology.” Artificial Intelligence and Law 1: 45–64. https://api.semanticscholar.org/CorpusID:20828933.
Karpf, J., and Handelshøjskolen Københav. 1989. “Quality Assurance of Legal Expert Systems.” In III International Congress "Logica, Informica, Diritto" Expert Systems in Law, Florence, Italy, November 2 - 5, 1989. https://books.google.it/books?id=xDV\_XwAACAAJ.
Katz, Daniel Martin, Ron Dolin, and Michael J. Bommarito. 2021. Legal Informatics. Cambridge University Press. https://doi.org/10.1017/9781316529683.
Kiryakov, Atanas, Borislav Popov, Damyan Ognyanoff, Dimitar Manov, Angel Kirilov, and Miroslav Goranov. 2003. “Semantic Annotation, Indexing, and Retrieval.” In International Workshop on the Semantic Web. https://api.semanticscholar.org/CorpusID:7267373.
Kiyavitskaya, Nadzeya, Nicola Zeni, Luisa Mich, James R. Cordy, and John Mylopoulos. 2006. “Text Mining Through Semi Automatic Semantic Annotation.” In Practical Aspects of Knowledge Management. https://api.semanticscholar.org/CorpusID:661878.
Loutsaris, Michalis Avgerinos, and Yannis Charalabidis. 2020. “Legal Informatics from the Aspect of Interoperability: A Review of Systems, Tools and Ontologies.” In Proceedings of the 13th International Conference on Theory and Practice of Electronic Governance, 731–37. ICEGOV ’20. New York, NY, USA: Association for Computing Machinery. https://doi.org/10.1145/3428502.3428611.
Ma, Megan, and Bryan Wilson. 2021. “The Legislative Recipe: Syntax for Machine-Readable Legislation.” Nw. J. Tech. & Intell. Prop. 19: 107.
Nazarenko, Adeline, François Lévy, and Adam Zachary Wyner. 2018. “An Annotation Language for Semantic Search of Legal Sources.” In International Conference on Language Resources and Evaluation. https://api.semanticscholar.org/CorpusID:21689131.
———. 2021. “A Pragmatic Approach to Semantic Annotation for Search of Legal Texts - an Experiment on GDPR.” In International Conference on Legal Knowledge and Information Systems. https://api.semanticscholar.org/CorpusID:245009585.
Palmirani, Monica, Raffaella Brighi, and Matteo Massini. 2003. “Automated Extraction of Normative References in Legal Texts.” In International Conference on Artificial Intelligence and Law. https://api.semanticscholar.org/CorpusID:20348337.
Rodriguez-Doncel, Victor. 2023. “Lynx - Legal Knowledge Graph for Smart Compliance Services in Multilingual Europe — Lynx-Project.eu.” https://lynx-project.eu/.
Rodriguez-Doncel, Víctor, Cristiana Santos, Pompeu Casanovas, Asunción Gómez-Pérez, and Jorge Gracia. 2018. “A Linked Data Terminology for Copyright Based on Ontolex-Lemon.” In AI Approaches to the Complexity of Legal Systems, edited by Ugo Pagallo, Monica Palmirani, Pompeu Casanovas, Giovanni Sartor, and Serena Villata, 410–23. Cham: Springer International Publishing.
Santos, Cristiana, Pompeu Casanovas, Víctor Rodríguez-Doncel, and Leendert van der Torre. 2018. “Reuse and Reengineering of Non-Ontological Resources in the Legal Domain.” In AI Approaches to the Complexity of Legal Systems, edited by Ugo Pagallo, Monica Palmirani, Pompeu Casanovas, Giovanni Sartor, and Serena Villata, 350–64. Cham: Springer International Publishing.
Savelka, Jaromír. 2023. “Unlocking Practical Applications in Legal Domain: Evaluation of GPT for Zero-Shot Semantic Annotation of Legal Texts.” ArXiv abs/2305.04417. https://api.semanticscholar.org/CorpusID:258557199.
Sharma, Sugam, Samia Gamoura, Deva Prasad, and Arti Aneja. 2021. “Emerging Legal Informatics Towards Legal Innovation: Current Status and Future Challenges and Opportunities.” Legal Information Management 21 (3-4): 218–35. https://doi.org/10.1017/S1472669621000384.
Sleimi, Amin, Nicolas Sannier, Mehrdad Sabetzadeh, Lionel Claude Briand, Marcello Ceci, and John Dann. 2020. “An Automated Framework for the Extraction of Semantic Legal Metadata from Legal Texts.” Empirical Software Engineering 26. https://api.semanticscholar.org/CorpusID:210966238.
Soavi, Michele, Nicola Zeni, John Mylopoulos, and Luisa Mich. 2022a. “From Legal Contracts to Formal Specifications: A Systematic Literature Review.” SN Computer Science 3. https://api.semanticscholar.org/CorpusID:249937766.
———. 2022b. “Semantic Annotation of Legal Contracts with ContrattoA.” Informatics 9: 72. https://api.semanticscholar.org/CorpusID:252455406.
Stegmeier, Jörn, Jakob Hartig, Michaela Levstáková, Kevin T. Logan, Sabine Bartsch, Andrea Rapp, and Peter F. Pelz. 2021. “Development of an Annotation Schema for the Identification of Semantic Uncertainty in DIN Standards.” In Uncertainty in Mechanical Engineering. https://api.semanticscholar.org/CorpusID:236365437.
Tang, Mingwei, Cui Su, Haihua Chen, Jingye Qu, and Junhua Ding. 2020. “SALKG: A Semantic Annotation System for Building a High-Quality Legal Knowledge Graph.” 2020 IEEE International Conference on Big Data (Big Data), 2153–59. https://api.semanticscholar.org/CorpusID:232371789.
Waismann, Friedrich. 1947. “Verifiability.” Journal of Symbolic Logic 12 (3): 101–1. https://doi.org/10.2307/2267243.
Wright, G. H. von. 1951. “Deontic Logic.” Mind 60 (237): 1–15. http://www.jstor.org/stable/2251395.
Zeni, Nicola, Nadzeya Kiyavitskaya, James R. Cordy, Luisa Mich, and John Mylopoulos. 2008. “Annotating Regulations Using Cerno: An Application to Italian Documents - Extended Abstract.” 2008 Third International Conference on Availability, Reliability and Security, 1437–42. https://api.semanticscholar.org/CorpusID:12708207.
Zeni, Nicola, Nadzeya Kiyavitskaya, Luisa Mich, James R. Cordy, and John Mylopoulos. 2013. “GaiusT: Supporting the Extraction of Rights and Obligations for Regulatory Compliance.” Requirements Engineering 20: 1–22. https://api.semanticscholar.org/CorpusID:254083214.