Home

Awesome

RED-GNN

The code for our paper "Knowledge Graph Reasoning with Relational Digraph" which has been accepted by WebConf 2022.

Instructions

A quick instruction is given for readers to reproduce the whole process.

Requirements

For transductive reasoning

cd transductive
python -W ignore train.py --data_path=data/WN18RR

For inductive reasoning

cd inductive
python -W ignore train.py --data_path=data/WN18RR_v1

Data splition in transductive setting

We follow the rule mining methods, i.e., Neural-LP and DRUM, to randomly split triplets in the original train.txt file into two files facts.txt and train.txt with ratio 3:1. This step is to make sure that the query triplets will not be leaked in the fact triplets used in RED-GNN. Empirically, increasing the ratio of facts, e.g. from 3:1 to 4:1, will lead to better performance.

Transductive results

MetricsFamilyUMLSWN18RRFB15k-237NELL-995
MRR.992.964.533.374.543
Hit@1 (%)98.894.648.528.347.6
Hit@10 (%)99.799.062.455.865.1

Inductive results

We use the full set of negative samples in evaluating the inductive results. This is different from the setting of 50 negative samples in GraIL.

metricsWN-V1WN-V2WN-V3WN-V4FB-V1FB-V2FB-V3FB-V4NL-V1NL-V2NL-V3NL-V4
MRR.701.690.427.651.369.469.445.442.637.419.436.363
Hit@1 (%)65.363.336.860.630.238.135.134.052.531.934.525.9
Hit@10 (%)79.978.052.472.148.362.960.362.186.660.159.455.6

Readers are welcomed to fork this repository to reproduce the experiments and follow our work. Please kindly cite our paper

@inproceedings{zhang2022redgnn,
    title={Knowledge graph reasoning with relational digraph},
    author={Zhang, Yongqi and Yao, Quanming},
    booktitle={Proceedings of the ACM Web Conference 2022},
    pages={912--924},
    year={2022}
}