Need help with lang2logic?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

donglixp
138 Stars 39 Forks MIT License 11 Commits 6 Opened issues

Services available

!
?

Need anything else?

Contributors list

# 32,386
Lua
Perl
pytorch
text-re...
11 commits

Setup

  • If you have already installed Torch7, please rename its folder name.

    sh
    mv ~/torch ~/torch_bak
    
  • Download Torch7

    sh
    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

    sh
    cd ~/torch
    ./install.sh
    
  • Follow the instructions (in http://torch.ch/docs/getting-started.html) to refresh your env variables. ```sh

    On Linux with bash

    source ~/.bashrc ```

  • Install dependency

    sh
    luarocks install class
    pip install path.py
    
  • Pull data

    sh
    python pull_data.py
    

Usage

  • Run pretrained models
    sh
    ./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
    sh
    ./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

  • OS: Scientific Linux 7.1
  • GCC: 4.9.1 20140922 (Red Hat 4.9.1-10)
  • GPU: 980 or titan x
  • CUDA: 7.5
  • Torch7: c0e51b98acbb54e6655343a57152b6e711ffdc2b (https://drive.google.com/file/d/0B8yp1gOBCztycW42eDNNaExWSlU/view?usp=sharing ; 1. clean.sh 2. install.sh)

The code is only tested on the above environment.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.