Chatbot to help you in your course selection
View Demo
- Table of Contents
- About The Project
- Getting Started
- Making Changes
- Performing requests to API
- Project Layout
- Project Contributors
- References
The aim of this assignment is to create a messenger bot which can provide intelligent dialog conversations with the user,similar to bots like ELIZA or Bot. The bot uses a knowledge base built using conversations stored in aiml files.
The main goal of this chatbot is to help students decide on which courses they should take based on their intrests and recent trends in the market. It also uses a corpus containing information about his current university to provide more relavent responses based on which classes he attends and which professor he likes.
This project is written in python. Any interactions performed with the user are stored in flat file database using sqlite. The bot is designed to interact with other online services and api's. The front-end for this bot is an android app(flutter app added later) which interacts with a backend (a flask application which can be hosted on any cloud platform) using RESTful services.
You can interact with the bot hosted here
To get a local copy up and running follow these simple steps.
This project requires the following:
This is an example list of dependencies present/used in the project
- Clone the repo
git clone https://github.com/BSAkash/ChatBot.git
cd AiBot
- Install required python packages
pip install -r requirements.txt
- Run the development server (or see next step to run locally)
python flask_app.py
- Run the bot locally without any server
python conversation.py
Changes can be done to Backend/databases/corpus.db
according to the courses
and the faculty available which will be reflected by the bot. This can be done
by running the sqlite3 Backend/databases/corpus.db
command or by using any other GUI
sqlite database editor of your choice.
Bot responses can be obtained by performin a POST request to the API at rikilg.pythonanywhere.com/api/
// Query format
{
"query": "<user query here>"
}
// Response format
{
"response": "<reply from the bot>",
"mode": "reply"
// currently mode is set to reply but can change by reply type for example audio or video by improving the bot in future.
}
Folder structure:
AiBot
├── AndroidApp # A Basic android app to talk to bot on server
├── FlutterApp # A Better flutter app to talk to bot on server
├── Backend/src # Source code of the bot deployed on server
│ ├── aiml # holds all aiml files which serve as knowledgebase of the bot
│ │ ├── conversation.aiml
│ │ ├── dictionary.aiml
│ │ ├── quote.aiml
│ │ └── (other alice aiml)
│ ├── apis # python modules to interact with online apis
│ │ ├── dictionary.py
│ │ └── quotes.py
│ ├── templates # files served by the flask server for online bot access
│ │ ├── main_page.css
│ │ ├── main_page.js
│ │ └── main_page.html
│ ├── databases # folder to store database files
│ ├── conversation.py # main bot file which abstracts the underlying aiml interaction
│ ├── database.py # python module to interact with the stored database
│ ├── flask_app.py # main file used to run flask server
│ └── learningFileList.aiml # main aiml file which loads all other aiml files
├── README.md # this README file
└── requirements.txt # contains of all the required python packages
- Rikil Gajarla - 2017A7PS0202H
- Naga Sai Bharath - 2017A7PS0209H
- Akash Bonagiri - 2017AAPS0455H
Project Link: https://github.com/BSAkash/ChatBot