Form and slots

Goodmorning, i have a question: how can i extract two slot from the same entity (with role) from one single intent?

Example: “I go from Paris to London”

I want to extract this 2 slot but from one and only one intent. What i want to result:

slot extracted:

input_departure: Paris

input_arrival: London

Hi @emilyciola

You can define the mappings in your slot definition. Refer NLU Training Data

Hi @siriusraja, thank you for your answer. I have already defined mappings. My problem is that when I put this in a form, it asks one slot at a time. It’s okay, but i want to implement a second way that you can insert one intent with 2 entity and this entities fill in same time this two slot. I must use a form because I ask a lot of informations for example date and hourse.

Hi @emilyciola

During the validation of your first slot in the form, you can also validate & return another slot. This would enable you to set both slots at the same time.

1 Like

This is what you want, how I implement it? Must I write code in action with specify this? I don’t know how to make it and I don’t find out this in the documentation. Thanks a lot!!

May I know your version of rasa & rasa sdk ?

Yes, I have 3.0.9 Rasa version and 3.0.6 Rasa sdk

Please write to me as soon as possible! Thank you

Hi @emilyciola

Sorry for the delay. You can refer this Slot Validation Actions

To save multiple slots, you can return them as below.

return {
"slot1": slot1_value,
"slot2": slot2_value,
"slot3": slot3_value

Hi @siriusraja, thank you for your answer. I have another important question… I make this project for my thesis and because of this I have really really urgency. I entered this sentence: "the departure stop is Povo ". In this case i have one entities “departure_stop” and i want to fill the slot “departure_slot” with “Povo”. The result that i want is: departure_slot: Povo. Rasa recognise it, but after rasa don’t fill it. This happens despite running the action “action extract slots”, as reported by the debug (slots in italian).

2022-08-08 14:25:21 DEBUG rasa.core.processor - Received user message ‘la fermata di partenza è Povo’ with intent ‘{‘name’: ‘travel’, ‘confidence’: 1.0}’ and entities ‘[{‘entity’: ‘input_partenza’, ‘start’: 25, ‘end’: 29, ‘confidence_entity’: 0.9607881903648376, ‘value’: ‘Povo’, ‘extractor’: ‘DIETClassifier’}]’

2022-08-08 14:25:21 DEBUG rasa.core.processor - Default action ‘action_extract_slots’ was executed, resulting in 1 events: SlotSet(key: input_partenza, value: Povo)

2022-08-08 14:25:21 DEBUG rasa.core.processor - Current slot values:

    input_partenza: None

Why the slots is empty??

Thank you!

Hi @siriusraja have you any suggestion?

Thank you!

HI @emilyciola

Can you share your domain file. Need to understand how the slot mapping definition is done.

domain.yml (2.5 KB)