Within my bot I have several slots that are used to decide on which path the conversation will take. Some of the slots just capture the interest in a topic “Do you want to hear about XYZ?” and can be answered with yes or no.
Since yes or no is used frequently during a conversation those intents (affirm or deny) automatically fill my slots even though they should not so I would like to prevent this.
Further I would like to prevent slot filling when the same entity that should fill a slot is mentioned but in another context.
So here are my specific questions (related though):
Is there a way to disable automatic slot filling? However, that would probably imply that I need to write a custom action for every slot right?
Resetting slots is not really an option or is it? Because if a user has been interest in a topic then of course I do not want to reset this slot. So always resetting slots before the slot setting should actually take place is not a real option apart there would be a way to check whether the slot was just automatically filled or actually when it was supposed to be filled. That is not really a question but I wanted just to think out loud that resetting is something I considered but which would not really solve the issue I guess…
Is there a way to specifiy when a slot should be filled and when not? I assume I could define a form for every slot and activate or deactivate it every time but this would of course increase the needed code a lot
I have the feeling that I just asked the same questions in different ways. But I really struggle to find a solution to this automatic slot filling debacle. If you have any suggestions for me, I would highly appreciate it!
Yes, you can make a form and order the slots in the order that you want them to be filled. I’m struggling a bit with this myself. I made 2 (for me) identical chatbots. In 1 its auto - filling the slots and in the other it isn’t… Can you try making forms and let me know if this worked for you? In my chatbot showing the wanted behaviour it only fill the slot the form is asking for. Then it porceeds to the next slot.
I now decided for doing is solely in a form… I think that is the safest way of assuring that the slots get only filled in that specific context. Another option would possibly be to create a very unique intent/entity that would only make sense in that context and if there is not the “danger” that the user says something similar in another context… Hope you find a solution for your use case
Now I even added auto_fill: false. But no matter what I do, if I have an affirm intent or deny intent before that form it will auto-fill the slot “liked_topic”. (I start the form with this affirm intent, as the user does not know whether the form exists so I cannot define an intent start_basic_form). I do not know how to prevent this or can I never use common intents to fill a slot? I’m absolutely clueless and it would be awesome if you or someone else could help me with this
You should follow the examples in the docs. One rule to enter the form and a second rule to submit the form. The only slot related setting the rules should show is the requested_slot: null on the submit rule, the other slot_was_set items should be removed.
Also, don’t used featurzied slots in this case. Set influence_conversation: false on all of your slots. In general, set all slots to false.
How can I write a Form Activation Rule if I do not have an intent that specifies when the slot needs to get activated? As I explained the user does not know that there will be a question to them so I cannot create an intent like “want to do the form”… Like in the example form we have request_restaurant as a very specific intent that will trigger the form. I only have affirm what is super generic and cannot be used for a form activation. I also cannot train a specific intent because for that intent I would have the same training data in the nlu as for the affirm intent like “yes” or “sure” or “okay”… Hope that becomes clear what I mean, if not, please let me know. Maybe one would ask at this point “Why are you even using a form then?” The answer is that I wanted to make sure that the slot liked_topic gets only filled when the user is asked about it and not from other affirm and deny intents in other contexts (because that happened before). But actually as we see now the form is not even helping to prevent this. The slot gets still filled by another intent. That is extremely frustrating. Therefore, I think that I may handle literally every slot in a custom action.
I might have an idea regarding point 2 of your initial message (resetting slots before a form).
(I’m not a form expert)
If you store every form response using the template utter_ask_<form_name>_<slot_name>, you could use a custom action after the form-activation intent that:
uses tracker.events to look for all bot utterances that started with utter_ask_<form_name>
split each utterance after utter_ask_<form_name> to get the slots that were already asked for
reset all slots that are not in the extracted slot results
Looking at the example:
intent: request_restaurant
action: restaurant_form
You could get the “form_name” in your custom action via: