donglixp / lang2logic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setup

  • If you have already installed Torch7, please rename its folder name.
mv ~/torch ~/torch_bak
  • Download Torch7
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; bash install-deps;
  • Replace ~/torch/extra/cunn/lib/THCUNN/ClassNLLCriterion.cu with the one in the ./install folder.

The original ClassNLLCriterion.cu throws an error when the input is 0. We modify this file to make it accept 0.

  • Install Torch7
cd ~/torch
./install.sh
# On Linux with bash
source ~/.bashrc
  • Install dependency
luarocks install class
pip install path.py
  • Pull data
python pull_data.py

Usage

  • Run pretrained models
./pretrain.sh [seq2seq|seq2tree] [jobqueries|geoqueries|atis] [lstm|attention] GPU_ID
# run seq2seq without attention
./pretrain.sh seq2seq jobqueries lstm
# print results
cat seq2seq/jobqueries/dump_lstm/pretrain.t7.sample
# run seq2seq with attention
./pretrain.sh seq2seq jobqueries attention
# print results
cat seq2seq/jobqueries/dump_attention/pretrain.t7.sample
  • Run experiments
./run.sh [seq2seq|seq2tree] [jobqueries|geoqueries|atis] [lstm|attention] GPU_ID
# run seq2seq without attention
./run.sh seq2seq jobqueries lstm
# print results
cat seq2seq/jobqueries/dump_lstm/model.t7.sample
# run seq2seq with attention
./run.sh seq2seq jobqueries attention
# print results
cat seq2seq/jobqueries/dump_attention/model.t7.sample

Environment

The code is only tested on the above environment.

ezoic increase your site revenue

About

License:MIT License


Languages

Language:Lua 97.7%Language:Cuda 1.9%Language:Shell 0.3%Language:Python 0.1%