Few-shot knowledge graph completion aims to infer unseen queries for a target relation with only a few support triples. This study proposed a relation-aware semantic modeling method. It integrated global structural context and local neighborhood semantics of triples to create expressive relation-specific representations. The method used a context path generator to extract multi-hop dependency paths. It also employed a multi-scale graph encoder to capture global semantic structure and local entity features. A semantic matching aggregation module aligned query triples with support triples under each relation. Experiments on NELL-One and Wiki-One datasets showed consistent improvement over existing methods on multiple metrics. For the five-shot setting on NELL-One, it increased mean reciprocal rank, Hits@10, Hits@5, and Hits@1 by 3.8%, 2.4%, 2.2%, and 4.3%, respectively. The results demonstrate the method's effectiveness and robustness in handling sparse neighborhoods and relation ambiguity in few-shot scenarios.
知识图谱本质上是由海量事实构成的多关系网络,其基本单位为三元组(头实体,关系,尾实体),记为。例如,三元组(爱因斯坦,出生地,德国)表明“爱因斯坦的出生地是德国”。当前,以YAGO(Yet Another Great Ontology)[1]、NELL(Never-ending Language Learner)[2]和Wikidata[3]为代表的大规模知识图谱,已在问答系统[4]、语义搜索[5]、信息抽取[6]等下游任务中广泛应用。尽管知识图谱规模庞大,但其构建依赖有限文本导致事实覆盖不全,需通过知识图谱补全推断新三元组。
平移模型将关系解释为实体对之间的几何平移操作,并构建基于距离的评分函数。TransE(Translating Embeddings)[6]作为该领域的开创性工作,将关系建模为连接头尾实体的平移向量,实现了高效知识表示,但其难以处理一对多、多对一等复杂关系模式。为此,TransH(Translation on Hyperplanes)[13]通过引入关系特定超平面,使实体在不同关系下具备差异化表示。TransR(Translation in Relation Space)[14]进一步采用实体空间与关系空间分离的矩阵投影机制,提升了对多语义实体和复杂关系的建模能力。
1) 基于元度量学习的方法:GMatching[11]作为首个FKGC研究,利用邻居编码器融合直接邻居信息学习实体表示;FSRL(Few-shot Relation Learning Model)[24]将其进一步深化,引入注意力机制对直接邻居进行差异化权重编码;FAAN(Adaptive Attentional Network for Few-Shot KG completion)[12]提出实体表示应具备关系自适应性,学习动态属性表示;FCC(Few-shot Knowledge Graph Completion Framework Through Complementary Diverse Feature Learning and Consistent Relation Modeling)[25]通过双分支特征提取器获取互补实体表示,并引入结构关系建模,解决了FKGC中的关系表示不一致问题。
2) 基于元学习的方法:MetaR(Meta Relational Learning)[9]通过关系元学习器从实体对嵌入中生成关系元信息,实现新关系的快速梯度更新学习;GANA-MTransH(Gated and Attentive Neighbor Aggregator with Meta-learning-based TransH)[26]沿袭相似思路,但通过关系特定超平面参数建模复杂关系;SMetaR(Simple and Effective Meta Relational Learning Model)[27]采用基于线性模型的元关系学习器和TransH翻译模型,有效保留少样本关系特征并处理复杂关系。
SuchanekF M, KasneciG, WeikumG. Yago: A Core of Semantic Knowledge[C]//Proceedings of the 16th International Conference on World Wide Web. New York: ACM, 2007: 697-706. DOI: 10.1145/1242572.1242667 .
[2]
CarlsonA, BetteridgeJ, KisielB, et al. Toward an Architecture for Never-ending Language Learning[J]. Proc AAAI Conf Artif Intell, 2010, 24(1): 1306-1313. DOI: 10.1609/aaai.v24i1.7519 .
SinghalK, TuT, GottweisJ, et al. Toward Expert-level Medical Question Answering with Large Language Models[J]. Nat Med, 2025, 31(3): 943-950. DOI: 10.1038/s41591-024-03423-7 .
[5]
XiongC Y, PowerR, CallanJ. Explicit Semantic Ranking for Academic Search via Knowledge Graph Embedding[C]//Proceedings of the 26th International Conference on World Wide Web. International World Wide Web Conferences Steering Committee. Geneva: IW 3C2. 2017: 1271-1279. DOI: 10.1145/3038912.3052558 .
[6]
BordesA, UsunierN, Garcia-duranA, et al. Translating Embeddings for Modeling Multi-relational Data[C]//Proceedings of the 27th International Conference on Neural Information Processing Systems, Red Hook: Curran Associates, Inc. 2013, 2787-2795.
[7]
TrouillonT, WelblJ, RiedelS, et al. Complex Embeddings for Simple Link Prediction[PP/OL]. (2016-06-20)[2025-08-05].
[8]
ZhangW, PaudelB, WangL, et al. Iteratively Learning Embeddings and Rules for Knowledge Graph Reasoning[C]//The World Wide Web Conference. New York: ACM, 2019: 2366-2377. DOI: 10.1145/3308558.3313612 .
[9]
ChenM Y, ZhangW, ZhangW, et al. Meta Relational Learning for Few-shot Link Prediction in Knowledge Graphs[C]//Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP). Stroudsburg, PA, USA: ACL, 2019: 4216-4225. DOI: 10.18653/v1/d19-1431 .
[10]
GuoL, SunZ, HuW. Learning to Exploit Long-term Relational Dependencies in Knowledge Graphs[C]//International Conference on Machine Learning. Cambridge: PMLR, 2019: 2505-2514.
[11]
XiongW H, YuM, ChangS Y, et al. One-shot Relational Learning for Knowledge Graphs[C]//Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing. Stroudsburg, PA, USA: ACL, 2018: 1980-1990. DOI: 10.18653/v1/d18-1223 .
[12]
ShengJ W, GuoS, ChenZ Y, et al. Adaptive Attentional Network for Few-shot Knowledge Graph Completion[C]//Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP). Stroudsburg, PA, USA: ACL, 2020: 1681-1691. DOI: 10.18653/v1/2020.emnlp-main.131 .
[13]
WangZ, ZhangJ W, FengJ L, et al. Knowledge Graph Embedding by Translating on Hyperplanes[J]. Proc AAAI Conf Artif Intell, 2014, 28(1): 1112-1119. DOI: 10.1609/aaai.v28i1.8870 .
[14]
LinY K, LiuZ Y, SunM S, et al. Learning Entity and Relation Embeddings for Knowledge Graph Completion[J]. Proc AAAI Conf Artif Intell, 2015, 29(1): 2181-2187. DOI: 10.1609/aaai.v29i1.9491 .
[15]
NickelM, TrespV, KriegelH P. A Three-way Model for Collective Learning on Multi-relational Data[C]//ICML. New York: ACM, 2011, 11(10.5555): 3104482-3104584.
[16]
YangB, YihW, HeX, et al. Embedding Entities and Relations for Learning and Inference in Knowledge Bases[C]//Proceedings of the International Conference on Learning Representations (ICLR). San Diego: ICLR, 2015.
[17]
DongX, GabrilovichE, HeitzG, et al. Knowledge Vault: a Web-scale Approach to Probabilistic Knowledge Fusion[C]//Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. New York: ACM, 2014: 601-610. DOI: 10.1145/2623330.2623623 .
[18]
NguyenD Q, NguyenT D, NguyenD Q, et al. A Novel Embedding Model for Knowledge Base Completion Based onConvolutional Neural Network[C]//Proceedings of the 2018 Conference of the North American Chapter Ofthe Association for Computational Linguistics: Human LanguageTechnologies, Volume 2 (Short Papers). Stroudsburg, PA, USA: ACL, 2018: 327-333.. DOI: 10.18653/v1/n18-2053 .
SchlichtkrullM, KipfT N, BloemP, et al. Modeling Relational Data with Graph Convolutional Networks[M]//The Semantic Web. Cham: Springer International Publishing, 2018: 593-607. DOI: 10.1007/978-3-319-93417-4_38 .
[21]
LuoP F, ZhuX, XuT, et al. Semantic Interaction Matching Network for Few-shot Knowledge Graph Completion[J]. ACM Trans Web, 2024, 18(2): 1-19. DOI: 10.1145/3589557 .
[22]
MohamedS K, NováčekV, NounuA. Discovering Protein Drug Targets Using Knowledge Graph Embeddings[J]. Bioinformatics, 2020, 36(2): 603-610. DOI: 10.1093/bioinformatics/btz600 .
[23]
MaR X, YuM F, GaoB Y, et al. Enhancing Path Information with Reinforcement Learning for Few-shot Knowledge Graph Completion[C]//2023 IEEE 29th International Conference on Parallel and Distributed Systems (ICPADS). New York: IEEE, 2023: 1603-1611. DOI: 10.1109/ICPADS60453.2023.00225 .
LiuJ, FanC F, ZhouF Y, et al. Complete Feature Learning and Consistent Relation Modeling for Few-shot Knowledge Graph Completion[J]. Expert Syst Appl, 2024, 238: 121725. DOI: 10.1016/j.eswa.2023.121725 .
[26]
NiuG L, LiY, TangC G, et al. Relational Learning with Gated and Attentive Neighbor Aggregator for Few-shot Knowledge Graph Completion[C]//Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval. New York: ACM, 2021: 213-222. DOI: 10.1145/3404835.3462925 .
[27]
ChenS J, YangB, ZhaoC X. Simple and Effective Meta Relational Learning for Few-shot Knowledge Graph Completion[J]. Optim Eng, 2025, 26(2): 869-889. DOI: 10.1007/s11081-024-09880-w .