|Rajesh K Jeyapaul (firstname.lastname@example.org)||Riya Mary (email@example.com)|
|Cloud Soln Architect , Dev Advocate and startup Mentor – IBM||Dev Advocate – IBM|
Watson Conversation is one of the powerful service made available through Bluemix. The dialog component of the Conversation service uses the intents and entities that are identified in the user’s input, plus context from the application, to interact with the user and ultimately provide a useful response.
A dialog is made up of nodes, which define steps in the conversation. Dialog nodes are chained together in a tree structure to create an interactive conversation with the end user. You can think of the node as an if/then construction: if this condition is true, then return this response.
At the beginning of each conversation, dialog evaluation begins at the top level of dialog nodes.
Each time the dialog returns a response, it stores the ID of the node at which the conversation should resume. This node is called the contextual node.
- In the first stage, the dialog tries to find an answer in the child nodes of the contextual node. That is, it tries to match all the conditions of the child nodes of this contextual node.
- In second stage it tries to find an answer to a particular input by matching the top level of dialog nodes.
If the last selected dialog node has children, it is set as the contextual node for the next round, and the dialog evaluation in the next round starts from the child nodes of this contextual node.
The order of your dialog branches is important. When a user input is received, and the intent and entity have been identified, dialog base nodes are evaluated in the order in which they appear.
Below is the problem statement where though the order is followed and the correct Intent and entities are returned, Dialog fails to get the proper response.We have presented what was missing in this particular case and how it has to be resolved.
Conversation Dialog Objective:
The intention is to list all the clients belonging to particular industry verticals .For example:
- List clients pertaining to Finance
- List clients pertaining to AI
- List clients both from Finance and AI
Problematic Dialog Flow:
Child node has Finance , Finance and AI (logical AND ) and AI as the flow in the order
- Repeating the same question does not yield the expected conversation response
- For Example:
- Q: Can you list me Finance Clients ?
- A: ABC ( which is correct )
- Q: Can you list me Finance clients ? (same question repeated )
- A: XYZ (which is wrong)
- Not reaching the correct dialog response in spite of getting the correct Intent and Entity
Start the child node with Logical AND, in this case, Both AI AND Finance, then to Finance and then to AI
- Provide a jump to from parent node (clients ) to the child node
Why this behavior ?
Dialog flow retains the last executed child node as context node. In this case, since the logical AND operation is inbetween, if the same question is repeated, then dialog moves from the existing context node (child node ) to the next child node . If it finds the logical AND/OR , then it tries satisfy that and come back with the different response.
In case if the condition is not met, it follows through and goes back to the virtual root node and comes back to parent node and handles the default message
Building the dialog flow is very important and recommend to understand this and test the behavior before moving on with the next level of implementation.
For any queries , pls. feel to reach out to us.