-
Notifications
You must be signed in to change notification settings - Fork 5
1.2 Train new NLP intention understanding model
michaelhwn edited this page Jan 22, 2021
·
1 revision
CAIT uses Rasa to provide NLP capability. You can train your own NLP models for projects you need to build. Below, we outline the steps for you to create your own model used in the Visual Programming Interface or in the Python Programming Environment.
- SSH into the system you have CAIT running; for example, we have CAIT running on our Raspberry Pi with hostname caitrobot. I can ssh into it by typing
ssh [email protected]
from my computer's terminal. -
cd
into the root folder of the cait project. - In
samples/sample_nlu_data
folder, some sample NLP training data is provided; changing these data is a good starting point to create your customized NLP model. In this tutorial, we will start by changing the data in thedefault
folder. - From the root folder of cait project, use any editor you like to open
samples/sample_nlu_data/default/nlu.md
. We will use thenano
editor to edit this file. - Once the file is opened, you will see something like the screenshot below.
- This is the standard Rasa nlu training data format; please refer to Rasa's official nlu training data documentation page to learn about how to customize this data.
- Once you have customized the training data for your own purpose, save and exit this file.
- From the root folder of cait project, run the following command to train and save your model into CAIT's nlu model list.
bash utils/train_nlu_model.sh --model-name=<name of your model> --training-data-path=<full path to the folder containing your modified nlu.md file>
. In this tutorial, our command looks like this:
bash utils/train_nlu_model.sh --model-name="my_customized_model" --training-data-path="${PWD}/samples/sample_nlu_data/default"
. - After the command is finished, you should see something like the screenshot below.
. - Go back to CAIT's visual programming interface; after you drag and drop the nlp initialization block into the setup block, you should be able to select your customized model from the drop-down menu. (If you don't see it still, click the refresh button on your browser).
.