The official implementation for the paper Sequential Query Encoding For Complex Query Answering on Knowledge Graphs [Paper].
The KG data we are using is from the KG reasoning repo from here. The data descriptions are here: https://github.com/snap-stanford/KGReasoning. Please put the downloaded files under ./KG_data
directory.
The complex query dataset for our benchmark can be downloaded here(52.9GB). Some people experience difficulty in downloading large files from onedrive on the command line. Here is a tutorial on downloading onedrive files in the command line.
We provided a wide range of baselines with our codebase. For experiments, please check out example.sh
for script format.
During the running process, you can monitor the training process via tensorboard with following commands:
tensorboard --logdir your_log_dir --port the_port_you_fancy
ssh -N -f -L localhost:port_number:localhost:port_number your_server_location
Iterative Encoding Model:
Sequential Encoding Models:
Model Flag (-m) | Paper |
---|---|
biqe | Answering Complex Queries in Knowledge Graphs with Bidirectional Sequence Encoders |
tcn | (this paper) Sequential Query Encoding for Complex Query Answering on Knowledge Graphs |
lstm | (this paper) Sequential Query Encoding for Complex Query Answering on Knowledge Graphs |
gru | (this paper) Sequential Query Encoding for Complex Query Answering on Knowledge Graphs |
transformer | (this paper) Sequential Query Encoding for Complex Query Answering on Knowledge Graphs |
Also, you are welcome to build your own models with our benchmark, by overriding the functions in ./models/model.py
. You only need to write your model, and the rest of things can be done by the code in this repo~
If you find the code/data/paper interesting, please cite our paper!
@article{
bai2023sequential,
title={Sequential Query Encoding for Complex Query Answering on Knowledge Graphs},
author={Jiaxin Bai and Tianshi Zheng and Yangqiu Song},
journal={Transactions on Machine Learning Research},
issn={2835-8856},
year={2023},
url={https://openreview.net/forum?id=ERqGqZzSu5},
note={}
}