|
--- |
|
language: en |
|
datasets: custom |
|
tags: |
|
- text-to-sql |
|
- t5 |
|
- natural-language-processing |
|
- transformers |
|
- huggingface |
|
license: apache-2.0 |
|
--- |
|
|
|
# π Text-to-SQL with T5 (`t5-base`) |
|
|
|
This model is a fine-tuned version of [`t5-base`](https://huggingface.co/t5-base) on a custom **Text-to-SQL** dataset. It translates natural language questions into corresponding SQL queries. |
|
|
|
## π Model Details |
|
|
|
- **Base model:** [t5-base](https://huggingface.co/t5-base) |
|
- **Task:** Natural Language to SQL (text-to-SQL) |
|
- **Dataset:** Small custom dataset (~10β15 examples) of questions and SQL queries |
|
- **Language:** English |
|
- **Fine-tuned by:** [Priyanshu05](https://huggingface.co/Priyanshu05) |
|
|
|
## π§ Example |
|
|
|
```python |
|
from transformers import T5Tokenizer, T5ForConditionalGeneration |
|
|
|
model = T5ForConditionalGeneration.from_pretrained("Priyanshu05/text-to-sql-t5") |
|
tokenizer = T5Tokenizer.from_pretrained("Priyanshu05/text-to-sql-t5") |
|
|
|
question = "translate natural language to SQL: show all customers" |
|
inputs = tokenizer(question, return_tensors="pt") |
|
output = model.generate(**inputs) |
|
print(tokenizer.decode(output[0], skip_special_tokens=True)) |
|
``` |
|
## License |
|
This project is licensed under the Apache-2.0 License. |