Closed furqan-shakoor closed 4 years ago
This makes sense. Would you be interested in contributing a fix @furqan-shakoor ?
I have reproduced the behavior in 0.15.1. If failing early is the good behavior when training a component, one way to do it is:
intent_dict = self._create_intent_dict(training_data)
if len(intent_dict) < 2:
raise Exception("Can not train an intent classifier. "
"Need at least 2 different classes. "
"Skipping training of intent classifier.")
This will make the server return a 500 status code with the message as content. I haven't tested this in master. The server has changed since 0.15.1 and more test will be needed.
I would like to work on that
awesome @lucianaribeiro 🎉would be great if you could look into this issue on master. Let us know if you need any help! Maybe @jeanfrancois8512 can also help!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
not stale, in discussion atm
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed due to inactivity. Please create a new issue if you need more help.
Rasa version: '0.15.1'
Rasa X version (if used & relevant):
Python version: 3.7
Operating system (windows, osx, ...): MacOS
Issue: If the number of intents in an application is less than 2, the application does not correctly classify any inputs to an intent.
The endpoints
/train
and/parse
both return 200 in such a case, indicating no errors. But the server logs show the following errors when/parse
is calledI traced the error to the following snippet of code in
embedding_intent_classifier.py
, in the functiontrain
Since this block bails out of the train function, as a consequence the training of the EmbeddingIntentClassifier never goes through and the relevant training files are never saved.
Eventually when
/train
is called, theload
function ofEmbeddingIntentClassifier
fails because of the snippetif model_dir and meta.get("file")
. This translates into thesession
attribute not being set and then theprocess
method failing becauseself.session is None
I believe the
/train
endpoint should return an error in such a case and let the user know that train was in fact not successful