This repository contains Pytorch-based code implementing of paper "Improving Multi-hop Logical Reasoning in Knowledge Graphs with Context-Aware Query Representation Learning (CaQR)"(paper).
Improving Multi-hop Logical Reasoning in Knowledge Graphs with Context-Aware Query Representation Learning.
Jeonghoon Kim, Heesoo Jung, Hyeju Jang, and Hogun Park
Findings of the Association for Computational Linguistics, 2024
Our CaQR can be applied to query embedding-based methodologies such as Q2B, BetaE, and ConE.
The code and data in this repository are based on KGReasoning(repo).
- python==3.9.15
- torch==1.13.1
- tensorboard==2.11.0
- tqdm
- Make data directory in CaQR directory.
- Download the query dataset from the drive and move them in data directory (i.e., 'data/FB15k-237-betae', 'data/NELL-betae').
To apply CaQR to Q2B, execute the shell file, q2b_caqr.sh in the CaQR/q2b directory:
bash q2b_caqr.shTo apply CaQR to BetaE, execute the shell file, betae_caqr.sh in the CaQR/betae directory:
bash betae_caqr.shTo apply CaQR to ConE, execute the shell file, cone_caqr.sh in the CaQR/cone directory:
bash cone_caqr.shIf CaQR is helpful in your research, we would appreciate it if you could cite our paper as follows:
@inproceedings{kim-etal-2024-improving-multi,
title = "Improving Multi-hop Logical Reasoning in Knowledge Graphs with Context-Aware Query Representation Learning",
author = "Kim, Jeonghoon and
Jung, Heesoo and
Jang, Hyeju and
Park, Hogun",
booktitle = "Findings of the Association for Computational Linguistics ACL 2024",
year = "2024",
address = "Bangkok, Thailand",
publisher = "Association for Computational Linguistics",
pages = "15978--15991",
}