ChapTER
[NAACL 2024 Findings] Deja vu: Contrastive Historical Modeling with Prefix-tuning for Temporal Knowledge Graph Reasoning
Install / Use
/learn @GKNL/ChapTERREADME
Official code repository :bookmark_tabs: for NAACL 2024 Findings paper "Deja vu: Contrastive Historical Modeling with Prefix-tuning for Temporal Knowledge Graph Reasoning".
:link: Arxiv, ACL Anthology

Requirements
- python>=3.7
- torch>=1.6
- transformers>=4.15
All experiments are run with GeForce RTX 3090 GPUs.
How to Run
We provide codes and instructions for running transductive TKG reasoning experiments.
Total 3 steps to follow: dataset preprocessing, model training, and model evaluation.
Datasets used in this repository are list in the directory $REPO_DIR/data. Besides, we've preprocessed the datasets, so you can skip step 1 (unless you want to preprocess your own datasets), directly run the training and evaluation scripts.
Running Steps
Taking ICEWS14 dataset as an example:
Step 1, preprocess the dataset
bash scripts/preprocess.sh ICEWS14
Step 2, training the model
CUDA_VISIBLE_DEVICES=0,1,2 OUTPUT_DIR=./checkpoint/ICEWS14/ bash scripts/train_icews14.sh
Step 3, evaluate the model
CUDA_VISIBLE_DEVICES=0 bash scripts/eval.sh ./checkpoint/ICEWS14/model_last.mdl ICEWS14
The trained model checkpoints and output files are saved in directory $REPO_DIR/checkpoint.
Note: For custom dataset, replace ICEWS14 to any dataset name that you want to run.
Citation
If you use our code in your research, please cite our work:
@inproceedings{peng2024deja,
title={Deja vu: Contrastive Historical Modeling with Prefix-tuning for Temporal Knowledge Graph Reasoning},
author={Peng, Miao and Liu, Ben and Xu, Wenjie and Jiang, Zihao and Zhu, Jiahui and Peng, Min},
booktitle={Findings of the Association for Computational Linguistics: NAACL 2024},
pages={1178--1191},
year={2024}
}
Related Skills
node-connect
346.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
