How can I activate a form after X number of intents detected?

Hello everyone!

We want to know how can we activate a form when a user has made X questions (intents) and we answered them successfully, e.g., the user asks one question to the bot, the bot answers, and again, the user asks a question, then, the bot answers, after that second time, we would like to activate the form. Is there a way to set in a slot how many intents had been identified correctly and then trigger a form after that?

Let me know if it’s clear enough

Thanks,

I guess you could just activate that form after those X questions in your stories, and make you have TED policy max_history set to at least X.

Maybe a custom tracker store could be of some use if you want to abstract this behaviuor, but that seems more advanced and I haven’t tried it.

I’m pretty sure that the required_slots method is called before any slots get asked for. So you could edit that method in your form validation action to check for the number of questions the user has asked. If that number is less than X, simply return an empty list. Then, in your stories, include the form after each time the user asks a question.

As far as actually setting the number of questions asked in a slot, it depends on how you’re responding to those questions. If you’re responding with a custom action, then simply increment the slot value in the custom action. (You can set the slot’s initial value in your domain to 0).

To add a different side to the discussion, what do you mean by “how many intents had been identified correctly”? By nature, a bot cannot know whether it was right in its prediction of an intent; that’s why it’s a prediction. Did you have some kind of proxy metric in mind?

Yes, for example, we want to activate a form after X number of FAQs answered. That will be the first scenario.

I’ll try that. Thank you!