APP下载

基于句子转换和双注意力机制的归纳关系预测

2025-08-03李卫军刘雪洋刘世侠王子怡丁建平苏易磻

计算机应用研究 2025年6期
关键词:三元组图谱实体

Inductive relation prediction based on sentence Transformer and dual attention mechanism

Li Weijun a,b† ,Liu Xueyang²,Liu Shixia,Wang Ziyia,Ding Jianpinga,Su Yileia (a.Colegeofueneamp;oKbafgsamp;asellgentossnofateEcs sion,North Minzu University,Yinchuan75oo21,China)

Abstract:Relation predictionisaimportant task in knowledgegraphcompletion,aimedat predicting mising relationships between entities.Existing inductiverelationprediction methodsoften facechalenges inadequatelymodeling semanticand structural information.Toaddress thisisse,thispaper proposedaninductiverelation predictionmodel basedonsentence transformationandadual-atentionmechanism.Theproposedmethodenhancedentitysemanticrepresentationsbyautomaticallyretrievingdescritionsandincorporatesadual-atentionmechanism,whichonsiderededgeandelationawarenes,toacu ratelymodelthecomplexinteractionsbetweeentities.Firstly,itextractedtheclosedsubgraphofthetargettripleanduseda random walk strategytosearchformuli-hoprelational paths.Thesetriplesand pathswerethen transformedinto natural language sentences,generating semanticall rich sentence embeddings.Next,it updated the subgraph embeddings using GCN andbidirectionalGRU,combiningsentenceandsubgraphembeddings tocapturebothstructuralandsemanticinformationExperimentalresultsonthree public datasets—WN18RR,FB15k-237,andNELL-995—demonstratethattheproposed method outperformsexisting methodsinbothtransformationandinductiverelationpredictiontasks,validatingtheimportanceof the dual-attention mechanismandsentence transformationin improving model performance.Thisapproach efectively enhances the accuracy and efficiency of relation prediction in knowledge graphs.

Key words:knowledge graph(KG);inductiverelation prediction;sentence Transformer;dual atention mechanism;random walk pathfinding strategy

0 引言

知识图谱(KG)是一种用于表示和存储客观世界知识的图形化知识库,通过三元组方式进行形式化描述,广泛应用于网络搜索[1]、社区检测[2]和推荐系统[3]等任务。然而,构建大规模知识图谱(如Freebase[4] YAGO[5] 和DBpedia[6])既耗时又费力,常导致图谱不完整,影响下游应用的性能,这就引起了对知识图谱补全任务的研究。

关系预测是知识图谱补全中的核心任务,旨在预测实体之间缺失的关系,以完善知识图谱。传统方法如KGT5[7]、Ex-pressivE[8]和DRR-GAT[9]通过将实体和关系映射到低维向量空间进行预测,取得了很好的性能。但由于对实体的依赖,上述方法被限制在转换设置中,其中测试集中的所有实体都可以在训练集中看到。然而,现实世界是不断发展的,随着新实体不断出现,基于转换的方法性能普遍下降。因此,研究人员将研究重点转向归纳设置中的关系预测,其中训练集和测试集中的实体完全不同。当前一些模型,如AMIE + [10]、NeuralLP[11]明确地挖掘逻辑规则进行归纳关系预测,具有良好的可解释性,但由于搜索空间大、优化离散化,性能受到限制。最近,一些基于子图的方法,如 GraIL[12] 、CoMPILE[13] TACT[14] ,利用相邻三元组构造的局部子图进行推理来隐式挖掘逻辑规则,推断两个实体之间的关系,利用图神经网络对提取的子图进行预测。

现有的归纳关系预测方法多侧重于通过实体间的关系路径进行推理,但在以下两个方面存在显著不足:a)语义信息建模不足。现有方法大多通过实体名称或简单的文本描述来表示实体的语义信息,难以全面表达实体的复杂语义特征。……

登录APP查看全文

猜你喜欢

三元组图谱实体
数字经济与实体经济融合发展的挑战与对策分析
有限域 Fpn 上完全置换多项式的构造
融合知识图谱的多行为职位推荐
基于生成对抗网络与渐进式融合的多模态实体对齐
构建微积分知识图谱 助推一流课程建设
基于深度学习的高中思想政治课程知识图谱构建及应用
1微米分辨率小鼠三维脑图谱问世
融合实体邻域信息的时序知识图谱实体对齐
无极拳第一路图谱