Datasets:
Reetu Raj Harsh commited on
Upload Text2SQL dataset with 34 SQLite databases and metadata files
Browse filesFiles changed (2)
- README.md+49-29
- schemas/database_schemas.yamlAdded
94 unmodified lines959697989910010130 unmodified lines1321331341351361371381391401411421431441451461471481491501511521531541551561571581596 unmodified lines1661671681691701711721731745 unmodified lines18018118218318418518618718818919019119219313 unmodified lines20720820921021121221394 unmodified lines### Data Files Structure- **`finch_dataset.json`**: Main dataset file with 75,725 NL-SQL pairs (appears in HF dataset viewer)- **`schemas/database_schemas.json`**: Database schema metadata for all 33 databases (auxiliary file)- **`text2sql-db/`**: SQLite database files organized by source (auxiliary files)### Sample Data from finch_dataset.json30 unmodified lines]```### Schema Information (schemas/database_schemas.json)The `schemas/database_schemas.json` file contains comprehensive schema metadata for all databases:```json{"financial": {"db_id": "financial","table_names_original": ["account", "card", "client", "disp", "district", "loan", "order", "trans"],"table_names": ["account", "card", "client", "disposition", "district", "loan", "order", "transaction"],"column_names_original": [[-1, "*"],[0, "account_id"],[0, "district_id"],[0, "frequency"],[0, "date"]],"column_types": ["text", "number", "number", "text", "text"],"foreign_keys": [[2, 1], [4, 2]],"primary_keys": [1]}}```## Example Usage6 unmodified linesfrom datasets import load_datasetfrom huggingface_hub import hf_hub_downloadimport sqlite3# Load the main dataset using HuggingFace datasets librarydataset = load_dataset("reeturajahrsh1907/finch")print(f"Dataset: {dataset}")print(f"Number of examples: {len(dataset['train'])}")5 unmodified linesprint(f"Difficulty: {sample['difficulty']}")# Load schema information for the databaseschema_path = hf_hub_download(repo_id="reeturajahrsh1907/finch", filename="schemas/database_schemas.json")import jsonwith open(schema_path, 'r') as f:schemas = json.load(f)# Download the corresponding SQLite databasedb_path = hf_hub_download(repo_id="reeturajahrsh1907/finch",filename=f"text2sql-db/text2sql/bird/{sample['db_id']}.sqlite")13 unmodified linesfrom huggingface_hub import hf_hub_download# Alternative: Load dataset JSON file directlysamples_path = hf_hub_download(repo_id="reeturajahrsh1907/finch", filename="finch_dataset.json")with open(samples_path, 'r') as f:dataset = json.load(f)94 unmodified lines959697989910010130 unmodified lines1321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781796 unmodified lines1861871881891901911921931941955 unmodified lines20120220320420520620720820921021121221313 unmodified lines22722822923023123223394 unmodified lines### Data Files Structure- **`finch_dataset.json`**: Main dataset file with 75,725 NL-SQL pairs (appears in HF dataset viewer)- **`schemas/database_schemas.yaml`**: Database schema metadata for all 33 databases (auxiliary file)- **`text2sql-db/`**: SQLite database files organized by source (auxiliary files)### Sample Data from finch_dataset.json30 unmodified lines]```### Schema Information (schemas/database_schemas.yaml)The `schemas/database_schemas.yaml` file contains comprehensive schema metadata for all databases:```yamlfinancial:db_id: financialtable_names_original:- account- card- client- disp- district- loan- order- transtable_names:- account- card- client- disposition- district- loan- order- transactioncolumn_names_original:- [-1, "*"]- [0, "account_id"]- [0, "district_id"]- [0, "frequency"]- [0, "date"]column_types:- text- number- number- text- textforeign_keys:- [2, 1]- [4, 2]primary_keys:- 1```## Example Usage6 unmodified linesfrom datasets import load_datasetfrom huggingface_hub import hf_hub_downloadimport sqlite3import yaml# Load the main dataset using HuggingFace datasets librarydataset = load_dataset("domyn/finch")print(f"Dataset: {dataset}")print(f"Number of examples: {len(dataset['train'])}")5 unmodified linesprint(f"Difficulty: {sample['difficulty']}")# Load schema information for the databaseschema_path = hf_hub_download(repo_id="domyn/finch", filename="schemas/database_schemas.yaml")with open(schema_path, 'r') as f:schemas = yaml.safe_load(f)# Download the corresponding SQLite databasedb_path = hf_hub_download(repo_id="domyn/finch",filename=f"text2sql-db/text2sql/bird/{sample['db_id']}.sqlite")13 unmodified linesfrom huggingface_hub import hf_hub_download# Alternative: Load dataset JSON file directlysamples_path = hf_hub_download(repo_id="domyn/finch", filename="finch_dataset.json")with open(samples_path, 'r') as f:dataset = json.load(f)
README.md+49-29
schemas/database_schemas.yamlAdded