Session recommendation method of double-contrast learning and relation perception enhanced star graph

By employing a star-shaped graph approach that combines dual contrastive learning with relation-aware enhancement, we address the issues of insufficient relation differentiation and inadequate semantic alignment in conversational recommendation models, thereby achieving more efficient information dissemination and improved recommendation performance.

CN121542499APending Publication Date: 2026-02-17NANTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511645531.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-11
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing conversation recommendation models, when combining knowledge graphs and graph neural networks, fail to adequately distinguish the importance of different relationship types and lack a semantic alignment mechanism between the entity layer and the conversation layer, resulting in limited information dissemination and decreased recommendation performance.

Method used

We employ a star graph approach combining dual contrastive learning and relation-aware enhancement. Through star graph construction, knowledge-enhanced embedding, relation-aware attention aggregation, and dual contrastive learning stages, we provide self-supervised signals at the entity layer and the conversation layer, respectively. We explicitly learn the semantic contributions of different relation types and achieve semantic differentiation and information enhancement through weighted aggregation via an attention mechanism.

Benefits of technology

It significantly improves the model's structural expressiveness and semantic consistency, and enhances recommendation performance and generalization ability, especially the recommendation accuracy under highly sparse and short sequence conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121542499A_ABST
    Figure CN121542499A_ABST
Patent Text Reader

Abstract

The invention provides a session recommendation method for a double-contrast learning and relation perception enhanced star graph, and relates to the technical field of session recommendation. Comprising a star graph construction stage, a knowledge enhancement embedding stage, a relation perception attention aggregation stage, a double-contrast learning stage and a joint optimization and prediction stage, and solves the technical problems of insufficient relation distinguishing and insufficient semantic alignment in a session recommendation method based on the combination of a knowledge graph and a graph neural network in the prior art. According to the method, the structure expression ability and semantic consistency of the model can be improved at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of conversation recommendation technology, specifically a conversation recommendation method using a dual-contrast learning and relation-aware enhanced star graph. Background Technology

[0002] Session-based recommendation, which predicts the next potentially interesting item by analyzing the user's interaction sequence in a single session, has become one of the mainstream research paradigms in recommender systems. In recent years, graph neural networks (GNNs) have been widely applied to session recommendation tasks, learning high-order dependencies between items by modeling session sequences as graph structures. For example, methods such as SR-GNN and GC-SAN can capture local and global dependencies between nodes in the graph. However, due to the short duration of session sequences, graph structure data is often extremely sparse, with limited semantic connections between nodes, resulting in restricted information propagation and reduced recommendation performance. To alleviate the data sparsity problem, researchers have begun to introduce knowledge graphs (KGs) to enrich the semantic representation of items using external entities and relationships. Although the combination of KG and GNNs is relatively common in recommendation tasks, it still has the following two shortcomings:

[0003] (1) Existing models fail to adequately distinguish the importance of different relation types. In the process of information dissemination, the contributions of various relations (such as class attributes, co-occurrence relations, and hierarchical relations) are treated uniformly, making it difficult to reflect semantic differences.

[0004] (2) Most current methods use a single self-supervised or contrastive learning module to optimize only a single layer of representation. They lack a mechanism for semantic alignment at both the entity layer and the conversation layer, which limits the consistency and discriminability of the embedding space.

[0005] Therefore, how to strike a balance between enhancing relational distinctiveness and optimizing semantic alignment has become a key issue that urgently needs to be addressed in the field of conversation recommendation. Summary of the Invention

[0006] Therefore, this invention provides a conversation recommendation method based on dual contrastive learning and relation-aware enhanced star graphs to solve the technical problems of insufficient relation differentiation and inadequate semantic alignment in existing conversation recommendation methods based on the combination of knowledge graphs and graph neural networks. This method simultaneously improves the structural expressiveness and semantic consistency of the model.

[0007] The present invention provides a conversation recommendation method using a dual-contrast learning and relation-aware enhanced star graph, which mainly includes a star graph construction stage, a knowledge enhancement embedding stage, a relation-aware attention aggregation stage, a dual-contrast learning stage, and a joint optimization and prediction stage.

