{"id":14181817,"url":"https://github.com/xiaojunxu/SQLNet","last_synced_at":"2025-08-07T14:31:51.519Z","repository":{"id":41394798,"uuid":"110507963","full_name":"xiaojunxu/SQLNet","owner":"xiaojunxu","description":"Neural Network for generating structured queries from natural language.","archived":false,"fork":false,"pushed_at":"2023-10-10T17:23:44.000Z","size":58105,"stargazers_count":427,"open_issues_count":43,"forks_count":161,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-08-18T11:13:40.212Z","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":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xiaojunxu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-11-13T06:17:59.000Z","updated_at":"2024-07-29T06:06:09.000Z","dependencies_parsed_at":"2022-09-01T17:23:49.045Z","dependency_job_id":"53f1638e-6d80-4262-af0a-ad6e56c4aa41","html_url":"https://github.com/xiaojunxu/SQLNet","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/xiaojunxu%2FSQLNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaojunxu%2FSQLNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaojunxu%2FSQLNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaojunxu%2FSQLNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiaojunxu","download_url":"https://codeload.github.com/xiaojunxu/SQLNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229052499,"owners_count":18012564,"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.200Z","updated_at":"2024-12-10T11:30:25.536Z","avatar_url":"https://github.com/xiaojunxu.png","language":"Python","funding_links":[],"categories":["💬 Classic Model"],"sub_categories":[],"readme":"# SQLNet\n\nThis repo provides an implementation of SQLNet and Seq2SQL neural networks for predicting SQL queries on [WikiSQL dataset](https://github.com/salesforce/WikiSQL). The paper is available at [here](https://arxiv.org/abs/1711.04436).\n\n## Citation\n\n\u003e Xiaojun Xu, Chang Liu, Dawn Song. 2017. SQLNet: Generating Structured Queries from Natural Language Without Reinforcement Learning.\n\n## Bibtex\n\n```\n@article{xu2017sqlnet,\n  title={SQLNet: Generating Structured Queries From Natural Language Without Reinforcement Learning},\n  author={Xu, Xiaojun and Liu, Chang and Song, Dawn},\n  journal={arXiv preprint arXiv:1711.04436},\n  year={2017}\n}\n```\n\n## Installation\nThe data is in `data.tar.bz2`. Unzip the code by running\n```bash\ntar -xjvf data.tar.bz2\n```\n\nThe code is written using PyTorch in Python 2.7. Check [here](http://pytorch.org/) to install PyTorch. You can install other dependency by running \n```bash\npip install -r requirements.txt\n```\n\n## Downloading the glove embedding.\nDownload the pretrained glove embedding from [here](https://github.com/stanfordnlp/GloVe) using\n```bash\nbash download_glove.sh\n```\n\n## Extract the glove embedding for training.\nRun the following command to process the pretrained glove embedding for training the word embedding:\n```bash\npython extract_vocab.py\n```\n\n## Train\nThe training script is `train.py`. To see the detailed parameters for running:\n```bash\npython train.py -h\n```\n\nSome typical usage are listed as below:\n\nTrain a SQLNet model with column attention:\n```bash\npython train.py --ca\n```\n\nTrain a SQLNet model with column attention and trainable embedding (requires pretraining without training embedding, i.e., executing the command above):\n```bash\npython train.py --ca --train_emb\n```\n\nPretrain a [Seq2SQL model](https://arxiv.org/abs/1709.00103) on the re-splitted dataset\n```bash\npython train.py --baseline --dataset 1\n```\n\nTrain a Seq2SQL model with Reinforcement Learning after pretraining\n```bash\npython train.py --baseline --dataset 1 --rl\n```\n\n## Test\nThe script for evaluation on the dev split and test split. The parameters for evaluation is roughly the same as the one used for training. For example, the commands for evaluating the models from above commands are:\n\nTest a trained SQLNet model with column attention\n```bash\npython test.py --ca\n```\n\nTest a trained SQLNet model with column attention and trainable embedding:\n```bash\npython test.py --ca --train_emb\n```\n\nTest a trained [Seq2SQL model](https://arxiv.org/abs/1709.00103) withour RL on the re-splitted dataset\n```bash\npython test.py --baseline --dataset 1\n```\n\nTest a trained Seq2SQL model with Reinforcement learning\n```bash\npython test.py --baseline --dataset 1 --rl\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaojunxu%2FSQLNet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaojunxu%2FSQLNet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaojunxu%2FSQLNet/lists"}