RASA based covid bot on flask
-
Create a python virtual environment
-
Activate the virtual environment
-
All the commands to be run in the virtual environment
python3 -m venv rasa_env
rasa_env\Scripts\activate.bat #On Windows
source rasa-env/bin/activate #On nix based
-
Ensure you are on the Python virtual environment
-
Install rasa pip install rasa
-
Alternatively, execute the requirements.txt from the repo
pip install -r requirements.txt
- Clone this project if you don't want to initiate rasa on your own.
- Alternatively, create an empty directory where you want to the project to live
- Cd into your project directory
- Command to initiate rasa : rasa init
- This will create all the rasa related files with basic content
- corona_state is a project specific intents
- Other intents comes with rasa init
- Add a new story to connect the new intent corona_state to new action
- new action name is action_corona_tracker
- Add a new action : action_corona_tracker
- Ensure the endpoints are uncommented in endpoints.yml
- action_endpoint points to localhost at port 5055
- Actual logic of the tracker happens here.
- Tracker has the inputs to the custom function
- Dispatcher gives back the output
- On a new terminal execute command rasa shell
- Interact and test your bot on command line.
- If you had executed requirements.txt, flask should be already there
- Else install it using pip install flask
- app.py is the flask entry point
- app.py interacts with the rasa endpoint
- app.py renders the output to a html page
- Accepts simple text input from app.py
- Run command rasa train at the project folder
- This should create a new model file under models directory
- Train and regenerate whenever changes to rasa specific files are made
- Custom actions require a seperate server to execute on
- Command to create action server rasa run actions
- Keep the action terminal open to allow the action server to live
- Open a new terminal and run rasa with api
- rasa run -m models --enable-api
- Keep this rasa terminal open as well
- To run flask execute run flask