Datasets:
Reetu Raj Harsh
commited on
Upload Text2SQL dataset with 34 SQLite databases and metadata files
Browse files- README.md +8 -8
- schemas/database_schemas.json +0 -0
README.md
CHANGED
|
@@ -95,7 +95,7 @@ finch/
|
|
| 95 |
|
| 96 |
### Data Files Structure
|
| 97 |
- **`finch_dataset.json`**: Main dataset file with 75,725 NL-SQL pairs (appears in HF dataset viewer)
|
| 98 |
-
- **`
|
| 99 |
- **`text2sql-db/`**: SQLite database files organized by source (auxiliary files)
|
| 100 |
|
| 101 |
### Sample Data from finch_dataset.json
|
|
@@ -132,9 +132,9 @@ finch/
|
|
| 132 |
]
|
| 133 |
```
|
| 134 |
|
| 135 |
-
### Schema Information (
|
| 136 |
|
| 137 |
-
The `
|
| 138 |
|
| 139 |
```json
|
| 140 |
{
|
|
@@ -168,7 +168,7 @@ from huggingface_hub import hf_hub_download
|
|
| 168 |
import sqlite3
|
| 169 |
|
| 170 |
# Load the main dataset using HuggingFace datasets library
|
| 171 |
-
dataset = load_dataset("
|
| 172 |
print(f"Dataset: {dataset}")
|
| 173 |
print(f"Number of examples: {len(dataset['train'])}")
|
| 174 |
|
|
@@ -180,14 +180,14 @@ print(f"Database: {sample['db_id']}")
|
|
| 180 |
print(f"Difficulty: {sample['difficulty']}")
|
| 181 |
|
| 182 |
# Load schema information for the database
|
| 183 |
-
schema_path = hf_hub_download(repo_id="
|
| 184 |
import json
|
| 185 |
with open(schema_path, 'r') as f:
|
| 186 |
schemas = json.load(f)
|
| 187 |
|
| 188 |
# Download the corresponding SQLite database
|
| 189 |
db_path = hf_hub_download(
|
| 190 |
-
repo_id="
|
| 191 |
filename=f"text2sql-db/text2sql/bird/{sample['db_id']}.sqlite"
|
| 192 |
)
|
| 193 |
|
|
@@ -207,7 +207,7 @@ import sqlite3
|
|
| 207 |
from huggingface_hub import hf_hub_download
|
| 208 |
|
| 209 |
# Alternative: Load dataset JSON file directly
|
| 210 |
-
samples_path = hf_hub_download(repo_id="
|
| 211 |
with open(samples_path, 'r') as f:
|
| 212 |
dataset = json.load(f)
|
| 213 |
|
|
@@ -410,4 +410,4 @@ For questions about the FINCH dataset, please contact the research team at Domyn
|
|
| 410 |
**Research Team:**
|
| 411 |
- Avinash Kumar Singh (avinash.kumarsingh@domyn.com)
|
| 412 |
- Bhaskarjit Sarmah (bhaskarjit.sarmah@domyn.com)
|
| 413 |
-
- Stefano Pasquali (stefano.pasquali@domyn.com)
|
|
|
|
| 95 |
|
| 96 |
### Data Files Structure
|
| 97 |
- **`finch_dataset.json`**: Main dataset file with 75,725 NL-SQL pairs (appears in HF dataset viewer)
|
| 98 |
+
- **`schemas/database_schemas.json`**: Database schema metadata for all 33 databases (auxiliary file)
|
| 99 |
- **`text2sql-db/`**: SQLite database files organized by source (auxiliary files)
|
| 100 |
|
| 101 |
### Sample Data from finch_dataset.json
|
|
|
|
| 132 |
]
|
| 133 |
```
|
| 134 |
|
| 135 |
+
### Schema Information (schemas/database_schemas.json)
|
| 136 |
|
| 137 |
+
The `schemas/database_schemas.json` file contains comprehensive schema metadata for all databases:
|
| 138 |
|
| 139 |
```json
|
| 140 |
{
|
|
|
|
| 168 |
import sqlite3
|
| 169 |
|
| 170 |
# Load the main dataset using HuggingFace datasets library
|
| 171 |
+
dataset = load_dataset("reeturajahrsh1907/finch")
|
| 172 |
print(f"Dataset: {dataset}")
|
| 173 |
print(f"Number of examples: {len(dataset['train'])}")
|
| 174 |
|
|
|
|
| 180 |
print(f"Difficulty: {sample['difficulty']}")
|
| 181 |
|
| 182 |
# Load schema information for the database
|
| 183 |
+
schema_path = hf_hub_download(repo_id="reeturajahrsh1907/finch", filename="schemas/database_schemas.json")
|
| 184 |
import json
|
| 185 |
with open(schema_path, 'r') as f:
|
| 186 |
schemas = json.load(f)
|
| 187 |
|
| 188 |
# Download the corresponding SQLite database
|
| 189 |
db_path = hf_hub_download(
|
| 190 |
+
repo_id="reeturajahrsh1907/finch",
|
| 191 |
filename=f"text2sql-db/text2sql/bird/{sample['db_id']}.sqlite"
|
| 192 |
)
|
| 193 |
|
|
|
|
| 207 |
from huggingface_hub import hf_hub_download
|
| 208 |
|
| 209 |
# Alternative: Load dataset JSON file directly
|
| 210 |
+
samples_path = hf_hub_download(repo_id="reeturajahrsh1907/finch", filename="finch_dataset.json")
|
| 211 |
with open(samples_path, 'r') as f:
|
| 212 |
dataset = json.load(f)
|
| 213 |
|
|
|
|
| 410 |
**Research Team:**
|
| 411 |
- Avinash Kumar Singh (avinash.kumarsingh@domyn.com)
|
| 412 |
- Bhaskarjit Sarmah (bhaskarjit.sarmah@domyn.com)
|
| 413 |
+
- Stefano Pasquali (stefano.pasquali@domyn.com)
|
schemas/database_schemas.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|