[0008] Furthermore, during the star schema construction phase, the user's session sequence is modeled as a star schema. Among them, the node set Includes each item node in the session (i.e., the items clicked by the user), and the central node representing global semantics. edge set This defines the directed connection between the project node and the central node. This structure effectively reduces redundant edges in traditional fully connected graphs, making information propagation more directional and semantically representative. Each project node... The set of neighbor nodes is represented as Session center node Connect all project nodes to capture the overall session intent.

[0009] Furthermore, to alleviate the problems of short session sequence length and insufficient semantic information of nodes, an external knowledge graph (KG) is introduced for semantic enhancement. The knowledge graph consists of entities and relations, and is structured using triples. This indicates that the head entity is... ,relation Tail-end entity Align project nodes in the session with entity nodes in the knowledge graph to supplement high-dimensional semantic features such as hierarchical relationships, attributes, and categories. Each project node... The set of one or more entity nodes corresponding to a knowledge graph is denoted as . Each entity node has an initial embedding vector. Through a learnable mapping matrix Perform feature transformation to obtain the initial semantic representation of the project nodes. :

[0010]

[0011] in This is a nonlinear transformation function. Through this process, the knowledge semantic space can be mapped to the conversation graph space, providing high-quality initial features for subsequent information dissemination.

[0012] Furthermore, in traditional graph neural networks, edges of different relation types are often treated equally, leading to insufficient semantic discrimination. To address this, a relation-aware attention aggregation mechanism is proposed, which assigns differentiated weights to different relation types during information propagation. For nodes... its first-order neighborhood Each edge in the array has a relation type. The embedding vector of the relation type is denoted as During feature propagation, the head node With tail node After passing through the mapping matrix respectively and Transformed into the same space, different relation types are then mapped using a specific matrix. Perform semantic adjustments. Neighboring nodes. Through relationships For nodes The degree of influence is measured by attention score express:

[0013]

[0014] in For relation type The corresponding learnable attention parameter vector, This represents a vector concatenation operation. LeakyReLU is the activation function used to maintain gradient stability.

[0015] Subsequently, attention weights are obtained through Softmax normalization. :

[0016]

[0017] This weight represents the importance of neighboring nodes to the target node under different relationship types.

[0018] Finally, the node feature update formula is:

[0019]

[0020] in It is a non-linear activation function. Indicates the node at the 1st Layer feature representation.

[0021] Through this relation-aware weighted aggregation method, the model can explicitly learn the semantic contributions of different relation types, thereby achieving semantic differentiation and information enhancement in graph structure propagation.

[0022] Furthermore, to enhance the discriminativeness and consistency of the model, a dual contrastive learning mechanism at the entity level and the conversation level was designed, providing self-supervised signals at the knowledge layer and the conversation layer, respectively.

[0023] (1) Entity-level comparative learning

[0024] Embedding for each entity in the knowledge graph Sample semantically similar positive samples from their neighborhood. And sample irrelevant negative samples from non-neighborhoods. By maximizing positive sample similarity and minimizing negative sample similarity, a contrastive loss is constructed for the entity layer. :

[0025]

[0026] in, Represents the cosine similarity function. This is a temperature coefficient used to adjust the smoothness of the softmax distribution.

[0027] (2) Conversation-level contrastive learning

[0028] For session embedding Two enhanced views are generated through random occlusion and project perturbation. and And maximize the consistency between the two in the embedding space:

[0029]

[0030] This module enhances the model's robustness in modeling conversational semantics.

[0031] Furthermore, considering both the recommendation prediction loss and the dual-contrast learning loss, the overall optimization objective is defined as follows:

[0032]

[0033] in, Recommended prediction loss (which can be in the form of cross-entropy or negative log-likelihood) is used to measure the consistency between the model's predicted items and the actual clicked items. , It is a balancing hyperparameter used to adjust the relative weights of the contrastive learning task and the main recommendation task.

