I have a model that I trained previously using rasa train
whose NLU training takes a while to finish. Is it possible to just use the NLU part of that model and then replace the Rasa core part?
If I am not mistaken, you can just train with rasa train core
.
Iâm currently trying to meet a deadline, so I canât test this at the moment. I would really appreciate it if you, or someone else here could confirm this. @j.mosig
From the docs:
If you only want to train an NLU or a Core model, you can run rasa train nlu or rasa train core. However, Rasa will automatically skip training Core or NLU if the training data and config havenât changed.
Iâm using rasa train core
to attempt to accomplish exactly what the original poster said. However, Iâm unable to get it working with rasa interactive
. It loads the core model (most recently trained model), but doesnât load an NLU model; this results in it detecting whatever string I give it as an intent that correspond to the given string literal. Example: I type âbacon is goodâ and it says the following:
Your NLU model classified â/bacon is goodâ with intent âbacon is goodâ and there are no entities, is this correct? (Y/n)
The core training run prepends âcore-â to the beginning of the model, unlike nlu-core joint model files that donât have âcore-â at the beginning. Example core model file name: âcore-20211014-101916.tar.gzâ. Example flu-core joint model file name: â20211014-101916.tar.gzâ.
Is there a way to specify both an NLU model and a Core model rather than specifying just one?
@bradyneal If you train an NLU model once, then subsequent calls of rasa train
should actually just call the training for Core and re-use the NLU model (unless you changed training data thatâs relevant for NLU or you use end-to-end predictions). Does this work for you?
Yes, I havenât had an issue with rasa train
rerunning NLU training when NLU data hasnât trained, but Iâm specifically interested in the case where my NLU data is different, but I donât want to retrain the NLU model yet because it takes some time whereas training the core model is fast (at least for now). In Rasa X, the following seems to work:
- Make old combined NLU-Core model file active.
- Make new Core-only model file active (but canât do this step without doing step 1 first).
But Iâd like to be able to get this working with rasa interactive
as well.
That shouldnât actually work. If you only want to update the core part of your model, then you shouldnât make any NLU changes. Perhaps you can stash those changes before training? You might also be interested in incremental training.
Gotcha, sounds like thereâs no way to get it working with rasa interactive
. I havenât been careful about hooking training and git together, but it sounds the thing you suggest is maybe the best solution for now:
- Hook git commits and training together (always have a data commit associated with a training run)
- Run
git stash && rasa train
(should only train the Core component, but save all the models together, unlikerasa train core
).
That [Rasa X hack Brady mentioned] shouldnât actually work.
Hehe weird . What is the point of rasa train core
then?
What is the point of
rasa train core
then?
Mostly for debugging. I use it often to check that my stories donât conflict with rules. Since rasa train core
will raise an error if that is not so.