{"id":19520152,"url":"https://github.com/osu-nlp-group/text2sql-error-detection","last_synced_at":"2025-04-26T07:31:31.992Z","repository":{"id":202930001,"uuid":"708441754","full_name":"OSU-NLP-Group/Text2SQL-Error-Detection","owner":"OSU-NLP-Group","description":"Code for paper \"Error Detection for Text-to-SQL Semantic Parsing\"","archived":false,"fork":false,"pushed_at":"2024-08-19T02:39:06.000Z","size":108,"stargazers_count":5,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T10:03:43.536Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OSU-NLP-Group.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-22T15:20:27.000Z","updated_at":"2024-12-30T07:32:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"a4db4668-eebe-4bff-aaf7-f5cdace3caf2","html_url":"https://github.com/OSU-NLP-Group/Text2SQL-Error-Detection","commit_stats":null,"previous_names":["osu-nlp-group/text2sql-error-detection"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FText2SQL-Error-Detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FText2SQL-Error-Detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FText2SQL-Error-Detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FText2SQL-Error-Detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OSU-NLP-Group","download_url":"https://codeload.github.com/OSU-NLP-Group/Text2SQL-Error-Detection/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250953585,"owners_count":21513394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T00:24:04.485Z","updated_at":"2025-04-26T07:31:29.729Z","avatar_url":"https://github.com/OSU-NLP-Group.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Text2SQL-Error-Detection\nCode for our EMNLP 2023 paper [Error Detection for Text-to-SQL Semantic Parsing](https://aclanthology.org/2023.findings-emnlp.785/). An updated version is available on [arxiv](https://arxiv.org/abs/2305.13683).\n\n\n## Setup\n1. Install pytorch (1.12.1) and torch-geometric (2.1.0.post1) (https://pytorch-geometric.readthedocs.io/en/latest/install/installation.html). The code is tested with Python 3.8.\n2. Install other required libraries.\n    ```bash\n    pip install -r requirements.txt\n    ```\n3. Download preprocessed data and model checkpoints\n- Preprocessed data collected from the three base parsers is available at [url](https://drive.google.com/file/d/1E_ojxiX8m-8M4-o2wajL9o6FrWEHccuR/view?usp=drive_link).\n    - Unzip the downloaded file and put the `datasets` folder in the `preprocessing` folder.\n- Model checkpoints for simulated interactive evaluations for each base parser is available at [url](https://drive.google.com/file/d/1MAhIT87JxeLxfW7AIyb2KRs-RtPtvAlJ/view?usp=drive_link) (1 checkpoint each).\n    - Unzip the downloaded file and put the folders in `experiments` folder.\n    - `Parser_{parser}` folders are for parser-dependent baselines.\n\n## Training\n1. Prepare training data.\n    \n    In `preprocessing/dataset_beam.py`, choose indented data files `ed_{parser}_beam_train_sim2.json` and `ed_{parser}_beam_dev_sim2.json`. Then execute 'dataset_beam.py'. This will produce `.dat` files for training and dev sets, as well as `.pkl` files for indexers of non-terminal nodes.\n    ```\n    cd preprocessing\n    python3 dataset_beam.py\n    ```\n2. Set the path to training and dev datasets, run `bash train.sh` for CodeBERT+GAT models and `train_no_graph.sh` for `CodeBERT` models.\n    ```bash\n    bash train.sh\n    ```\n## Evaluation\n1. Prepare evaluation data.\n    \n    First choose the target evaluation dataset and source parser non-terminal node indexer in the `main()` function of `dataset_beam.py`. Then execute to obtain `{test_set}_sim2.dat`.\n    ```bash\n    cd preprocessing\n    python3 dataset_beam.py\n    ```\n2. Set the path to evaluation dataset and model checkpoint, run `bash test.sh` for CodeBERT+GAT models and `test_no_graph.sh` for `CodeBERT` models.\n    ```bash\n    bash test.sh\n    ```\n    The prediction results `eval_{test_name}.json` can be found in the checkpoint folder.\n\n\n## Citation\n```\n@inproceedings{chen-etal-2023-error,\n    title = \"Error Detection for Text-to-{SQL} Semantic Parsing\",\n    author = \"Shijie Chen and Ziru Chen and Huan Sun and Yu Su\",\n    booktitle = \"Findings of the Association for Computational Linguistics: EMNLP 2023\",\n    month = dec,\n    year = \"2023\",\n    address = \"Singapore\",\n    publisher = \"Association for Computational Linguistics\",\n    url = \"https://aclanthology.org/2023.findings-emnlp.785\",\n    doi = \"10.18653/v1/2023.findings-emnlp.785\",\n    pages = \"11730--11743\",\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosu-nlp-group%2Ftext2sql-error-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosu-nlp-group%2Ftext2sql-error-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosu-nlp-group%2Ftext2sql-error-detection/lists"}