rasa: Make error message about too few training examples more informative

Description of Problem:

The message about too few core training examples doesn’t inform of what kind of training example is needed (i.e. more intent phrasings or more stories containing the intent). It also doesn’t help that the message appears right after Training NLU model... giving the impression that this is about nlu data.

UserWarning: Intent 'out_of_scope' has only 1 training examples! Minimum is 2, training may fail.

Overview of the Solution:

One way to make this better would be to explicit what kind of training example is meant:

UserWarning: Intent '{intent}' is present in only one story! Minimum is 2, training may fail.

Alternatively, raise the warning only after Training Core model... which would also help put the warning in context.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (14 by maintainers)

Most upvoted comments

should probably add one at least for the scenario involving number_of_examples_per_intent 😄

That would be dope! 💯

@wochinge are you suggesting I should create a test for split_nlu_examples? There’s not currently one. Otherwise, test_train_test_split passes after the change to nlu_examples in number_of_examples_per_intent. I also created a test for number_of_examples_per_intent that passes (and fails before the change).

If I do Find usages in Pycharm it show me the following usages of number_of_examples_per_intent:

  • print_stats -> Fine
  • split_nlu_examples -> Seems your fix would also fix this as the method name already suggests “split NLU examples”
  • validate -> That’s the one you want to fix
  • test_train_test_split -> A test for split_nlu_examples which would need adapting

Hi @Ghostvv I discussed with Joe that a possible solution would be to replace number_of_examples_per_intent in TrainingData.validate method with a different function that counts only nlu training examples. Would this create any inconsistencies with other parts of the code base that uses number_of_examples_per_intent?