Code Monkey home page Code Monkey logo

kbqa-ar-smcnn's Introduction

kbqa-ar-smcnn

Question answering over Freebase (single-relation).

This is the source code for Question Answering over Freebase via Attentive RNN with Similarity Matrix based CNN.

Install packages

  • Python 3.5
  • PyTorch 0.2.0
  • NLTK
  • NLTK data (tokenizers, stopwords list)
  • Virtuoso

After install Virtuoso, you should modify config file at freebase_data/dump_virtuoso_data/virtuoso.ini (or you could copy your virtuoso.ini file to this directory)

  1. You have to change the variables such as NumberOfBuffers and MaxDirtyBuffers depending on your RAM. For other variables you can follow the official documents.
  2. Add the absolute path of XXX/freebase_data/dump_virtuoso_data/ to DirsAllowed.

Start the Virtuoso server

This may need to be under the root user.

virtuoso-t +foreground +configfile freebase_data/dump_virtuoso_data/virtuoso.ini &

Set up

Run the setup script. This takes a long time. It fetches datasets, does some preprocesses, and dumps Freebase triples into Virtuoso.

sh data_setup.sh

Training

  • entity detection model
cd entity_detection
sh process.sh
python predict.py --trained_model XXX --results_path results  --save_qadata
  • relation detection model
cd relation_ranking
python seqRankingLoader.py --batch_size 64 --neg_size 50  #Create training data for relation detection
sh process.sh
python predict.py --trained_model XXX --results_path results --predict

kbqa-ar-smcnn's People

Contributors

quyingqi avatar

Watchers

James Cloos avatar Shubham Pachori 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.