8000 GitHub - dswangGH/lang2logic: 爱丁堡大学 提出了利用注意力机制增强的 Encoder-Decoder 模型,将 Semantic Parser 问题转化为 Seq2Seq 问题。 该论文除了使用一个 Seq2Seq 模型来完成 Query 到 Logical Forms 的转化外,还提出了一个 Seq-to-Tree 的模型,利用层次的树形解码器捕捉 Logical Forms 的结构 · GitHub
[go: up one dir, main page]

Skip to content

About

爱丁堡大学 提出了利用注意力机制增强的 Encoder-Decoder 模型,将 Semantic Parser 问题转化为 Seq2Seq 问题。 该论文除了使用一个 Seq2Seq 模型来完成 Query 到 Logical Forms 的转化外,还提出了一个 Seq-to-Tree 的模型,利用层次的树形解码器捕捉 Logical Forms 的结构

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

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.

About

爱丁堡大学 提出了利用注意力机制增强的 Encoder-Decoder 模型,将 Semantic Parser 问题转化为 Seq2Seq 问题。 该论文除了使用一个 Seq2Seq 模型来完成 Query 到 Logical Forms 的转化外,还提出了一个 Seq-to-Tree 的模型,利用层次的树形解码器捕捉 Logical Forms 的结构

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0