This repository contains the code for the paper TEILP: Time Prediction over Knowledge Graphs via Logical Reasoning.
This is a follow-up work of TILP: Differentiable Learning of Temporal Logical Rules on Knowledge Graphs. We convert TKGs into a temporal event knowledge graph (TEKG) which equips us to develop a differentiable random walk approach. We also introduce conditional probability density functions, associated with the logical rules involving the query interval, using which we arrive at the time prediction.
The structure of the file folder should be like
TEILP/
│
├── src/
│
├── data/
│
├── exps/
│
└── output/
First step
cd src
Random walk:
python main_random_walk_for_interval_datasets.py --dataset {$dataset name}
Rule learning:
python main_rule_learning_interval_dataset.py --dataset {$dataset name} --train
Rule application:
python main_rule_learning_interval_dataset.py --dataset {$dataset name} --test --from_model_ckpt {$your_model_location}
Random walk:
python main_random_walk_for_timestamp_datasets.py --dataset {$dataset name}
Rule learning:
python main_rule_learning_timestamp_dataset.py --dataset {$dataset name} --train
Rule application:
python main_rule_application_timestamp_dataset.py --dataset {$dataset name}
python main_rule_learning_timestamp_dataset.py --dataset {$dataset name} --test --from_model_ckpt {$your_model_location}
If you have any inquiries, please feel free to raise an issue or reach out to sxiong45@gatech.edu.
@inproceedings{xiong2024teilp,
title={Teilp: Time prediction over knowledge graphs via logical reasoning},
author={Xiong, Siheng and Yang, Yuan and Payani, Ali and Kerce, James C and Fekri, Faramarz},
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
volume={38},
number={14},
pages={16112--16119},
year={2024}
}