pengyanhui / LineaRE

23 stars 4 forks source link

LineaRE

Source code for ICDM2020 research paper "LineaRE: Simple but Powerful Knowledge Graph Embedding for Link Prediction", a.k.a., LineaRE.
You can easily add your own model to the code framework.

Update!

We reorganized and optimized the code (/new code). The new version of the code has clearer logical structure and faster running speed, and supports multi GPUs parallel training to further accelerate the training speed.

Code

Running LineaRE is very easy, just:

  1. put your arguments in the json files ./config/*.json , e.g. config_FB15k.json
  2. execute command, python3 main.py

    Code files

    Totally six python files:

    • configure.py: including all hyper parameter, reading arguments from ./config/*.json ;
    • data.py: dataloader, a KG class containing all data in a dataset;
    • lineare.py: the implementation of the LineaRE model;
    • main.py: the entry of the whole program, creating a KG object, a TrainTest object, and start training and test;
    • traintest.py: receiving a KG object, a model, and the process of training and testing is described;
    • utils.py: some model independent tools.

      Dependencies

    • Python 3
    • PyTorch 1.*
    • Numpy

Datasets

Four datasets: FB15k, WN18, FB15k-237, WN18RR. (the same as [1])

Parameters(./config/config_FB15k.json)

Citation

If you use this model or code, please cite it as follows:

@inproceedings{peng2020lineare,
  author    = {Yanhui Peng and Jing Zhang},
  editor    = {Claudia Plant and Haixun Wang and Alfredo Cuzzocrea and Carlo Zaniolo and Xindong Wu},
  title     = {LineaRE: Simple but Powerful Knowledge Graph Embedding for Link Prediction},
  booktitle = {IEEE International Conference on Data Mining, {ICDM}},
  pages     = {422--431},
  year      = {2020},
  url       = {https://ieeexplore.ieee.org/document/9338434}
}

References