tarzanagh commited on
Commit
f31e124
Β·
verified Β·
1 Parent(s): 57d071a

Upload data/text2sql/README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. 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, following the
4
- [Spider2-lite](https://github.com/xlang-ai/Spider2) directory layout.
5
 
6
  ## Structure
7
 
8
  ```
9
  data/text2sql/
10
- β”œβ”€β”€ spider2-lite.jsonl # Benchmark questions (instance_id, db, question)
11
  β”œβ”€β”€ README.md
12
- └── databases/
13
- β”œβ”€β”€ sqlite/ # Local SQLite databases
14
- β”‚ └── <DB_Name>/
15
- β”‚ β”œβ”€β”€ <DB_Name>.sqlite # SQLite database file
16
- β”‚ └── <DB_Name>_db_summary.json # Auto-generated schema summary
17
- β”‚
18
- β”œβ”€β”€ bigquery/ # BigQuery dataset schemas
19
- β”‚ └── <dataset_group>/
20
- β”‚ └── <dataset_group>_bigquery_summary.json # Schema summary
21
- β”‚
22
- └── snowflake/ # Snowflake database schemas
23
- └── <DATABASE>/
24
- └── <DATABASE>_db_summary.json # Schema summary
 
 
 
 
 
 
25
  ```
26
 
27
- ## Sample Databases
28
 
29
- One example db_summary is included per backend type:
30
-
31
- | Backend | Database | Summary file | Description |
32
- |-----------|----------|-------------------------------------------|------------------------------|
33
- | sqlite | Pagila | `Pagila/Pagila_db_summary.json` | DVD rental store (16 tables) |
34
- | bigquery | austin | `austin/austin_bigquery_summary.json` | Austin 311 service requests |
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/databases/sqlite/MyDB/MyDB.sqlite
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/databases/sqlite/MyDB/MyDB.sqlite
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/databases/bigquery/my_dataset/
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/databases/snowflake/MY_DATABASE/
65
  ```
66
 
67
  ## Full Spider2-lite Data
68
 
69
  To run the full benchmark, clone [Spider2](https://github.com/xlang-ai/Spider2)
70
- and symlink or copy the databases into `databases/`.
 
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/`.