Giter Club home page Giter Club logo

tkgelib's Introduction

ECEformer

Transformer-based Reasoning for Learning Evolutionary Chain of Events on Temporal Knowledge Graph

ECEformer is a novel Transformer-based reasoning model for TKG to learn the Evolutionary Chain of Events. It will appear in SIGIR 2024 (arXiv version).

Installation

The repo requires python>=3.7, anaconda and a new env is recommended.

conda create -n eceformer python=3.7 -y # optional
conda activate eceformer # optional
git clone [email protected]:seeyourmind/TKGElib.git
cd ECEformer
pip install -e .

Data

First download the standard benchmark datasets. The Data folder can be downloaded from GDELT & ICEWS14/05-15, ICEWS18, YAGO11k & WikiData12k. Then process the dataset using the commands below.

cd data
# for GDELT/ICEWS14/ICEWS05-15/ICEWS18
# e.g. python preprocess.py icews14
python preprocess.py $dataset_name
# for YAGO11k and WikiData12k
python preprocess_intravel.py $dataset_name

Training

Configurations for the experiments are in the /config folder.

python -m kge start config/gdelt-best.yaml

The training process uses DataParallel in all visible GPUs by default, which can be overrode by appending --job.device cpu to the command above.

Evaluation

You can evaluate the trained models on dev/test set using the following commands.

python -m kge eval <saved_dir>
python -m kge test <saved_dir>

Acknowledgment

Thanks LibKGE and HittER for providing the preprocessing scripts and the base frameworks.

Citation

@inproceedings{fang-sigir-2024-eceformer,
    title = "Temporal Knowledge Graph Completion, Context Information Mining, Link Prediction, Evolutionary Chain of Event",
    author = "Fang, Zhiyu and Lei, Shuai-Long and Zhu, Xiaobin and Yang, Chun and Zhang, Shi-Xue and Yin, Xu-Cheng and Qin, Jingyan",
    booktitle = "Proceedings of The 47th International ACM SIGIR Conference",
    year = "2024"
}

tkgelib's People

Contributors

seeyourmind avatar

Stargazers

Chenglu Li avatar dangerous avatar  avatar  avatar  avatar NeoSong avatar Victor Tsai avatar  avatar HySon avatar Tong Liu avatar

Watchers

 avatar

tkgelib's Issues

关于"Transformer-based Reasoning for Learning Evolutionary Chain of Events on Temporal Knowledge Graph " 论文的一些疑问

I recently saw your work published on SIGIR 2024 and was very interested. I am a little confused about the results in Table 2. Do the results of eceformer means that predict the T + 1 moment (s, R, ?) based on historical TKG? I mainly see that one of your baseline Stoke comparisons is actually in the interpolation setting, and the L2TKG above is in the extrapolation setting? So I have these doubts.

I hope you can help me answer my questions at your convenience. I would appreciate it!

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 64: invalid start byte

Hi, I tried to run an evaluation after training for a model file, e.g., checkpoint_00003.pt, and somehow I am getting below error:

Reader.init(self, stream)
File "/opt/anaconda3/envs/eceformer/lib/python3.8/site-packages/yaml/reader.py", line 85, in init
self.determine_encoding()
File "/opt/anaconda3/envs/eceformer/lib/python3.8/site-packages/yaml/reader.py", line 124, in determine_encoding
self.update_raw()
File "/opt/anaconda3/envs/eceformer/lib/python3.8/site-packages/yaml/reader.py", line 178, in update_raw
data = self.stream.read(size)
File "/opt/anaconda3/envs/eceformer/lib/python3.8/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 64: invalid start byte

Can you please kindly let me know how to fix it>?

Cheers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.