The code and data of "RelaGraph: Improving Embedding on Small-scale Sparse Knowledge Graphs by Neighborhood Relations" (paper)
In this paper, we propose a new KGE method named RelaGraph, which works well on small-scale sparse knowledge graphs. RelaGraph is based on StarGraph and improves the process of subgraph generation and entity encoding in StarGraph. We extend the neighborhood information by aggregate the links between the target node and its neighbors. In addition, we also make some improvements to the loss function and other aspects to adapt the KGE model to small sparse data sets. We tested our method on 3 small sparse KGs, and achieved SOTA performance. The experimental results proves that RelaGraph nicely compensates for the poor performance of current KGE algorithms on small KGs, and the improvement demonstrates its great effectiveness of representation learning on small-scale knowledge graphs.
In this paper, we conducted experiments on three small-scale sparse KGs in total, including:
./datasets/KMHEO
) is a KG of historical events constructed in the pre-experimental stage, which contains 8,713 triples with 6,767 entities and 230 relations after preprocessing. ./datasets/T250Films
) comes from a Chinese open knowledge graph platform OpenKG, containing 1,701 triples with 1,061 entities and 5 relations. ./datasets/RedMansions
) also comes from OpenKG, containing 381 entities, 98 relations and 344 triples. ./datasets/XXX/
../requirements.txt
train.txt
, test.txt
, and valid.txt
, respectively, and a line in each file represents a triple (h,r,t), split by '\t'../run.py
to train and evaluate the KGE model. You can change the hyperparameters if necessary.You may need to change the hyperparameters in ./run.py
for best performance. And here comes the expression of some important hyperparameters.
./datasets/data_name/
. If you find this work useful, please consider citing the paper:
@article{SHI2023103447,
author = {Bin Shi and Hao Wang and Yueyan Li and Sanhong Deng},
title = {RelaGraph: Improving Embedding on Small-scale Sparse Knowledge Graphs by Neighborhood Relations},
journal = {Information Processing & Management},
volume = {60},
number = {5},
pages = {103447},
year = {2023},
issn = {0306-4573},
doi = {https://doi.org/10.1016/j.ipm.2023.103447},
url = {https://www.sciencedirect.com/science/article/pii/S030645732300184X},
keywords = {Knowledge graph, Knowledge graph embedding, Deep learning, StarGraph}
}