Giter VIP home page Giter VIP logo

latent-attention's Introduction

Latent Attention For If-Then Program Synthesis

This repo provides the code to replicate the experiments in the paper

Xinyun Chen, Chang Liu, Richard Shin, Dawn Song, Mingcheng Chen, Latent Attention For If-Then Program Synthesis , in Proc. of NIPS 2016

Paper [arXiv] [NIPS]

Prerequisites

Tensorflow version >= v0.7

sklearn

jsonnet

Datasets

IFTTT

We use the same crawler from Quirk et al. to crawl recipes from IFTTT.com.

Processed data can be found in here.

Zapier

We additional provide a preprocessed dataset derived from Zapier recipes crawled using a crawler.

Processed data can be found under this folder.

Usage

Model architectures

The code includes the implementation of following models:

  • BDLSTM+LA: in configs/model.jsonnet, set model/name to be "rnn", model/decoder to be "LA".
  • BDLSTM+A: in configs/model.jsonnet, set model/name to be "rnn", model/decoder to be "attention".
  • BDLSTM: in configs/model.jsonnet, set model/name to be "rnn", don't set model/decoder(delete this line or set it to "").
  • Dict+LA: in configs/model.jsonnet, set model/name to be "Dict", model/decoder to be "LA".
  • Dict+A: in configs/model.jsonnet, set model/name to be "Dict", model/decoder to be "attention".
  • Dict: in configs/model.jsonnet, set model/name to be "Dict", don't set model/decoder(delete this line or set it to "").

Run experiments

In the following we list some important arguments in train.py:

  • --dataset: path to the preprocessed dataset.
  • --load-model: path to the pretrained model (optional).
  • --config: path to the file that stores the configuration of model architecture.
  • --logdir: path to the directory that stores the models (optional).
  • --output: name of the file that stores the prediction results (no need to specify the filename extension, the output is a pickle (.pkl) file).
python train.py --dataset dataset/IFTTT/msr_data.pkl --config configs/model.jsonnet --logdir model --output result

To ensemble results of several models:

python test_ensemble_probs.py --data dataset/IFTTT/msr_data.pkl --res result_0.pkl result_1.pkl ... result_N.pkl

Citation

If you use the code in this repo, please cite the following paper:

@inproceedings{chen2016latent,
  title={Latent Attention For If-Then Program Synthesis},
  author={Chen, Xinyun and Liu, Chang and Shin, Richard and Song, Dawn and Chen, Mingcheng},
  booktitle={Proceedings of the 29th Advances in Neural Information Processing Systems},
  year={2016}
}

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.