Prevent intent recognition from happening after action_listen?

Hi, I am trying to collect feedback about some data that is sent to the user upon the user’s request for that data. The story for collecting the feedback is as below:

  • int_feedback
    • utter_askProblem
    • action_listen
    • act_understandProblem

In my act_understandProbem, I am taking the user’s latest message and saving it in a slot, but after action_listen, if the user has typed something related to any other intent, act_understandProblem does not execute and instead the action for that particular intent is executed. Or if it does not understand the intent, it goes to fallback. Is there any way I can stop intent recognition from happening and force act_understandProblem to execute immediately after action_listen?


Try with a form. It will not prevent intent recognition, but the conversation will flow as you want.

class FormFeedback(FormAction):
	def name(self):
		return 'form_feedback'
	def required_slots(tracker):
		return ['problem']
	def slot_mappings(self):
		return { 'problem': self.from_text(intent=None)}
	def submit(self, dispatcher, tracker, domain):
			#do something
			return[SlotSet('problem', None)]

If you use this method, change “utter_askProblem” to “utter_ask_problem”.

Thanks, I have tried that and I seem to be getting an error that states “Failed to extract slot problem with action feedback_form”. I can’t seem to figure out what’s wrong.

This is my FormFeedback Form Action:

class ActionCollectFeedback(FormAction):

def name(self) -> Text:
	return "feedback_form"

def required_slots(self, tracker: Tracker) -> List[Text]:
	return ["problem"]

def submit(
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> List[Dict]:

	return []

My story is as below:

Generated Story -3740159369497454957

  • int_affirmUnderstandProblem
    • feedback_form
    • form{“name”: “feedback_form”}
    • utter_ask_problem
    • act_confirmProblem

So my utter_ask_problem executes and then I enter a message, then, I get the error saying “Failed to extract slot problem with action feedback_form”. After this, act_confirmProblem executes. In my act_confirmProblem, I am trying to access the slot “problem” using tracker but the slot value shows that it’s none.

Here is my domain file if it is relevant:


  • problem
  • requested_slot



type: unfeaturized


type: unfeaturized

You forgot the slot_mapping function in your form

def slot_mappings(self):
		return { 'problem': self.from_text(intent=None)}

Oh okay thank you for the reply. I’m not sure what exactly the intent mapping function does, could you help me understand? Does this part “self.from_text(intent=None)” mean just take the whole text and store it in the slot?

Yes, exactly that, this prevents the “Failed to extract slot problem with action feedback_form” error, because it always extract something.

1 Like