https://github.com/awslabs/unified-text2sql-benchmark
UNITE: A Unified Benchmark for Text-to-SQL Evaluation
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
✓DOI references
Found 1 DOI reference(s) in README -
✓Academic publication links
Links to: arxiv.org, sciencedirect.com, acm.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.4%) to scientific vocabulary
Repository
UNITE: A Unified Benchmark for Text-to-SQL Evaluation
Basic Info
- Host: GitHub
- Owner: awslabs
- License: apache-2.0
- Language: Python
- Default Branch: main
- Homepage: https://arxiv.org/abs/2305.16265
- Size: 101 KB
Statistics
- Stars: 74
- Watchers: 4
- Forks: 2
- Open Issues: 2
- Releases: 0
Metadata Files
README.md
UNITE: A Unified Benchmark for Text-to-SQL Evaluation
This benchmark is composed of 18 publicly available text-to-SQL datasets, containing natural language questions from more than 12 domains, SQL queries from more than 3.9K patterns, and 29K databases. Compared to the widely used Spider benchmark, we introduce ∼120K additional examples and a threefold increase in SQL patterns, such as comparative and boolean questions. More details can be found in this paper:
@misc{lan2023unite,
title={UNITE: A Unified Benchmark for Text-to-SQL Evaluation},
author={Wuwei Lan and Zhiguo Wang and Anuj Chauhan and Henghui Zhu and Alexander Li and Jiang Guo and Sheng Zhang and Chung-Wei Hang and Joseph Lilien and Yiqun Hu and Lin Pan and Mingwen Dong and Jun Wang and Jiarong Jiang and Stephen Ash and Vittorio Castelli and Patrick Ng and Bing Xiang},
year={2023},
eprint={2305.16265},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
Setup
This project uses Poetry for managing dependencies. For getting the appropriate python version you can look into PyEnv.
poetry env use $(pyenv which python3)
can allow you to install a specific version using pyenv and letting poetry know to use it.
Clone the original datasets into the original folder.
Data
To get all the datasets from in their original formats:
cd original
./download.sh
Note: Remember to check the warnings for some datasets which require manual download.
Usage
There is one script per dataset in the scripts folder which published its output in the unified folder.
Usage example:
- poetry run python3 scripts/prepare_cosql.py
- poetry run python3 scripts/prepare_wikisql.py
- poetry run python3 scripts/prepare_criteriasql.py
Data format for Unified Text2SQL.
- tables.jsonl (Based off https://github.com/taoyds/spider/blob/master/README.md#tables)
- db_id
- table_names
- primary_keys
- foreign_keys
- column_names
- List of List (number of columns) of Tuples (tablenumber, columnname)
- Where tablenumber is the index of the table in tablenames.
- List of List (number of columns) of Tuples (tablenumber, columnname)
- column_types
- List of columntype:: text, number for the column in columnnames by index.
- train.jsonl
- db_id
- query
- question
- database/
- {db_id}
- {db_id}.sqlite
- {db_id}
Spider-Syn:
The tables.json and database/ was copied from unified/spider.
For train/dev files SpiderSynQuestion is used as the question while retaining the query and `db_id.
DB: Patients
The dataset "covers different linguistic variations for the user NL input and maps it to an expected SQL output.".
The dataset is split into the sub-datasets unified/{flavour}_paraphrase_bench which share the same database/ and tables.json:
1. Naıve: ”What is the average length of stay of patients where age is 80?”
2. Syntactic: ”Where age is 80, what is the average length of stay of patients?”
3. Morphological: ”What is the averaged length of stay of patients where age equaled 80?”
4. Lexical: ”What is the mean length of stay of patients where age is 80 years?”
5. Semantic: ”What is the average length of stay of patients older than 80?”
6. Missing Information: ”What is the average stay of patients who are 80?”
Stats:
Usage: poetry run python3 stats/generate_statistics.py
Generates schema level and NLQ level statistics using the SQLglot parser.
Evaluation:
Our evaluation metric is based on execution accuracy, please refer spider test suite eval and type command like the following for execution accuracy: ``` python evaluation.py --gold [gold file] --pred [predicted file] --etype exec --db [database dir]
arguments:
[gold file] gold.sql file where each line is a gold SQL \t db_id
[predicted file] predicted sql file where each line is a predicted SQL
[evaluation type] we only support "exec" evaluation.
[database dir] directory which contains sub-directories where each SQLite3 database is stored
``` Note: to avoid SQL parsing error, we can use function call in PICARD codebase.
References:
- Spider: https://github.com/taoyds/spider
- WikiSQL: https://github.com/salesforce/WikiSQL
- SQUALL: https://github.com/tzshi/squall
- Spider-Syn: https://github.com/ygan/Spider-Syn
- Criteria2SQL: https://github.com/xiaojingyu92/Criteria2SQL
- SParC: https://github.com/taoyds/sparc
- CoSQL: https://github.com/taoyds/cosql
- Spider-DK: https://github.com/ygan/Spider-DK
- ParaphraseBench: https://github.com/DataManagementLab/ParaphraseBench
- XSP (Restaurants): https://github.com/google-research/language/tree/master/language/xsp
- KaggleDBQA: https://www.microsoft.com/en-us/research/publication/kaggledbqa-realistic-evaluation-of-text-to-sql-parsers/
- ACL-SQL: https://dl.acm.org/doi/10.1145/3430984.3431046
- SEOSS-Queries: https://www.sciencedirect.com/science/article/pii/S2352340922004152
- FIBEN: https://github.com/IBM/fiben-benchmark
- SQLGlot: https://github.com/tobymao/sqlglot
Owner
- Name: Amazon Web Services - Labs
- Login: awslabs
- Kind: organization
- Location: Seattle, WA
- Website: http://amazon.com/aws/
- Repositories: 914
- Profile: https://github.com/awslabs
AWS Labs
GitHub Events
Total
- Issues event: 1
- Watch event: 18
- Push event: 1
- Pull request review event: 1
- Pull request event: 2
- Fork event: 1
Last Year
- Issues event: 1
- Watch event: 18
- Push event: 1
- Pull request review event: 1
- Pull request event: 2
- Fork event: 1
Issues and Pull Requests
Last synced: about 2 years ago
All Time
- Total issues: 2
- Total pull requests: 3
- Average time to close issues: 17 days
- Average time to close pull requests: 1 minute
- Total issue authors: 2
- Total pull request authors: 1
- Average comments per issue: 2.5
- Average comments per pull request: 0.0
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 3
- Average time to close issues: 17 days
- Average time to close pull requests: 1 minute
- Issue authors: 2
- Pull request authors: 1
- Average comments per issue: 2.5
- Average comments per pull request: 0.0
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- Nutingnon (2)
- tshu-w (1)
- harshakokel (1)
- ShuoZhangXJTU (1)
Pull Request Authors
- Anuj-Chauhan (3)
- lanwuwei (1)
- dependabot[bot] (1)