RasaHQ / rasa

💬 Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
https://rasa.com/docs/rasa/
Apache License 2.0
18.92k stars 4.63k forks source link

FormAction: Less restrictive slot mapping for not-requested-slot #5193

Closed IgNoRaNt23 closed 4 years ago

IgNoRaNt23 commented 4 years ago

Description of Problem: Relevant thread: https://forum.rasa.com/t/extract-other-slots-neglects-custom-slot-mappings/14788

Filling slots from entites, that don't have the exact same as the corresponding entity is currently restricted to situations, where we specifically ask for this slot (the slot is the current 'requested_slot') within a FormAction. While this prevents any ambiguity, it seems overly restrictive to me.

This get's problematic, when we want to map the same entity to different slots, but the specific slot we want to map to is known with high confidence using a heuristic approach

Overview of the Solution: Extend the 'from_entity' slot mappings and allow a mapping from entity to slot for specific situations (trigger intent message or for specific requested slots).

or add another slot mapping for this.

Examples (if relevant): A bot that collects information to make travel booking for a company (so its always a round trip). It's picking up the transport vehicle, destination (starting point is known) and departure dates and times.

Bot: Hi, how can I help you? User: I need a flight (transport) to Moscow (destination) on monday (date of depature) Bot:

The Bot uses Duckling as an entity extractor for dates and will thus not be able to map the time entity to the correct slot even though the users intent is very clear and it is very likely that this is the date of departure (using a heuristic approach).

sara-tagger commented 4 years ago

Thanks for raising this issue, @akelad will get back to you about it soon✨

Please also check out the docs and the forum in case your issue was raised there too 🤗
akelad commented 4 years ago

Hi @IgNoRaNt23 thanks for the feature request - this is covered by https://github.com/RasaHQ/rasa/issues/4644 as far as I can tell (please correct me if i'm wrong).

IgNoRaNt23 commented 4 years ago

@akelad #4644 covers only a part of this. It should not only be possible with the trigger message but always. As explained this is only problematic when we map the same entity to different slots. Additionaly I suggest an additional slot-mapping in the solution above. Something like 'for_requested_slot', where one can specify entities for a slot that only get mapped, when a specific other slot is requested.

akelad commented 4 years ago

We've thought about that a lot and it gets quite complicated. E.g. if you have a "mobile_number" and a "home_number" slot, both of which are filled by the entity number, how would you know which one to fill unless that slot is currently being requested?