This repository contains our end of foundations project called ChatAfrica which is a web-based chatbot application that allows one to know more about the African culture and its diversity. The application uses GPT-3 to generate responses and renders it to the user in text format. Other resources used to train the data are found in the folder named content.
Additional applications and dependencies used are listed in the requirement.txt file. The backend folder houses all the tasks carried out at the backend level.
Overview.mp4
- Clone this repository:
git clone "https://github.com//devmarrie/ChatAfrica.git"
- Access ChatAfrica directory:
cd ChatAfrica
It contains the endpoints connecting various parts of the application including the database, frontend and the GPT-3 api. These endpoints are stored in the following files or folders:
This folder contains the following files:
-
auth.py - It contains the google authentication implementation and the login routes used by the user to login or signup and access various parts of the application. Once the user logs in he/she is directed to the chat page.
-
views.py - contains an implementation of the chats, user and questions routes.
This folder contains the code implementation of how we trained the GPT-3 api with content exclusive to Africa and its connection with our backend.
- content - this folder contains all the data we used to train our model.
- ask_ChatAfrica.py - generates the responses to user's questions.
- construct_index.py - constructs an index of text documents using GPT (Generative Pre-trained Transformer) models.
- index.json - contains the data used to train gpt-3 continuously and test if it is working perfectly.
It contains classes used for creating orms used to define the database tables of this project:
- base_model.py - defines an abstract table which is inherited by all the other tables
- chat.py - defines the chat table
- db_storage.py - testing the database and bringing the tables to life.
- question.py - used to create the question table in the database.
- response.py - used to create the response table.
- user.py - used to create the user table.
** setup_mysql_chat_africa.sql ** init.py
This file is the entry point of our application. It starts the Flask application.
From the home page, click on the login button to either sign up or sign in to use the ChatAfrica application. Sign up & sign in is very easy as it is automated with Google authentication (You don't need to stress in imputing your name, password or the likes :) ).
After successful login, input a room name in the container. The name could be anything; a nickname, a question, an expression, etc. Then click on create to create a room and begin your conversation with ChatAfrica.
ChatAfrica has the ability of retaining your conversation with it. Once you are done, click on the logout button to exit the room. You can always log back in, select your created room and view your conversations with the bot. Alternatively, you can continue your chat or create a new room to start another conversation with ChatAfrica.
"What is the capital of Kenya?" "Got any creative ideas about Nigerian Afrobeats?" "How do I go to Ghana from here?"
Remembers what user said earlier in the conversation Allows user to provide follow-up corrections Trained to decline inappropriate requests
May occasionally generate incorrect information May occasionally produce harmful instructions or biased content Limited knowledge of world and events after 2022