[0034] Through joint optimization, the model can enhance semantic consistency and structural robustness while maintaining prediction accuracy. Finally, after multiple layers of iterative propagation and optimization, the model output node embeddings... and session embedding Used to calculate the recommendation probability of candidate items .

[0035] The present invention has the following advantages over the prior art:

[0036] 1. The present invention provides a conversation recommendation method based on dual contrastive learning and relation-aware enhanced star graphs. By introducing a relation-aware attention aggregation mechanism, independent learnable weights are assigned to different types of relations (such as project association, attribute connection, upstream and downstream interaction, etc.), thereby realizing dynamic differentiation and weighted aggregation of relation-level semantics and effectively alleviating the semantic ambiguity problem caused by relation mixing in traditional graph neural networks.

[0037] 2. This invention provides a conversation recommendation method based on dual contrastive learning and relation-aware enhanced star graphs. It designs an entity-level and conversation-level dual contrastive learning mechanism, introducing self-supervised signals at both the knowledge entity layer and the conversation representation layer to achieve consistency constraints in the multi-layer embedding space. This mechanism improves the discriminativeness and robustness of conversation representations while maintaining entity semantic aggregation, thus capturing stable user preference patterns even under highly sparse and short sequence conditions, significantly improving recommendation performance and generalization ability. Attached Figure Description

[0038] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0039] Figure 1 This is a diagram of the star graph neural network framework for dual contrast learning and relation-aware enhancement of the present invention.

[0040] Figure 2 An example of embedding a star diagram to enhance the knowledge of this invention;

[0041] Figure 3 This is a flowchart of the star graph neural network for dual contrast learning and relational perception enhancement of the present invention. Detailed Implementation

[0042] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0043] Example 1

[0044] Reference Figures 1 to 2 This invention provides a conversation recommendation method based on dual-contrast learning and relation-aware enhanced star graphs. The invention mainly includes: a star graph construction stage, a knowledge enhancement embedding stage, a relation-aware attention aggregation stage, a dual-contrast learning stage, and a joint optimization and prediction stage.

[0045] During the star schema construction phase, the user's session sequence is modeled as a star schema. ,like Figure 2 As shown. The node set... Includes each item node in the session (i.e., the items clicked by the user), and the central node representing global semantics. edge set This defines the directed connection between the project node and the central node. This structure effectively reduces redundant edges in traditional fully connected graphs, making information propagation more directional and semantically representative. Each project node... The set of neighbor nodes is represented as Session center node Connect all project nodes to capture the overall session intent.

[0046] To alleviate the problems of short session sequence length and insufficient semantic information of nodes, this invention introduces an external knowledge graph (KG) for semantic enhancement. The knowledge graph consists of entities and relations, and is structured using triples. This indicates that the head entity is... ,relation Tail-end entity Align project nodes in the session with entity nodes in the knowledge graph to supplement high-dimensional semantic features such as hierarchical relationships, attributes, and categories. Each project node... The set of one or more entity nodes corresponding to a knowledge graph is denoted as . Each entity node has an initial embedding vector. Through a learnable mapping matrix Perform feature transformation to obtain the initial semantic representation of the project nodes. :

[0047]

[0048] in This is a nonlinear transformation function. Through this process, the knowledge semantic space can be mapped to the conversation graph space, providing high-quality initial features for subsequent information dissemination.

[0049] In traditional graph neural networks, edges of different relation types are often treated equally, leading to insufficient semantic discrimination. To address this, this invention proposes a relation-aware attention aggregation mechanism that assigns differentiated weights to different relation types during information propagation. For nodes... its first-order neighborhood Each edge in the array has a relation type. The embedding vector of the relation type is denoted as During feature propagation, the head node With tail node After passing through the mapping matrix respectively and Transformed into the same space, different relation types are then mapped using a specific matrix. Perform semantic adjustments. Neighboring nodes. Through relationships For nodes The degree of influence is measured by attention score express:

[0050]

