GithubHelp home page GithubHelp logo

hhy5277 / memn2n-babi-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vinhkhuc/memn2n-babi-python

0.0 1.0 0.0 16.01 MB

End-To-End Memory Networks for bAbI question-answering tasks

License: Other

Python 100.00%

memn2n-babi-python's Introduction

End-To-End Memory Networks for Question Answering

This is an implementation of MemN2N model in Python for the bAbI question-answering tasks as shown in the Section 4 of the paper "End-To-End Memory Networks". It is based on Facebook's Matlab code.

Web-based Demo

Requirements

  • Python 2.7
  • Numpy, Flask (only for web-based demo) can be installed via pip:
$ sudo pip install -r requirements.txt
  • bAbI dataset should be downloaded to data/tasks_1-20_v1-2:
$ wget -qO- http://www.thespermwhale.com/jaseweston/babi/tasks_1-20_v1-2.tar.gz | tar xvz -C data

Usage

  • To run on a single task, use babi_runner.py with -t followed by task's id. For example,
python babi_runner.py -t 1

The output will look like:

Using data from data/tasks_1-20_v1-2/en
Train and test for task 1 ...
1 | train error: 0.876116 | val error: 0.75
|===================================               | 71% 0.5s
  • To run on 20 tasks:
python babi_runner.py -a
  • To train using all training data from 20 tasks, use the joint mode:
python babi_runner.py -j

Question Answering Demo

  • In order to run the Web-based demo using the pretrained model memn2n_model.pklz in trained_model/, run:
python -m demo.qa
  • Alternatively, you can try the console-based demo:
python -m demo.qa -console
  • The pretrained model memn2n_model.pklz can be created by running:
python -m demo.qa -train
  • To show all options, run python -m demo.qa -h

Benchmarks

See the results here.

Author

Vinh Khuc

Future Plans

  • Port to TensorFlow/Keras
  • Support Python 3

References

memn2n-babi-python's People

Contributors

solaris33 avatar vinhkhuc avatar

Watchers

 avatar

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.