Giter VIP home page Giter VIP logo

ssrp's Introduction

Neural Program Induction for KBQA Without Gold Programs or Query Annotations

This repository contains the implementation of the Stable Sparse Reward Programmer model proposed in Neural Program Induction for KBQA Without Gold Programs or Query Annotations and links to download associated datasets.

Datasets

Datasets on Complex Question answering on Knowledge Bases, used for evaluating SRP (Sparse Reward Programmer)

  1. Complex Sequential Question Answering (https://amritasaha1812.github.io/CSQA/) Dataset
  2. WebQuestionsSP (https://www.microsoft.com/en-us/download/details.aspx?id=52763) Dataset

Experiments on CQA

Experiments on the gold entity, relation, type linking data

Experiments on the noisy entity, relation, type linking data

  • Step 14: This section contains the necessary experimentation details pertaining to the paper.

  • Step 15: To do so go inside {repo_root}/code/NPI/pytorch/noisy_WikiData_CSQA folder

  • Step 16: Each of the experiments are configured with a parameter file (in the parameter folder). There are three question types (simple, logical, quanti_count) in the parameter folder and each of the variants can be run on either the smaller subset of the dataset (i.e. CQA with 100 QA pairs per question type) or on the bigger subset (CQA with 10K QA pairs per question type). For e.g. for running on the simple question type on CQA-100 subset, use the parameter file parameters_simple_small.jso and to run on the CQA-10K dataset use the parameter file parameters_simple_big.json (small is for 100 QA pair subset of CQA and big is for 10K QA pair subset of CQA)

  • Step 17: Create a folder model

  • Step 18: To run the SRP model on any of the question categories (simple/logical/quanti_count) run python train_SRP.py <parameter_file> <time_stamp> (time-stamp is the ID of the current experiment run). Example script to run is in run_SRP.sh. This script will start the training as well as dump the trained model in the model and also run validation.

  • Step 19: To run the SSRP model on any of the question categories (simple/logical/quanti_count) run python train_SSRP.py <parameter_file> <time_stamp> (time-stamp is the ID of the current experiment run). Example script to run is in run_SSRP.sh. This script will start the training as well as dump the trained model in the model and also run validation.

  • Step 20: To load the trained model and run test, run python load.py <parameter_file> <time-stamp> (use the same ID as used during training)

For e.g. to train and test the models on simple question type on 100-QA pair subset of CQA:

  1. cd {repo_root}/code/NPI/pytorch/noisy_WikiData_CSQA
  2. python train_SRP.py parameters/parameters_simple_small.json SRP_Jan_7 #this will create a folder model/simple_SRP_Jan_7 to dump the trained model
  3. python load.py parameters/parameters_simple_big.json SRP_Jan_7 #this will run the trained model on the big test data, as mentioned in the parameter file
  4. python train_SSRP.py parameters/parameters_simple_small.json SSRP_Jan_7 #this will create a folder model/simple_SSRP_Jan_7 to dump the trained model
  5. python load.py parameters/parameters_simple_big.json SSRP_Jan_7 #this will run the trained model on the big test data, as mentioned in the parameter file

ssrp's People

Contributors

ahmedansari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ssrp's Issues

Train on WebQuestionsSP

Excuse me, I have two questions about your work.

  1. If your code can be trained on WebQuestionsSP dataset or not? Because I observe that there are only parameters for CSQA in the .../parameters/ menu.
  2. How did you get the "All" results in the following table? Were they related to the above five question types results?
    image

Looking forward to receiving your reply, thanks!

There is an OOM error

I followed the steps on my server with 120GB CPU-memory, but the model is said to have an OOM error and the training process is killed, unfortunately.
Before the processed is terminated, we found that the 120G CPU-memory is fully consumed but the GPU memory is not used at all.
I wonder how large the size of the CPU-memory is sufficient to run the model.

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.