Robo-lawyer: Your AI Conflict Resolution

2019-05-21

Getting a divorce is hard, but going through paperwork and court proceedings can leave a deeper scar. A team of HKUST’s Computer Science and Engineering (CSE) students, supervised by professors and alumnus, has developed a “robo-lawyer” that not only saves time and money, but also paves the way for wider application of artificial intelligence technologies in the legal profession.

Hong Kong’s divorce rate in 2016 was more than double that in 1991. The rising demand for family mediation has been a mounting challenge for Albert SO, a CSE alumnus from HKUST, who chairs the Hong Kong Mediation and Arbitration Centre. Few divorcing couples actually realized that the high legal costs and procedural drag would take an emotional toll on themselves, says Albert. Many of them are unwilling or unable to sit down for a mediation that could take months or years, especially for cross-border couples.

This is where technologies can play a role to make things easier and avoid face-to-face conflicts. Albert reached out to his alma mater in the summer of 2018 and collaborated with a group of four CSE undergraduate students – Jack CHEN, Oliver ZHANG, LIU Sonya and Wesley NGAI who were in their third year. The lawyer’s quest became their final year project (FYP) – developing the city’s first-of-its-kind smart contract generator with a chatbot specialized in generating divorce agreements and employment contracts. After nine months of research, collaboration with legal professionals and then trials and errors, the team now proudly presents their program which will lead a paradigm shift in the legal field.

“This project is interesting as the Center’s application is very much geared towards the masses,” says SONG Yangqiu, Assistant Professor from the Department of CSE and Associate Director of WeChat-HKUST Joint Lab on Artificial Intelligence Technology, who supervised the FYP. 

The robo-lawyer’s primary task is to sort out essential matters for drafting the agreement from user’s input of 20 questions. The user can retrieve an agreement only if he/she can answer all questions, showing that they have thoroughly considered all the matters of concern in a divorce, such as custody of children and alimony.

To make the robo-lawyer more like a real person, the team applies sentiment analysis in it to help identify true feelings and moods of a person heading to a divorce through the dialogue. When a user writes “I am glad”, for instance, it should be interpreted as an expression of relief instead of being upbeat. It even makes effort to persuade couples to think twice before finally deciding to divorce.

“Not only can it make responses based on the users’ feelings, but also advises users to prudently reconsider if they really want to get divorced,” says team member Oliver. Users showing signs of hesitation, he adds, will be directed to contact other professional services.

It has been a very steep learning curve for the team. While AI is part of the CSE students’ foundation studies, they had to learn Natural Language Processing (NLP) from scratch to develop a chatbot. Yet that was not their biggest obstacle.

“There aren’t too many technical boundaries. It’s mostly the lack of divorce-specific data that prevented the team from building a more complex deep learning program from scratch,” explains Prof. SONG. As past divorce cases are kept confidential, the team had to adopt a ready-to-use open source platform and fine-tune the program to serve its specific purposes.

However, when the program is well utilized, big data processed by the chatbot will be able to offer a solid ground for social policy planning. “The divorce rate is on the climb in Hong Kong and the chatbot program can provide an analysis on the pattern of causes and resentments behind divorces. It certainly will help the government and service providers to come up with suitable measures,” comments Jack.

The four team members are thankful for the FYP that has given them valuable experience in self-learning and teamwork.

“After four years in university, we are able to learn something new really fast,” Jack says. “We now know better how to work as a team, thanks to previous group projects. Here we’ve also got used to self-motivated learning, thus we could quickly acquire a new skill and apply it to the FYP.”

While the robo-lawyer still needs further polishing and training before it can be put into use in the real-life setting, Albert is hopeful that it will soon benefit divorcees from saving tens of thousands in legal fees and lawyers from focusing on more value-added duties as computers will perform the more tedious and repetitive tasks.

HKUST’s Computer Science and Engineering students discuss with their supervisor SONG Yangqiu.
HKUST’s Computer Science and Engineering students discuss with their supervisor SONG Yangqiu.
Robo-lawyer is a smart contract generator with a chatbot specialized in generating divorce agreements and employment contracts.
Robo-lawyer is a smart contract generator with a chatbot specialized in generating divorce agreements and employment contracts.