Extending a Conventional Chatbot Knowledge Base to External Knowledge Source and Introducing User-Based Sessions for Diabetes Education

Extending a Conventional Chatbot Knowledge Base to External Knowledge Source and Introducing User-Based Sessions for Diabetes Education

Shafquat Hussain (Western Sydney University, Australia) and Athula Ginige (Western Sydney University, Australia)
DOI: 10.4018/978-1-5225-6023-4.ch015
OnDemand PDF Download:
No Current Special Offers


Chatbots or conversational agents are computer programs that interact with users using natural language through artificial intelligence in a way that the user thinks he is having dialogue with a human. One of the main limits of chatbot technology is associated with the construction of its local knowledge base. A conventional chatbot knowledge base is typically hand constructed, which is a very time-consuming process and may take years to train a chatbot in a particular field of expertise. This chapter extends the knowledge base of a conventional chatbot beyond its local knowledge base to external knowledge source Wikipedia. This has been achieved by using Media Wiki API to retrieve information from Wikipedia when the chatbot's local knowledge base does not contain the answer to a user query. To make the conversation with the chatbot more meaningful with regards to the user's previous chat sessions, a user-specific session ability has been added to the chatbot architecture. An open source AIML web-based chatbot has been modified and programmed for use in the health informatics domain. The chatbot has been named VDMS – Virtual Diabetes Management System. It is intended to be used by the general community and diabetic patients for diabetes education and management.
Chapter Preview


With the rapid advancement of computing technology and the underlying language processing software progresses, there is an exponential growth in the delivered complexity of chatbots. They have already come a long way from their roots in systems that were more about simple chat or fun and entertainment. A text based or a voice based conversation is usually initiated by the user who asks a question using natural language and the chatbot answers the question using natural language. Natural language has recently been viewed as a compelling enabling technology for personalisation, which allows each user to interact with the system in his or her own words, rather than using one of a small number of preset ways to interact (Zadrozny, Budzikowska, Chai, & Kambhatla, 2000). From the chatbot literature, it is suggested that chatbots are like a typical search engine function but only produce one output as compared to a typical search engine. The basic process flow for a chat bot is similar to the search engine where an input is entered each time and a new search is done to produce a meaningful and relevant output (Lokman, & Zain, 2010). The brain of the chatbot is its knowledge base which could be simply in the forms of file/s or a database. Figure 1 shows the fundamental structure of a typical chatbot.

Figure 1.

Chatbot Structure


A typical implementation of chatbot brain/knowledge base contains a set of hand coded templates which match user inputs and then generate responses. Because those templates are hand coded, therefore the chatbot knowledge base is limited and the conversational level of the chatbot is insufficient to satisfy the users. In order solve this problem and to augment the traditional hand coded approach to the chatbot knowledge base, we presented a chatbot architecture that will use Wikipedia information, along with its own local hand coded knowledge base. The modified chatbot architecture also integrates user specific session ability in Virtual Diabetes Management System (VDMS) chatbot. The user specific ability of the chatbot will help the chatbot to remember and recall the previous conversation sessions of an individual user during the current conversation session.

This web-based chatbot (VDMS) will help general community members and diabetes patients by interacting with them during a question answer session. A new user needs to register first in order to start a session. After completing the registration process, a new user is created in the chatbot's database with its own login credentials. A logged in user can start the session by typing questions about diabetes in natural language and the chatbot will provide answers to the user’s queries using the same natural language. All the conversations are saved in chatbot's database against that logged in user. AIML - Artificial Intelligence Mark-up Language that has been used to program the local knowledge base of VDMS has the ability to remember the previous utterance of the chatbot by using <that> tag inside the AIML categories. Categories are the single unit of knowledge inside the AIML file. Another tag called <topic> let you to group the categories in AIML on the same topic. Typically we group together a bunch of categories into one topic. With the use of <that> and <topic> tags, the chatbot can generate a response that remains in the same topic and the context of the conversation can be maintained up to a certain extent. These tags are really effective in creating a continuous dialogue scenario with the chatbot on a particular topic. This ability is used to elaborate the user's/patient's condition by VDMS asking questions to the user/patient during the conversation. A sample dialogue scenario is show below;

  • User: I am diabetic

  • VDMS: Is it diabetes Type 1 or Type 2?

  • User: Type 2

  • VDMS: Do you take oral medicines or insulin or combination of both to control your blood glucose level?

Complete Chapter List

Search this Book: