How to create a bot so that rasa NLU can understand that a question has been asked?

Hi How to train rasa in such a way that if any question is asked it calls a custom action_question? I have only 3 intents as shown below , but many times NLU model is not able to understand my question. since I have 3 intents, greet , bye and question, is there a way I can force rasa to take question as the default intent in case it is not able to understand what is asked ? Right now it is working for 80 % of the use cases, but failing for 20 %. I tried adding fallback but that just gives a message that I am not able to understand can you say again. greet

  • Hi
  • Hello


  • Bye
  • Thanks


  • How to repair a car ?
  • What is the capital of United States ? … around 100 such questions

Hi @shaktisd

first of all - are those samples everything you got? If so, that would be too few data for the predictions to work properly. Think about extending them - I am almost sure, that there are many prebuilt bots with greet and bye sample data.

If you really want to do it the way you asked for, I’d suggest to change the FallbackPolicy documented here:

in a way that it assumes your question_action everytime the uncertainty is too high. Keep in mind that if you provide 2-3 samples per intents bye and greet and over 100 vor question, the model will become quite unbalanced due to over- and underrepresentations of the intent sample data.


Thanks , I will try this out. One more question as a follow-up. What is the ideal number of intent samples one should have to make the NLU model work properly.

Hi @shaktisd,

I had to smile while reading your question. Let’s say: provide at least 10 samples per each intent which show visible differences between each other (minimizing similarities between them).

The question is similar to: What are the optimal settings for my hyperparameters?

Tell me, if you got an answer, we are going to make money with it. :slight_smile:

To be serious: This question cannot be answered in general, it heavily depends on your use-case and the underlying algorithm-infrastructure.


1 Like