This is rasa based chatbot. User is asked several health related questions and at the end the logs are shared back to the user. This project demonstrates how easy it is to create NLP based chatbots with rasa opensource sdk. It mainly consists of a Form and Custom Actions. A beginner friendly scope was kept so that any one looking for getting started, could refer this.
It is recommended to use Python 3.6 or Python 3.7 with rasa framework. Below are the steps to run this project.
- Clone master branch of this repository & open root directory in terminal.
- Create virtual env with python:
python3.7 -m venv ./venv
and activate it bysource ./venv/bin/activate
- Install rasa
pip install rasa
, with this you can now run rasa commands described below.
Make sure python virtual env is active in terminal. Change directory to backend
& run rasa train like below. After training is done, you will find models
directory at backend/models
this is the result of rasa NLU training & rasa Core training.
cd backend
rasa train
After training is done, you need to run server to serve custom actions related computation. Open another terminal instance, activate virtual env and open backend
directory.
rasa run actions
Below command loads the trained model, opens communication to custom actions running server & provides REPL to interact with chatbot.
rasa shell
Once you have developed your bot and you are ready to integrate the bot with the UI, you can start the Rasa server using the below command
rasa run -m models --enable-api --cors "*" --debug
If you have custom actions, you can start the action server using the below command
rasa run actions --cors "*" --debug
Once you have you Rasa server up and running, you can test the bot by running the index.html file in the browser.
rasa train
rasa run actions
rasa shell - happy flow 1 - affirmed for exercise
rasa shell - happy flow 2 - denied for exercise
rasa shell - sad flow 1 - going out of scope & coming back
rasa shell - sad flow 2 - going out of scope & denied to proceed