Citation: Soavi, M.; Zeni, N.;
Mylopoulos, J.; Mich, L. Semantic
Annotation of Legal Contracts with
ContrattoA. Informatics 2022, 9, 72.
https://doi.org/10.3390/
informatics9040072
Academic Editors: Sanjay Misra,
Robertas Damaševiˇcius and
Bharti Suri
Received: 9 August 2022
Accepted: 15 September 2022
Published: 20 September 2022
Publisher’s Note: MDPI stays neutral
with regard to jurisdictional claims in
published maps and institutional affil-
iations.
Copyright: © 2022 by the authors.
Licensee MDPI, Basel, Switzerland.
This article is an open access article
distributed under the terms and
conditions of the Creative Commons
Attribution (CC BY) license (https://
creativecommons.org/licenses/by/
4.0/).
Article
Semantic Annotation of Legal Contracts with ContrattoA
Michele Soavi
1,
* , Nicola Zeni
1
, John Mylopoulos
2
and Luisa Mich
1
1
Department of Industrial Engineering, University of Trento, Via Sommarive 14, 38123 Trento, TN, Italy
2
School of Electrical Engineering and Computer Science, University of Ottawa, 800 King Edward Ave,
Ottawa, ON K1N 6N5, Canada
* Correspondence: michele.soavi@unitn.it
Abstract:
The aim of the research is to semi-automate the process of generating formal specifications
from legal contracts in natural language text form. Towards this end, the paper presents a tool, named
ContrattoA, that semi-automatically conducts semantic annotation of legal contract text using an
ontology for legal contracts. ContrattoA was developed through two iterations where lexical patterns
were defined for legal concepts and their effectiveness was evaluated with experiments. The first
iteration was based on a handful of sample contracts and resulted in defining lexical patterns for
recognizing concepts in the ontology; these were evaluated with 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. The second iteration focused on the lexical patterns for the core contract
concepts of obligation and power where results of the first iteration were mixed. On the basis of
an extended set of sample contracts, new lexical patterns were derived and those were shown to
substantially improve the performance of ContrattoA, nearing in quality the performance of experts.
The experiments suggest that good quality annotations can be generated for a broad range of contracts
with minor refinements to the lexical patterns.
Keywords:
legal contract; semantic annotation; structural annotation; contract ontology; semantic
annotation tool
1. Introduction
Legal contracts constitute for millennia the main vehicle for conducting business
transactions worldwide. They are established (aka ‘formed’ in Law) through a systematic
negotiation process, followed by an execution (aka ‘performance’) supported by legal
dispute resolution mechanisms. Contracts exist as natural language (NL) text using legal
terminology grounded on legal concepts, such as those of obligation and power.
The aim of the research is to transform legal contract text into formal specifications
for two reasons. Firstly, there is much interest in Law in the algorithmic analysis of legal
contracts to ensure they are consistent with the expectations and interests of contracting
parties. Formal analysis tools, such as model checkers [
1
] and SMT/OMT solvers [
2
], have
come of age in the past decade and are used routinely to analyze various kinds of artifacts,
including hardware, software and business process designs. However, such tools can only
be used with a formal specification of the artifact to be analyzed. Secondly, there is a new
class of software systems called smart contracts [
3
] that partially automate, monitor and
control the execution of legal contracts. Formal specifications of legal contracts can serve
as a starting point for the systematic tool-supported process of generating smart contract
code. The formality of specifications is essential to avoid ambiguity, a ubiquitous trait of
natural language documents and a critical issue for legal contracts [4].
Based on experiences from our earlier work [
5
,
6
] we envision the generation of a
formal specification from NL text as a five-step process: (a) identify domain terms in the
text; (b) annotate the text using an ontology for legal contracts, to determine text fragments
that describe concepts such as ‘role’, ‘obligation’, ‘power’ and ‘asset’; (c) mine relationships
Informatics 2022, 9, 72. https://doi.org/10.3390/informatics9040072 https://www.mdpi.com/journal/informatics