Journal of Computer Applications ›› 2025, Vol. 45 ›› Issue (4): 1148-1156.DOI: 10.11772/j.issn.1001-9081.2024030321
• Artificial intelligence • Previous Articles Next Articles
Sheping ZHAI1,2, Qing YANG1(), Yan HUANG1, Rui YANG1
Received:
2024-03-21
Revised:
2024-04-28
Accepted:
2024-04-29
Online:
2024-06-04
Published:
2025-04-10
Contact:
Qing YANG
About author:
ZHAI Sheping, born in 1971, Ph. D., professor. His research interests include semantic computing, blockchain.Supported by:
通讯作者:
杨晴
作者简介:
翟社平(1971—),男,陕西宝鸡人,教授,博士,CCF高级会员,主要研究方向:语义计算、区块链基金资助:
CLC Number:
Sheping ZHAI, Qing YANG, Yan HUANG, Rui YANG. Knowledge graph completion using hierarchical attention fusing directed relationships and relational paths[J]. Journal of Computer Applications, 2025, 45(4): 1148-1156.
翟社平, 杨晴, 黄妍, 杨锐. 融合有向关系与关系路径的层次注意力的知识图谱补全[J]. 《计算机应用》唯一官方网站, 2025, 45(4): 1148-1156.
Add to citation manager EndNote|Ris|BibTeX
URL: https://www.joca.cn/EN/10.11772/j.issn.1001-9081.2024030321
数据集 | 实体数 | 关系数 | 训练集 样本数 | 验证集 样本数 | 测试集 样本数 | 三元组数 |
---|---|---|---|---|---|---|
FB15k-237 | 14 541 | 237 | 272 115 | 17 535 | 20 466 | 310 116 |
WN18RR | 40 943 | 11 | 86 835 | 3 034 | 3 134 | 93 003 |
Tab. 1 Statistics of datasets
数据集 | 实体数 | 关系数 | 训练集 样本数 | 验证集 样本数 | 测试集 样本数 | 三元组数 |
---|---|---|---|---|---|---|
FB15k-237 | 14 541 | 237 | 272 115 | 17 535 | 20 466 | 310 116 |
WN18RR | 40 943 | 11 | 86 835 | 3 034 | 3 134 | 93 003 |
数据集 | 学习率 | 嵌入 维度 | dropout | 批大小 | 注意力 头数 | 编码器 层数 |
---|---|---|---|---|---|---|
FB15k-237 | 0.003 | 200 | 0.1 | 1 024 | 2 | 2 |
WN18RR | 0.003 | 200 | 0.1 | 512 | 1 | 2 |
Tab. 2 Optimal combination of hyperparameters on different datasets
数据集 | 学习率 | 嵌入 维度 | dropout | 批大小 | 注意力 头数 | 编码器 层数 |
---|---|---|---|---|---|---|
FB15k-237 | 0.003 | 200 | 0.1 | 1 024 | 2 | 2 |
WN18RR | 0.003 | 200 | 0.1 | 512 | 1 | 2 |
模型 | FB15k-237 | WN18RR | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
MR↓ | MRR↑ | Hits@1↑ | Hits@3↑ | Hits@10↑ | MR↓ | MRR↑ | Hits@1↑ | Hits@3↑ | Hits@10↑ | |
TransE | 339 | 0.270 | 0.191 | 0.295 | 0.426 | 6 175 | 0.200 | 0.223 | 0.370 | 0.428 |
PTransE | 200 | 0.212 | 0.174 | 0.227 | 0.285 | 2 824 | 0.187 | 0.166 | 0.202 | 0.219 |
OPTransE | 265 | 0.342 | 0.250 | 0.377 | 0.530 | 5 944 | 0.364 | 0.349 | 0.360 | 0.387 |
KPE-PTransE | 0.371 | — | — | 0.594 | 2 140 | 0.450 | — | — | ||
DistMult | 352 | 0.239 | 0.162 | 0.259 | 0.394 | 3 915 | 0.317 | 0.236 | 0.366 | 0.468 |
ComplEx | 395 | 0.271 | 0.187 | 0.298 | 0.441 | 4 790 | 0.388 | 0.333 | 0.422 | 0.472 |
RotatE | 177 | 0.338 | 0.241 | 0.375 | 0.533 | 3 340 | 0.475 | 0.428 | 0.492 | 0.571 |
RatE | 172 | 0.344 | 0.261 | 0.382 | 0.541 | — | — | — | — | — |
ConvE | 260 | 0.305 | 0.237 | 0.356 | 0.494 | 4 917 | 0.424 | 0.415 | 0.445 | 0.496 |
InteractE | — | 0.354 | 0.263 | — | 0.535 | — | 0.463 | 0.430 | — | 0.528 |
CompGCN | 231 | 0.355 | 0.264 | 0.390 | 0.535 | 3 533 | 0.479 | 0.443 | 0.494 | 0.546 |
KBGAT | 210 | 0.352 | — | — | 0.539 | 0.412 | — | — | 0.554 | |
MRGAT | — | 0.358 | 0.266 | 0.386 | 0.542 | — | 0.481 | 0.443 | 0.501 | 0.568 |
Hic-KGQA | — | — | 0.596 | |||||||
DRPGAT | 142 | 0.396 | 0.294 | 0.461 | 0.613 | 2 438 | 0.508 | 0.452 | 0.536 | 0.615 |
Tab. 3 Comparison of results of different models on FB15k-237 and WN18RR datasets
模型 | FB15k-237 | WN18RR | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
MR↓ | MRR↑ | Hits@1↑ | Hits@3↑ | Hits@10↑ | MR↓ | MRR↑ | Hits@1↑ | Hits@3↑ | Hits@10↑ | |
TransE | 339 | 0.270 | 0.191 | 0.295 | 0.426 | 6 175 | 0.200 | 0.223 | 0.370 | 0.428 |
PTransE | 200 | 0.212 | 0.174 | 0.227 | 0.285 | 2 824 | 0.187 | 0.166 | 0.202 | 0.219 |
OPTransE | 265 | 0.342 | 0.250 | 0.377 | 0.530 | 5 944 | 0.364 | 0.349 | 0.360 | 0.387 |
KPE-PTransE | 0.371 | — | — | 0.594 | 2 140 | 0.450 | — | — | ||
DistMult | 352 | 0.239 | 0.162 | 0.259 | 0.394 | 3 915 | 0.317 | 0.236 | 0.366 | 0.468 |
ComplEx | 395 | 0.271 | 0.187 | 0.298 | 0.441 | 4 790 | 0.388 | 0.333 | 0.422 | 0.472 |
RotatE | 177 | 0.338 | 0.241 | 0.375 | 0.533 | 3 340 | 0.475 | 0.428 | 0.492 | 0.571 |
RatE | 172 | 0.344 | 0.261 | 0.382 | 0.541 | — | — | — | — | — |
ConvE | 260 | 0.305 | 0.237 | 0.356 | 0.494 | 4 917 | 0.424 | 0.415 | 0.445 | 0.496 |
InteractE | — | 0.354 | 0.263 | — | 0.535 | — | 0.463 | 0.430 | — | 0.528 |
CompGCN | 231 | 0.355 | 0.264 | 0.390 | 0.535 | 3 533 | 0.479 | 0.443 | 0.494 | 0.546 |
KBGAT | 210 | 0.352 | — | — | 0.539 | 0.412 | — | — | 0.554 | |
MRGAT | — | 0.358 | 0.266 | 0.386 | 0.542 | — | 0.481 | 0.443 | 0.501 | 0.568 |
Hic-KGQA | — | — | 0.596 | |||||||
DRPGAT | 142 | 0.396 | 0.294 | 0.461 | 0.613 | 2 438 | 0.508 | 0.452 | 0.536 | 0.615 |
模型 | FB15k-237 | WN18RR | ||||
---|---|---|---|---|---|---|
MR | MRR | Hits@10 | MR | MRR | Hits@10 | |
DRPGAT-PE-path- DR-GAT | 195 | 0.301 | 0.516 | 3 056 | 0.439 | 0.562 |
DRPGAT-PE-path- DR | 172 | 0.331 | 0.531 | 2 883 | 0.461 | 0.575 |
DRPGAT-PE-path | 166 | 0.340 | 0.556 | 2 762 | 0.473 | 0.590 |
DRPGAT-PE | 151 | 0.375 | 0.591 | 2 509 | 0.495 | 0.599 |
DRPGAT | 142 | 0.396 | 0.613 | 2 438 | 0.508 | 0.615 |
Tab. 4 Results of DRPGAT ablation experiments
模型 | FB15k-237 | WN18RR | ||||
---|---|---|---|---|---|---|
MR | MRR | Hits@10 | MR | MRR | Hits@10 | |
DRPGAT-PE-path- DR-GAT | 195 | 0.301 | 0.516 | 3 056 | 0.439 | 0.562 |
DRPGAT-PE-path- DR | 172 | 0.331 | 0.531 | 2 883 | 0.461 | 0.575 |
DRPGAT-PE-path | 166 | 0.340 | 0.556 | 2 762 | 0.473 | 0.590 |
DRPGAT-PE | 151 | 0.375 | 0.591 | 2 509 | 0.495 | 0.599 |
DRPGAT | 142 | 0.396 | 0.613 | 2 438 | 0.508 | 0.615 |
路径信息 | 相似度值 | 注意力值 |
---|---|---|
1.000 0 | — | |
0.727 4 | 0.001 3 | |
0.195 8(过滤) | — | |
0.386 9(过滤) | — | |
1.000 0 | — | |
0.684 9 | 0.001 3 | |
0.711 2 | 0.001 6 | |
0.231 7(过滤) | — | |
1.000 0 | — | |
0.859 1 | 0.003 8 | |
0.463 4(过滤) | — | |
0.228 4(过滤) | — |
Tab. 5 Role of filter paths at path layer
路径信息 | 相似度值 | 注意力值 |
---|---|---|
1.000 0 | — | |
0.727 4 | 0.001 3 | |
0.195 8(过滤) | — | |
0.386 9(过滤) | — | |
1.000 0 | — | |
0.684 9 | 0.001 3 | |
0.711 2 | 0.001 6 | |
0.231 7(过滤) | — | |
1.000 0 | — | |
0.859 1 | 0.003 8 | |
0.463 4(过滤) | — | |
0.228 4(过滤) | — |
1 | 杜雪盈,刘名威,沈立炜,等. 面向链接预测的知识图谱表示学习方法综述[J]. 软件学报, 2024, 35(1): 87-117. |
DU X Y, LIU M W, SHEN L W, et al. Survey on representation learning methods of knowledge graph for link prediction [J]. Journal of Software, 2024, 35(1): 87-117. | |
2 | BOLLACKER K, EVANS C, PARITOSH P, et al. Freebase: a collaboratively created graph database for structuring human knowledge [C]// Proceedings of the 2008 ACM SIGMOD International Conference on Management of Data. New York: ACM, 2008: 1247-1250. |
3 | MILLER G A. WordNet: a lexical database for English [J]. Communications of the ACM, 1995, 38(11): 39-41. |
4 | LEHMANN J, ISELE R, JAKOB M, et al. DBpedia — a large-scale, multilingual knowledge base extracted from Wikipedia [J]. Semantic Web, 2015, 6(2): 167-195. |
5 | SUDHAHAR S, PIERLEONI A, ROBERTS I. Reasoning over paths via knowledge base completion [C]// Proceedings of the 13th Workshop on Graph-Based Methods for Natural Language Processing. Stroudsburg: ACL, 2019: 164-171. |
6 | 张文豪,徐贞顺,刘纳,等. 知识图谱补全方法研究综述[J]. 计算机工程与应用, 2024, 60(12):61-73. |
ZHANG W H, XU Z S, LIU N, et al. Overview of knowledge graph completion methods[J]. Computer Engineering and Applications, 2024, 60(12):61-73. | |
7 | BORDES A, USUNIER N, GARCIA-DURÁN A, et al. Translating embeddings for modeling multi-relational data [C]// Proceedings of the 26th International Conference on Neural Information Processing Systems — Volume 2. Red Hook: Curran Associates Inc., 2013: 2787-2795. |
8 | LIN Y, LIU Z, SUN M, et al. Learning entity and relation embeddings for knowledge graph completion [C]// Proceedings of the 29th AAAI Conference on Artificial Intelligence. Palo Alto: AAAI Press, 2015, 2181-2187. |
9 | NICKEL M, TRESP V, KRIEGEL H P. A three-way model for collective learning on multi-relational data [C]// Proceedings of the 28th International Conference on Machine Learning. Madison, WI: Omnipress, 2011: 809-816. |
10 | TROUILLON T, WELBL J, RIEDEL S, et al. Complex embeddings for simple link prediction [C]// Proceedings of the 33rd International Conference on Machine Learning. New York: JMLR.org, 2016: 2071-2080. |
11 | LIN Y, LIU Z, LUAN H, et al. Modeling relation paths for representation learning of knowledge bases [C]// Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing. Stroudsburg: ACL, 2015: 705-714. |
12 | XIONG W, HOANG T, WANG W Y. DeepPath: a reinforcement learning method for knowledge graph reasoning [C]// Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing. Stroudsburg: ACL, 2017: 564-573. |
13 | DETTMERS T, MINERVINI P, STENETORP P, et al. Convolutional 2D knowledge graph embeddings [C]// Proceedings of the 32nd AAAI Conference on Artificial Intelligence. Palo Alto: AAAI Press, 2018: 1811-1818. |
14 | VASHISHTH S, SANYAL S, NITIN V, et al. InteractE: improving convolution-based knowledge graph embeddings by increasing feature interactions [C]// Proceedings of the 34th AAAI Conference on Artificial Intelligence. Palo Alto: AAAI Press, 2020: 3009-3016. |
15 | VASHISHTH S, SANYAL S, NITIN V, et al. Composition-based multi-relational graph convolutional networks [EB/OL]. [2024-01-23].. |
16 | LI Z, LIU H, ZHANG Z, et al. Learning knowledge graph embedding with heterogeneous relation attention networks [J]. IEEE Transactions on Neural Networks and Learning Systems, 2022, 33(8): 3961-3973. |
17 | WANG Z, ZHANG J, FENG J, et al. Knowledge graph embedding by translating on hyperplanes [C]// Proceedings of the 28th AAAI Conference on Artificial Intelligence. Palo Alto: AAAI Press, 2014: 1112-1119. |
18 | XIAO H, HUANG M, HAO Y, et al. TransA: an adaptive approach for knowledge graph embedding [EB/OL]. [2023-12-19]. . |
19 | YANG B, YIH W T, HE X, et al. Embedding entities and relations for learning and inference in knowledge bases [EB/OL]. [2023-11-14]. . |
20 | SCHLICHTKRULL M, KIPF T N, BLOEM P, et al. Modeling relational data with graph convolutional networks [C]// Proceedings of the 2018 European Semantic Web Conference, LNCS 10843. Cham: Springer, 2018: 593-607. |
21 | NATHANI D, CHAUHAN J, SHARMA C, et al. Learning attention-based embeddings for relation prediction in knowledge graphs [C]// Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics. Stroudsburg: ACL, 2019: 4710-4723. |
22 | DAI G, WANG X, ZOU X, et al. MRGAT: multi-relational graph attention network for knowledge graph completion [J]. Neural Networks, 2022, 154: 234-245. |
23 | WANG J, LI W, LIU F, et al. Hic-KGQA: improving multi-hop question answering over knowledge graph via hypergraph and inference chain [J]. Knowledge-Based Systems, 2023, 277: No.110810. |
24 | LAO N, COHEN W W. Relational retrieval using a combination of path-constrained random walks [J]. Machine Learning, 2010, 81(1): 53-67. |
25 | ZHU Y, LIU H, WU Z, et al. Representation learning with ordered relation paths for knowledge graph completion [C]// Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing. Stroudsburg: ACL, 2019: 2662-2671. |
26 | ZHANG Y, YAO Q, CHEN L. Interstellar: searching recurrent architecture for knowledge graph embedding [C]// Proceedings of the 34th International Conference on Neural Information Processing Systems. Red Hook: Curran Associates Inc., 2020: 10030-10040. |
27 | PENG Z, YU H, JIA X. Path-based reasoning with K-nearest neighbor and position embedding for knowledge graph completion[J]. Journal of Intelligent Information Systems, 2022, 58(3): 513-533. |
28 | VASWANI A, SHAZEER N, PARMAR N, et al. Attention is all you need [C]// Proceedings of the 31st International Conference on Neural Information Processing Systems. Red Hook: Curran Associates Inc., 2017: 6000-6010. |
29 | SUN Z, DENG Z H, NIE J Y, et al. RotatE: knowledge graph embedding by relational rotation in complex space [EB/OL]. [2024-01-12]. . |
30 | HUANG H, LONG G, SHEN T, et al. RatE: relation-adaptive translating embedding for knowledge graph completion [C]// Proceedings of the 28th International Conference on Computational Linguistics. [S.l.]: International Committee on Computational Linguistics, 2020: 556-567. |
[1] | Liqin WANG, Zhilei GENG, Yingshuang LI, Yongfeng DONG, Meng BIAN. Open-world knowledge reasoning model based on path and enhanced triplet text [J]. Journal of Computer Applications, 2025, 45(4): 1177-1183. |
[2] | Chun XU, Shuangyan JI, Huan MA, Enwei SUN, Mengmeng WANG, Mingyu SU. Consultation recommendation method based on knowledge graph and dialogue structure [J]. Journal of Computer Applications, 2025, 45(4): 1157-1168. |
[3] | Zixin XU, Xiuwen YI, Jie BAO, Tianrui LI, Junbo ZHANG, Yu ZHENG. Construction and application of knowledge graph for epidemiological investigation [J]. Journal of Computer Applications, 2025, 45(4): 1340-1348. |
[4] | Yan YANG, Feng YE, Dong XU, Xuejie ZHANG, Jin XU. Construction of digital twin water conservancy knowledge graph integrating large language model and prompt learning [J]. Journal of Computer Applications, 2025, 45(3): 785-793. |
[5] | Chengzhe YUAN, Guohua CHEN, Dingding LI, Yuan ZHU, Ronghua LIN, Hao ZHONG, Yong TANG. ScholatGPT: a large language model for academic social networks and its intelligent applications [J]. Journal of Computer Applications, 2025, 45(3): 755-764. |
[6] | Xuefei ZHANG, Liping ZHANG, Sheng YAN, Min HOU, Yubo ZHAO. Personalized learning recommendation in collaboration of knowledge graph and large language model [J]. Journal of Computer Applications, 2025, 45(3): 773-784. |
[7] | Meng WANG, Daqian ZHANG, Bingyan ZHOU, Qianying MA, Jidong LYU. Fault diagnosis method for train control on-board interface equipment of CTCS-3 based on temporal knowledge graph completion [J]. Journal of Computer Applications, 2025, 45(2): 677-684. |
[8] | Rui LI, Guanfeng LI, Dezhou HU, Wenxin GAO. Knowledge graph multi-hop reasoning model fusing path and subgraph features [J]. Journal of Computer Applications, 2025, 45(1): 32-39. |
[9] | Zidong CHENG, Peng LI, Feng ZHU. Potential relation mining in internet of things threat intelligence knowledge graph [J]. Journal of Computer Applications, 2025, 45(1): 24-31. |
[10] | Wenbo ZHAO, Zitong MA, Zhe YANG. Link prediction model based on directed hypergraph adaptive convolution [J]. Journal of Computer Applications, 2025, 45(1): 15-23. |
[11] | Xueqiang LYU, Tao WANG, Xindong YOU, Ge XU. HTLR: named entity recognition framework with hierarchical fusion of multi-knowledge [J]. Journal of Computer Applications, 2025, 45(1): 40-47. |
[12] | Guixiang XUE, Hui WANG, Weifeng ZHOU, Yu LIU, Yan LI. Port traffic flow prediction based on knowledge graph and spatio-temporal diffusion graph convolutional network [J]. Journal of Computer Applications, 2024, 44(9): 2952-2957. |
[13] | Jie WU, Ansi ZHANG, Maodong WU, Yizong ZHANG, Congbao WANG. Overview of research and application of knowledge graph in equipment fault diagnosis [J]. Journal of Computer Applications, 2024, 44(9): 2651-2659. |
[14] | Yubo ZHAO, Liping ZHANG, Sheng YAN, Min HOU, Mao GAO. Relation extraction between discipline knowledge entities based on improved piecewise convolutional neural network and knowledge distillation [J]. Journal of Computer Applications, 2024, 44(8): 2421-2429. |
[15] | Youren YU, Yangsen ZHANG, Yuru JIANG, Gaijuan HUANG. Chinese named entity recognition model incorporating multi-granularity linguistic knowledge and hierarchical information [J]. Journal of Computer Applications, 2024, 44(6): 1706-1712. |
Viewed | ||||||
Full text |
|
|||||
Abstract |
|
|||||