{"id":14181811,"url":"https://github.com/microsoft/IRNet","last_synced_at":"2025-08-07T14:31:37.539Z","repository":{"id":37933781,"uuid":"218888365","full_name":"microsoft/IRNet","owner":"microsoft","description":"An algorithm for cross-domain NL2SQL ","archived":false,"fork":false,"pushed_at":"2023-07-22T20:20:22.000Z","size":3100,"stargazers_count":269,"open_issues_count":29,"forks_count":80,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-12-04T15:51:10.616Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null}},"created_at":"2019-11-01T01:10:43.000Z","updated_at":"2024-10-09T22:24:14.000Z","dependencies_parsed_at":"2022-07-20T00:49:00.514Z","dependency_job_id":"fcda91de-ecce-4867-b4c6-3aa7d34d3f99","html_url":"https://github.com/microsoft/IRNet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FIRNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FIRNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FIRNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FIRNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/IRNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229052494,"owners_count":18012562,"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-08-18T11:04:14.020Z","updated_at":"2024-12-10T11:30:18.860Z","avatar_url":"https://github.com/microsoft.png","language":"Python","funding_links":[],"categories":["💬 Classic Model","Python"],"sub_categories":[],"readme":"# IRNet\r\nCode for our ACL'19 accepted paper: [Towards Complex Text-to-SQL in Cross-Domain Database with Intermediate Representation](https://arxiv.org/pdf/1905.08205.pdf)\r\n\r\n\u003cp align='center'\u003e\r\n  \u003cimg src='https://zhanzecheng.github.io/architecture.png' width=\"91%\"/\u003e\r\n\u003c/p\u003e\r\n\r\n## Environment Setup\r\n\r\n* `Python3.6`\r\n* `Pytorch 0.4.0` or higher\r\n\r\nInstall Python dependency via `pip install -r requirements.txt` when the environment of Python and Pytorch is setup.\r\n\r\n## Running Code\r\n\r\n#### Data preparation\r\n\r\n\r\n* Download [Glove Embedding](https://nlp.stanford.edu/data/wordvecs/glove.42B.300d.zip) and put `glove.42B.300d` under `./data/` directory\r\n* Download [Pretrained IRNet](https://drive.google.com/open?id=1VoV28fneYss8HaZmoThGlvYU3A-aK31q) and put `\r\nIRNet_pretrained.model` under `./saved_model/` directory\r\n* Download preprocessed train/dev datasets from [here](https://drive.google.com/open?id=1YFV1GoLivOMlmunKW0nkzefKULO4wtrn) and put `train.json`, `dev.json` and \r\n`tables.json` under `./data/` directory\r\n\r\n##### Generating train/dev data by yourself\r\nYou could process the origin [Spider Data](https://drive.google.com/uc?export=download\u0026id=11icoH_EA-NYb0OrPTdehRWm_d7-DIzWX) by your own. Download  and put `train.json`, `dev.json` and \r\n`tables.json` under `./data/` directory and follow the instruction on `./preprocess/`\r\n\r\n#### Training\r\n\r\nRun `train.sh` to train IRNet.\r\n\r\n`sh train.sh [GPU_ID] [SAVE_FOLD]`\r\n\r\n#### Testing\r\n\r\nRun `eval.sh` to eval IRNet.\r\n\r\n`sh eval.sh [GPU_ID] [OUTPUT_FOLD]`\r\n\r\n\r\n#### Evaluation\r\n\r\nYou could follow the general evaluation process in [Spider Page](https://github.com/taoyds/spider)\r\n\r\n\r\n## Results\r\n| **Model**   | Dev \u003cbr /\u003e Exact Set Match \u003cbr /\u003eAccuracy | Test\u003cbr /\u003e Exact Set Match \u003cbr /\u003eAccuracy |\r\n| ----------- | ------------------------------------- | -------------------------------------- |\r\n| IRNet    | 53.2                        | 46.7                      |\r\n| IRNet+BERT(base) | 61.9                          | **54.7**                      |\r\n\r\n\r\n## Citation\r\n\r\nIf you use IRNet, please cite the following work.\r\n\r\n```\r\n@inproceedings{GuoIRNet2019,\r\n  author={Jiaqi Guo and Zecheng Zhan and Yan Gao and Yan Xiao and Jian-Guang Lou and Ting Liu and Dongmei Zhang},\r\n  title={Towards Complex Text-to-SQL in Cross-Domain Database with Intermediate Representation},\r\n  booktitle={Proceeding of the 57th Annual Meeting of the Association for Computational Linguistics (ACL)},\r\n  year={2019},\r\n  organization={Association for Computational Linguistics}\r\n}\r\n```\r\n\r\n## Thanks\r\nWe would like to thank [Tao Yu](https://taoyds.github.io/) and [Bo Pang](https://www.linkedin.com/in/bo-pang/) for running evaluations on our submitted models.\r\nWe are also grateful to the flexible semantic parser [TranX](https://github.com/pcyin/tranX) that inspires our works.\r\n\r\n# Contributing\r\n\r\nThis project welcomes contributions and suggestions. Most contributions require you to\r\nagree to a Contributor License Agreement (CLA) declaring that you have the right to,\r\nand actually do, grant us the rights to use your contribution. For details, visit\r\nhttps://cla.microsoft.com.\r\n\r\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need\r\nto provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the\r\ninstructions provided by the bot. You will only need to do this once across all repositories using our CLA.\r\n\r\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\r\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)\r\nor contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2FIRNet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2FIRNet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2FIRNet/lists"}