Source code and data for our long paper (Wu et al., 2019)
This is the code and data for ACL 2019 long paper "Learning Representation Mapping for Relation Detection in Knowledge Base Question Answering".
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.
The main code for this paper is qa+adapter.
Our relation embeddings are trained by JointNRE between FB2M and wikipedia, please see this link for detail.
cd qa+adapter
bash script/run_baseline.sh
cd qa+adapter
bash script/run_baseline-star.sh
cd qa+adapter
bash script/run-other.sh $card
We use FocusPrune to annotated the entity, please refer to https://github.com/wudapeng268/KBQA-Baseline for detail.
cd qa+adapter
bash script/test-all-kbqa.sh $card_num
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
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}
}