[0051] in For relation types The corresponding learnable attention parameter vector, This represents a vector concatenation operation. LeakyReLU is the activation function used to maintain gradient stability.

[0052] Subsequently, attention weights are obtained through Softmax normalization. :

[0053]

[0054] This weight represents the importance of neighboring nodes to the target node under different relationship types.

[0055] Finally, the node feature update formula is:

[0056]

[0057] in It is a non-linear activation function (such as ReLU). Indicates the node at the 1st Layer feature representation.

[0058] Through this relation-aware weighted aggregation method, the model can explicitly learn the semantic contributions of different relation types, thereby achieving semantic differentiation and information enhancement in graph structure propagation.

[0059] To further enhance the discriminativeness and consistency of the model, this invention designs a dual-contrast learning mechanism at the entity level and the conversation level, providing self-supervised signals at the knowledge layer and the conversation layer, respectively.

[0060] (1) Entity-level comparative learning

[0061] Embedding for each entity in the knowledge graph Sample semantically similar positive samples from their neighborhood. And sample irrelevant negative samples from non-neighborhoods. By maximizing positive sample similarity and minimizing negative sample similarity, a contrastive loss is constructed for the entity layer:

[0062]

[0063] in, Represents the cosine similarity function. This is a temperature coefficient used to adjust the smoothness of the softmax distribution.

[0064] (2) Conversation-level contrastive learning

[0065] For session embedding Two enhanced views are generated through random occlusion and project perturbation. and And maximize the consistency between the two in the embedding space:

[0066]

[0067] This module enhances the model's robustness in modeling conversational semantics.

[0068] This invention comprehensively considers both recommendation prediction loss and dual-contrast learning loss, and defines an overall optimization objective:

[0069]

[0070] in, Recommended prediction loss (which can be in the form of cross-entropy or negative log-likelihood) is used to measure the consistency between the model's predicted items and the actual clicked items. , It is a balancing hyperparameter used to adjust the relative weights of the contrastive learning task and the main recommendation task.

[0071] Through joint optimization, the model can enhance semantic consistency and structural robustness while maintaining prediction accuracy. Finally, after multiple layers of iterative propagation and optimization, the model output node embeddings... and session embedding Used to calculate the recommendation probability of candidate items .

[0072] Example 2

[0073] This embodiment conducts validation experiments on three public session recommendation datasets: Yoochoose1 / 64, Diginetica, and Last-FM. For evaluation metrics, accuracy (P@K) and mean reciprocal rank (MRR@K) are used to assess the accuracy of the model's recommendation results, and the improvement (Improve.%) is used to measure the overall performance improvement.

[0074] To verify the effectiveness of the method of this invention, ten mainstream conversation recommendation baseline models were selected for comparison, including S-POP, Item-KNN, BPR-MF, GRU4REC, NARM, STAMP, RepeatNet, SR-GNN, SGNN-HN, and COTREC. The performance of these models was compared with the conversation recommendation method based on dual contrastive learning and relation-aware enhanced star graph proposed in this invention. The experimental results are shown in Table 1 below.

[0075] Table 1: Performance Comparison Table of Baseline Model and the Recommended Framework of this Invention

[0076]

[0077] Taking the COTREC model as an example, evaluation results on the Diginetica dataset show that after incorporating the mechanism of this invention, the model improves by 2.60% and 5.67% on the metrics P@20 and MRR@20, respectively, which measure recommendation accuracy. On the Yoochoose1 / 64 and Last-FM datasets, the improvements are 1.39% / 3.19% and 0.52% / 3.68%, respectively. This demonstrates that the relationship-aware attention aggregation mechanism and entity-conversation dual-contrast learning strategy proposed in this invention can significantly improve recommendation accuracy and ranking precision in different scenarios.

[0078] Example 3

