Skip to content
Simple question answering over knowledge graphs (Mohammed et al., NAACL 2018)
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docker_files
entity_detection
entity_linking evidence integration (#37) Nov 20, 2017
evidence_integration evidence integration (#37) Nov 20, 2017
exploration Analysis of SimpleQA dataset. (#21) Oct 17, 2017
relation_prediction update to pytorch 0.4.0 and torchtext 0.2.3 Jun 26, 2018
scripts change data preprocess Jul 13, 2018
.gitignore
README.md added Dockerfile and installation info on README (#61) Sep 6, 2018
important-papers-links.md moved ferhan's folder stuff to root folder and removed unnecessary fi… Nov 13, 2017
setup.sh

README.md

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
You can’t perform that action at this time.