Building well-functioning intents for your chatbot requires careful analysis and planning. Investing time upfront to define and list all the actions your bot is expected to understand is crucial. The more scenarios you consider, the better prepared you'll be to handle various user inputs and maintain a robust natural language understanding (NLU) for your bot.
To begin, we recommend shifting your focus from objects (such as products, services, or themes) to the specific actions your bot needs to perform. This shift often involves moving from a business-oriented perspective to a linguistic one. Although it may seem counterintuitive at first, it is the key to developing a well-functioning NLU system.
"I’d like to change my debt consolidation loan schedule."
"I’d like to change my mortgage loan schedule."
From a business perspective, these two topics might be treated separately as they may lead to different customer service departments. However, from a linguistic perspective, these utterances are essentially identical except for the parameters: "debt consolidation loan" and "mortgage loan."
Therefore, they should belong to the same intent and be differentiated based on the parameters (objects or entities). The output paths in your bot's flow should include both of them as a condition, such as:
nlu.intent == your_intent AND nlu.variables == parameter1
One important reality about bots is that they tend to evolve over time. It is common for the initial intent infrastructure to become inadequate as the bot's capabilities expand. Therefore, we highly recommend building intents based on general actions or specific concepts, depending on how they manifest in relevant user phrases.
The examples below demonstrate intents built around broad actions, with specific cases expressed through entities:
(+ entities: card, account)
(+ entities: login, password)
(+ entities: loan, details)
(+ entities: loan, repayment)
(+ entities: payment, methods)
(+ entities: payment, failure)
This data architecture helps prevent content overlap among intents by grouping common phrases and sentence structures within a single intent.
The rule of thumb is to focus on the actions a given intent should cover. Objects, on the other hand, can be treated as parameters that guide these actions in a specific direction. Entities are well-suited for this purpose.
If you notice different user actions becoming apparent within a single intent, it is recommended to split it into multiple intents as soon as possible.
“I want to repay the loan quicker”
“Is it possible to arrange higher installments”
“I have a problem with repayment”
The first two sentences contain commonly used phrases related to repayment schedules. However, the third sentence, although still related to repayment, asks for a different type of action compared to the first two. By recognizing this distinction early on, you can save significant time and effort in intent development.
Remember, building effective intents requires continuous evaluation and refinement as your chatbot evolves. By following these best practices, you can create a robust and adaptable NLU system for your bot.
Updated 3 months ago