Train the model

Now we’re going to create a configuration file. This configuration file will define the pipeline that is to be used in the process of training and building of the model.

Create a file called config_spacy.yml in your working directory which looks like this:

language: "en"
pipeline: "spacy_sklearn"
fine_tune_spacy_ner: true

Know the Code:  SpaCy configuration customization is there for a reason. Other Data Scientists have found some utility in the ability to change values here and it's good practice to explore this as you get more familiar with this technology.  There is a huge list of configuration which you can look into here https://nlu.rasa.com/config.html.

This configuration states that we will be using English language models and the pipeline running in the backend will be spaCy with the combination of sklearn. Now to begin the training process execute the following command:

python -m rasa_nlu.train 
    --config config_spacy.yml 
    --data restaurant.json 
    --path projects

This takes the configuration file and the training data file as input and --path parameter is the location where the trained model will get stored.

Once the model training process is completed you’ll see a new folder named as projects/default/model_YYYYMMDD-HHMMSS with the timestamp when training finished. The complete project structure will look as seen in the following screenshot:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset