When building chatbots there are two main approaches for formulating dialogue between a user (patient) and a dialogue agent (A.I. chatbot). These are keyword matching and intent classification, intent classification can be further improved using entity recognition.
Keyword matching
A user will input a sentence such as “I have a headache” and the word “headache” will be matched to a particular response. Doing this is a long process as each keyword needs to be individually typed up and given an appropriate response. This will work well when the amount of chat message data is low but is not scalable to when the user base and functionality increases.
Intent classification
This involves the A.I. understanding the whole meaning of a sentence and classifying it against a particular intent. For example, “I have stomach pain” will be matched to a SYMPTOM intent whereas “Can I cancel my appointment tomorrow” will be matched with the APPOINTMENT intent. In the case of the first sentence, the system would then look within the possible symptoms and find the appropriate response for when someone says they have a “headache”.
Entity recognition
Another aspect of intent classification is finding entities, these are bits of information within the data to give context. For example, “Can I cancel my appointment tomorrow” has the entity DATE = “tomorrow”. The system would need to be trained to discover these bits of information.
Example Architecture
Let’s take the example user message as: “I want to cancel my appointment next week”.
This message is classified against a particular intent, in this case APPOINTMENT.
Then the entities in the text are discovered, date=“Next week”. The system then does a series of checks to see whether the patient does actually have an appointment and sends a response. “Do you confirm you want to cancel you appointment next week on Thursday?” Once confirmed, the patient’s appointment is cancelled and a new one can now be scheduled.
Intent Classification
Some of the possible intents that can be used, include “Symptoms, Appointments, Medication” are intents that also may contain sub-intents. AI’s that respond to users symptoms require massive amounts of data to be accurate and pose the risk of giving a wrong diagnosis to a patient. Therefore, systems for actively collecting this data but not using it until a significant amount of data is collected are required during the training phase.
Data Collection
Wizard-of-Oz
A common method used is the “wizard-of-oz” method where subjects interact with a computer system that they believe is using an A.I. but there is actually a human sending response. The benefits of this are two-fold. Firstly, the messages the user sends are representative of how they would behave if talking to an AI. Secondly, it allows user input and output to be correctly labelled which is necessary to make the system robust. The person replying would be required to “tag” every interaction under a particular intent, then the system could learn that when a patient says “ 你好 ” then it is a GREETING and the it can automatically respond.
Knowledge Mining
Knowledge mining is useful for collecting information related to diagnosing users symptoms. It would involve downloading vast amounts of data around diagnosing patient symptoms to accurately predict the cause of their issues.
Manual data entry
This involves manually typing up “fake” messages with their responses and labelling them to have an initial dataset. The issue is that the data is often not representative of how a patient would actually talk with a physician and also the process takes a long time.
Summary
Most modern chatbots such as ones built by WeChat or Facebook tend to use the intent classification as mentioned above along with a knowledge databse. For a chinese example check this chatbot by WeChat.