Coder Social home page Coder Social logo

buboqa's Introduction

Simple Question Answering over Knowledge Graphs

This repo contains code for the following paper:

Running the Code

Install the following Python 3 packages:

  • PyTorch (version 0.4.0)
  • torchtext (version 0.2.3)
  • NLTK
  • NLTK data (tokenizers, stopwords list)
  • fuzzywuzzy

If you use PyTorch version 0.2.0, please checkout to

commit 34a71f29192ed57f83d8576002f2b540de7d722f

Run the setup script. This takes a long time. It fetches dataset, other files, processes them and creates indexes:

sh setup.sh 

There are four main components to our formulation of the problem, as detailed in the paper: entity detection, entity linking, relation prediction and evidence integration. Each of these components is contained in a separate directory, with an associated README.

  • entity_detection and relation_prediction can be run independently.
  • entity_detection needs to be run before entity_linking.
  • entity_linking and relation_prediction needs to be run before evidence_integration.

Running the Code with Docker (GPU, Ubuntu 16, Cuda 9.0 base)

  • Make sure you have the Docker daemon running

  • Build the image from Dockerfile

cp docker_files/Dockerfile_gpu Dockerfile
docker build -t buboqa .
  • Run the Docker image on GPU with nvidia-docker installed. Notice that we are mounting the current directory so that data persists.
nvidia-docker run -it --rm \
  -v "$(pwd)":/code \
  buboqa
  • OR ... Run the Docker image on CPU (not tested)
docker run -it --rm \
  -v "$(pwd)":/code \
  buboqa
  • Exit shell when needed
$  exit

buboqa's People

Contributors

salman1993 avatar impavidity avatar lintool avatar aliceranzhou 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.