How chatbots work… When you say something to a chatbot the bot processes your sentence with the goal to identify your “intent“.
If the bot “feels” it is confident it has understood your intent, it provides an answer, if not it usually asks to repeat the request, maybe using different words.
Processing your sentence to understand the intent is strongly related to the domain of the conversation as the same question, asked in different domains, can lead to a different answer.
To help your bot be “smarter” you need to provide several different ways to phrase the same question (the so called “utterances“).
As an example the question “What is the status of my order?” could “hide” the same intent of “Has my last order been shipped?” or “When should I receive my order?“.
Providing a rich and diverse set of utterances for each intent and making sure there is no overlap between the utterances related to different intents is one of the keys for a well functioning chatbot.
To avoid a natural bias each of us has in how we use our language to express our intent, it is a good practice to dedicate to the utterances collection a team of people and not a single individual and to include in the “training” process not just the team that is developing the bot but also real end-users.
Even better if you have an history of real conversations you can leverage on. You’ll be surprised to see how many different ways of saying the same thing we humans are able to come up with.
Another key capability for a smart chatbot is being able to dynamically change the confidence threshold it uses during a conversation to determine if it can provide a reply or if it is safer to ask for further clarification.
There are many other things a good bot should be able to handle like the ability to recognize, within a sentence, the entities that could influence the process of picking the right answer.
How chatbots work… How do chatbots understand human language?
For example, imagine you ask your bot “How much does it cost 1lt of milk?”, well, your bot should be able to extract “milk” and “1lt” while understanding that your intent is to know the price.
This will make your bot capable of providing an answer different from the one it should pick when answering to “How much for a gallon of orange juice?”.
If we ask to our bot to be able to recognize not just intents and entities but also the context in which a question is asked, than things become a little more complicated.
But, don’t worry, the best chatbot frameworks can help you build bots that remember the all conversation flow and can easily handle such situations.
So, again, if after asking “How much does it cost 1lt of milk?” you add “and does it come in a glass bottle or in a plastic one?” your bot will be able to understand that your second question is related to “milk”.
There are many more things a chatbot can and should do and we’ll continue this conversation step by step, meanwhile thank you for reading.