shuuchen / keras_mn

A Keras implementation of end-2-end memory networks https://arxiv.org/pdf/1503.08895.pdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

keras_mn

Memory networks are used for automatic question answering.

The model is trained using story, question, answer triplets and tested using story, question to predict the answer.

Requirements

  • nltk==3.2.3
  • matplotlib==2.0.2
  • Keras==2.0.6
  • numpy==1.12.1

Train/Test data

bAbI Tasks Data 1-20 (v1.2) https://research.fb.com/downloads/babi/

Test result

The model is tested against all 10,000 samples in test data. The first 10 results show that only one mis-prediction happens.

Story Question Answer Prediction
john travelled to the hallway . mary journeyed to the bathroom . where is john ? hallway hallway
daniel went back to the bathroom . john moved to the bedroom . where is mary ? bathroom bedroom
john went to the hallway . sandra journeyed to the kitchen . where is sandra ? kitchen kitchen
sandra travelled to the hallway . john went to the garden . where is sandra ? hallway hallway
sandra went back to the bathroom . sandra moved to the kitchen . where is sandra ? kitchen kitchen
sandra travelled to the kitchen . sandra travelled to the hallway . where is sandra ? hallway hallway
mary went to the bathroom . sandra moved to the garden . where is sandra ? garden garden
sandra travelled to the office . daniel journeyed to the hallway . where is daniel ? hallway hallway
daniel journeyed to the office . john moved to the hallway . where is sandra ? office office
john travelled to the bathroom . john journeyed to the office . where is daniel ? office kitchen

Model plot

License

Released under the MIT license. See LICENSE for details.

About

A Keras implementation of end-2-end memory networks https://arxiv.org/pdf/1503.08895.pdf

License:MIT License


Languages

Language:Python 100.0%