APPLYING COGNITIVE COMPUTING TO LEGAL SERVICES

With the development of Artificial Intelligence (AI) and the growing demand for chatbots that connect to other networks, the popularity of Cognitive Computing (CC) is growing. This paper looks at the development of a cognitive AI chatbot for legal services and explains the requirements and tasks involved in setting up a cognitive AI chatbot. It looks at current legal chatbots and their uses in legal services, considering how cognitive bots can be used to make appointments and handle frequently asked questions. How cognitive bots can be linked to a corpus of information and Application Programming Interfaces is outlined.


INTRODUCTION
Cognitive Computing (CC) is a multidisciplinary research field that involves Artificial Intelligence (AI). Its goal is to understand the phenomena of thinking. AI is a discipline that builds computer programs that perform tasks that require intelligence, such as automated reasoning or machine learning. Both Cognitive Computing and AI are growing fields that are gaining popularity, drawing attention from academia and industry because of the variety of opportunities they offer to improve business functions (Lytras & Visvizi, 2021).
There are two fields of thought: weak AI, which is a field that involves building machines that perform tasks usually done by humans. These tasks need some degree of intelligence. The other, strong AI, argues that the machine must perform a cognitive task such as thinking (Butterfield & Ngondi, 2016). Cognitive Computing finds patterns in data using algorithms that allow the computer to understand the data the same way a biological neural network does. This paper focuses on the 'how' question and considers how a Cognitive Computer system (CCS) is developed. It hopes to shed light on software development that uses AI and CCS. The domain selected was Law to make an inspiring example of a legal website of the future, which improved the customer experience and increased user trust by adding interactivity using CCS. As this paper details, this research offers relevant implications for developers and academics who are eager to know more about implementing AI as a service.

BACKGROUND
Cognitive Computing is a new way to innovate and deliver software as a service. Companies such as Netflix use it to understand their customers' behaviour better and enable the service to offer a unique experience for each customer (Sandhya et al., 2021), giving the firms that harness the power of AI the edge over competitors. Cognitive Computing is almost a hidden technology, as many users do not know they are using a cognitive system (Schuetz & Venkatesh, 2020). Nevertheless, this technology is profoundly reshaping the development process of software and delivering the best user experiences. Not only will users benefit, but the companies will benefit also. Law firms, for example, handle volumes of information, searching many online repositories and accessing legal database systems. Using AI, information can be accessed at an increased speed and efficiently return the most relevant information to increase the effectiveness of lawyers. This technology has the potential to reshape the Legal System and improve the quality of legal services.
Cognitive Computing systems have characteristics that are different from a typical digital system. As information or data is added, the system learns from it and alters the system. It develops different objectives and requirements as a result. Cognitive Computing systems connect to other elements within the system's network, and then the system interprets the input given by the human and provides relevant answers. Cognitive Computing systems have the capacity to understand complex information and predict results (Nayak et al., 2020).
Simple AI chats bots are autonomous programs on a network, usually the internet, that can interact with systems or users. AI chatbots have been used in computer games to help guide users and are increasingly used on commercial websites to support customers. These chatbots respond to queries and are designed to feel like you are speaking to a human. Cognitive Computing bots use systems such as IBM Watson services. This intelligent application allows companies to process 2 service requests and can be linked to different platforms like Facebook, LinkedIn, or websites.
Well-designed chatbots can save time by guiding users through steps to accomplish a task, gathering information and interacting in a personal way. A trial looked at how users would respond to a chatbot that answered questions about sexual health. Despite mixed attitudes towards chatbots, the users thought the chatbot was convenient and allowed them to be anonymous and offered information in a nonjudgmental way (Nadarzynski et al., 2021). However, poorly designed chatbots will frustrate users and create a negative feeling toward the company. Because of the interface and the use of natural language, users tend to assume a high level of skill, which may not match its actual capability. Users will get frustrated if the chatbot does not meet expectations (Schuetzler et al., 2021).

