Is it possible to fill multiple forms with one utterance?

I can see how I might fill multiple slots in the same FormAction with Rasa, similar to the discussion here: Multiple slot filling from multi-intent (intent_X + intent_Y)

However, is it possible to have e.g.

class Form1:
     def slot_mappings(self):
           return {"slot1": self.from_entity(entity="entity1", intent="inform")}


class Form2:
     def slot_mappings(self):
           return {"slot2": self.from_entity(entity="entity2", intent="inform")}

And fill both slot1 and slot2 from the same utterance? In my tests, only the active form seems to get filled.

that’s right, you can only have one active form at a time.

what is the use case where you want to do this?

I want to be able to parse multi-intent utterances that fill slots in different forms. So if, e.g. a user is describing the game of soccer to me and I have a form for describing all of the attributes of the goalie position, and one for describing the attributes of the forward position, I can elicit each of these attributes following some form logic.

However if a user describes something about the goalie (e.g. can_use_hands intent), and in the same utterance says that this is to block the goal from the forward, whose job is to score goals, I want to know that once I enter the forward form, I do not need to elicit the ‘scores_goals’ attribute slot.

I believe that I can fill multiple slots of the same form in one turn. However, putting all of these slots in one form makes the elicitation pattern very difficult.

Generally I would implement this by considering all forms, and potentially weighing the active form more highly in the mapping between NLU and the form (or semantic frame). However, the hard constraint that only the active form can be considered seems to limit this possibility.

thanks Adam, I’m still struggling a bit to picture this conversation, but I’m keen to brainstorm a solution. Can you maybe give an example conversation of what you’d like to achieve?

1 Like

Hi Alan,

Thanks for the fast response. Sure, here is a dumb example I can make quickly.

Agent: “Can you tell me about the soccer positions?

User: “Sure, what do you want to know?

A: “Who is the person that stands in front of the goal?”[start goalie form; eliciting goalie_postiion_name]

U: “That is the keeper, they can block the ball with their hands when an opposing forward shoots it.”[goalie_position_name=“keeper”; goalie_description=“block the ball with their hands”; goalie_can_use_hands=True; forward_position_name=“forward”]

A: “Thanks! So the keeper, who stands in front of the goal, can block the ball with their hands?”[submit_goalie_form]

U: “Right.

A: “Can you tell me bout the the forward?” [eliciting forward_description because forward_position_name is already filled]

I’d like to have a sequence of eliciting these 2 forms (goalie and forward) separately. However, I want to detect when a slot of one form is already filled, in a turn where a different form was active, so that I don’t need to use a turn to elicit a slot that should have already been filled. I also want to know which one of the forms is most pragmatically relevant (e.g. active), without constraining myself from filling a slot in another form.

hi @Adamits - sorry I lost track of this thread. This is a doozy, did you come up with a workaround? My best guess would be to merge all of this into a single form, and achieve the branching you want by overriding the required_slots method