This is an end-to-end implementation of deep learning. The Lucy is a web-based chatbot, which gives you information about Nepal Engineering College from where I graduated and this was my second minor college project. This repository contains back-end code for a NLP Powered Chatbot (3rd year project) written in Python using FastAPI framework. It provides a handful of API endpoints to perform all the tasks related to the chatbot.
-
Install postgresql
-
Create a database with name
lucy
sudo -iu postgres createdb -h localhost -p 5432 -U postgres lucy
-
Clone this repo
-
Create an .env file in a project root directory and add the following information
ENV_STATE="development" API_NAME="Lucy-API" API_DESCRIPTION="These are the restful API's which is used to talk with Lucy. The ultimate goal of this project is to provide a common, user-friendly, efficient way to retrieve the response to a query asked by end-users." API_VERSION="0.0.2" DATABASE_HOSTNAME="localhost" DATABASE_PORT=5432 DATABASE_USERNAME="postgres" DATABASE_PASSWORD="postgres" DATABASE_NAME="lucy" PGADMIN_EMAIL="admin@admin.com" PGADMIN_PASSWORD="admin" JWT_EXPIRE_SECONDS=604800 SECRET_KEY="m!-WBkY461NKLG3RYOZfds" ALGORITHM="HS256" HOST="0.0.0.0" PORT=8080 DEVICE="cpu" MODEL_NAME="bert"
-
Click here and download the pre-trained
lucy_bert.pth
file and paste it inside thelucy_models
directory of project root. -
Install all the dependencies
pip install -r "requirements.txt"
-
Migrate the database
alembic upgrade head
-
Migrate the data
python seeder.py
-
Run
python manage.py
-
Clone the repo
-
Install docker
-
Create an .env file in a project root directory and add the following information
ENV_STATE="development" API_NAME="Lucy-API" API_DESCRIPTION="These are the restful API's which is used to talk with Lucy. The ultimate goal of this project is to provide a common, user-friendly, efficient way to retrieve the response to a query asked by end-users." API_VERSION="0.0.2" DATABASE_HOSTNAME="postgres" DATABASE_PORT=5432 DATABASE_USERNAME="lucyuser" DATABASE_PASSWORD="lucypassword" DATABASE_NAME="lucy" PGADMIN_EMAIL="admin@admin.com" PGADMIN_PASSWORD="admin" JWT_EXPIRE_SECONDS=604800 SECRET_KEY="m!-WBkY461NKLG3RYOZf" ALGORITHM="HS256" HOST="0.0.0.0" PORT=8080 DEVICE="cpu" MODEL_NAME="bert"
-
Click here and download the pre-trained
lucy_bert.pth
file and paste it inside thelucy_models
directory of project root. -
Run
docker compose up
You can access the documentation of the API by going to this link http://0.0.0.0:8080/docs after running the backend server.
To run the frontend of the Lucy first go to this link and follow the instructions.