Welcome to the Text to SQL Chatbot project! This project aims to bridge the gap between non-technical team members and database interactions, allowing users to query databases using natural language instead of SQL.
π Table of Contents
- π Project Overview
- π§ Features
- π οΈ Installation
- π Usage
- πΌ Architecture
- π Evaluation
- π Future Work
- π License
π Project Overview In many companies, team members may need access to data stored in SQL databases but lack the technical skills to write SQL queries. This chatbot allows users to ask questions in natural language, converts those questions into SQL queries, and retrieves results from the database.
This project is applicable in various domains, including healthcare, retail, and finance.
π§ Features
- Natural Language Processing: Converts user queries into SQL statements.
- Database Interaction: Connects to MySQL databases to fetch results.
- User-Friendly Output: Provides results back to the user in natural language.
- End-to-End Solution: From data preparation to interaction with the chatbot.
π οΈ Installation To get started with the Text to SQL Chatbot, follow these steps:
-
Clone the Repository:
git clone https://github.com/pik1989/Text-to-SQL-Chatbot.git cd Text-to-SQL-Chatbot -
Set Up MySQL:
- Create a MySQL database and tables as specified in the project.
- Load your data from Excel sheets into the MySQL database.
-
Configure API Keys: Ensure you have the necessary API keys for the LLM you will be using (e.g., Google Gemini).
πΌ Architecture The architecture of the Text to SQL Chatbot consists of the following components:
- Data Source: Excel sheets containing raw data.
- Database: MySQL database where the data is stored and queried.
- LLM Chain: Uses a large language model to convert natural language questions into SQL queries.
- Output Parser: Processes the SQL query output and formats it for user display.
π Evaluation The performance of the chatbot can be evaluated using various metrics, including:
- Accuracy: How accurately the LLM generates the correct SQL queries.
- Response Time: The time taken to return results after a query is made.
- User Feedback: Collecting feedback from users on the clarity and usefulness of responses.
π Future Work There are several ways to enhance this project:
- Multiple LLMs: Experiment with other large language models for better accuracy.
- User Interface: Develop a web interface using Flask or Streamlit for easier interaction.
- Deployment: Host the application on cloud platforms to make it accessible to a wider audience.
π License This project is licensed under the MIT License. See the LICENSE file for more details.
Feel free to contribute to this project or reach out with any questions! Happy coding! π
# Notes:
- Replace `pik1989` in the clone command with your actual GitHub username.
- Update the path to the architecture diagram image in the Markdown.
- Customize any sections as needed to better fit your project specifics.