In this How-To, we will explore a scenario in a Banking Bot, where traits can be used to steer the conversation flow in a more natural and predictable direction. For details on what Trait is and how it is implemented in the Kore.ai Bots platform, refer here.
Problem Statement
Consider the cases where the user is trying to report an issue or ask a question pertaining to “Transfer Funds”. The Bot will trigger the “Transfer Amount” intent as opposed to “Issue Resolution” or “FAQ regarding Funds Transfer”
In this document, we will show how Traits can be used to identify such situations and take appropriate action.
Pre-requisites
- Bot building knowledge
- A Banking Bot with the dialogs as mentioned below:
- Transfer Amount – Dialog task prompting the user for Payer and Payee account numbers and the amount to be transferred and transferring the specified amount from the payer account to the payee account.
- Issue Resolution – Dialog task to assist in any issues faced by the user. It would display a regret message and transfer to a Live Agent.
- Knowledge Collection – A node “transfer funds” with an FAQ “How do I transfer funds”
- Transfer Amount – Dialog task prompting the user for Payer and Payee account numbers and the amount to be transferred and transferring the specified amount from the payer account to the payee account.
Implementation
Intent Detection using Traits
We will be using Trait to steer the conversation to “Issue Resolution” when the word “issue” is present in the User Utterance.
Steps:
- From Natural Language -> Training open the Traits page.
- Click Add New Trait. We will be using a trait to identify the existence of issue in the user utterance.
- Add a Trait Type as Problem Statement, and Traits as issue. A given Trait Type can have multiple Traits grouped together logically.
- Optionally you can add utterances for Issues as ‘problem’, ‘unable to’, and ‘not working’. These are the alternate words that user might use to indicate an issue.
- Save the Trait.
- Click Add New Rule. We will be defining the intent that needs to be triggered in the presence of this Issue trait.
- Train the Traits.
- Open the Issue Resolution Intent to see the Trait Rules under the NLP properties panel updated with the issue trait.
- Run the Bot and see the changed flow.
Knowledge Intent using Traits
Here we will see how to drive the query from user to appropriate FAQ instead of the dialog task.
Steps
- From Natural Language -> Training open Traits dialog.
- Click Add New Trait. We will be using a trait to identify the existence of question in the user utterance.
- Add a Trait Type as Enquiry, and Traits as ask. A given Trait Type can have multiple Traits grouped together logically.
- Optionally you can add utterances for Issues as ‘wondering’, and ‘want to know’. These are the alternate words that user might use to indicate an enquiry.
- Save the Trait.
- Train the Traits.
- Associate the Trait to the FAQ
- Run the Bot. You will see that the Bot is still going to the “Transfer Funds” intent.
- To understand the reason behind this:
- To ensure that the intent is not selected, we will add a Negative Pattern to the “Transfer Funds” intent.
- Under Natural Language -> Training open Advanced Settings.
- Enable Negative Patterns. This will add Negative Patterns tab.
- Select Negative Patterns.
- Search for “Transfer Funds” intent and add “know more” as the negative pattern. This will ensure that the ‘Transfer Funds’ intent is not identified when ‘know more‘ is present in the user utterance.
- Check the Utterance Training.
- Run the Bot and see the change.