Relational Structure-Aware Knowledge Graph Representation in Complex Space
<p>An illustration of complex relations in knowledge graphs. Different colours of solid arrows (r) between entities represent different relations. The dashed arrows represent the predictable relations.</p> "> Figure 2
<p>Score distributions of positive triplets.</p> "> Figure 3
<p>The framework of MARS.</p> "> Figure 4
<p>Visualisation of entity feature vectors. The two figures in the first and second quadrants are the visualisations of the vectors obtained by MARS. The two figures in the third and fourth quadrants are visualisations of the vectors obtained by RotatE. The heat maps are used to visualise embedding matrices, where the vertical axis represents nodes and the horizontal axis represents the values corresponding to different dimensions.</p> ">
Abstract
:1. Introduction
- We present a novel knowledge graph representation learning framework, namely MARS, to exploit complex relations for embedding knowledge graphs. MARS can effectively capture various binary relation patterns, as well as rich relational structures in knowledge graphs. Thus, our model can achieve more accurate embeddings.
- We find that the scores of triplets that preserve rich relational structures and various binary relational patterns approximate a Gaussian distribution. The scores in the tail have negative influences on tasks. To overcome this weakness and optimise the accuracy of embedding triplets, we specifically involved the standard deviation approach to alleviate the deviation caused by the scores of the triplets located in the tail of the distribution, leading to better performance in triple classification and link prediction.
- We conducted comprehensive experiments on several benchmark datasets. The experimental results of MARS consistently outperformed state-of-the-art models on the tasks of link prediction and triple classification. This demonstrates the effectiveness of our proposed model.
2. Related Work
3. Preliminaries
4. The Design of MARS
4.1. Message-Passing Scheme
4.2. Structure-Aware Binary Relation Embedding
4.3. Standard-Deviation-Biased Loss Function
Algorithm 1 The pseudo-code of MARS |
|
5. Experiments
5.1. Datasets
- FB15K. The FB15k dataset contains triplets extracted from entity pairs of the freebase dataset. The entities and relations of the dataset are uniquely encoded and stored in the form of text in different files. The triplet file has 592,213 triplets; the entity dictionary file has 14,951 unique entities; the relation dictionary file has 1345 unique relations.
- FB15K-237. The FB15K-237 dataset is a subset of the Freebase knowledge base. It is extracted and purified from the FB15K dataset by removing the inverse relations from the original dataset. Here, “15K” means 15,000 keywords in the knowledge base and “237” means 237 relations in total. The training set contains 272,115 triplets; the validation set contains 17,535 triplets; the test set contains 20,466 triplets.
- WN18. The WN18 dataset is a subset of WordNet, having 18 kinds of relations and roughly 41,000 kinds of entities scraped from the original dataset. The source of WN18 has training, validation, and test sets, resulting in 151,442 triplets.
5.2. Evaluation Protocols
5.3. Baselines
5.4. Hyperparameter Settings
5.5. Experimental Results
5.5.1. Structural Preserving Results and Analysis
5.5.2. Triple Classification Results and Analysis
5.5.3. Link Prediction Results and Analysis
5.5.4. Efficiency Analysis
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Ji, S.; Pan, S.; Cambria, E.; Marttinen, P.; Philip, S.Y. A survey on knowledge graphs: Representation, acquisition, and applications. IEEE Trans. Neural Netw. Learn. Syst. 2021, 33, 494–514. [Google Scholar] [CrossRef] [PubMed]
- Liu, J.; Ren, J.; Zheng, W.; Chi, L.; Lee, I.; Xia, F. Web of scholars: A scholar knowledge graph. In Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval, Virtual Event, China, 25–30 July 2020; pp. 2153–2156. [Google Scholar]
- Guo, Q.; Zhuang, F.; Qin, C.; Zhu, H.; Xie, X.; Xiong, H.; He, Q. A survey on knowledge graph-based recommender systems. IEEE Trans. Knowl. Data Eng. 2020. [Google Scholar] [CrossRef]
- Fang, H.; Chen, C.; Long, Y.; Xu, G.; Xiao, Y. DTCRSKG: A Deep Travel Conversational Recommender System Incorporating Knowledge Graph. Mathematics 2022, 10, 1402. [Google Scholar] [CrossRef]
- Dong, L.; Yang, N.; Wang, W.; Wei, F.; Liu, X.; Wang, Y.; Gao, J.; Zhou, M.; Hon, H.W. Unified language model pre-training for natural language understanding and generation. In Proceedings of the 33rd International Conference on Neural Information Processing Systems, Vancouver, BC, Canada, 8–14 December 2019; Volume 32, pp. 13063–13075. [Google Scholar]
- Huang, X.; Zhang, J.; Li, D.; Li, P. Knowledge graph embedding based question answering. In Proceedings of the 12th ACM International Conference on Web Search and Data Mining, Melbourne, VIC, Australia, 11–15 February 2019; pp. 105–113. [Google Scholar]
- Wang, Q.; Mao, Z.; Wang, B.; Guo, L. Knowledge graph embedding: A survey of approaches and applications. IEEE Trans. Knowl. Data Eng. 2017, 29, 2724–2743. [Google Scholar] [CrossRef]
- Xia, F.; Sun, K.; Yu, S.; Aziz, A.; Wan, L.; Pan, S.; Liu, H. Graph Learning: A Survey. IEEE Trans. Artif. Intell. 2021, 2, 109–127. [Google Scholar] [CrossRef]
- Wang, Z.; Zhang, J.; Feng, J.; Chen, Z. Knowledge graph embedding by translating on hyperplanes. In Proceedings of the AAAI Conference on Artificial Intelligence, Vancouver, BC, Canada, 22 February–1 March 2014; Volume 28. [Google Scholar]
- Sun, Z.; Deng, Z.H.; Nie, J.Y.; Tang, J. RotatE: Knowledge Graph Embedding by Relational Rotation in Complex Space. In Proceedings of the International Conference on Learning Representations, New Orleans, LA, USA, 6–9 May 2019. [Google Scholar]
- Zhang, Z.; Cai, J.; Zhang, Y.; Wang, J. Learning hierarchy-aware knowledge graph embeddings for link prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, New York, NY, USA, 7–12 February 2020; Volume 34, pp. 3065–3072. [Google Scholar]
- Vashishth, S.; Sanyal, S.; Nitin, V.; Agrawal, N.; Talukdar, P. Interacte: Improving convolution-based knowledge graph embeddings by increasing feature interactions. In Proceedings of the AAAI Conference on Artificial Intelligence, New York, NY, USA, 7–12 February 2020; Volume 34, pp. 3009–3016. [Google Scholar]
- Zhao, F.; Xu, T.; Jin, L.; Jin, H. Convolutional Network Embedding of Text-enhanced Representation for Knowledge Graph Completion. IEEE Internet Things J. 2020, 8, 16758–16769. [Google Scholar] [CrossRef]
- He, Q.; Wu, L.; Yin, Y.; Cai, H. Knowledge-graph augmented word representations for named entity recognition. In Proceedings of the AAAI Conference on Artificial Intelligence, New York, NY, USA, 7–12 February 2020; Volume 34, pp. 7919–7926. [Google Scholar]
- Dai, Y.; Wang, S.; Xiong, N.N.; Guo, W. A survey on knowledge graph embedding: Approaches, applications and benchmarks. Electronics 2020, 9, 750. [Google Scholar] [CrossRef]
- Ren, J.; Xia, F.; Chen, X.; Liu, J.; Hou, M.; Shehzad, A.; Sultanova, N.; Kong, X. Matching Algorithms: Fundamentals, Applications and Challenges. IEEE Trans. Emerg. Top. Comput. Intell. 2021, 5, 332–350. [Google Scholar] [CrossRef]
- Sun, K.; Wang, L.; Xu, B.; Zhao, W.; Teng, S.W.; Xia, F. Network representation learning: From traditional feature learning to deep learning. IEEE Access 2020, 8, 205600–205617. [Google Scholar] [CrossRef]
- Bordes, A.; Usunier, N.; Garcia-Duran, A.; Weston, J.; Yakhnenko, O. Translating embeddings for modeling multi-relational data. In Proceedings of the Neural Information Processing Systems, Lake Tahoe, NV, USA, 5–10 December 2013; pp. 1–9. [Google Scholar]
- Lin, Y.; Liu, Z.; Sun, M.; Liu, Y.; Zhu, X. Learning entity and relation embeddings for knowledge graph completion. In Proceedings of the 12th AAAI Conference on Artificial Intelligence, Seattle, WA, USA, 1–4 August 2015. [Google Scholar]
- Wang, W.; Liu, J.; Tang, T.; Tuarob, S.; Xia, F.; Gong, Z.; King, I. Attributed collaboration network embedding for academic relationship mining. ACM Trans. Web 2020, 15, 1–20. [Google Scholar] [CrossRef]
- Wang, W.; Xia, F.; Wu, J.; Gong, Z.; Tong, H.; Davison, B.D. Scholar2vec: Vector representation of scholars for lifetime collaborator prediction. ACM Trans. Knowl. Discov. Data 2021, 15, 1–19. [Google Scholar] [CrossRef]
- Wang, W.; Tang, T.; Xia, F.; Gong, Z.; Chen, Z.; Liu, H. Collaborative Filtering with Network Representation Learning for Citation Recommendation. IEEE Trans. Big Data 2020, 1. [Google Scholar] [CrossRef]
- Liu, J.; Xia, F.; Wang, L.; Xu, B.; Kong, X.; Tong, H.; King, I. Shifu2: A network representation learning based model for advisor-advisee relationship mining. IEEE Trans. Knowl. Data Eng. 2019, 33, 1763–1777. [Google Scholar] [CrossRef]
- Trouillon, T.; Welbl, J.; Riedel, S.; Gaussier, É.; Bouchard, G. Complex embeddings for simple link prediction. In Proceedings of the International Conference on Machine Learning, PMLR, New York, NY, USA, 19–24 June 2016; pp. 2071–2080. [Google Scholar]
- Gilmer, J.; Schoenholz, S.S.; Riley, P.F.; Vinyals, O.; Dahl, G.E. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning, PMLR, Sydney, Australia, 6–11 August 2017; pp. 1263–1272. [Google Scholar]
- Mikolov, T.; Chen, K.; Corrado, G.; Dean, J. Efficient estimation of word representations in vector space. arXiv 2013, arXiv:1301.3781. [Google Scholar]
- Mikolov, T.; Sutskever, I.; Chen, K.; Corrado, G.S.; Dean, J. Distributed representations of words and phrases and their compositionality. In Proceedings of the 26th International Conference on Neural Information Processing Systems, Lake Tahoe, NV, USA, 5–10 December 2013; pp. 3111–3119. [Google Scholar]
- Ji, G.; He, S.; Xu, L.; Liu, K.; Zhao, J. Knowledge graph embedding via dynamic mapping matrix. In Proceedings of the 53rd annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing, Beijing, China, 27–31 July 2015; Volume 1, pp. 687–696. [Google Scholar]
- Yang, B.; Yih, W.t.; He, X.; Gao, J.; Deng, L. Embedding entities and relations for learning and inference in knowledge bases. In Proceedings of the International Conference on Learning Representations, San Diego, CA, USA, 7–9 May 2015; pp. 1–2. [Google Scholar]
- Bordes, A.; Glorot, X.; Weston, J.; Bengio, Y. A semantic matching energy function for learning with multi-relational data. Mach. Learn. 2014, 94, 233–259. [Google Scholar]
- Liu, H.; Wu, Y.; Yang, Y. Analogical inference for multi-relational embeddings. In Proceedings of the 34th International Conference on Machine Learning, PMLR, Sydney, Australia, 6–11 August 2017; pp. 2168–2178. [Google Scholar]
- Lin, Q.; Yu, S.; Sun, K.; Zhao, W.; Alfarraj, O.; Tolba, A.; Xia, F. Robust Graph Neural Networks via Ensemble Learning. Mathematics 2022, 10, 1300. [Google Scholar] [CrossRef]
- Petrovska, B.; Zdravevski, E.; Lameski, P.; Corizzo, R.; Štajduhar, I.; Lerga, J. Deep learning for feature extraction in remote sensing: A case-study of aerial scene classification. Sensors 2020, 20, 3906. [Google Scholar] [CrossRef] [PubMed]
- Dettmers, T.; Minervini, P.; Stenetorp, P.; Riedel, S. Convolutional 2d knowledge graph embeddings. In Proceedings of the AAAI Conference on Artificial Intelligence, Hilton New Orleans Riverside, New Orleans, LA, USA, 2–7 February 2018; Volume 32. [Google Scholar]
- Schlichtkrull, M.; Kipf, T.N.; Bloem, P.; Van Den Berg, R.; Titov, I.; Welling, M. Modeling relational data with graph convolutional networks. In Proceedings of the European Semantic Web Conference; Springer: Berlin/Heidelberg, Germany, 2018; pp. 593–607. [Google Scholar]
- Kipf, T.N.; Welling, M. Semi-Supervised Classification with Graph Convolutional Networks. In Proceedings of the 5th International Conference on Learning Representations, Toulon, France, 24–26 April 2017. [Google Scholar]
- Chen, M.; Wei, Z.; Huang, Z.; Ding, B.; Li, Y. Simple and deep graph convolutional networks. In Proceedings of the 37th International Conference on Machine Learning, PMLR, Virtual Event, 13–18 July 2020; pp. 1725–1735. [Google Scholar]
- Hong, D.; Gao, L.; Yao, J.; Zhang, B.; Plaza, A.; Chanussot, J. Graph convolutional networks for hyperspectral image classification. IEEE Trans. Geosci. Remote Sens. 2020, 59, 5966–5978. [Google Scholar] [CrossRef]
- Shang, C.; Tang, Y.; Huang, J.; Bi, J.; He, X.; Zhou, B. End-to-end structure-aware convolutional networks for knowledge base completion. In Proceedings of the AAAI Conference on Artificial Intelligence, Honolulu, HI, USA, 27 January–1 February 2019; Volume 33, pp. 3060–3067. [Google Scholar]
- Zhang, N.; Deng, S.; Sun, Z.; Chen, J.; Zhang, W.; Chen, H. Relation adversarial network for low resource knowledge graph completion. In Proceedings of the Web Conference 2020, Taipei, Taiwan, 20–24 April 2020; pp. 1–12. [Google Scholar]
- Zhang, C.; Yao, H.; Huang, C.; Jiang, M.; Li, Z.; Chawla, N.V. Few-shot knowledge graph completion. In Proceedings of the AAAI Conference on Artificial Intelligence, New York, NY, USA, 7–12 February 2020; Volume 34, pp. 3041–3048. [Google Scholar]
Model | Score Function | Symmetry | Antisymmetry | Inversion | Composition | O2M | M2O | M2M |
---|---|---|---|---|---|---|---|---|
TransE [18] | ✗ | ✓ | ✓ | ✓ | ✗ | ✗ | ✗ | |
TransH [9] | ✗ | ✓ | ✓ | ✗ | ✓ | ✓ | ✓ | |
TransR [19] | ✓ | ✗ | ✗ | ✗ | ✓ | ✓ | ✓ | |
DISTMULT [29] | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | |
ComplEx [24] | ✓ | ✓ | ✓ | ✗ | ✗ | ✗ | ✗ | |
RotatE [10] | ✓ | ✓ | ✓ | ✓ | ✗ | ✗ | ✗ | |
MARS | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Notations | Implications |
---|---|
The real part of vectors in complex space | |
The imaginary part of vectors in complex space | |
Vectors’ concatenating operation | |
A triplet set | |
r | Embedding of a relation |
s | Embedding of a source entity |
t | Embedding of a target entity |
∘ | Hadamard product operation |
i | Index of a node (entity) |
A complex embedding space |
Dataset | WN18 | FB15K | FB15K-237 |
---|---|---|---|
Entities | 40,943 | 14,951 | 14,541 |
Relations | 18 | 1345 | 237 |
Edges | 151,442 | 592,213 | 310,116 |
Train triplets | 141,442 | 483,142 | 272,115 |
Val. triplets | 5000 | 50,000 | 17,535 |
Test triplets | 5000 | 59,071 | 20,466 |
O2O relation | 42 | 832 | 192 |
O2M relation | 1847 | 5259 | 1293 |
M2M relation | 1130 | 44,343 | 14,796 |
M2O relation | 1981 | 8637 | 4185 |
Model | FB15K | WN18 | FB15K237 | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
F1-Score | Acc | P | Recall | F1-Score | Acc | P | R | F1-Score | Acc | P | R | |
TransE | 0.929 | 0.924 | 0.871 | 0.995 | 0.894 | 0.885 | 0.826 | 0.975 | 0.922 | 0.919 | 0.890 | 0.957 |
TransH | 0.948 | 0.946 | 0.911 | 0.988 | 0.924 | 0.921 | 0.889 | 0.963 | 0.916 | 0.915 | 0.909 | 0.922 |
TransR | 0.940 | 0.936 | 0.895 | 0.989 | 0.957 | 0.957 | 0.952 | 0.963 | 0.911 | 0.912 | 0.916 | 0.907 |
DISTMULT | 0.967 | 0.967 | 0.957 | 0.977 | 0.978 | 0.978 | 0.989 | 0.967 | 0.927 | 0.926 | 0.910 | 0.945 |
ComplEx | 0.963 | 0.962 | 0.941 | 0.986 | 0.968 | 0.968 | 0.964 | 0.973 | 0.949 | 0.949 | 0.942 | 0.957 |
RotatE | 0.961 | 0.960 | 0.929 | 0.996 | 0.966 | 0.966 | 0.955 | 0.977 | 0.948 | 0.948 | 0.946 | 0.949 |
MARS | 0.975 | 0.975 | 0.973 | 0.977 | 0.981 | 0.981 | 0.995 | 0.967 | 0.951 | 0.950 | 0.931 | 0.972 |
Model | FB15K | ||||
---|---|---|---|---|---|
MRR | Hits@ | ||||
Raw | Filtered | 1 | 3 | 10 | |
TransE | 0.270 | 0.502 | 0.366 | 0.595 | 0.730 |
TransH | 0.253 | 0.492 | 0.336 | 0.604 | 0.744 |
TransR | 0.257 | 0.568 | 0.415 | 0.687 | 0.797 |
DISTMULT | 0.152 | 0.216 | 0.116 | 0.238 | 0.433 |
ComplEx | 0.231 | 0.359 | 0.232 | 0.421 | 0.607 |
RotatE | 0.269 | 0.604 | 0.485 | 0.685 | 0.805 |
MARS | 0.305 | 0.631 | 0.512 | 0.713 | 0.831 |
Model | WN18 | ||||
---|---|---|---|---|---|
MRR | Hits@ | ||||
Raw | Filtered | 1 | 3 | 10 | |
TransE | 0.340 | 0.504 | 0.089 | 0.925 | 0.948 |
TransH | 0.317 | 0.468 | 0.035 | 0.911 | 0.937 |
TransR | 0.341 | 0.511 | 0.096 | 0.934 | 0.947 |
DISTMULT | 0.399 | 0.452 | 0.316 | 0.518 | 0.737 |
ComplEx | 0.544 | 0.727 | 0.626 | 0.807 | 0.896 |
RotatE | 0.596 | 0.946 | 0.939 | 0.950 | 0.958 |
MARS | 0.607 | 0.947 | 0.938 | 0.953 | 0.961 |
Model | FB15K-237 | ||||
---|---|---|---|---|---|
MRR | Hits@n | ||||
Raw | Filtered | 1 | 3 | 10 | |
TransE | 0.169 | 0.289 | 0.193 | 0.328 | 0.478 |
TransH | 0.155 | 0.277 | 0.175 | 0.321 | 0.474 |
TransR | 0.156 | 0.311 | 0.214 | 0.351 | 0.504 |
DISTMULT | 0.126 | 0.179 | 0.094 | 0.203 | 0.350 |
ComplEx | 0.230 | 0.351 | 0.222 | 0.412 | 0.602 |
RotatE | 0.327 | 0.359 | 0.261 | 0.398 | 0.557 |
MARS | 0.241 | 0.422 | 0.317 | 0.470 | 0.629 |
Model | Epoch Time (s) | GPU Memory (MB) | CPU Memory (GB) |
---|---|---|---|
TransE | 3.32 | 1947 | 2.3 |
TransH | 5.21 | 2429 | 2.2 |
TransR | 45.56 | 10,207 | 2.7 |
DISTMULT | 3.22 | 2139 | 2.3 |
ComplEx | 5.78 | 3027 | 2.3 |
RotatE | 3.84 | 3317 | 2.3 |
MARS | 8.55 | 4037 | 2.3 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Sun, K.; Yu, S.; Peng, C.; Wang, Y.; Alfarraj, O.; Tolba, A.; Xia, F. Relational Structure-Aware Knowledge Graph Representation in Complex Space. Mathematics 2022, 10, 1930. https://doi.org/10.3390/math10111930
Sun K, Yu S, Peng C, Wang Y, Alfarraj O, Tolba A, Xia F. Relational Structure-Aware Knowledge Graph Representation in Complex Space. Mathematics. 2022; 10(11):1930. https://doi.org/10.3390/math10111930
Chicago/Turabian StyleSun, Ke, Shuo Yu, Ciyuan Peng, Yueru Wang, Osama Alfarraj, Amr Tolba, and Feng Xia. 2022. "Relational Structure-Aware Knowledge Graph Representation in Complex Space" Mathematics 10, no. 11: 1930. https://doi.org/10.3390/math10111930
APA StyleSun, K., Yu, S., Peng, C., Wang, Y., Alfarraj, O., Tolba, A., & Xia, F. (2022). Relational Structure-Aware Knowledge Graph Representation in Complex Space. Mathematics, 10(11), 1930. https://doi.org/10.3390/math10111930