Skip to content
/ SelfKG Public

Codes for WWW2022 accepted paper: SelfKG: Self-Supervised Entity Alignment in Knowledge Graphs

License

Notifications You must be signed in to change notification settings

THUDM/SelfKG

Repository files navigation

License

SelfKG: Self-Supervised Entity Alignment in Knowledge Graphs

Original implementation for paper SelfKG: Self-Supervised Entity Alignment in Knowledge Graphs.

This paper is accepted and nominated as a best paper by The Web Conference2022! 😆

SelfKG is the first self-supervised entity alignment method without label supervision, which can match or achieve comparable results with state-of-the-art supervised baselines. The performance of SelfKG suggests self-supervised learning offers great potential for entity alignment in Knowledge Graphs.

SelfKG: Self-Supervised Entity Alignment in Knowledge Graphs

https://doi.org/10.1145/3485447.3511945

Installation

Requirements

torch==1.9.0
faiss-cpu==1.7.1
numpy==1.19.2
pandas==1.0.5
tqdm==4.61.1
transformers==4.8.2
torchtext==0.10.0

You can use setup.sh to set up your Anaconda environment by

bash setup.sh

Quick Start

Data Preparation

You can download the our data from here, and the final structure our project should be:

├── data
│   ├── DBP15K
│   │   ├── fr_en
│   │   ├── ja_en
│   │   └── zh_en
│   ├── DWY100K
│   │   ├── dbp_wd
│   │   └── dbp_yg
│   └── LaBSE
│       ├── bert_config.json
│       ├── bert_model.ckpt.index
│       ├── checkpoint
│       ├── config.json
│       ├── pytorch_model.bin
│       └── vocab.txt
│   └── getdata.sh
├── loader
├── model
├── run.sh # Please use this bash to run the experiments!
├── run_DWY_LaBSE_neighbor.py # SelfKG on DWY100k
├── run_LaBSE_neighbor.py # SelfKG on DBP15k
... # run_LaBSE_*.py # Ablation code will be available soon
├── script
│   └── preprocess
├── settings.py
└── setup.sh # Can be used to set up your Anaconda environment

You can also use the following scripts to download the datasets directly:

cd data
bash getdata.sh # The download speed is decided by your network connection. If it's pretty slow, please directly download the datasets from the website as mentioned before.

⭐Run Experiments

Please use

bash run.sh

to reproduce our experiments results. For more details, please refer to run.sh and our code.

❗ Common Issues

"XXX file not found"
Please make sure you've downloaded all the dataset according to README.

to be continued ...

Citing SelfKG

If you use SelfKG in your research or wish to refer to the baseline results, please use the following BibTeX.

@article{DBLP:journals/corr/abs-2203-01044,
  author    = {Xiao Liu and
               Haoyun Hong and
               Xinghao Wang and
               Zeyi Chen and
               Evgeny Kharlamov and
               Yuxiao Dong and
               Jie Tang},
  title     = {SelfKG: Self-Supervised Entity Alignment in Knowledge Graphs},
  journal   = {CoRR},
  volume    = {abs/2203.01044},
  year      = {2022},
  url       = {https://arxiv.org/abs/2203.01044},
  eprinttype = {arXiv},
  eprint    = {2203.01044},
  timestamp = {Mon, 07 Mar 2022 16:29:57 +0100},
  biburl    = {https://dblp.org/rec/journals/corr/abs-2203-01044.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

About

Codes for WWW2022 accepted paper: SelfKG: Self-Supervised Entity Alignment in Knowledge Graphs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published