Building a Chatbot That Answers Queries on Business Law

Tian Huat Tan
3 min readNov 29, 2021

In this article, we will highlight an engagement we have done for an educational institution in our IBM Data Science and AI Elite (DSE) engagement. One objective of the engagement is to use Watson Assistant and Watson Discovery to build a chatbot that enables students who attend the offered business law course to query cases or principles in business law.

The workflow is highlighted in the figure above. First, we must import the PDF documents and enable Watson Discovery to index them (this step has been introduced in this article). Second, we must integrate Watson Assistant with Watson Discovery so that the user can query the course material using the Watson Assistant chatbot.

With the high-level workflow in mind, let’s move on to discuss integrating Watson Assistant with Watson Discovery.

First, under IBM Watson Assistant (cloud version), select “Create skill.”

Subsequently, select “Search skill,” then choose “Next.”

Now, choose the Watson Discovery instance we have created (the methodology is covered in this article) and also choose the right collection name under the instance.

Now, choose the annotations for the title and body and how many results to show for a user query (here, we select the top three replies).

In the following chatbot, you can see the top three replies and where the title and body are located.

Until now, we have integrated Watson Discovery and Watson Assistant. The next step is to configure the dialog in Watson Assistant so that it can trigger the search skills we have just configured when a user queries. The way to achieve this is to choose “Anything else” under the Dialog menu and select “Search skill” under “Assistant responds.” The “Anything else” dialog node will be matched if it doesn’t match the previous dialog nodes (here it’s “Welcome” and “Query Law cases and principles,” which are created for other purposes that we will omit here for simplicity).

So far, we have configured everything. Let’s click on “Preview” to preview the chatbot.

In the chatbot interface, we enter “case rainbow.” It does not match the previous dialog nodes “Welcome” and “Query Law cases and principles”; therefore, it is mapped to “Anything else” (by default). The query “case rainbow” will then be sent to Watson Discovery, and the replies from Watson Discovery will be sent back to Watson Assistant and displayed to the user, as we see in the following.

That’s it. I hope you enjoy the simplicity of this approach. With the intuitive user interface of Watson Assistant and Watson Discovery, we have built a chatbot that can query business law documents — without any codes and complexities.

--

--

Tian Huat Tan
0 Followers

Father of one. AI Practitioner and Geek. Computer Science PhD.