How to map intents to slot values?

For one of the slots in my form, I have two intents — affirm and deny — which should map to the corresponding slot values — True and False. In the forms section of the domain, the slot (set_reminder) is currently defined like this:

  set_reminder:
  - intent: affirm
    type: from_intent
    value: True
  - intent: deny
    type: from_intent
    value: False

But this causes action_default_fallback to be triggered after the form is completed and deactivated. This is strange because the slot values are filled just fine; it is the action prediction following the form that breaks down. However, if I define the slot like this

  set_reminder:
  - type: from_text

then action_default_fallback is not predicted after the form completes. But this is only a temporary fix since I will need some way of mapping the intents to the slot values. While I am aware that I could use custom validation or custom slot setting, that just seems like overkill, and I’d imagine that Rasa offers a simple functionality for this type of logic although I couldn’t find it in the documentation.

Hey Alex! What do your stories with the form in them look like? And can you share your logs? I’m wondering if the problem might not be in the dialog policy.

Hi Rachael, the form is included in my stories like this:

- action: schedule_reminders_form
- active_loop: schedule_reminders_form
- active_loop: null

And here is the output of rasa shell --debug, starting from when the user inputs the last slot of schedule_reminders_form. (I skipped some parts of the list of slots just because they’re so long.)

And for reference, this is how the form is defined in my domain:

schedule_reminders_form:
  set_reminder:
  - intent: affirm
    type: from_intent
    value: True
  - intent: deny
    type: from_intent
    value: False
  reminder_days:
  - entity: day_of_week
    type: from_entity
  reminder_times:
  - entity: exact_time
    type: from_entity

Gotcha. It looks like your assistant isn’t sure what to do after the form completes. I’d add one or more stories with the appropriate action after the form is done and see if that helps.

I tried adding a story (that was almost an exact duplicate), and it did not solve the problem. :slightly_frowning_face:

So I finally ran into this problem myself & was able to fix it. Steps:

  1. I added a new story with interactive learning
  2. I deleted my most recent trained models
  3. retrained my assistant

After this my action triggered as expected. Let me know if it works for you too!

2 Likes

That fixed it for me too. Thanks!

1 Like

For anyone else who may come across this problem, I believe that any slot which is used exclusively in forms should be defined with the influence_conversation: false tag in the domain. Otherwise this problem will occur.

1 Like