Glenn, Parker
commited on
Commit
·
d2d05c1
1
Parent(s):
8e0aa72
adding readme
Browse files
README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
tags:
|
| 5 |
+
- text2sql
|
| 6 |
+
datasets:
|
| 7 |
+
- splash
|
| 8 |
+
widget:
|
| 9 |
+
- text: "Give the name, population, and head of state for the country that has the largest area. || select name, population, continent from country order by surfacearea desc limit 1 || world_1 | country : name, population, headofstate, surfacearea || swap continent with head of state because it is not required."
|
| 10 |
+
---
|
| 11 |
+
## parkervg/destt5-text2sql
|
| 12 |
+
|
| 13 |
+
Fine-tuned weights for the text2sql model described in [Correcting Semantic Parses with Natural Language through Dynamic
|
| 14 |
+
Schema Encoding](https://arxiv.org/pdf/2305.19974.pdf), based on [t5-base](https://huggingface.co/t5-base).
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
### Training Data
|
| 18 |
+
|
| 19 |
+
The model has been fine-tuned on the 7,481 training examples in the [SPLASH interactive semantic parsing dataset](https://github.com/MSR-LIT/Splash).
|
| 20 |
+
|
| 21 |
+
Rather than seeing the full database schema, it only received the filtered schema as predicted by the [destt5-schema-prediction model](https://huggingface.co/parkervg/destt5-schema-prediction)
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
### Training Objective
|
| 25 |
+
|
| 26 |
+
This model was initialized with [t5-base](https://huggingface.co/t5-base) and fine-tuned with the text-to-text generation objective.
|
| 27 |
+
|
| 28 |
+
As this model works in the interactive setting, we utilize the standard text2sql features such as `question` and `db_schema`, in addition to `feedback` and `incorrect_parse`.
|
| 29 |
+
|
| 30 |
+
Importantly, the `[table]`, `[column]`, `[content]` features are expected to be the 'gold' schema items, as predicted by an initial auxiliary schema prediction model.
|
| 31 |
+
|
| 32 |
+
```
|
| 33 |
+
[question] || [incorrect_parse] || [db_id] | [table] : [column] ( [content] , [content] ) , [column] ( ... ) , [...] | [table] : ... | ... || [feedback]
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
The model then attempts to parse the corrected SQL query, using the filtered database schema items. This is prefaced by the `db_id`.
|
| 37 |
+
|
| 38 |
+
```
|
| 39 |
+
[db_id] | [sql]
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
### Performance
|
| 44 |
+
|
| 45 |
+
When this model receives the serialized database schema as predicted by [destt5-schema-prediction](https://huggingface.co/parkervg/destt5-schema-prediction), it achieves 53.43% correction accuracy (exact-match) on the SPLASH test set.
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
### References
|
| 49 |
+
|
| 50 |
+
1. [Correcting Semantic Parses with Natural Language through Dynamic
|
| 51 |
+
Schema Encoding](https://arxiv.org/pdf/2305.19974.pdf)
|
| 52 |
+
|
| 53 |
+
2. [DestT5 codebase](https://github.com/parkervg/destt5)
|
| 54 |
+
|
| 55 |
+
3. [Speak to your Parser: Interactive Text-to-SQL with Natural Language Feedback](https://arxiv.org/pdf/2005.02539v2.pdf)
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
### Citation
|
| 59 |
+
|
| 60 |
+
```bibtex
|
| 61 |
+
@inproceedings{glenn2023correcting,
|
| 62 |
+
author = {Parker Glenn, Parag Pravin Dakle, Preethi Raghavan},
|
| 63 |
+
title = "Correcting Semantic Parses with Natural Language through Dynamic Schema Encoding",
|
| 64 |
+
booktitle = "Proceedings of the 5th Workshop on NLP for Conversational AI",
|
| 65 |
+
publisher = "Association for Computational Linguistics",
|
| 66 |
+
year = "2023"
|
| 67 |
+
}
|
| 68 |
+
```
|