Session recommendation system improvement method based on graph algorithm
By adopting improved methods based on graph algorithm in the recommendation system, constructing conversation graphs and global graphs, improving the adjacency matrix and utilizing attention mechanisms, the shortcomings of the existing recommendation system in generalization capabilities and personalized recommendations are solved, and more accurate and personalized recommendation effects are achieved.
Patent Information
- Application Number
- CN202510080899.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-05-16
AI Technical Summary
Existing recommendation systems have shortcomings in generalization capabilities and personalized recommendations, especially when dealing with sparse user behavior and not taking advantage of user and material attribute characteristics.
The improvement method of the session recommendation system based on graph algorithm is adopted, and the adjacency matrix is improved by constructing the session graph and the global graph, the attention mechanism is used to learn the weights between nodes, and the session representation is obtained in combination with the context to achieve more accurate recommendations.
It improves the accuracy and effectiveness of the recommendation system, can better explore data value, discover potential relationships, and improve the personalization and generalization capabilities of recommendations.
Smart Images

Figure CN120011629A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of graph algorithms, and specifically relates to a method for improving a conversation recommendation system based on a graph algorithm. Background Art
[0002] The recommendation system is based on complex scenarios, rich users and massive features, and aims to better serve users by understanding user behavior through big data. The development history of its related technologies is as follows: In 1992, Xerox proposed a recommendation system based on collaborative filtering algorithm for spam filtering, and in 2003, Amazon used it in e-commerce, which was the beginning of the real recommendation system. Collaborative filtering is divided into two types: user and product. Amazon uses ItemCF based on products. Because its user behavior data is sparse, collaborative filtering has strong interpretability but insufficient generalization, which easily makes the tail products not recommended. In 2006, Netflix proposed matrix decomposition technology to enhance generalization ability. Logistic regression can solve the collaborative filtering problem, with low computational complexity, strong interpretability and covering more features. In 2010, Osaka University proposed the FM model to capture second-order cross features, which became mainstream after 2012. In 2014, Facebook proposed the GBDT+LR solution, which made the recommendation algorithm enter the feature engineering modeling stage, but GBDT cannot be well parallelized. In 2015, deep learning technology was used in recommendation systems, such as Deep&Crossing and its variant PNN. Wide&Deep has both "memory" and generalization capabilities. In addition, sequence modeling is used to capture time series information, such as DIN, DIEN, and MIMN, which is of great significance in special scenarios such as conversational recommendations and anonymous recommendations. However, existing technologies have obvious shortcomings. Collaborative filtering technology is the beginning of the recommendation system. Although it is simple to implement and highly interpretable, it has weak generalization ability and cannot provide personalized recommendations for users with sparse behavior. Matrix decomposition also has shortcomings. Its generalization ability is not strong enough, nonlinear features cannot be fully fitted, and its interpretability is poor. Like collaborative filtering, it only relies on user behavior data and does not utilize user and material attribute features. Logistic regression can solve some problems, but it cannot perform feature crossover and has weak expression ability. Important feature patterns such as gender and age combinations cannot be captured. Feature crossover technology has gone through multiple stages and has advantages, but it ignores sequence information. Sequence modeling opens up new channels for obtaining information, but it still does not fully utilize data. After 2016, graph-based recommendation research emerged. It can contain sequence information and build user and material social networks to achieve more personalized recommendations. This is the technical improvement basis of the patent of this invention. Summary of the invention
[0003] The purpose of the present invention is to provide an improved method for a conversation recommendation system based on a graph algorithm to solve the problems raised in the above background technology.
[0004] In order to achieve the above object, the present invention provides the following technical solution: The specific steps of a method for improving a conversation recommendation system based on a graph algorithm are as follows:
[0005] S1: User click data is represented by: Let V = {v1, v2, ..., v m} represents all item items, use Represents each anonymous session Session, which consists of user click items arranged in chronological order, where Represents the item clicked in session S, where S has length L;
[0006] S2: Construct a session graph: Construct each session sequence into a session graph. Let G s =(V s ,E s ) is its corresponding session graph;
[0007] S3: Construct global graph related definitions: construct a global graph through the session graph, where the global graph related definitions are defined as defining neighbor sets and global-level item transformation definitions;
[0008] S4: Improved adjacency matrix: for each node v i , adjacent edges generate weights to distinguish v j Neighbor importance, only retain the first N edges and perform shortest path conversion, improving weight information into distance information;
[0009] S5: Linear combination of items based on session attention scores: Linear combination of items based on session attention scores, the formula is Where π(v i ,v j ) represents different importance weights, For project v i The set of neighbors in the graph g, and the edge (v i ,v j )’s weights are trainable parameters;
[0010] S6: Using attention mechanism to learn weights between nodes: Given that the neighbors of items in the conversation graph have different importance to themselves, the weights between different nodes are learned through the attention mechanism. ij v represents the node j Feature pair node v j The importance of LeakyRelu is used as the activation function here;
[0011] S7: Combine the context to obtain and calculate the session representation: For each item, first combine the global context and the session context to obtain its representation, and then calculate the final session representation through sum pooling.
[0012] Preferably, the user click data in S1 is represented by V={v1,v2,…,v m} represents all item items, use Represents each anonymous session Session, which consists of user click items arranged in chronological order, where Represents the item clicked in session S, where S has length L.
[0013] Preferably, constructing the session graph in S2 refers to constructing each session sequence as a session graph Graph for learning the embeddings of the items in the current session through GNN. Let G s =(V s ,E s ) is its corresponding session graph, where V s is the set of items clicked in S, represents an edge set, where each edge represents two adjacent edges in S
[0014] Preferably, constructing the global graph related definition in S3 refers to having two definitions, which are divided into defining neighbor sets: where i' is the session S q Medium, Items The order in which they are located, ε is a hyperparameter used to control the short-distance conversion of items in the conversation model; the global level item conversion definition is: {(v i ,v j )|v i ,v j ∈V;v j ∈N ε (v i )}.
[0015] Preferably, the improved adjacency matrix in S4 refers to an adjacency matrix improved based on the shortest path for each node v i , adjacent edges generate weights to distinguish v j Neighbor importance, only retains the first N edges and performs shortest path conversion, improving weight information into distance information.
[0016] Preferably, the linear combination of items based on the conversation attention score in S5 refers to a linear combination of items according to the conversation attention score, and the formula is: Where π(v i ,v j) represents different importance weights, For project v i The set of neighbors in the graph g, and the edge (v i ,v j ) are trainable parameters.
[0017] Preferably, the use of the attention mechanism to learn the weights between nodes in S6 refers to learning the weights between different nodes through the attention mechanism in view of the different importance of the neighbors of the items in the conversation graph to themselves. ij v represents the node j Feature pair node v j The importance of , LeakyRelu is used here as the activation function.
[0018] Preferably, the step of obtaining and calculating the session representation in combination with the context in S7 means that for each item, the representation is first obtained by combining the global context and the session context, and then the final session representation is calculated by the sum pool. Specifically, the session sequence is input into the graph neural network to obtain the representation of the items in the session, that is, We learn the corresponding weights through a soft attention mechanism: Finally, the session representation is obtained based on the linear combination project:
[0019] The beneficial effects of the present invention are as follows:
[0020] 1. This invention optimizes data utilization and mining association patterns to address the shortcomings of sequence recommendation in utilizing data information and mining association patterns. Based on the conversational recommendation (anonymous recommendation) scenario and sequence recommendation technology, an improvement plan is proposed to enable the recommendation system to better mine data value, discover potential associations, and improve the accuracy and effectiveness of recommendations.
[0021] 2. The present invention improves information expression by improving the adjacency matrix. The single 0 / 1 adjacency matrix is improved into a weighted adjacency matrix with the shortest distance as the weight. The shortest path algorithm is used to enrich the information expression capability of the adjacency matrix, which helps to capture potential relationship patterns and provide more basis for more accurate recommendations.
[0022] 3. The present invention improves the problem of node information convergence and loss of feature extraction capability caused by the simple adjacent node information aggregation method of GCN3-rank when the number of layers increases. By adding attention during information aggregation, the feature extraction capability of the system is maintained and improved, thereby ensuring the performance of the recommendation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 This is a flow chart of a method for improving a conversation recommendation system based on a graph algorithm according to the present invention;
[0024] Figure 2 It is the experimental result figure of the present invention;
[0025] Figure 3 This is an improved schematic diagram of the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] like Figures 1 to 3 As shown, the specific steps of the embodiment of the present invention providing a method for improving a conversation recommendation system based on a graph algorithm are as follows:
[0028] S1: User click data is represented by: Let V = {v1, v2, ..., v m} represents all item items, use Represents each anonymous session Session, which consists of user click items arranged in chronological order, where Represents the item clicked in session S, where S has length L;
[0029] S2: Construct a session graph: Construct each session sequence into a session graph. Let G s =(V s ,E s ) is its corresponding session graph;
[0030] S3: Construct global graph related definitions: construct a global graph through the session graph, where the global graph related definitions are defined as defining neighbor sets and global-level item transformation definitions;
[0031] S4: Improved adjacency matrix: for each node v i , adjacent edges generate weights to distinguish v j Neighbor importance, only retain the first N edges and perform shortest path conversion, improving weight information into distance information;
[0032] S5: Linear combination of items based on session attention scores: Linear combination of items based on session attention scores, the formula is Where π(v i ,v j ) represents different importance weights, For project v iThe set of neighbors in the graph g, and the edge (v i ,v j )’s weights are trainable parameters;
[0033] S6: Using attention mechanism to learn weights between nodes: Given that the neighbors of items in the conversation graph have different importance to themselves, the weights between different nodes are learned through the attention mechanism. ij v represents the node j Feature pair node v j The importance of LeakyRelu is used as the activation function here;
[0034] S7: Combine the context to obtain and calculate the session representation: For each item, first combine the global context and the session context to obtain its representation, and then calculate the final session representation through sum pooling.
[0035] In summary, we use two ranking-based evaluation metrics, P@N and MRR@N. P@N represents the accuracy of the top n results, specifically where y i =0, 1 indicates whether the i-th result is correct, MRR@N for each query q i , remember that the first relevant result is ranked at position k i , that is, rank is k i , then the score y (ReciprocalRank) is recorded as 1 / k, and the average of the RR of all queries is the MRR, which is calculated as follows
[0036] The user click data in S1 is represented by V = {v1, v2, ..., v m} represents all item items, use Represents each anonymous session Session, which consists of user click items arranged in chronological order, where Represents the item clicked in session S, where S has length L.
[0037] In short, Item represents a product. Session refers to the products that a user has visited continuously within a short period of time (for example, 3 hours). Arranging the products in chronological order is a session.
[0038] The construction of the session graph in S2 refers to constructing each session sequence into a session graph Graph, which is used to learn the embeddings of the items in the current session through GNN. Let G s =(V s ,E s ) is its corresponding session graph, where Vs is the set of items clicked in S, represents an edge set, where each edge represents two adjacent edges in S
[0039] In short, Embedding information embedding is translated as vector mapping: organizing the original data into the form of vectors is called Embedding, and this structure is used as input data for machine learning.
[0040] Among them, the definition related to constructing the global graph in S3 refers to two definitions, which are divided into defining neighbor sets: where i' is the session S q Medium, Items The order in which they are located, ε is a hyperparameter used to control the short-distance conversion of items in the conversation model; the global level item conversion definition is: {(v i ,v j )|v i ,v j ∈V;v j ∈N ε (v i )}.
[0041] By constructing relevant definitions of the global graph and clarifying the neighbor set and global-level item conversion definitions, we can effectively control the item conversion relationship and lay the foundation for accurate recommendations.
[0042] The improved adjacency matrix in S4 refers to the adjacency matrix improved based on the shortest path for each node v i , adjacent edges generate weights to distinguish v j Neighbor importance, only retains the first N edges and performs shortest path conversion, improving weight information into distance information.
[0043] The improved adjacency matrix is implemented based on the shortest path. For each node v j , generate weights for its adjacent edges to distinguish v j The importance of neighbors is determined, and only the first N edges are retained. Then, the weight information is converted into distance information through the shortest path conversion. This improvement is of great significance and can make the data information more valuable.
[0044] The linear combination of items based on the conversation attention score in S5 refers to a linear combination of items according to the conversation attention score, and the formula is: Where π(v i ,v j ) represents different importance weights, For project v i The set of neighbors in the graph g, and the edge (v i ,vj ) are trainable parameters.
[0045] The linear combination of items based on the conversation attention score is of great significance. By linearly combining items according to the conversation attention score, the formula is: Where π(v i ,v j )’s importance weights reflect the differences, and both the neighbor set and the trainable global graph edge weights provide strong support for accurate recommendations.
[0046] Among them, the use of the attention mechanism to learn the weights between nodes in S6 refers to learning the weights between different nodes through the attention mechanism in view of the different importance of the neighbors of the items in the conversation graph to themselves. ij v represents the node j Feature pair node v j The importance of , LeakyRelu is used here as the activation function.
[0047] It is of great significance to use the attention mechanism to learn the weights between nodes. Since the importance of project neighbors in the session graph is different, this mechanism can effectively learn the weights of different nodes. ij v represents the node j Feature pair node v j The importance of ,using the LeakyRelu activation function, can accurately capture the relationship and improve the ,accuracy of recommendation.
[0048] The step of obtaining and calculating the session representation in combination with the context in S7 means that for each item, the representation is first obtained by combining the global context and the session context, and then the final session representation is calculated by the sum pool. Specifically, the session sequence is input into the graph neural network to obtain the representation of the items in the session, that is, We learn the corresponding weights through a soft attention mechanism: Finally, the session representation is obtained based on the linear combination project:
[0049] By combining the global and session contexts to obtain item representations, and calculating session representations through sum pooling, soft attention mechanism and linear combination, we can more comprehensively and accurately reflect session information and improve the performance of the recommendation system.
[0050] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0051] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for improving a conversation recommendation system based on a graph algorithm, characterized in that: The specific steps of the improved method of the conversation recommendation system based on the graph algorithm are as follows: S1: User click data is represented by: Let V = {v1, v2, ..., v m } represents all item items, use Represents each anonymous session Session, which consists of user click items arranged in chronological order, where Represents the item clicked in session S, where S has length L; S2: Construct a session graph: Construct each session sequence into a session graph. Let G s =(V s ,E s ) is its corresponding session graph; S3: Construct global graph related definitions: construct a global graph through the session graph, where the global graph related definitions are defined as defining neighbor sets and global-level item transformation definitions; S4: Improved adjacency matrix: for each node v i , adjacent edges generate weights to distinguish v j Neighbor importance, only retain the first N edges and perform shortest path conversion, improving weight information into distance information; S5: Linear combination of items based on session attention scores: Linear combination of items based on session attention scores, the formula is Where π(v i ,v j ) represents different importance weights, For project v i The set of neighbors in the graph g, and the edge (v i ,v j )’s weights are trainable parameters; S6: Using attention mechanism to learn weights between nodes: Given that the neighbors of items in the conversation graph have different importance to themselves, the weights between different nodes are learned through the attention mechanism. ij v represents the node j Feature pair node v j The importance of LeakyRelu is used as the activation function here; S7: Combine the context to obtain and calculate the session representation: For each item, first combine the global context and the session context to obtain its representation, and then calculate the final session representation through sum pooling.
2. The improved method for a conversation recommendation system based on a graph algorithm according to claim 1, characterized in that: The user click data in S1 is represented by V = {v1, v2, ..., v m } represents all item items, use Represents each anonymous session Session, which consists of user click items arranged in chronological order, where Represents the item clicked in session S, where S has length L.
3. The improved method for a conversation recommendation system based on a graph algorithm according to claim 1, characterized in that: Constructing the session graph in S2 refers to constructing each session sequence into a session graph Graph for learning the embeddings of the items in the current session through GNN. Let G s =(V s ,E s ) is its corresponding session graph, where V s is the set of items clicked in S, Represents an edge set, where each edge represents two adjacent items in S:
4. The improved method for a conversation recommendation system based on a graph algorithm according to claim 1, characterized in that: The definition of constructing the global graph in S3 refers to two definitions, which are divided into defining neighbor sets: where i' is the session S q Medium, Items The order in which they are located, ε is a hyperparameter used to control the short-distance conversion of items in the conversation model; the global level item conversion definition is: {(v i ,v j )|v i ,v j ∈V;v j ∈N ε (v i )}.
5. The improved method for a conversation recommendation system based on a graph algorithm according to claim 1, characterized in that: The improved adjacency matrix in S4 refers to the adjacency matrix improved based on the shortest path for each node v i , adjacent edges generate weights to distinguish v j Neighbor importance, only retains the first N edges and performs shortest path conversion, improving weight information into distance information.
6. The improved method for a conversation recommendation system based on a graph algorithm according to claim 1, characterized in that: The linear combination of items based on the conversation attention score in S5 refers to the linear combination of items according to the conversation attention score, and the formula is: Where π(v i ,v j ) represents different importance weights, For project v i The set of neighbors in the graph g, and the edge (v i ,v j ) are trainable parameters.
7. The improved method for a conversation recommendation system based on a graph algorithm according to claim 1, characterized in that: The use of the attention mechanism to learn the weights between nodes in S6 refers to learning the weights between different nodes through the attention mechanism in view of the different importance of the neighbors of the items in the conversation graph to themselves. ij v represents the node j Feature pair node v j The importance of , LeakyRelu is used here as the activation function.
8. The improved method for a conversation recommendation system based on a graph algorithm according to claim 1, characterized in that: In S7, obtaining and calculating the session representation in combination with the context means that for each item, the representation is first obtained by combining the global context and the session context, and then the final session representation is calculated by summing the pools. Specifically, the session sequence is input into the graph neural network to obtain the representation of the items in the session, that is, We learn the corresponding weights through a soft attention mechanism: Finally, the session representation is obtained based on the linear combination project:
Citation Information
Patent Citations
Session recommendation system based on graph algorithm
CN116485496A
Session recommendation method based on self-supervised double graphs and intention association
CN119003885A