I have been studying solutions for businesses that want to build their own chatbot. And we have a lot of options: Rasa, IBM Watson, Amazon Lex, Microsoft LUIS, Blip.ai, NLP.js, Bot Framework, BotSchool and more…
The amazing thing is that, however much the same problem, all the solutions built are very different. For example, imagine: Five people at the same point in the city, give them a far way destination, let them go alone… Belief… They probably went to different paths. Even if they from the same place and arrived at the same place.
This way happened with chatbots solutions. They can be trained and can respond to our clients, but each defines the response in a different way. Each needs different artifacts for her mission. In such a way that is very difficult to migrate between platforms without rebuilding the knowledge base.
But relax… Exists a way for comprehending the operation of each. And to facilitate the understand I realized that all solutions can be split into two main parts.
The first part is responsible for understanding the user utterance. I call her NLU (Natural Language Understanding). In this phase, the framework goes to identify the main intent for this utterance and recognize the entities in the phrase. Calm I will go explain… The intent is the objective of the user when he expressed this sentence. And the entities are some parts of the sentence that has meaning in your context.
For example, considers that we are in a banking context:
User: What is my account balance?
In this case, we can understand that the user’s desire is to know the amount of money has in your banking account. That is intent. And the output can be:
INTENT: ACCOUNT_BALANCE (98%)
The user could have expressed for many different forms to ask your account balance. This part must comprehend his interactions and choose the intent that more nearby of one existent in the knowledge base. Usually, this part informs the confidence of this choice (the 98% at the above example). Some give a ranking of probable intents.
And the entities? You can be wondering now!!! In this example, the words account and balance can be classified as entities because they have meaning in a banking context. Usually, they are used to comprehend the context of dialogue.
I will explain the Entities more in a future post…
In practically all solutions the NLU phase its equals. If not all. Of course, they use different algorithms but the inputs and outputs are very similar. And these different algorithms do with that can different intents be recognized and different entities formats.
The second part is responsible for choosing the answer for the user. I call her Dialogue. Generally, at this moment this phase has the sentence of the user, the intent, the entities, and the context. And it is in this part that solutions move away.
Then, using this methodology I will go summarize some chatbots solutions in the market, in the following table:
This table is on Gist help me to build!
I will explain each solutions more in a future post…
An analogy that I usually talk is this solutions are as vehicles that needs different fuels. All they understanding and respond the user, but the knowledge base must prepared in specific format for each.
Then when your Boss goes ask about the possibility of migration between this solutions give back the ask for him:
Can you transform gasoline into diesel?
After all, both are combustible, just transform!!!
But, if I want to use the NLU module of a solution next to the Dialogue module of another. This can be sense in my context. For this was created the Dazu project, hehe, another subject for a future post.