File size: 1,226 Bytes
10dc432
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
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.