{"id":19520139,"url":"https://github.com/osu-nlp-group/auto-sql-correction","last_synced_at":"2025-07-27T01:05:59.024Z","repository":{"id":168450260,"uuid":"635996346","full_name":"OSU-NLP-Group/Auto-SQL-Correction","owner":"OSU-NLP-Group","description":"Code, data, and model of paper \"Text-to-SQL Error Correction with Language Models of Code\" (ACL'23)","archived":false,"fork":false,"pushed_at":"2024-08-22T14:28:38.000Z","size":51,"stargazers_count":30,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-05T04:42:33.195Z","etag":null,"topics":["code-editor","code-generation","natural-language-interface","text-to-sql"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2305.13073","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-05-03T23:00:49.000Z","updated_at":"2024-11-18T05:03:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"89d44f8d-f0d7-421c-9c49-0e61a5615223","html_url":"https://github.com/OSU-NLP-Group/Auto-SQL-Correction","commit_stats":null,"previous_names":["osu-nlp-group/auto-sql-correction"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OSU-NLP-Group/Auto-SQL-Correction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FAuto-SQL-Correction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FAuto-SQL-Correction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FAuto-SQL-Correction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FAuto-SQL-Correction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OSU-NLP-Group","download_url":"https://codeload.github.com/OSU-NLP-Group/Auto-SQL-Correction/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FAuto-SQL-Correction/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267278631,"owners_count":24063252,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["code-editor","code-generation","natural-language-interface","text-to-sql"],"created_at":"2024-11-11T00:23:59.992Z","updated_at":"2025-07-27T01:05:59.007Z","avatar_url":"https://github.com/OSU-NLP-Group.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Auto-SQL-Correction\nCode, data, and model for our ACL 2023 paper [Text-to-SQL Error Correction with Language Models of Code](https://arxiv.org/abs/2305.13073).\n\n## Table of Contents\n\n1. Installation\n2. Data\n3. Preprocessing\n4. Training\n5. Evaluation\n6. Citation\n\n## Installation\nPlease run the following commands to create a conda environment in Python 3.9 with the required packages.\n```sh\nconda create -n sqledit python=3.9 pip\nconda activate sqledit\npip install -r requirements.txt\n```\n\n## Data\nPlease first download the original Spider dataset from this [link](https://drive.google.com/uc?export=download\u0026id=1TqleXec_OykOYFREKKtschzY29dUcVAQ) and unzip it in the `data/` folder.\n```sh\nunzip spider.zip -d data/\n```\nThen, please download our synthesized SQL error correction data from this [link](https://buckeyemailosu-my.sharepoint.com/:f:/g/personal/chen_8336_buckeyemail_osu_edu/EjAxbCHp5q9BgT9Ljyq60xUBN_gEFGeOLQFSl5NusgV9VQ?e=EpB555) and also put them in the `data/` folder.\n\nThe `data/` folder should be organized as follows:\n```\n.\n├───  data\n│    ├───  spider\n│        ├───  ...\n│    ├───  spider-dev-bridge.json\n│    ├───  spider-dev-codet5.json\n│    ├───  spider-dev-smbop.json\n│    ├───  spider-train-bridge.json\n│    ├───  spider-train-codet5.json\n│    ├───  spider-train-smbop.json\n│    ├───  sqledit_dev_gold.sql\n│   ...\n```\n\n## Preprocessing\n```sh\npython run.py --preproc --use_content --query_type pydict --edit_type program --base_parser smbop\n```\n\n## Training\n```sh\nmkdir model\npython run.py --train --load_checkpoint Salesforce/codet5-base --save_checkpoint model/codet5-sqledit --seed 42 --gpu 0\n```\n\n## Evaluation\n```sh\npython run.py --eval --load_checkpoint model/codet5-sqledit --gpu 0\n```\n\n\n### Model Checkpoints\nYou may download our pre-trained model checkpoints from this [link](https://buckeyemailosu-my.sharepoint.com/:f:/g/personal/chen_8336_buckeyemail_osu_edu/Er_mV3sNNotPoaCivzCLwDQBBuI5rRR1fymCJpshIrJEZA?e=U4Xz2t). It includes our `CodeT5-PyDict+Program` model trained for the three text-to-SQL base parser in our paper.\n\n## Citation\n```\n@inproceedings{chen-etal-2023-sqledit,\n    title = \"Text-to-SQL Error Correction with Language Models of Code\",\n    author = \"Chen, Ziru  and\n      Chen, Shijie  and\n      White, Michael  and\n      Mooney, Raymond  and\n      Payani, Ali  and\n      Srinivasa, Jayanth  and\n      Su, Yu  and\n      Sun, Huan\",\n    booktitle = \"Proceedings of the 61th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers)\",\n    year = \"2023\",\n    address = \"Toronto, Canada\",\n    publisher = \"Association for Computational Linguistics\",\n    url = \"https://arxiv.org/abs/2305.13073\"\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosu-nlp-group%2Fauto-sql-correction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosu-nlp-group%2Fauto-sql-correction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosu-nlp-group%2Fauto-sql-correction/lists"}