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.

Jonathan Chiu
Marketing Director
3DP Technology Limited

Jonathan handles all external affairs include business development, patents write up and public relations. He is frequently interviewed by media and is considered a pioneer in 3D printing products.

Krutz Cheuk
Biomedical Engineer
Hong Kong Sanatorium & Hospital

After graduating from OUHK, Krutz obtained an M.Sc. in Engineering Management from CityU. He is now completing his second master degree, M.Sc. in Biomedical Engineering, at CUHK. Krutz has a wide range of working experience. He has been with Siemens, VTech, and PCCW.

Hugo Leung
Software and Hardware Engineer
Innovation Team Company Limited

Hugo Leung Wai-yin, who graduated from his four-year programme in 2015, won the Best Paper Award for his ‘intelligent pill-dispenser’ design at the Institute of Electrical and Electronics Engineering’s International Conference on Consumer Electronics – China 2015.

The pill-dispenser alerts patients via sound and LED flashes to pre-set dosage and time intervals. Unlike units currently on the market, Hugo’s design connects to any mobile phone globally. In explaining how it works, he said: ‘There are three layers in the portable pillbox. The lowest level is a controller with various devices which can be connected to mobile phones in remote locations. Patients are alerted by a sound alarm and flashes. Should they fail to follow their prescribed regime, data can be sent via SMS to relatives and friends for follow up.’ The pill-dispenser has four medicine slots, plus a back-up with a LED alert, topped by a 500ml water bottle. It took Hugo three months of research and coding to complete his design, but he feels it was worth all his time and effort.

Hugo’s public examination results were disappointing and he was at a loss about his future before enrolling at the OUHK, which he now realizes was a major turning point in his life. He is grateful for the OUHK’s learning environment, its industry links and the positive guidance and encouragement from his teachers. The University is now exploring the commercial potential of his design with a pharmaceutical company. He hopes that this will benefit the elderly and chronically ill, as well as the society at large.

Soon after completing his studies, Hugo joined an automation technology company as an assistant engineer. He is responsible for the design and development of automation devices. The target is to minimize human labor and increase the quality of products. He is developing products which are used in various sections, including healthcare, manufacturing and consumer electronics.

Course Code Title Credits
  COMP S321F Advanced Database and Data Warehousing 5
  COMP S333F Advanced Programming and AI Algorithms 5
  COMP S351F Software Project Management 5
  COMP S362F Concurrent and Network Programming 5
  COMP S363F Distributed Systems and Parallel Computing 5
  COMP S382F Data Mining and Analytics 5
  COMP S390F Creative Programming for Games 5
  COMP S492F Machine Learning 5
  ELEC S305F Computer Networking 5
  ELEC S348F IOT Security 5
  ELEC S371F Digital Forensics 5
  ELEC S431F Blockchain Technologies 5
  ELEC S425F Computer and Network Security 5
 Course CodeTitleCredits
 ELEC S201FBasic Electronics5
 IT S290FHuman Computer Interaction & User Experience Design5
 STAT S251FStatistical Data Analysis5
 Course CodeTitleCredits
 COMPS333FAdvanced Programming and AI Algorithms5
 COMPS362FConcurrent and Network Programming5
 COMPS363FDistributed Systems and Parallel Computing5
 COMPS380FWeb Applications: Design and Development5
 COMPS381FServer-side Technologies and Cloud Computing5
 COMPS382FData Mining and Analytics5
 COMPS390FCreative Programming for Games5
 COMPS413FApplication Design and Development for Mobile Devices5
 COMPS492FMachine Learning5
 ELECS305FComputer Networking5
 ELECS363FAdvanced Computer Design5
 ELECS425FComputer and Network Security5