Upload data/text2sql/README.md with huggingface_hub
Browse files- data/text2sql/README.md +33 -29
data/text2sql/README.md
CHANGED
|
@@ -1,49 +1,53 @@
|
|
| 1 |
# Text-to-SQL Data
|
| 2 |
|
| 3 |
-
This directory contains the data for the Text-to-SQL benchmark,
|
| 4 |
-
[Spider2-lite](https://github.com/xlang-ai/Spider2)
|
| 5 |
|
| 6 |
## Structure
|
| 7 |
|
| 8 |
```
|
| 9 |
data/text2sql/
|
| 10 |
-
βββ spider2-lite.jsonl # Benchmark questions (instance_id, db, question)
|
| 11 |
βββ README.md
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
```
|
| 26 |
|
| 27 |
-
##
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
|
| 32 |
-
|
|
| 33 |
-
|
|
| 34 |
-
|
|
| 35 |
-
| snowflake | AUSTIN | `AUSTIN/AUSTIN_db_summary.json` | Austin 311 service requests |
|
| 36 |
|
| 37 |
## Adding a New SQLite Database
|
| 38 |
|
| 39 |
1. Place the `.sqlite` file:
|
| 40 |
```
|
| 41 |
-
data/text2sql/
|
| 42 |
```
|
| 43 |
2. The schema summary is auto-generated on first run, or generate manually:
|
| 44 |
```bash
|
| 45 |
python -m src.indexing.extract_db_summary \
|
| 46 |
-
--db-path data/text2sql/
|
| 47 |
```
|
| 48 |
|
| 49 |
## Adding a BigQuery Database
|
|
@@ -52,7 +56,7 @@ One example db_summary is included per backend type:
|
|
| 52 |
```bash
|
| 53 |
python -m src.indexing.extract_db_summary_bigquery \
|
| 54 |
--datasets project_id.dataset_id \
|
| 55 |
-
--output-dir data/text2sql/
|
| 56 |
```
|
| 57 |
|
| 58 |
## Adding a Snowflake Database
|
|
@@ -61,10 +65,10 @@ One example db_summary is included per backend type:
|
|
| 61 |
```bash
|
| 62 |
python -m src.indexing.extract_db_summary_snowflake \
|
| 63 |
--databases MY_DATABASE \
|
| 64 |
-
--output-dir data/text2sql/
|
| 65 |
```
|
| 66 |
|
| 67 |
## Full Spider2-lite Data
|
| 68 |
|
| 69 |
To run the full benchmark, clone [Spider2](https://github.com/xlang-ai/Spider2)
|
| 70 |
-
and
|
|
|
|
| 1 |
# Text-to-SQL Data
|
| 2 |
|
| 3 |
+
This directory contains the data for the Text-to-SQL benchmark, supporting
|
| 4 |
+
[Spider2-lite](https://github.com/xlang-ai/Spider2) and [Bird](https://bird-bench.github.io/) datasets.
|
| 5 |
|
| 6 |
## Structure
|
| 7 |
|
| 8 |
```
|
| 9 |
data/text2sql/
|
|
|
|
| 10 |
βββ README.md
|
| 11 |
+
βββ spider2-lite/
|
| 12 |
+
β βββ spider2-lite.jsonl # Spider2-lite questions (546 instances)
|
| 13 |
+
β βββ golden_lite_spider_total.json # Gold labels for evaluation
|
| 14 |
+
β βββ sqlite/ # Local SQLite databases
|
| 15 |
+
β β βββ <DB_Name>/
|
| 16 |
+
β β βββ <DB_Name>.sqlite # SQLite database file
|
| 17 |
+
β β βββ <DB_Name>_db_summary.json # Auto-generated schema summary
|
| 18 |
+
β βββ bigquery/ # BigQuery dataset schemas
|
| 19 |
+
β β βββ <dataset_group>/
|
| 20 |
+
β β βββ <dataset_group>_bigquery_summary.json
|
| 21 |
+
β βββ snowflake/ # Snowflake database schemas
|
| 22 |
+
β βββ <DATABASE>/
|
| 23 |
+
β βββ <DATABASE>_db_summary.json
|
| 24 |
+
βββ bird/
|
| 25 |
+
βββ bird.jsonl # Bird questions (129 instances)
|
| 26 |
+
βββ databases/
|
| 27 |
+
βββ <DB_Name>/
|
| 28 |
+
βββ <DB_Name>.sqlite
|
| 29 |
+
βββ <DB_Name>_db_summary.json
|
| 30 |
```
|
| 31 |
|
| 32 |
+
## Included Example Databases
|
| 33 |
|
| 34 |
+
| Backend | Benchmark | Database | Description |
|
| 35 |
+
|-----------|-------------|------------|------------------------------|
|
| 36 |
+
| SQLite | Spider2-lite | **Pagila** | DVD rental store (16 tables) |
|
| 37 |
+
| SQLite | Bird | **superhero** | Superhero database (10 tables) |
|
| 38 |
+
| BigQuery | Spider2-lite | austin | Austin 311 service requests (schema only) |
|
| 39 |
+
| Snowflake | Spider2-lite | AUSTIN | Austin 311 service requests (schema only) |
|
|
|
|
| 40 |
|
| 41 |
## Adding a New SQLite Database
|
| 42 |
|
| 43 |
1. Place the `.sqlite` file:
|
| 44 |
```
|
| 45 |
+
data/text2sql/spider2-lite/sqlite/MyDB/MyDB.sqlite
|
| 46 |
```
|
| 47 |
2. The schema summary is auto-generated on first run, or generate manually:
|
| 48 |
```bash
|
| 49 |
python -m src.indexing.extract_db_summary \
|
| 50 |
+
--db-path data/text2sql/spider2-lite/sqlite/MyDB/MyDB.sqlite
|
| 51 |
```
|
| 52 |
|
| 53 |
## Adding a BigQuery Database
|
|
|
|
| 56 |
```bash
|
| 57 |
python -m src.indexing.extract_db_summary_bigquery \
|
| 58 |
--datasets project_id.dataset_id \
|
| 59 |
+
--output-dir data/text2sql/spider2-lite/bigquery/my_dataset/
|
| 60 |
```
|
| 61 |
|
| 62 |
## Adding a Snowflake Database
|
|
|
|
| 65 |
```bash
|
| 66 |
python -m src.indexing.extract_db_summary_snowflake \
|
| 67 |
--databases MY_DATABASE \
|
| 68 |
+
--output-dir data/text2sql/spider2-lite/snowflake/MY_DATABASE/
|
| 69 |
```
|
| 70 |
|
| 71 |
## Full Spider2-lite Data
|
| 72 |
|
| 73 |
To run the full benchmark, clone [Spider2](https://github.com/xlang-ai/Spider2)
|
| 74 |
+
and copy the databases into `spider2-lite/sqlite/`.
|