Slot Filling using from_text

@akelad I have a situation in which i have applied mapping policy triggers to some of the intents in my domain and other are free intents handled by the stories.

Now lets say i am in the form action and i want to fill the slot having slot mapping free_text = [self.from_text(intent=None)] and when the user types in the message, unfortunately it gets mapped to the intent that is mapped with some action using mapping policy and now instead of filling the slot bot executes the action against the predicted intent, but it should instead fill the free_text slot regardless of the intent. My question is how can we avoid this situation, as i also don’t want to remove triggers all over my domain? Thanks

Also what will happen if an entity gets extracted using lookup table against the slot in the form action but the intent gets predicted that is mapped to an action using mapping policy? Shouldn’t bot fill the slot instead of calling an action against the intent?

@Ghostvv may be you can help. Thanks

If you have intent that does different things, unfortunately, you are overusing the mapping policy. I’d recommend to try 2.0 alpha version where we agglomerated all rule base policies into one RulePolicy, this policy is capable of figuring out that a form should be predicted first. But you’ll need to remove all your triggers anyhow

No i don’t have an intent that do different things but for Name and Email slots we can cannot train entities. So names and emails can be predicted to some intent that we don’t know and if that intent is mapped to some action then there will no no use of this slot mapping namet = [self.from_text(intent=None)] . My question is how can we avoid this?

I don’t think with a mapping policy it is that simple to avoid, without modifying source code of the policy ensemble

Hmm ok. do we still face this issue in RulePolicy as well?

no, RulePolicy should always predict forms first (unless there is specific default mapping like restart)

Great, but know if we want to get the answer of an intent using mapping policy while the form is activated we wouldn’t be able to achieve that except default mapping like /restart? which is also what we don’t desire. I think the solution should be like: In the case of this slot mapping name = [self.from_text(intent=None)] , every Rule policy should be ignored except the Formpolicy. What do you think?

in 2.0 there is no FormPolicy. RulePolicy is responsible for everything

Ok but do that fullfil my above requirement?

no, overwriting default action would need to update RulePolicy, why do you need that?

I need it because during the activated form user can ask for some FAQ before providing the information for some slot and that FAQ intent will be mapped to an action using mapping policy, but as you said RulePolicy will still run the Form. But i want the bot should answer the FAQ and using custom code i will divert the bot back to the activated form. And in the case of slot = [self.from_text(intent=None)] bot should not call the action for the FAQ intent instead it should fill the slot

the idea is that the form is always executed first, but if it doesn’t extract requested slot, it’ll reject execution, and RulePolicy or TEDPolicy will predict smth else. In case of from_text the form will not reject.

ok, i got it. Thank you so much for your time @Ghostvv :slight_smile:

1 Like