This project converts natural language queries into SQL queries using a pre-trained language model and executes them on a DuckDB database.
-
Clone the repository:
git clone https://github.com/yourusername/yourproject.git cd yourproject
-
Install the dependencies:
pip install -r requirements.txt
-
Replace the placeholder
YOUR_HF_TOKEN
inmain.py
with your Hugging Face API token.
Run the project with:
python main.py
You can input natural language queries such as:
- "What is the total sales for each product?"
- "Which region sold the most laptops?"
The model will generate an SQL query and execute it on the DuckDB database.
- "What is the total sales for each product?"
- "Which region sold the most laptops?"
- "What is the best-selling product in terms of quantity?"
You can try the code in an interactive environment on Google Colab:
This project is licensed under the MIT License.