Yoruba Practice Chatbot - Project Documentation
Project Overview
This project is a Yoruba Practice Chatbot built using Python and Flask, combining a responsive web frontend with a conversational backend to help users learn and practice Yoruba language phrases.
The chatbot offers two operational modes:
- Practice Mode: Allows users to practice predefined Yoruba phrases and receive feedback and corrections.
- Q&A Mode: Provides basic translation and simple Yoruba language question answering capabilities.
Users are greeted upon entry and can switch modes anytime with a simple command.
Features
1. Interactive phrase practice with fuzzy string matching and accent normalization
2. Basic translation and question answering in Q&A mode
3. User greeting and instruction before practice starts
4. Session management to track current phrase and attempts
5. Auto-advance to next phrase after multiple failed attempts
6. Responsive and accessible interface with dark mode toggle, avatars, timestamps, and input control
Project Structure
1. app.py: Flask backend handling chatbot logic, conversation state, and response generation.
2. templates/index.html: Frontend HTML, CSS, and JavaScript for the chatbot UI.
3. requirement.txt: Dependencies for the application to run smoothly.
Prerequisites
1. Python 3.8 or newer
2. pip package manager
Setup and Installation
1. Create and activate virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
2. Install dependencies:
pip install -r requirement.txt
3. Run the Flask app:
python app.py
4. Open your browser and go to:
127.0.0.1
Usage Instructions
- When the page loads, you will be greeted and introduced to the chatbot.
- Begin by typing Yoruba phrases as prompted in practice mode.
- Receive instant feedback and corrections on your practice answers.
- To switch between Practice and Q&A modes, type the prompt:
switch
- In Q&A mode, …