Josh Flynn
Josh Flynn

Reputation: 140

Can we use wild cards for slot values in Rasa Core Stories?

I'm trying to get a reasonable understanding of how Rasa Core handles stories. I basically have 3 entities - occasion, relationship and gender

Based on the different values of each of these, I'd like to utter certain templates. However, there are times when say occasion is Christmas, and no matter what relationship or gender slots are filled with, I'd still want to use a certain template.

However, the only way I seem to get around this is by entering all permutation values of relationship and gender for a given value of occasion as Christmas.

Can I rather use something like this:

* suggest {"occasion": "Christmas", "relationship": *, "gender" : *}

I've tried a story line in Rasa with this:

* suggest {"occasion": "Christmas"}

However when I put in a query for "Where would you suggest I should take my brother for Christmas", Rasa NLU identifies the slot occasion as Christmas and relationship as brother, and my story line is never called, since now relationship is set to brother. I wouldn't say its intuitive to permute every possible combination for relationship with occasion as Christmas, rather I'd achieve this programatically through actions then. However, I just thought I'd be able to take the benefit of Rasa stories and understand the concept better.

Any help will really be appreciated.

Upvotes: 2

Views: 462

Answers (1)

Tobias
Tobias

Reputation: 1910

Rasa Core currently does not a functionality for "wildcard" slots. However, I am not entirely sure whether this is actually needed.

Case 1: You want to utter different templates depending on which slots are filled. In this case you have to provide different stories (with the different combinations) to your training data.

Case 2: You don't care whether some slot is filled and want the bot to utter the same template. In this case I suggest to set the slot type of the ignored slots to unfeaturized as it is described here. unfeaturized will mean that is does not affect the stories whether these slots are set.

Upvotes: 1

Related Questions