A common question that comes up is how to handle where the end user makes two utterances, but you only want to take action on one.
The most common being someone saying hello, versus saying hello with a question. You would want the question to take priority.
It’s very easy to do. You just do the following:
- Create your first node with a condition of True and create your priority intents under this. Set your top node to jump to the first in that branch.
- Create your second node which handles greetings.
- Add a True node at the end of your important intents, and let it jump to greeting condition.
And that’s it! But that is the old style conversation way. Just before the new year a new version of conversation was released that makes this so much more simple.
The magic is in the first node.
Here we check to ensure that a greeting hasn’t been mentioned, then check each important intent.
With this method you don’t need any complex branches or jumping around. One important thing is to ensure that your less important intents do not have any training data that may cause it to pick it over the important intents.
8 thoughts on “Prioritizing Intents”
I was just dealing with this very issue. Thank you, Simon.
I don’t get it. In the second (new version) example, why do we want #Greeting not to be true? If it should be about prioritization, both greeting and important intent should be true and then important intent prioritized… Or what am I missing? In this scenario, what would happen if user greets and asks about an important intent in one sentence? Thank you for answering and – lovely blog, thanks!
Thanks Peter. Yea I thinking to revisit this, and change it. As you pointed out it’s wrong. It’s should be:
#Temperature OR intents.intent == #Temperature
Although the latest new feature of being able to get absolute confidences solves this in a better way. https://sodoherty.ai/2017/02/06/compound-questions
On second thought, why can’t we give lower priority to the greeting intent. That way, when we hit our more prioritized intent.. it will be executed. If it is really a greeting, it will come there eventually.
@praveen. This is an old post. Watson Assistant has features now that makes this post redundant. One of the reasons I haven’t updated in a while. 🙂 Everytime I start something to write, a feature gets added to make it out of date.
Hi Simon, I’m struggling with a similar situation. How would you handle: “I know it works on iPhone 8 but what about other models?”
Thanks for your help!
Can you still access the intent array? It isn’t working for me, would like to see the 2nd highest intent in the watson assistant dialog. Is it named something else now?
Hi David. You have to request that all intents are returned via the API. Should be “input.options.alternate_intents” -> https://cloud.ibm.com/apidocs/assistant/assistant-v2