LAW BOTS
Law bots can be simple chatbots or Cognitive Computing systems built to provide a bespoke legal application. They have the potential to offer an effective approach to providing people with essential legal advice 24/7 and are typically free. Although there are a few Law bot examples, it is not common practice yet with Cognitive Computing still comparatively new to the legal sector.
One of the first Law bots, called "DoNotPay", was created by Joshua Browder, famous for successfully overturning 160,000 parking tickets in London and New York. The DoNotPay bot was built on IBM Watson (Olson Parmy, 2016). Robot Lawyer LISA was created in 2017 and is a free tool for the creation of confidentiality agreements or non-disclosure agreements. The idea is to eliminate the need to use a lawyer during the negotiation process, with LISA creating the document. This bot is currently being expanded to also create draft commercial leases. LISA aims to solve the issue with cost, time, and convenience. It was created by Chrissie Lightfoot and Adam Duthie and was built on Neota Logic.
Another Bot is Billy Bot, a junior clerk Bot who helps barristers' clerks deal with questions from the public. Billy Bot can also make clients coffee as it is connected to a smart coffee machine. Billy Bot was built using IBM Watson.
ROSS Intelligence also used Watson. The ROSS bot searches a massive legal database and produces the relevant information in the form of a report. The ROSS Intelligence bot is a monthly subscription service aimed at lawyers.
IVA is a chatbot that assists immigrants based in Montreal. IVA answers Frequently Asked Questions about moving to Canada and can interact in different languages. The data is only stored per session and is not retained. IVA's purpose is to give users the correct information quickly.

APPLYING COGNITIVE COMPUTING AND AI TO A LEGAL WEBSITE
A legal website was built using WordPress, a free and open-source content management system. The website included a chatbot called LegalBot to answer questions about Living Wills and signpost people to the correct forms. This project was developed and trained in English.
LegalBot was built using IBM Watson Assistant, one of today's leading Cognitive Computing systems. IBM Watson Assistant is an artificial neural network (High & Bakshi, 2019) based on the complex POWER7 architecture (Abrar & Arumugam, 2013). The IBM Watson Assistant Lite plan provided a free service allowing up to 1000 users per month. Watson also has a Natural Language Classifier (NLC) and Natural Language Understanding (NLU). It is much more than a chatbot and links to a host of cloud services. LegalBot is designed to be engaging, answering frequently asked questions by text or a video explanation. The bot signposts users to forms, and if the user wants to see a solicitor, it arranges a meeting. If the bot cannot help the user, it will switch to a human agent.

CREATING LEGALBOT
Firstly an IBM cloud account was created, and then a Watson assistant service was added and an IBM Discovery Service. There are then three parts to creating and teaching an IBM Watson Assistant: 1) Intents -the user's intentions or goals, such as "make an appointment;" 2) Entities -values detected within the intent, such as "a place name;" and 3) Dialogue: The conversational responses from the chatbot, such as "Hello, can I help you?"

Intents
A list of commonly asked questions and answers were formed to start building LegalBot. These were drawn from relevant texts, including King's "Private Client" (Lesley King, 2020) and through examining frequently asked questions within other legal sites on living wills and advanced decisions. In addition, intents were identified through reading frequently asked questions on traditional solicitors' websites along with advice provided by the NHS (National Health Service) and Age UK websites. For Advanced Decisions, typical questions included: "What is an Advance Decision?", "How do you make an Advanced Decision?" and "Is a Living Will the same as an Advanced Decision?" For Lasting Power of Attorney (LPA) questions included: "What is a Lasting Power of Attorney?", "Can you have both property and health LPA?" and "Who can be an Attorney?" From this assessment of typical interactions, LegalBot was provided forty-eight intents, that is, actions that the user may express and will need the application to support. Figure 1 provides examples of some of the intents.
Intents contain action words such as "ask", "cancel", and "reschedule". Other intents were added to deal with general conversations, including greetings which dealt with "Hello", "hi", and "howdy." Other intents trained LegalBot to understand that when a human wants to end the conversation, they say "Bye" or "goodbye." The Joke intent was added to demonstrate that the LegalBot could interact with an Application Programming Interface (API), and the incorporation of humour was included with the aim of making LegalBot appear more human. Some intents were added to answer questions about typical chit-chat that bots need to deal with, such as "Will you take over the world?"

