Rasa bot training

Training Rasa using Google Colab Jupyter Notebook

This document explains how you can train the Rasa Hybrid Bot on Google Colab Notebook and deploy it on premise. Colaboratory is a free Jupyter notebook environment that requires no setup and runs entirely in the cloud. With Colaboratory you can write and execute code, save and share your analyses, and access powerful computing resources, all for free from your browser. The notebook we have created will help you build a complete chatbot with Rasa Stack, without having to install anything on your computer.  Step by step instructions are given in the notebook on how to build, train the bot and persist the trained model on GDrive.

  1. Make sure you have a Google account. Log in to your account
  2. Open the notebook following the link here.
  3. Follow the step by step instructions given in the notebook. It is very important to add here that, nothing needs to be installed on your pc or server for that matter. All you need to do is, run each cell (blocks of code), for instance, the first two cells will install Rasa Core, one of the two major components of the framework. The notebook actually works much similar to a Google Doc, so at any point in time, if you need to save your progress, just hit CTRL + S.
  4. Once you are done with successful training and testing, i.e. went through all the steps, you would need to export the trained models, needed to deploy the chatbot on Hybrid Chat solution. For this, instructions are given below,

Export Models and Actions to Rasa

  1. Go to the directory on your Google Drive (instructions provide in the notebook Part 1, Mounting Google drive ) where the models and actions are stored. 
  2. Download the folders, 'actions' and 'models'
  3. Upload these folders to the server where rasa-hybrid-bot is deployed. The path where you need to place these folders is, 
    <path to where chat-solution project is deployed>/chat-solution/docker/data/rasa-hybrid-bot/ 

  4. If these folders already exist on the server and you want to deploy a newly trained model, then replace them.
  5. Go to <path to where chat-solution project is deployed>/chat-solution/docker/data/rasa-hybrid-bot/ and run the command 

    chmod 775 -R .

     to change the permissions of the newly added folders.

  6. Now you have to restart the rasa-hybrid-bot. Go to <path to where chat-solution project is deployed>/chat-solution and run the command

    docker-compose -f docker/docker-compose-rasa-bot.yml restart rasa-hybrid-bot

Related docs & files