Natural Language Processing
How To Use Knowledge Graphs To Build Chatbots That Can Parse Ambiguous User Utterances
Introduction
In this article, I will explain how a chatbot can use a knowledge graph to resolve entities extracted from ambiguous utterances.
We will use Rasa as the example chatbot and TypeDB as the example knowledge graph. I assume the user is familiar with how these tools work. Otherwise, folks can refer to the respective tool’s quick start guides.
The code to reproduce the results in this article can be found here.
Problem Statement
Suppose you are tasked with building a chatbot for a telecommunications company to improve their customer experience. This means that the bot should be able to handle things like bill payment, common customer enquiries, online purchases, etc.
So, given an utterance like:
I want to buy an iphone
It is clear that the user’s intent is to purchase a device and the word “iPhone” is the device. Therefore, annotating this utterance’s intent and entities is straightforward.
Now, consider the following utterance:
iphone