Coder Social home page Coder Social logo

kg-deductive-reasoner's Introduction

End-To-End Memory Networks for Deductive Reasoning over Knowledge Graph

This is a modification of implementation of MemN2N model in Python for the Deductive Reasoning over Knowledge Graph as inspired by the Section 4 of the paper "End-To-End Memory Networks". It is based on Facebook's Matlab code.

[Web-based Demo](Coming soon!)

Requirements

  • Python 2.7
  • Numpy, Flask (only for web-based demo) can be installed via pip:
$ sudo pip install -r requirements.txt

$ mkdir data
=======

$ tar xvf sample_data_normalized.tar.xz -C data


$ tar xvf sample_json_files.tar.xz -C data
python json_reader_normalizer.py

Usage

  • To run on a knowledge graph reasoning task, use kg_reasoner_runner.py. For example,
python kg_reasoner_runner.py

The output will look like:

Using data from data/task_name/task_name
Train and test for task task_name ...
1 | train error: 0.876116 | val error: 0.75
|===================================               | 71% 0.5s

Knowledge Graph Reasoning Demo

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

Author

  • Monireh Ebrahimi

References

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.