A chat-bot to order pizza.
- Python 3.6+
- Django
- DjangoRestFramework
- SQLite3
- NLTK
- Run
setup.bat
file to setup and run server
- Run
setup.sh
file to setup and run server
Run python manage.py createsuperuser
to create Admin User
- Create python virtual environment if needed.
- Run
pip install -r requirement.txt
to download dependencies. - Run
python manage.py migrate
to setup database. - Run
python manage.py loaddata db.json
to populate database with basic responses and other data. - Run
python manage.py createsuperuser
to create Admin User - Run
python manage.py runserver
to run server.
-
Ask bot to take your order and start telling him the requirements
- Eg:
I would like to order pizza.
- Eg:
-
Ask bot that you want to know your order status.
- Eg:
Can I my pizza status?
- Eg:
-
Access admin page on
<hostname>/admin
- You can see orders and update order status from Admin Panel.
- You can add more Chat-bot responses from Admin Panel.
- You can add more pizza toppings and size from Admin Panel.
- Bot: Hello, Welcome to YoYo Pizza.
- User: Hi
- Bot: Hi there, How may I help you?
- User: I would like to order pizza.
- Bot: Here is our Menu. We have Farmhouse, Margherita, Indian spice, Desi chutney.
- User: I like Farmhouse.
- Bot: Sure, What pizza size do you want?
- User: I prefer large pizza.
- Bot: Nice, How many pizza do you want?
- User: I want 2 pizza. (Provide quantity in integer)
- Bot: Great, Can you tell me your name?
- User: Sam (Provide Name only)
- Bot: Where do you want it to be delivered?
- User: 401, Shayam Nagar (Provide Address only)
- Bot: That will be: 800Rs. Shall I confirm it.
- User: Sure.
- Bot: Thanks for ordering with us. Your Order No is: 1380165
- User: What is my order status?
- Bot: Can you provide me your order number.
- User: Here it is. 1380165
- Bot: Your Order is Placed.
- You can add more user speeches to
trainingSet.csv
file and runcreate_classifier.py
to create classifier. - Run
create_classifier.py
file separately when server is not running. create_classifier.py
will create classifier and save it inmedia
folder so it can be used by Django server.
Naive Bayes Classifier is used to predict user's text context. Server predicts the context and based on that chooses a random response from database. App uses REST API to communicate to server and uses session to remember context during multiple REST requests. Regular expression is used to take order details.