This paper designs and implements an explainable recommendation model that integrates knowledge graphs with structure-aware attention mechanisms. The model is built on graph neural networks and incorporates a multi-hop neighbor aggregation strategy. By integrating the structural information of knowledge graphs and dynamically assigning importance to different neighbors through an attention mechanism, the model enhances its ability to capture implicit preference relationships. In the proposed method, users and items are embedded into a unified graph structure. Multi-level semantic paths are constructed based on entities and relations in the knowledge graph to extract richer contextual information. During the rating prediction phase, recommendations are generated through the interaction between user and target item representations. The model is optimized using a binary cross-entropy loss function. Experiments conducted on the Amazon Books dataset validate the superior performance of the proposed model across various evaluation metrics. The model also shows good convergence and stability. These results further demonstrate the effectiveness and practicality of structure-aware attention mechanisms in knowledge graph-enhanced recommendation.
翻译:本文设计并实现了一种融合知识图谱与结构感知注意力机制的可解释推荐模型。该模型基于图神经网络构建,并采用多跳邻居聚合策略。通过整合知识图谱的结构信息,并利用注意力机制动态分配不同邻居的重要性,模型增强了捕捉隐式偏好关系的能力。在所提方法中,用户与物品被嵌入统一的图结构中。基于知识图谱中的实体与关系构建多层级语义路径,以提取更丰富的上下文信息。在评分预测阶段,通过用户与目标物品表征的交互生成推荐。模型使用二元交叉熵损失函数进行优化。在Amazon Books数据集上进行的实验验证了所提模型在多种评估指标上的优越性能。模型同时表现出良好的收敛性与稳定性。这些结果进一步证明了结构感知注意力机制在知识图谱增强推荐中的有效性与实用性。