Code Monkey home page Code Monkey logo

kbqa-adapter's Introduction

KBQA-Adapter

This is the code and data for ACL 2019 long paper "Learning Representation Mapping for Relation Detection in Knowledge Base Question Answering".

Requirements

  • Python3.5
  • Tensorflow 1.7.0

Re-organize SimpleQuestion to SimpleQuestion_Balance

As we discuss, for SimpleQuestion, 99% of the relations in the test set also exist in the training data. In order to evaluate unseen relation detection and seen relation detection fairly, we re-organize SimpleQuestion to SimpleQuestion_Balance(SQB), the dataset is released at Data/SQB and the script for re-organize this dataset is mix_dataset.py.

Reproduce Main Result

The main code for this paper is qa+adapter.

Get JointNRE embedding for FB2M

Our relation embeddings are trained by JointNRE between FB2M and wikipedia, please see this link for detail.

Train baseline and all model with adapter

cd qa+adapter
bash script/run_baseline.sh

Train baseline and our model using adapting JointNRE embedding

cd qa+adapter
bash script/run_baseline-star.sh

Train adapter with only mapping and adapter without fine-tuning

cd qa+adapter
bash script/run-other.sh $card

Reproduce KBQA result

Entity Linking

We use FocusPrune to annotated the entity, please refer to https://github.com/wudapeng268/KBQA-Baseline for detail.

Test for kbqa

cd qa+adapter
bash script/test-all-kbqa.sh $card_num

Influence of Number of Relations for Training

Our data for this experiment at Data/Number_relation_in_training created by this script.

You can use following script to reproduce this result:

cd qa+adapter
bash script/run_tl.sh

Citation

If you use our code or data, please kindly cite the paper about it!

@inproceedings{peng19acl,
    title = {Learning Representation Mapping for Relation Detection in Knowledge Base Question Answering},
    author = {Peng Wu, Shujian Huang, Rongxiang Weng, Zaixiang Zheng, Jianbing Zhang, Xiaohui Yan and Jiajun Chen},
    booktitle = {The 57th Annual Meeting of the Association for Computational Linguistics (ACL)},
    address = {Florence, Italy},
    month = {July},
    year = {2019}
}

kbqa-adapter's People

Contributors

wudapeng268 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.