[0079] To verify the effectiveness of each key module in this invention, multiple ablation experiments were designed, removing the star graph structure (KGE-SGNN-S), knowledge graph augmentation (KGE-SGNN-K), relation-aware attention mechanism (KGE-SGNN-R), and dual-contrast learning module (KGE-SGNN-D), respectively. The models were tested on the Yoochoose1 / 64, Diginetica, and Last-FM datasets. Table 2 below shows that removing any module resulted in varying degrees of performance degradation in P@20 and MRR@20 metrics. Removing relation-aware attention and dual-contrast learning modules caused the most significant performance drops, averaging approximately 2%–3%. In contrast, the complete model of this invention achieved P@20 and MRR@20 scores of 54.45 and 19.20, respectively, on the Diginetica dataset, representing an overall performance improvement of approximately 3%–6% compared to the best baseline model. The results demonstrate that the star graph structure, knowledge graph enhancement, relation-aware aggregation, and dual-contrast learning modules have a significant synergistic effect in alleviating data sparsity, strengthening semantic distinction, and improving recommendation accuracy. Overall, this invention achieves a dual improvement in conversation recommendation performance and model generalization ability.

[0080] Table 2: Performance Comparison Table of Ablation Experiments of the Invention

[0081]

[0082] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.

Claims

1. A method for session recommendation of star graph enhanced by dual contrastive learning and relationship awareness, characterized in that, Comprising the following steps: S1: Star graph construction stage, modeling the user's session sequence as a star structure graph; S2: Knowledge enhanced embedding stage, introducing an external knowledge graph for semantic enhancement; S3: Relationship-aware attention aggregation stage, proposing a relationship-aware attention aggregation mechanism to assign different weights to different relationship types during information propagation; S4: Dual contrast learning stage, proposing an entity-level and session-level dual contrast learning mechanism to provide self-supervised signals at the knowledge level and the session level; S5: Joint optimization and prediction stage, comprehensively consider the recommendation prediction loss and double contrast learning loss, define the overall optimization target, through joint optimization, the model maintains the prediction accuracy while enhancing the semantic consistency and structural robustness, finally, after multiple iteration propagation and optimization, the model outputs the node embedding and session embedding , used to calculate the recommendation probability of the candidate item .

2. The conversation recommendation method of claim 1, wherein, In the step S1, the star structure graph is represented as ; where the set of nodes contains each item node in the session , and a center node representing the global semantics ; the set of edges defines the directed connections between the item nodes and the center node .

3. The conversation recommendation method of claim 2, wherein, The knowledge graph in the step S2 is composed of entities and relations, and is represented by a triple , that is, a head entity , a relation , and a tail entity ; the item nodes in the conversation are aligned with the entity nodes in the knowledge graph, and the hierarchical relationship, attributes, and category high-dimensional semantic features of the item are supplemented.

4. The conversation recommendation method of claim 3, wherein, In the step S3, for each node , each edge in the first-order neighborhood of the node is associated with a relation type , and an embedding vector of the relation type is denoted as . In the feature propagation, the head node and the tail node are respectively converted to the same space through mapping matrices and , and different relation types are adjusted in semantics through a specific mapping matrix .

5. The conversation recommendation method of claim 4, wherein, In the step S4, an embedding is obtained for each entity in the knowledge graph , sampling positive samples with similar semantics from the neighborhood of each entity , and sampling negative samples with no relation from non-neighborhood ; constructing a contrastive loss of the entity layer by maximizing the similarity of positive samples and minimizing the similarity of negative samples : wherein, denotes the cosine similarity function, is a temperature coefficient, used to adjust the degree of smoothing of the softmax distribution.

6. The conversation recommendation method of claim 5, wherein, In said step S4, for the session embedding Two augmented views are generated by random masking, item perturbation, etc. and and maximizing their consistency in the embedding space: 。 7. The conversation recommendation method of claim 6, wherein, In the step S5, the overall optimization target is: ; wherein, a recommendation prediction loss, measuring the consistency between the model's predicted items and the real clicked items; , is a balance hyper-parameter, used to adjust the relative weight of the contrast learning task and the main recommendation task.

8. A computer readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the dual contrast learning and relationship-aware enhanced star graph session recommendation method of any one of claims 1 to 8.