食品科学 ›› 2026, Vol. 47 ›› Issue (12): 31-41.doi: 10.7506/spkx1002-6630-20251213-104

• 基础研究 • 上一篇    

基于邻域增强的大语言模型的食品安全标准知识图谱补全方法

毛典辉,马华宜,张金垚,赵志华   

  1. (1.北京工商大学计算机与人工智能学院,北京 100048;2.中国政法大学法学院,北京 102249)
  • 发布日期:2026-07-08
  • 基金资助:
    教育部人文社科基金规划项目(23YJAZH216)

A Method for Completing Food Safety Standards Knowledge Graphs Based on Neighborhood-Enhanced Large Language Model

MAO Dianhui, MA Huayi, ZHANG Jinyao, ZHAO Zhihua   

  1. (1. School of Computer and Artificial Intelligence, Beijing Technology and Business University, Beijing 100048, China;2. The Law School, China University of Political Science and Law, Beijing 102249, China)
  • Published:2026-07-08

摘要: 本研究提出基于邻域增强的大语言模型(large language model,LLM)知识图谱补全框架(neighborhood-enhanced large language model-knowledge graph completion,NELLM-KGC),旨在增强对食品安全标准领域复杂关联的推理能力。NELLM-KGC首先采用图结构化表示方式高效整合法规、标准限值、检测方法等关键异构数据,构建中文食品安全标准知识图谱。其次,采用引导式方法将传统的KGC任务转化为自然语言问答形式,并通过指令微调策略优化模型对中文食品标准领域任务的适应能力。为了提升推理的精确性,NELLM-KGC基于图剪枝算法设计了邻域信息融合机制,依托知识图谱检索器与LLM的双阶段筛选,从实体邻域中精准捕获与推理路径强相关的前m 个邻域节点信息(Top-m)证据链并进行精细化微调。本研究在公共知识图谱数据集(如FB15k-237、WN18RR)和自定义的食品安全标准数据集上进行了广泛验证,结果表明,NELLM-KGC在三元组分类准确率、实体预测Hits@1和关系预测Hits@1等关键指标上均表现出较好的性能,证明了该框架的有效性。

关键词: 食品安全监管;知识图谱;大语言模型;指令微调;知识图谱补全

Abstract: This paper proposed a neighborhood-enhanced large language model-based knowledge graph completion framework (NELLM-KGC), designed to enhance reasoning capabilities regarding complex relationships within the field of food safety standards. NELLM-KGC first employed a graph-structured representation to efficiently integrate key heterogeneous data such as regulations, standard limits, and testing methods, thereby constructing a knowledge graph of Chinese food safety standards. Secondly, NELLM-KGC employed a guided approach to transform the conventional KGC task into a natural language question-answering format. It further enhanced the model’s adaptability to Chinese food standards domain tasks through an instruction-tuning strategy. To enhance reasoning accuracy, NELLM-KGC designed a neighborhood information fusion mechanism based on graph pruning algorithms. Leveraging a two-stage screening process involving KG retrievers and LLMs, it precisely captured Top-m evidence chains strongly correlated with inference paths from entity neighborhoods and performs fine-tuning. We conducted extensive validation on public knowledge graph datasets such as FB15k-237 and WN18RR, as well as customized food safety standards datasets. Experimental results demonstrated that the NELLM-KGC framework exhibited favorable performance across key metrics including triplet classification accuracy, entity prediction Hits@1, and relation prediction Hits@1, thereby validating the efficacy of the framework.

Key words: food safety regulation; knowledge graph; large language model; instruction fine-tuning; knowledge graph completion

中图分类号: