Git Product home page Git Product logo

seq2sql's Introduction

Ftest_emb# seq2sql

pre-processing

data

  • Use WikiSQL/annotate.py to annotate files in WikiSQL/data. The usage of annotate.py could be found at https://github.com/salesforce/WikiSQL

  • Use WikiSQL/convert.py to extract input/outputs for seq2seq task from annotated files.

Vocabs

Vocabs are generated automatically when you run the training script. If you want to create the vocabe your self, you can use code/create_vocab.py

Embeddings

Train

Preprocessing procedures are already done for train and dev sets.

python translate.py --from_train_data ./wikisql_in_nmt/train.seq --to_train_data ./wikisql_in_nmt/train.sql --from_dev_data ./wikisql_in_nmt/dev.seq --to_dev_data ./wikisql_in_nmt/dev.sql --train /your/path/to/save/model --steps_per_checkpoint 1000 --drop_out 0.3 --gpu_id 1 --optim_method sgd --train_emb False --pretrain_embs ./data/emb_50000.pkl

Inference

You may modifed the code in decode() function in translate.py to get your goals.

python translate.py --from_train_data ./wikisql_in_nmt/train.seq --to_train_data ./wikisql_in_nmt/train.sql --from_dev_data ./wikisql_in_nmt/dev.seq --to_dev_data ./wikisql_in_nmt/dev.sql --train /your/path/to/save/model --steps_per_checkpoint 1000 --drop_out 0.3 --gpu_id 1 --optim_method sgd --train_emb False --pretrain_embs ./data/emb_50000.pkl --decode True

Evaluate

Fisrt convert the output to json file.

python3 convert_to_json_split_py3.py --din tmp.eval.ids.true --dout out_split.json --dsource /users1/ybsun/seq2sql/WikiSQL/annotated/dev.jsonl --dtable ../WikiSQL/data/dev.tables.jsonl

or

python3 convert_to_json_split_py3.py --din tmp.eval.ids.true --dout out_split.json --dsource /users1/ybsun/seq2sql/WikiSQL/annotated/dev.jsonl --dtable ../WikiSQL/data/dev.tables.jsonl --strong True

Then use the evaluating scripts.

python3 evaluate_split_py3.py ../WikiSQL/data/dev.jsonl ../WikiSQL/data/dev.db  ./out_split.json ../WikiSQL/annotated/dev.jsonl ../WikiSQL/data/dev.tables.jsonl ./wikisql_in_nmt/dev.sql

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.