Figure 1 Some of the intents used in LegalBot
As natural language is complex, people use different expressions to express the same intent. For the bot to understand this, each intent requires a list of possible ways users could express that intent. For example, as detailed in Figure 2, there are various ways for someone to ask to schedule an appointment.

Figure 2 Intents for making an appointment
Every time a new example is entered into LegalBot, IBM Watson's service begins to train the bot. It is best to try it out and confirm that LegalBot has understood the intent. In Figure 3 LegalBot correctly identifies greeting. and shows that LegalBot has understood the user's intent.

Entities
There are two types of Entities: "system" and "own Entities". The LegalBot has nine bespoke Entities. Entities are normally nouns such as location names or the object of the conversation. The System Entities can be turned on or off and are: "time", "date", "currency", "percentage", "number." Entities help the bot understand what the subject of the conversation is. For example, the difference between "I want to come into your London office" or "I want to come into your Sunderland office" the bot needs to understand that "London" or "Sunderland" are office locations and can differentiate between them. The LegalBot can be seen to have understood the user's request "Can I come in tomorrow" as a request for an appointment and that the user has requested a date. Bespoke Entities that were used in LegalBot are outlined in Figure 4.

Figure 4 Entities
When training LegalBot, several issues were found with getting the bot to understand first names and surnames and the difference between them. This was extraordinarily tricky and involved 116 examples of first names and 650 examples of surnames. IBM did previously have a system entity for handling names; however, this was removed as it did not work. With LegalBot, the solution was to use birth, death, and marriage records. However, training a Bot with names will be different depending on the country. This is something that developers should be aware of as it adds time and effort to the development process.  Understanding the flow of dialogue is complex. The dialogue is set up as a decision tree in IBM Watson. Developers can interact via text, options, images, video and webhooks. Figure 6 decomposes the living will advanced decision node revealing the child nodes attached.

Making the bot smarter
In order to make LegalBot smarter, it was connected to the IBM Discovery service. IBM Discovery services allow for documents to be uploaded and stored to form a corpus of data that can be queried. Services include document annotation, forming entities, and building relationship classifications. This service was trained with a sample of law cases and papers and frequently asked questions.
Supervised learning, a method that allows the machine to learn by example, was used to map the input to output. Fifty-four documents were entered classified as: answers, questions, header, subtitles, table of content or text, see figure 7. LegalBot was also enhanced with unsupervised learning, a machine learning method that allows the machine to learn entirely on its own. A web crawler application traversed several legal blogs systematically yielding 473 documents. LegalBot can be visited at: https://legalbot.deborahwhittle.com/ai-lawyer/

Making the bot secure and compliant
There are security implications when users are required to pass any confidential information which should be passed through an encrypted channel, as is often the case in legal services. Using IBM Watson ensured a robust security procedure that wrapped the interactions with an encryption layer. IBM also has a "no third party" policy, so no popups will ever show up. IBM recognise the importance of being trustworthy, and believe that your data is yours and yours alone (IBM, 2017).
IBM Watson and the Discovery Service are GDPR compliant. They both use Privacy Shield or Safe Harbour. They are certified with ISO 20000-1, SSAE 16, ISAE 3402, and BDSG.

