This repo provides the model, code & data of our paper: Temporal Knowledge Graph Forecasting Without Knowledge Using In-Context Learning (EMNLP 2023). [PDF]
Authors: Dong-Ho Lee*, Kian Ahrabian*, Woojeong Jin, Fred Morstatter, Jay Pujara.
Temporal knowledge graph (TKG) forecasting challenges models to predict future facts using knowledge of past facts. Our work shows that in-context learning (ICL) with large language models (LLMs) can solve TKG forecasting effectively.
Python >= 3.10
pip install -r requirements.txt
python run_rule.py \
--dataset {dataset} \
--model {recency|frequency} \
--history_len {history_len} \
--history_type {entity|pair} \
--history_direction {uni|bi} \
--label \
{--multi_step}
For more options you can use --help
or take a look at utils.get_args
function.
python run_hf.py \
--dataset {dataset} \
--model "EleutherAI/gpt-neox-20b" \
--history_len {history_len} \
--history_type {entity|pair} \
--history_direction {uni|bi} \
--label \
{--multi_step}
If you make use of this code, please kindly cite the following paper:
@InProceedings{lee2023temporal,
author = {Lee, Dong-Ho and Ahrabian, Kian and Jin, Woojeong and Morstatter, Fred and Pujara, Jay},
title = {Temporal Knowledge Graph Forecasting Without Knowledge Using In-Context Learning},
year = {2023},
booktitle = {The 2023 Conference on Empirical Methods in Natural Language Processing (EMNLP)},
url = {https://openreview.net/forum?id=wpjRa3d9OJ}
}