sqlnet-predict


Namesqlnet-predict JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummaryThis 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).
upload_time2023-06-25 16:25:13
maintainer
docs_urlNone
authorYour Name
requires_python>=3.10,<4.0
licenseBSD-3-Clause license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SQLNet

This 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).

## Citation

> Xiaojun Xu, Chang Liu, Dawn Song. 2017. SQLNet: Generating Structured Queries from Natural Language Without Reinforcement Learning.

## Bibtex

```
@article{xu2017sqlnet,
  title={SQLNet: Generating Structured Queries From Natural Language Without Reinforcement Learning},
  author={Xu, Xiaojun and Liu, Chang and Song, Dawn},
  journal={arXiv preprint arXiv:1711.04436},
  year={2017}
}
```

## Installation
The data is in `data.tar.bz2`. Unzip the code by running
```bash
tar -xjvf data.tar.bz2
```

The code is written using PyTorch in Python 2.7. Check [here](http://pytorch.org/) to install PyTorch. You can install other dependency by running 
```bash
pip install -r requirements.txt
```

## Downloading the glove embedding.
Download the pretrained glove embedding from [here](https://github.com/stanfordnlp/GloVe) using
```bash
bash download_glove.sh
```

## Extract the glove embedding for training.
Run the following command to process the pretrained glove embedding for training the word embedding:
```bash
python extract_vocab.py
```

## Train
The training script is `train.py`. To see the detailed parameters for running:
```bash
python train.py -h
```

Some typical usage are listed as below:

Train a SQLNet model with column attention:
```bash
python train.py --ca
```

Train a SQLNet model with column attention and trainable embedding (requires pretraining without training embedding, i.e., executing the command above):
```bash
python train.py --ca --train_emb
```

Pretrain a [Seq2SQL model](https://arxiv.org/abs/1709.00103) on the re-splitted dataset
```bash
python train.py --baseline --dataset 1
```

Train a Seq2SQL model with Reinforcement Learning after pretraining
```bash
python train.py --baseline --dataset 1 --rl
```

## Test
The 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:

Test a trained SQLNet model with column attention
```bash
python test.py --ca
```

Test a trained SQLNet model with column attention and trainable embedding:
```bash
python test.py --ca --train_emb
```

Test a trained [Seq2SQL model](https://arxiv.org/abs/1709.00103) withour RL on the re-splitted dataset
```bash
python test.py --baseline --dataset 1
```

Test a trained Seq2SQL model with Reinforcement learning
```bash
python test.py --baseline --dataset 1 --rl
```


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "sqlnet-predict",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/0d/15/b96a3d181611af13c7baa9970320d321e953a6b370c785aa2a1c73e0267e/sqlnet_predict-0.1.0.tar.gz",
    "platform": null,
    "description": "# 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> 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",
    "bugtrack_url": null,
    "license": "BSD-3-Clause license",
    "summary": "This 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).",
    "version": "0.1.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1d55f455b956cbed827c30f410699ec79b509416df02b4a8e2f635611da7745d",
                "md5": "e6d9de851bf76fe1cec3971edc637ccf",
                "sha256": "166f04c3b18abf4519272b7f5af18431d1dc26cf5385b8633a89bd6f3fa48323"
            },
            "downloads": -1,
            "filename": "sqlnet_predict-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e6d9de851bf76fe1cec3971edc637ccf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 3328,
            "upload_time": "2023-06-25T16:25:11",
            "upload_time_iso_8601": "2023-06-25T16:25:11.429301Z",
            "url": "https://files.pythonhosted.org/packages/1d/55/f455b956cbed827c30f410699ec79b509416df02b4a8e2f635611da7745d/sqlnet_predict-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0d15b96a3d181611af13c7baa9970320d321e953a6b370c785aa2a1c73e0267e",
                "md5": "3f4db8106e95ff2d0522fc314c66ffea",
                "sha256": "ab5408886ac2bda2baf972f39366470dd088270b20e456e835fca8f89a108836"
            },
            "downloads": -1,
            "filename": "sqlnet_predict-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3f4db8106e95ff2d0522fc314c66ffea",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 2884,
            "upload_time": "2023-06-25T16:25:13",
            "upload_time_iso_8601": "2023-06-25T16:25:13.066520Z",
            "url": "https://files.pythonhosted.org/packages/0d/15/b96a3d181611af13c7baa9970320d321e953a6b370c785aa2a1c73e0267e/sqlnet_predict-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-25 16:25:13",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "sqlnet-predict"
}
        
Elapsed time: 0.17023s