TESTING
A small user test was conducted with a university law department aiming to assess whether LegalBot could support the law department by providing a bot that can: 1) Respond appropriately to questions about Living Wills; 2) Signpost people to the correct paperwork needed for Living Wills and LPA; and 3) Give advice about Living will and LPA.
Two users participated. Firstly, an expert user -the Head of a Law department that runs a Law Clinic. Secondly, a law student starting their final year. Both users were asked to engage with LegalBot after an explanation was given about LegalBot's main functionalities: answering questions about living wills and LPA; signposting users to relevant forms; making, cancelling and changing appointments; providing directions via a map; and telling a joke.
The expert user suggested that the LegalBot would be a helpful tool for the Law Clinic to help walk-in clients that need advice on Living Wills and LPA. They confirmed that signposting to forms was a beneficial feature. They also felt that the legal practitioners would consider the ability to use video messages important for supporting clients. The expert user thought LegalBot's capability to make an appointment for users to attend the law clinic was innovative and viewed it as an important feature. They also felt LegalBot could be expanded to cover other aspects of the Law.
The think-aloud method, a usability method that is used to help understand the cognitive processes the user requires when first learning to operate an unfamiliar system (Alhadreti, 2021), was used with the student test. The student user did a walk-through of a scenario where they were a client who was starting to forget things. As this was becoming a concern, the client wanted to know what her options were for Living Wills and LPA. The student user interacted effectively with LegalBot, they found the information quickly requiring no help. The student user used words like incredible, excellent, and engaging. They liked the video feature and the function to print forms out.

DISCUSSION
This paper aimed to explain "how" Cognitive Computing could be implemented and to show how it differs from conventional Computing. Cognitive Bots could be developed for many different social uses or any profession where users require advice. However, as users will perceive websites that use AI Chatbots to be of a higher calibre, it is important to ensure that bots are both usable and secure.
The paper outlines the successful application of IBM Watson Service to create a law bot. IBM Watson Service is incredibly flexible and can be configured for many different situations. However, making an effective bot involves researching the problem the bot is the solution for, developing a study of the questions users are likely to ask, a significant degree of testing and training and user observations. Creating a bot is not an out-of-the-box solution and requires lots of time and effort.
Developers need to be aware that when using Watson, there is a temptation to train the assistant to answer every question, and this was an error that was made the first time around in this project. It was found that the bot will respond with better answers if the developer specifies a goal as a target and narrows the field.
There are still some weaknesses with this type of system, with critical problems including challenges in getting Watson to populate a form. The other problem was with the data in the Discovery service; once data had been entered into the corpus, it could not be deleted. So, care must be taken with choosing sites or parts of sites from which the web crawl is done.
The approach taken to creating a law bot was successful, and LegalBot was used effectively by the test users. They found LegalBot an excellent solution for helping support people who need answers about how to create a Living Will or LPA.
Building an effective bot, such as LegalBot, is an ongoing process that requires updating and testing, and it will continue to improve over time. Even so, there will be users who don't want to engage with bots. Developers should include a way of allowing them to engage with a human if they wish.
The legal site, including LegalBot detailed in this paper, is currently undergoing testing with users to explore if the use of Cognitive Computing affects users' trust. Future work will be done with the Law Clinic with real clients to see how they respond to the LegalBot. There are also plans to make more bots that can cover other areas of Law as well as including features such as text to speech or adding Language recognition. Designing and building bots is a process that, once learned, can be applied to many domains, the process becoming easier and faster with experience.
In recent years, cuts in legal services have left more people having to pay for legal services, leading to many people representing themselves. The benefit of a system such as LegalBot is that it can help deliver advice given by a solicitor. This advice is then accessible to all, helping to drive social justice and delivering a fair legal service. Legal Services that can offer low-cost solutions will benefit all users. Future development could include using a bot to prepare people for court or areas where people are afraid or embarrassed to talk to a person. Law bots are truly unbiased when giving advice. In some ways, they are just like Lady Justice, a wellrecognised symbol in most lawyers' offices who treats everyone fairly because she sees no difference in the parties concerned.

CONCLUSION
6 Cognitive Computing provides a useful approach to providing users with effective interactions. It offers a different approach that could change how we engage with effectively automated services in domains such as Law. LegalBot provides an example of a Cognitive Computing system, providing advice for users on Living Wills and the Lasting Power of Attorney built using IBM Watson. Although IBM Watson does provide useful services, it is not an out-of-the-box solution, with the designbuild-train-test cycle taking considerable time and effort. However, the result is worthwhile with cognitive systems differing from traditional systems, as when data is added to a cognitive system, it learns and alters. LegalBot highlights the potential of Cognitive Computing with users able to interact effectively to answer legal queries. Current work focuses on user testing, including a consideration of the user's trust.