IKH

Training and Testing the NLU model-Rasa

Let us now learn how to train the NLU model. In the next video, Aiana will explain the basics of the Python libraries used for training the NLU model.

You can refer to the ‘Rasa Basic Folder’ (shared in the Natural Language Understanding (NLU) segment) for all the codes and data sets

To summarise, you can train the NLU model using the rasa_nlu Python library. You can train the NLU model using the following command: rasa train nlu.

For testing the NLU model, you can use the shell command of RASA: rasa shell nlu.

The output above shows the parsed results of the text “please find me a Chinese restaurant in Delhi” – the intent is classified correctly with 100% confidence, the entity is extracted correctly using CRFEntityExtractor. 

You can read more on the confidence score given by different pipelines here.

Try testing your model on utterances with some untrained entities and see whether the CRF is correctly predicting them. If not, you can add more examples to the NLU training dataset.

You have now learnt all the major aspects of the NLU layer required to train a chatbot. Next, you will study the second layer – Rasa Core.