School of Science and Technology 科技學院
Computing Programmes 電腦學系

A chatbot for Chinese medical diagnosis and dietary recommendation according to Traditional Chinese Medicine

Hon Yuet Sim

  
ProgrammeBachelor of Computing with Honours in Internet Technology
SupervisorDr. Andrew Lui
AreasIntelligent Applications
Year of Completion2018

Objectives

The aim of this project is to develop a chatbot to strengthen people's health awareness by giving healthcare consulting service base on TCM theory and help people to build healthy eating habits by recommending dietary therapy. A chatbot will act as a traditional Chinese physician to interact with the users and diagnosis by guiding them to speak about all the symptoms they are experiencing. Users can increase understanding of their physical conditions with this healthcare consulting service and thus health awareness can be strengthened. Moreover, dietary recommendation can be made after the consultation. Searching a dietary therapy recipe which meets both personal needs and food preferences can be a time-consuming task as there is too much information online. With the requirements specified by the users, the chatbot can recommend the most suitable recipes to them with information likes therapeutic effect and usage. Time can be saved and users can improve their eating habits by deriving knowledge.

 

To achieve the aim, the main objective of the project is to develop a chatbot that can understand user's sentences and retrieve accurate and useful information of conditions and recipes to satisfy their personal needs.

The project has defined a number of sub-objectives as follows:

  • Data collection of TCM syndrome classification and dietary therapy recipes.
  • Organize and insert data collected as JSON documents in the IBM Cloudant NoSQL database, import data from a CSV file as entities in the IBM Watson Assistant service.
  • Add recipe data into the database of the Recombee Recommender engine.
  • Add intents and build dialogs in a workspace of the IBM Watson Assistant service.
  • Integrate different technology modules into one Android mobile app.
  • Evaluation the chatbot to analyze the performance.

Background and Methodology

OLs who are suffering from different health problems like insomnia and constipation are used to visit a traditional Chinese physician in Chinese medicine clinic or herbal tea shop for consultation. They will be informed of their syndrome and the corresponding treatments. For those who want to prevent illness, they might buy Chinese herbal tea or Chinese style soup from herbal tea shops. They choose products from the comparison between the therapeutic effects and their symptoms after consulting the physicians. In this project, a chatbot will be used to replace the physicians to give consultation. The chatbot will be able to understand users' needs and give an accurate diagnosis and personalized recommendations using several technologies. Users can interact with the chatbot through an Android mobile app. The following figure simply shows how different components integrated together.

Overall Architecture of the System

Users can use the chatbot through typing sentences into an Android app. The chatbot is integrated with the following components:

Android App

The chatbot is implemented as an Android app to interact with the users. Users can simply use the chatbot by installing the apk file with an Android mobile phone.

IBM Watson Assistant

The IBM Watson Assistant service provides an easy way to build and deploy a chatbot which understands natural language input and responds to users through conversation like humans. To use this service, a workspace need to be created first. Then, intents, entities and dialogs can be maintained in the workspace. Intents are the goals that the users want to reach. Entities are the terms that provide context for an intent. The dialog flow determines how to respond to the users. Branches can be added in the dialog to handle different intents and entities identified by the service from a user's input. After adding the training data, a natural language classifier is automatically added to the workspace so that it can understand the user's requests. The IBM Watson Assistant API is used to connect the service on an Android app.

IBM Cloudant

The IBM Cloudant is a NoSQL cloud database-as-a-service which provides a highly scalable and performant JSON database service. It is used for data storage of the conditions with their symptoms, details of ingredients including name, thermal nature and therapeutic effects, and recipes including the type, name, ingredients, steps and usage. The data of the conditions come from the book Chinese Nutrition Therapy by Joerg Kastner while the details of ingredients and the recipes are scraped from the website http://www.nourishu.com/.

Recombee Recommendation Engine

The Recombee Recommendation Engine is an artificial intelligence powered recommender as a service which provides users with personalized recommendations through a real-time API. It reduces the time for searching relevant content to a user. It uses an ensemble of collaborative filtering (matrix factorization, nearest neighbors, etc.) algorithms, which work on the interactions (views, purchases, etc.), and content-based algorithms, which work on the item properties (titles, descriptions, etc.). If there is not a lot of interactions (cold start), content based algorithms are chosen. Otherwise, collaborative filtering algorithms are chosen. The algorithms are chosen automatically to give the best results.

Evaluation

In this project, the accuracy of understanding a user's intent of the chatbot and the accuracy of making a suitable recipe recommendation should be analyzed. However, although the Recombee KPI console provides the click-through rate (CTR) and the conversion rate (CR) of the recommendations, they are incredible unless real users interact with the items. Therefore, this chapter will only discuss the performance of the chatbot with the accuracy for understanding a user's intent.

Conclusion and Future Development

Chatbot has become a worldwide trend and is used more and more frequently for business. Unlike live chatting, chatbot provide a 24 hours service to allow people to get information and answers quickly. In the past 9 months, a chatbot has developed and integrated with different technologies due to the problem of unhealthy eating and the rise of dietary therapy. A user can chat with the chatbot by installing it in an Android mobile phone to perform the following three tasks. First, the user can ask for a health consultation by inputting the symptoms she realized. She can discover other symptoms she has and get advice on her most likely syndrome. Second, the user can learn more about an ingredient by telling the chatbot that she wants to know more about an ingredient, with the name of the ingredient. Third, the user can request a therapy recommendation with her requirements of food, her symptoms or conditions. She can click on a recipe name to check the entire recipe and bookmark it for future reference. These achievements lead to the satisfaction of the aim and objectives of this project.

However, there are some limitations in the solution. First, the diagnosis may not be accurate as the solution diagnosed a user with only one condition by the asking diagnostic method based on the theory of zang-fu, so it is for reference only. In real life, a patient may have more than one syndrome each time and the syndrome is analyzed using the four diagnostic methods: inspection, listening, asking and palpation. Second, no follow-up after consultation. In real life, a traditional Chinese physician would provide regular follow-up to a patient to see any improvement or deterioration with his/her condition. Therefore, professional knowledge from TCM practitioners should be involved to optimize the performance of the diagnostic procedure and the result. Also, a regular follow-up should be added.