Extracting multiple slots for a given intent --> only first slot is extracted


We are trying to learn our RASA bot to answer “How many X in Y” type of questions,
e.g. “How many sugar is there in milk?”.

We maintain the following intent/story:

image image image

And the domain contains the following:


Now, when we try to ask the bot such a question, only the first slot is being captured, hereby nutrient_regex. RASA doesn’t manage to capture the second slot (food_regex).

Can you please support us with that issue?

Thanks ahead,
Newt Team

Hi @sgino209

Those regexes seem to capture entire words, no matter what they are, so Rasa has no way of knowing what is food and what is a nutrient. So I’d recommend not to use a regex for this, but only annotate your entities as you do and let the DIET classifier learn what is what.

Also, a slot that is featurized as text lets rasa only see if a text is assigned (value is a string) or not (value is None). So setting the initial value to NA means that the text ‘NA’ is assigned and you may as well not featurize it (set type to unfeaturized) or you don’t give an initial value.

Does this help?

Hi Johannes,

Thanks for your quick reply.

We now understand that only the 1st entity is captured because the 1st regex captures the whole sentences…

What do you mean by “annotate the entities as you do”?
How shall we implement that in practice?

What do you mean by “the DIET classifier”?
We are not familiar with that terminology/feature.

Thanks ahead,
Newt Team

@sgino209 I recommend checking out the Masterclass video on entities and the Algorithm Whiteboard videos on DIET. Does that answer your questions?

Glad I could help :slight_smile:

What do you mean by “ annotate the entities as you do ”? How shall we implement that in practice?

I mean that you tell Rasa what words correspond to what entities by giving it examples in the way you do. For example,

- How much [sugar](nutrient) is there in [milk](food)

is one training utterance where Rasa can learn that sugar, in this context, is a nutrient-entity and milk is a food-entity. The more such examples you give, the better Rasa will be able to identify those entities.

What do you mean by “ the DIET classifier ”? We are not familiar with that terminology/feature.

I think out Algorithm Whiteboard and Masterclass videos that Ty just shared are the best starting point to learn about DIET and other terminology.

Very well, got it, thanks Johannes.

Would you recommend to use the Synonyms mechanism as well with the Entities context?
In other words, will it be helpful (or even just cleaner) to use synonyms instead of explicitly maintaining different variations of similar sentences in the training set?

One more question we had -
Can we know if RASA model suffers from Bias of Variance issues?
Is there such visibility (e.g. train/validation loss over time plots)?

Thanks ahead,
Newt Team

You can use entity synonyms (as described here: Training Data Format), but providing context in the form of full user utterances is essential for training. After all, the assistant should probably react differently to “it’s raining cats and dogs” than to “this morning my cat played with a dog”. Rasa X can help you to collect this data, see Conversation-Driven Development with Rasa X.

When you collect data (stories and NLU data), you will also want to make some of those conversations “test data”. You can run tests with rasa test and explore which intents get messed up the most etc., or with automated testing in CI/CD, see Test Your Assistant and Deploy Your Assistant.

1 Like

Hi Johannas.

Very interesting material, thanks for sharing that.

Our issues are all resolved now.


1 Like