Digitising Maltese Law

Digitising Maltese Law
10th November 2016 RIDT


Language is a multi-layered tool that gives poets the licence to alternate the meaning of words, and public speakers the power to imply messages without actually stating them… But what happens when the same language is used in legal contracts? Dr Albert Gatt is investigating.


Dr Albert Gatt

It is only when you start learning a new language as an adult, or studying a language you thought you knew thoroughly, that you truly see how complex languages can be. At this point, a light is shone on the meaning of idioms, a reason is given for the differences in pronunciation of the same vowels, and context becomes the key to understanding why, in a conversation, for example, the homophones ‘their’ and ‘there’, which sound the same, can mean ‘it belongs to them’ or ‘in that place’.

But what happens when those nuances are used in a legal context? Could a vagueness in the meaning of a word or a term affect the validity of a contract? And what happens if the inferred meaning is understood differently by different parties?

“The special thing about how humans use language – something you really have to face if, for example, you’re trying to generate text from non-linguistic input, or trying to analyse text to get to its underlying meaning – is that language has a lot of ambiguity. However, we often don’t notice it because we use all kinds of cues from the context to resolve them,” explains Dr Albert Gatt, a Senior Lecturer and the Director of the Institute of Linguistics at the University of Malta.

In order to counteract this, Dr Gatt is working on a project that will result in an add-on for standard word processing tools that will analyse the text of the contract as it’s being written, enabling the user to perform a number of actions, such as getting a summary of all the parties mentioned in the contract, with their duties and obligations and rights, finding keywords, or shading a key term and cross-referencing it against the entire body of Maltese laws. This project, which has been in the works for a number of years, started from joint discussions between Professor Gordon Pace, from the Department of Computer Science, and Dr Gatt.

“For a long time, Gordon’s been working on certain aspects of legal reasoning and how that can be modelled using sophisticated logics, referred to as ‘Deontic Logics’, which formalise things such as duties, rights and obligations. So, for example, suppose you have a contract which stipulates that a party has the duty to carry out a certain action. For instance, the contract might state that Ms Y shall pay her rent on the first Friday of every calendar month. Is that stipulation contradicted by something else in the contract? Does it go against an existing law? Are the other parties to the contract also subject to obligations that they have to fulfil in order to make it possible for the first party to carry out their duty? And so on,” says Dr Gatt.

Professor Pace has done a lot of work on the formal underpinnings of such constructs, and how they can be used to reason, yet what he was interested in was applying them to contracts and other legal documents. Dr Gatt, on the other hand, is looking at contracts from a different perspective.

“Suppose we think of a contract as being made up of two layers. On the surface, we’ve got the language (Maltese or English) in which the contract is aaeaaqaaaaaaaaigaaaajgjhzdhjnzixltkxnjqtngzhzs05nmqyltfmmtezyta5nwmxyqwritten. Below that, there’s this deeper level – call it the ‘meaning’ if you like – at which one reasons about rights, duties, obligations and so forth.

“What we’d like to do is to go from the linguistic surface to the logical depths. But to do that, we’ve got to analyse the language in an intelligent way. To go back to the earlier example, in order to figure out that the clause in question is about rental payments and that it’s an obligation stipulated on Ms Y, a system needs to know that ‘shall pay’ is a form of a verb that is typically used to stipulate such obligations (‘shall’ is often used as what we call a deontic modal in English).

“Notice, however, that there’s ambiguity there: shall in this context is not about something we know has happened, or even something we are certain will happen, but something we are positing should happen if this contract is to be valid. That needs to be distinguished from the use of “shall” that we use to talk about the future. For example, the statement ‘You shall be awarded a prize on September the 16th’ works differently… It is about an actual, planned, projected event, not an obligation.

“The system also needs to know that Ms Y is the subject of the clause, and that her in the second part of the sentence also refers to the same Ms Y, as
opposed to someone else… To cut a long story short, Gordon and I decided to join forces and to exploit Natural Language Processing techniques to investigate the automatic processing of contracts and using their linguistic surface to plumb their logical depths — A match made in heaven, I think!”

Of course, this all sounds a lot simpler than it actually is. For a computer to be able to tell the notaries and lawyers drafting documents whether a clause goes against an existing law, Dr Gatt and his team still need to integrate the body of laws of Malta into a digitally analysable form, “preferably annotated with a lot of metadata,” he explains. But laws are complex documents with numerous sub-divisions and cross-references that are obvious to human beings but not so clear to a computer.

“For instance, to carry on with the example of a rental agreement, suppose the contract stipulates that Ms Y cannot keep any pets in the house. One question that arises here is: Are there any laws about keeping pets that this particular clause in the contract might be in conflict with?

“The tool aims to enable the user to look up the laws that contain mentions of ‘pets’ but, perhaps more importantly, it should also try to go beyond the word ‘pet’, also finding potentially relevant hits such as laws about ‘domestic dogs’ and so on,” Dr Gatt continues.

While the obvious beneficiaries of this software add-on are the notaries and lawyers working on legal documents, annotating the digital corpus of laws of Malta will also help people who are interested in searching through the laws systematically, not just those who are drafting contracts. The benefits would go further than that, however.

heick-honor-learning-process-istockphoto“Ensuring the meaning in legal contracts is correct and that all clauses adhere to the current laws of the state is absolutely essential if the system is to reason adequately about the contract’s stipulations,” adds Dr Gatt.

Dr Gatt is not sure how long it will take to finalise, but it’s looking promising. This project, after all, could build on a substantial body of formal work already carried out by Prof Pace, and through the help of research assistants and postgraduate students, Karl Borg and Shaun Azzopardi, the project is advancing at a good rate. And, thanks to the help of RIDT, Dr Gatt has also secured a collaboration with a company called Loqus, which will help them hire new researchers to continue working on the project.

Even so, in reality, this project is a small step along a very long road, but, as Dr Gatt put it, “a lot of Artificial Intelligence tries to do just that: solve small problems to gain some understanding of the broader issues.”

Whatever happens, it looks like notaries and lawyers are in for some exciting times ahead!

You can be part of this fascinating world of research, too, by helping many others achieve their breakthroughs in all the faculties of the University of Malta. Please click here for more information on how to donate to research of this kind through the Research Trust (RIDT).