ngl567 / RPJE

AAAI 2020: Rule-Guided Compositional Representation Learning on Knowledge Graphs
44 stars 7 forks source link

RPJE

AAAI 2020: Rule-Guided Compositional Representation Learning on Knowledge Graphs

This is our c++ source code and data for the paper:

Guanglin Niu, Yongfei Zhang, Bo Li, Peng Cui, Si Liu, Jingyang Li, Xiaowei Zhang. Rule-Guided Compositional Representation Learning on Knowledge Graphs. In AAAI, 2020. Paper in arXiv.

Author: Dr. Guanglin Niu (beihangngl at buaa.edu.cn)

Introduction

Rule and Path-based Joint Embedding (RPJE) takes full advantage of the explainability and accuracy of logic rules, the generalization of knowledge graph (KG) embedding as well as the supplementary semantic structure of paths. RPJE achieves better performance with higher accuracy and explainability on KG completion task.

Dataset

We provide four datasets: FB15K, FB15K237, WN18 and NELL-995. You can find all the datasets as well as the encoded rules mined from each dataset in the folders ./data_FB15K, ./data_FB15K237, ./data_WN18, ./data_NELL-995, which containing the following files:

In each folder of dataset, the folder ./rule containing all the encoded rules with various confidence threshold:

Please note that all the above data contain the positive instances for training. The negative instances are generated in the process of training.

Example to Run the codes

Firstly, select the dataset and the rules confidence threshold in the training file Train_RPJE.cpp. And then implement the settings:

Compile

g++ Train_RPJE.cpp -o Train_RPJE -O2
g++ Test_RPJE.cpp -o Test_RPJE -O2

Train

./Train_RPJE

Test

./Test_RPJE

Acknowledge

@inproceedings{RPJE19,
  author    = {Guanglin Niu and
               Yongfei Zhang and
               Bo Li and
               Peng Cui and
               Si Liu and
               Jingyang Li and
               Xiaowei Zhang},
  title     = {Rule-Guided Compositional Representation Learning on Knowledge Graphs},
  booktitle = {arXiv preprint},
  year      = {2019}
}