Skip to content

usc-isi-i2/isi-tkg-icl

Repository files navigation

Temporal Knowledge Graph Forecasting Without Knowledge Using In-Context Learning

PRs Welcome arXiv

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.

Overview

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.

Requirements

Python >= 3.10

pip install -r requirements.txt

Frequency/Recency Baselines

python run_rule.py \
  --dataset {dataset} \
  --model {recency|frequency} \
  --history_len {history_len} \
  --history_type {entity|pair} \
  --history_direction {uni|bi} \
  --label \
  {--multi_step}

LLMs

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}

Citation

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}
}

About

Temporal Knowledge Graph Forecasting Using In-Context Learning (EMNLP 2023)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages