A chatbot that takes user queries and returns the best restaurants in the area using Zomato API
if you have anaconda installed in your system, please run this command to activate the environment:
conda env create -f environment.yml
or just refer to requirements.txt for package version information, Python3.7.9 is used.
Mandatory to install these Spacy Models:
python3 -m spacy download en_core_web_md
python3 -m spacy link en_core_web_md en
data/nlu/nlu.md : contains training examples for the NLU model
data/core/stories.md : contains training stories for the Core model
zomato : Contains Zomato API integration code
zomato_api.py : Contains functions to consume common Zomato APIs like fetch location details, type of cuisines, search for restaurants, etc
actions.py : Contains the following custom actions (insert ZOMATO API key in this script file before starting RASA server)
- search restaurant
- validate location
- validate cuisine
- send email
- restart conversation
- reset slots
nlu_test.py : Contains code to test generated NLU models
rasa_train.py :
- primary script file to test chatbot from CLI. Contains code to:
- train both NLU and Core model
- persist packaged model in 'models' folder
config.yml: Contains model configuration and custom policy
domain.yml: Defines chatbot domain like entities, actions, templates, slots
endpoints.yml: Contains the webhook configuration for custom action
smtpconfig.txt: Contains SMTP server configuration information (If using GMAIL, setup account and generate app password) .
rasa run actions
rasa shell
rasa shell nlu
python3 rasa_train.py
MODEL FILE is saved in models folder: (models/restaurant_rasa_model.tar.gz)
NOTE: Both nlu and core model are saved inside one model file, i.e models/restaurant_rasa_model.tar.gz
* DEFAULT : separate test set is created
* VALIDATION : uses cross - validation
bash python3 nlu_test.py --type DEFAULT
bash python3 nlu_test.py --type VALIDATION