A graph neural network conversation recommendation method and system based on decoupling user demand
Patent Information
- Application Number
- CN202311372916.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-23
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-10-23
AI Technical Summary
但是,目前基于图神经网络模型的会话推荐方法,大多数只考虑物品的转换序列,未考虑到用户选择物品也会受到物品种类的影响,存在会话图构建简单的问题,未能充分利用会话信息,会话推荐的准确性有待提升;此外,考虑到物品转换序列的会话推荐方法中,存在着将物品转换序列进行解耦的方法,该方法认为用户的意图是耦合的,应该从物品点击序列中对用户的意图进行解耦,找到最符合用户意图的物品,但该方法忽略了用户的意图不应该仅仅只存在于物品的转换序列中,也应该存在于物品对应类别的转换序列中
[0076] Beneficial Effects: The graph neural network-based session recommendation method and system based on decoupled user needs provided by this invention constructs a heterogeneous graph containing item nodes and category nodes for item transition sequences and category transition sequences, and decouples user needs by projecting the item sequence and category sequence into different sub-demand spaces. It utilizes graph neural network feature aggregation and extraction to obtain corresponding feature representations, and uses contrastive learning to make the item demand representation and category demand representation in the same sub-demand space more similar. An attention mechanism is used to obtain the final item session feature representation and category session feature representation, and then an inner product is performed to obtain the user's comprehensive score for items and categories. The session recommendation result is output based on the score. This invention uses a novel and different graph construction method, which can effectively reduce information loss. Simultaneously, by incorporating category session information, it can effectively incorporate collaborative information, improving the recommendation effect and diversity of the current session. Moreover, the method of this invention is highly reliable, accurate, and scientifically effective.
Smart Images

Figure CN117408779B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a graph neural network session recommendation method and system, and more particularly to a graph neural network session recommendation method and system based on decoupled user needs, belonging to the field of Internet big data technology. Background Technology
[0002] In the process of online shopping, there are situations where users are not logged in, and their historical browsing behavior and personal information cannot be obtained. Therefore, conversational recommendation methods have emerged to address these issues. These methods identify users' intentions and preferences through their interactions with items within a conversation and make accurate recommendations.
[0003] Currently, with the rapid development of graph neural network (Graph Neural Network) models, Graph Neural Networks have shown promising performance in conversation recommendation. However, most current conversation recommendation methods based on Graph Neural Networks only consider the item transition sequence, neglecting the influence of item category on user item selection. This leads to issues with simplistic conversation graph construction, failing to fully utilize conversation information, and consequently, the accuracy of conversation recommendations needs improvement. Furthermore, some conversation recommendation methods that consider item transition sequences decouple the sequence, assuming user intent is coupled and should be decoupled from the item click sequence to find the item that best matches the user's intent. However, this method overlooks the fact that user intent should not only exist in the item transition sequence but also in the transition sequence of the item's corresponding category. This also negatively impacts the accuracy of item recommendations. Summary of the Invention
[0004] Purpose of the invention: To address the problems existing in the prior art, the purpose of this invention is to provide a simple, efficient, accurate, and stable graph neural network-based session recommendation method and system based on decoupled user needs.
[0005] Technical solution: To achieve the above-mentioned objectives, the present invention adopts the following technical solution:
[0006] The graph neural network-based session recommendation method based on decoupled user needs described in this invention includes the following steps:
[0007] Step 1: Based on the sequence of items clicked by the user and the sequence of categories corresponding to the items, obtain the transformation sequence of the items and the transformation sequence of the categories corresponding to the items, and construct a heterogeneous graph containing both item and category nodes. The item transformation sequence is regarded as the user's item requirements, and the category transformation sequence corresponding to the items is regarded as the user's category requirements.
[0008] Step 2: Based on the heterogeneous graph described in Step 1, the user's item requirements and category requirements are decoupled into multiple sub-requirements. The node representations under each sub-requirement are obtained through a graph neural network, and the item session representations and category session representations under different sub-requirements are obtained through an attention mechanism.
[0009] Step 3: Pool the node representations under the same sub-requirement to obtain the representations of item sub-requirements and category sub-requirements under the same sub-requirement. Through comparative learning, the two representations under the same sub-requirement are made closer.
[0010] Step 4: Merge all sub-requirements to obtain the final item session representation and category session representation, and then improve the accuracy of item recommendations by predicting items and categories.
[0011] Further, in step 1, let the item transformation sequence be V = (v1, v2, ..., v i ,…,v M The category transformation sequence is C = (c1, c2, c3) j ,…c M M is the length of the sequence, and the i-th item v i and the j-th category c j Correspondingly, the specific process of constructing a heterogeneous graph containing both item and category nodes is as follows: construct directed edges between items based on the item transformation sequence clicked by the current user; construct directed edges between categories based on the category transformation sequence corresponding to the item; construct directed edges between items and categories based on the correspondence between items and categories; and generate a heterogeneous graph containing items and categories and the relationships between them.
[0012] Furthermore, step 2 includes the following steps:
[0013] Step 2-1: Initialize the embedding representations of item nodes and category nodes using the formulas...
[0014]
[0015]
[0016] Mapped into K sub-demand spaces as node representations in the sub-demand spaces, where This indicates the i-th item v in the session. i The initial embedding, For the i-th item v in the k-th sub-demand space i Embedded representation, This indicates the j-th category c in the session. j The initial embedding, For the j-th category c in the k-th sub-demand space jEmbedded representation, k = 1, 2, ..., K; W k b is a learnable weight matrix. k The bias vector is a learnable vector, T denotes transpose, σ is the sigmoid activation function, and ||||2 denotes its 2-norm. A loss function based on distance correlation is used.
[0017]
[0018] To ensure that any two sub-demand spaces remain relatively independent, where The COV(·) function is used to calculate the covariance between two matrices; the VAR(·) function is used to calculate the covariance of a matrix itself.
[0019] Step 2-2: In the k-th sub-requirement, for the transformation between items, construct the item input matrix based on the item transformation sequence. Sum of matrices The values in the input matrix are obtained by calculating and normalizing the similarity between the current item and the previous item, while the values in the output matrix are obtained by calculating and normalizing the similarity between the current item and the next item. The input and output matrices are then compared using the formula...
[0020]
[0021]
[0022] Item v i The weighted adjacency matrix after t iterations in the k-th sub-requirement in and The weight matrix is a learnable matrix. and For learnable bias vectors, For round t-1 v i The expression, Let be the input matrix of the i-th item. Let the output matrix be the i-th item, i = 1, 2, ..., M; then let the weight adjacency matrix of the items be... Through formula
[0023]
[0024]
[0025]
[0026]
[0027] Come and put the item v i v is obtained by integrating the characteristics of the items with those of its neighbors.i The representation of the k-th sub-requirement after t iterations in This indicates that the door is being reset. Indicates an update to the door. This represents a candidate hidden state. Let be a learnable weight matrix, tanh be a non-linear activation function, and ⊙ denote the dot product operation of vectors. After t iterations, the representation v′ of each item under the current user's sub-demands is obtained. i,k ,Right now
[0028] In steps 2-3, in the k-th sub-requirement, the category node not only aggregates the transformation information between categories, but also aggregates the information of the category and the items belonging to that category. Based on the aggregated transformation information between categories, an ingress matrix of the categories is constructed according to the category transformation order. Sum of matrices The values in the input matrix are obtained by calculating and normalizing the similarity between the current category and the previous category, while the values in the output matrix are obtained by calculating and normalizing the similarity between the current category and the next category. The input and output matrices are then compared using the formula...
[0029]
[0030]
[0031] Composition of category c j The weighted adjacency matrix after t iterations in the k-th sub-requirement in and The weight matrix is a learnable matrix. and For learnable bias vectors, For round t-1, c j The expression, Let j be the in matrix of the j-th category. For the output matrix of the j-th category, then use the weight adjacency matrix of the items. Through formula
[0032]
[0033]
[0034]
[0035]
[0036] To class c j Integrate the features of the neighboring categories to obtain c jThe representation of the k-th sub-requirement after t iterations in This indicates that the door is being reset. Indicates an update to the door. This represents a candidate hidden state. As a learnable weight matrix, information about the aggregation category and the items belonging to that category is obtained through the formula.
[0037]
[0038]
[0039] Category c j and belong to category c j Adjacent items v i The category is obtained by integrating information from all adjacent items under the k-th sub-requirement. Where p ji,k This represents a weight coefficient for each item belonging to category j. This indicates that it belongs to category c. j All adjacent items, This is the learnable weight matrix for the k-th sub-requirement. || represents the concatenation operation. Finally, the category representation after aggregating adjacent category information is... Category representation after aggregating adjacent item information Average pooling is performed to obtain the representation c′ of the category-aggregated neighbor node information. j,k ;
[0040] Steps 2-4: Based on the last item and category clicked by the user, and the user's item and category requirements, use the formula...
[0041]
[0042]
[0043]
[0044]
[0045] Get the user's item session representation S in the kth sub-demand v,k and demand session representation S c,k , where α vi,k Let α represent the weight coefficient of item i in the k-th sub-demand space within the item sequence. cj,k This represents the weight coefficient of category j in the category sequence within the k-th sub-demand space. W1,W2, W3 and W4 are learnable weight matrices. v′ is a learnable bias vector. M,k v represents the last item in the conversation M The representation of the k-th sub-demand, c′ M,k Indicates the last category v in the session M The representation in the k-th sub-requirement.
[0046] Furthermore, in step 3, the item representation v′ obtained in steps 2-3, which aggregates the information of adjacent items, is... i,k Average pooling is used to obtain the user's item demand representation D in the k-th sub-demand. v,k The category representation c′ that aggregates information about adjacent items and category information j,k Average pooling is used to obtain the user's category requirement representation D in the k-th sub-requirement. c,k Then D v,k and D c,k Input to loss function
[0047]
[0048] This allows item sub-requirements and category sub-requirements to complement each other, and makes the item requirement representation and category requirement representation under the same sub-requirement more similar, where D v,k D represents the demand for an item under the k-th sub-demand. c,k This represents the requirement category under the same sub-requirement, k′ represents other sub-requirements different from k, and D c,k′ This is a negative sample.
[0049] Furthermore, in step 4, candidate category c s Using the formula in step 2-1
[0050]
[0051] Mapped into K sub-demand spaces as node representations within those sub-demand spaces. Indicates candidate category c s The initial embedding, and then for each sub-requirement, through the formula
[0052]
[0053]
[0054] Get scores for candidate categories
[0055] Furthermore, in step 4, the candidate item v s Using the formula in step 2-1
[0056]
[0057] Mapped into K sub-demand spaces as node representations within those sub-demand spaces. Indicates candidate item v s The initial embedding, and then for each sub-requirement, through the formula
[0058]
[0059] The similarity between candidate items and the current user's item needs is obtained, and then the similarity is calculated using the formula.
[0060]
[0061] The similarity y between candidate items and the current user's item needs. v The score corresponding to the category of the candidate item The calculation is performed to obtain the mixed similarity y between the item and the item category and the current user's item demand. vc Then through the formula
[0062]
[0063] The candidate items are obtained based on a joint predicted score of user item demand and category demand.
[0064] Furthermore, in step 4, the predicted loss function adopts the cross-entropy loss function.
[0065]
[0066] Among them, y i For the true value, For joint prediction scoring.
[0067] Furthermore, in step 4, the final loss function is:
[0068] L = L d +L contrast +L c
[0069] Where L d For distance-based loss functions, L contrast For the loss function of contrastive learning, L c This is the cross-entropy loss function.
[0070] Based on the same inventive concept, the present invention also provides a graph neural network-based session recommendation system for decoupled user needs, comprising the following units:
[0071] The construction unit is used to obtain the transformation sequence of the item and the transformation sequence of the category corresponding to the item based on the item sequence clicked by the user and the category sequence corresponding to the item, and to construct a heterogeneous graph containing two types of nodes: item and category. The transformation sequence of the item clicked by the current user is regarded as the user's item requirement, and the transformation sequence of the category corresponding to the item is regarded as the user's category requirement.
[0072] The decoupling unit is used to decouple the user's item requirements and category requirements into multiple sub-requirements based on the heterogeneous graph described in the building unit. It obtains the node representation under each sub-requirement through a graph neural network and obtains the item session representation and category session representation under different sub-requirements through an attention mechanism.
[0073] The processing unit is used to pool the node representations under the same sub-requirement to obtain the representations of the item sub-requirement and the category sub-requirement under the same sub-requirement. Through comparative learning, the two representations under the same sub-requirement are made closer.
[0074] The recommendation unit is used to merge all sub-requirements to obtain the final item session representation and category session representation, and then improve the accuracy of item recommendation by predicting items and categories.
[0075] Based on the same inventive concept, the present invention also provides a computer system, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when loaded onto the processor, implements the steps of the graph neural network session recommendation method based on decoupled user needs.
[0076] Beneficial Effects: The graph neural network-based session recommendation method and system based on decoupled user needs provided by this invention constructs a heterogeneous graph containing item nodes and category nodes for item transition sequences and category transition sequences, and decouples user needs by projecting the item sequence and category sequence into different sub-demand spaces. It utilizes graph neural network feature aggregation and extraction to obtain corresponding feature representations, and uses contrastive learning to make the item demand representation and category demand representation in the same sub-demand space more similar. An attention mechanism is used to obtain the final item session feature representation and category session feature representation, and then an inner product is performed to obtain the user's comprehensive score for items and categories. The session recommendation result is output based on the score. This invention uses a novel and different graph construction method, which can effectively reduce information loss. Simultaneously, by incorporating category session information, it can effectively incorporate collaborative information, improving the recommendation effect and diversity of the current session. Moreover, the method of this invention is highly reliable, accurate, and scientifically effective. Attached Figure Description
[0077] Figure 1 This is a flowchart illustrating the method of the present invention.
[0078] Figure 2 This is a model framework diagram of the method of the present invention. Detailed Implementation
[0079] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. 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. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0080] like Figure 1 The flowchart shown is a schematic diagram of an embodiment of the present invention. This embodiment of a graph neural network-based session recommendation method based on decoupled user needs includes the following steps:
[0081] Step 1: Construct a heterogeneous graph for the session. Based on the item sequence clicked by the current user and all users, as well as the corresponding category sequence, obtain the item conversion order and the corresponding category conversion order. Construct a heterogeneous graph containing both item and category nodes, and assign the current user's clicked item conversion sequence V = (v1, v2, ..., v...). i ,…,v M Considering the user's item requirements, the corresponding category transformation sequence C = (c1, c2, ..., c) is used. j ,…c M ) is considered as the user's category requirement, and M is the length of the sequence;
[0082] Step 2: Learn item conversation representation and category conversation representation under different needs based on the heterogeneous graph. Based on the heterogeneous graph, decouple the user's item needs and category needs into multiple sub-needs respectively. Obtain the node representation under each sub-need through graph neural network, and obtain the item conversation representation and category conversation representation under different sub-needs through attention mechanism.
[0083] Step 3: Compare and learn the item requirement representation and category requirement representation under the kth sub-requirement. Pool the node representations under the same sub-requirement to obtain the representations of item sub-requirement and category sub-requirement. Through comparative learning, make the two representations under the same sub-requirement closer.
[0084] Step 4: Multi-demand fusion and prediction. Multi-faceted sub-demands are fused to obtain item session representation and category session representation. Then, the accuracy of item recommendations is improved by predicting items and categories.
[0085] Furthermore, in Embodiment 1, the process of constructing a heterogeneous graph with item nodes and category nodes in step 1 specifically includes:
[0086] Step 1-1: Read the session data in the dataset and perform data preprocessing to obtain the item sequence clicked by the current user and all users, as well as the category sequence corresponding to the items, and obtain the conversion order of the items and the conversion order of the categories corresponding to the items.
[0087] Steps 1-2: Convert the currently clicked item into a sequence V = (v1, v2, ..., v i ,…,v M Considering the user's item requirements, the corresponding category transformation sequence C = (c1, c2, ..., c) is used. j ,…c M ) is considered as the user's category requirement, and the i-th item v i and the j-th category c j Correspondingly;
[0088] Steps 1-3: Construct directed edges between items based on the item transformation sequence clicked by the user; construct directed edges between categories based on the corresponding category transformation sequence; construct directed edges between items and categories based on the correspondence between items and categories; generate a heterogeneous graph containing items, nodes, and the relationships between them.
[0089] Furthermore, in Embodiment 1, the specific process of learning item conversation representations and category conversation representations based on heterogeneous graphs under different needs in step 2 includes:
[0090] Step 2-1: Initialize the embedding representations of item nodes and category nodes in the heterogeneous graph using the formulas...
[0091]
[0092]
[0093] Mapped into K sub-demand spaces as node representations in the sub-demand spaces, where This indicates the i-th item v in the session. i The initial embedding, For the i-th item v in the k-th sub-demand space i Embedded representation, This indicates the j-th category c in the session. j The initial embedding, For the j-th category c in the k-th sub-demand space j Embedded representation, k = 1, 2, ..., K; W k b is a learnable weight matrix. k The bias vector is a learnable vector, T denotes transpose, σ is the sigmoid activation function, ||||2 denotes taking its 2-norm, and a loss function based on distance correlation is used.
[0094]
[0095] To ensure that any two sub-demand spaces remain relatively independent, where The COV(·) function can calculate the covariance between two matrices, while the VAR(·) function can calculate the covariance of a matrix itself.
[0096] Step 2-2: In the k-th sub-requirement, for the transformation between items, construct the ingress matrix of the items according to the transformation order. Sum of matrices The values in the input matrix are obtained by calculating and normalizing the similarity between the current item and the previous item, while the values in the output matrix are obtained by calculating and normalizing the similarity between the current item and the next item. The input and output matrices are then compared using the formula...
[0097]
[0098]
[0099] Item v i The weighted adjacency matrix after t iterations in the k-th sub-requirement in and The weight matrix is a learnable matrix. and For learnable bias vectors, For round t-1 v i The expression, Let be the input matrix of the i-th item. Let the output matrix be the i-th item, and then the weight adjacency matrix of the item be... Through formula
[0100]
[0101]
[0102]
[0103]
[0104] Come and put the item v i v is obtained by integrating the characteristics of the items with those of its neighbors. i The representation of the k-th sub-requirement after t iterations in This indicates that the door is being reset. Indicates an update to the door. This represents a candidate hidden state. Let σ be a learnable weight matrix, σ be the sigmoid activation function, tanh be the non-linear activation function, and ⊙ denote the dot product operation of vectors. After t iterations, the representation v′ of each item under the current user's sub-demands is obtained. i,k (Right now );
[0105] In steps 2-3, in the k-th sub-requirement, the category node not only aggregates the transformation information between categories, but also aggregates the information of the category and the items belonging to that category. Based on the aggregated transformation information between categories, an ingress matrix of the categories is constructed according to the category transformation order. Sum of matrices The values in the input matrix are obtained by calculating and normalizing the similarity between the current category and the previous category, while the values in the output matrix are obtained by calculating and normalizing the similarity between the current category and the next category. The input and output matrices are then compared using the formula...
[0106]
[0107]
[0108] Composition of category c j The weighted adjacency matrix after t iterations in the k-th sub-requirement in and The weight matrix is a learnable matrix. and For learnable bias vectors, For round t-1, c j The expression, Let j be the in matrix of the j-th category. For the output matrix of the j-th category, then use the weight adjacency matrix of the items. Through formula
[0109]
[0110]
[0111]
[0112]
[0113] To class c j Integrate the features of the neighboring categories to obtain c j The representation of the k-th sub-requirement after t iterations in This indicates that the door is being reset. Indicates an update to the door. This represents a candidate hidden state. As a learnable weight matrix, information about the aggregation category and the items belonging to that category is obtained through the formula.
[0114]
[0115]
[0116] Category c j and belong to category c j Adjacent items v i The category is obtained by integrating information from all adjacent items under the k-th sub-requirement. Where p ji,k This represents a weight coefficient for each item belonging to category j. This indicates that it belongs to category c. j All adjacent items, This is the learnable weight matrix for the k-th sub-requirement. || represents the concatenation operation. Finally, the category representation after aggregating adjacent category information is... Category representation after aggregating adjacent item information Average pooling is performed to obtain the representation c′ of the category-aggregated neighbor node information. j,k ;
[0117] Steps 2-4 typically show that the last item and category a user clicks on is closer to their item and category needs, as indicated by the formula.
[0118]
[0119]
[0120]
[0121]
[0122] Get the user's item session representation S in the kth sub-demand v,k and demand session representation S c,k , where α vi,k Let α represent the weight coefficient of item i in the k-th sub-demand space within the item sequence. cj,k This represents the weight coefficient of category j in the category sequence within the k-th sub-demand space. The weight matrix is a learnable matrix. v′ is a learnable bias vector. M,k v represents the last item in the conversation M The representation of the k-th sub-demand, c′ M,k Indicates the last category v in the session M The representation in the k-th sub-requirement.
[0123] Furthermore, in Example 1, step 3 involves comparing and learning the item requirement representation and category requirement representation under the k-th sub-requirement, specifically as follows:
[0124] The item representation v′ obtained in steps 2-3, which aggregates the information of neighboring items, is used to represent all items. i,k Average pooling is used to obtain the user's item demand representation D in the k-th sub-demand. v,k The category representation c′ that aggregates information about adjacent items and category information j,k Average pooling is used to obtain the user's category requirement representation D in the k-th sub-requirement. c,k Then D v,k and D c,k Input to loss function
[0125]
[0126] This allows item sub-requirements and category sub-requirements to complement each other, and makes the item requirement representation and category requirement representation under the same sub-requirement more similar, where D v,k D represents the demand for an item under the k-th sub-demand. c,k This represents the requirement category under the same sub-requirement, k′ represents other sub-requirements different from k, and D c,k′ This is a negative sample.
[0127] Furthermore, in Example 1, step 4, multi-demand fusion and prediction, specifically includes the following process:
[0128] Step 4-1, select candidate category c s Using the formula in step 2-1)
[0129]
[0130] Mapped into K sub-demand spaces as node representations within those sub-demand spaces. Indicates candidate category c s The initial embedding, and then for each sub-requirement, through the formula
[0131]
[0132]
[0133] Get scores for candidate categories
[0134] Step 4-2, select candidate item v s Using the formula in step 2-1)
[0135]
[0136] Mapped into K sub-demand spaces as node representations within those sub-demand spaces. Indicates candidate item v s The initial embedding, and then for each sub-requirement, through the formula
[0137]
[0138] The similarity between candidate items and the current user's item needs is obtained, and then the similarity is calculated using the formula.
[0139]
[0140] The similarity y between candidate items and the current user's item needs. v The score corresponding to the category of the candidate item The calculation is performed to obtain the mixed similarity y between the item and the item category and the current user's item demand. vc Then through the formula
[0141]
[0142] The candidate items are obtained based on a joint predicted score of user item demand and category demand.
[0143] Step 4-3, the predicted loss function adopts the cross-entropy loss function.
[0144]
[0145] Among them, y i For the true value, For joint prediction scoring;
[0146] Step 4-4, the final loss function is
[0147] L = L d +L contrast +L c
[0148] Where L d For distance-based loss functions, L contrast For the loss function of contrastive learning, L c This is the cross-entropy loss function.
[0149] In the scheme of this embodiment, the graph neural network has 1 layer, the item and category embedding dimension is 80, the sub-demand space is 5, and the item and category embedding dimension in each sub-demand space is 16.
[0150] Based on the same inventive concept, this embodiment also discloses a graph neural network-based conversational recommendation system based on decoupled user needs, comprising:
[0151] The construction unit is used to obtain the transformation sequence of items and the transformation sequence of categories corresponding to items based on the item sequence clicked by the current user and all users and the category sequence corresponding to the items, and to construct a heterogeneous graph containing two types of nodes: item and category. The transformation sequence of items clicked by the current user is regarded as the user's item requirements, and the transformation sequence of categories corresponding to the items is regarded as the user's category requirements.
[0152] The decoupling unit is used to decouple the user's item requirements and category requirements into multiple sub-requirements based on the heterogeneous graph described in the building unit. It obtains the node representation under each sub-requirement through a graph neural network and obtains the item session representation and category session representation under different sub-requirements through an attention mechanism.
[0153] The processing unit is used to pool the node representations under the same sub-requirement to obtain the representations of the item sub-requirement and the category sub-requirement under the same sub-requirement. Through comparative learning, the two representations under the same sub-requirement are made closer.
[0154] The recommendation unit is used to merge all sub-requirements to obtain the final item session representation and category session representation, and then improve the accuracy of item recommendation by predicting items and categories.
[0155] Based on the same inventive concept, this embodiment also provides a graph neural network session recommendation computer system based on decoupled user needs, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded onto the processor, it implements the steps of the graph neural network session recommendation method based on decoupled user needs in this embodiment.
[0156] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
Claims
1. A graph neural network-based session recommendation method based on decoupled user needs, characterized in that, Includes the following steps: Step 1: Based on the sequence of items clicked by the user and the sequence of categories corresponding to the items, obtain the transformation sequence of the items and the transformation sequence of the categories corresponding to the items, and construct a heterogeneous graph containing both item and category nodes. The item transformation sequence is regarded as the user's item requirements, and the category transformation sequence corresponding to the items is regarded as the user's category requirements. Includes: Assuming the item conversion sequence is The category transformation sequence is M is the length of the sequence, and the nth... Items and the Categories Correspondingly, the specific process of constructing a heterogeneous graph containing both item and category nodes is as follows: construct directed edges between items based on the item transformation sequence clicked by the current user; construct directed edges between categories based on the category transformation sequence corresponding to the items; construct directed edges between items and categories based on the correspondence between items and categories; and generate a heterogeneous graph containing items and categories and the relationships between them. Step 2, based on the heterogeneous graph described in Step 1, decouples the user's item requirements and category requirements into multiple sub-requirements, obtains node representations for each sub-requirement through a graph neural network, and obtains item session representations and category session representations for different sub-requirements through an attention mechanism; including the following steps: Step 2-1: Initialize the embedding representations of item nodes and category nodes using the formulas... ; ; Mapped into K sub-demand spaces as node representations in the sub-demand spaces, where Indicates the first in the conversation Items The initial embedding, For the k-th sub-demand space Items Embedded representation, Indicates the first in the conversation Categories The initial embedding, For the k-th sub-demand space Categories The embedding representation, k=1,2,…,K; The weight matrix is a learnable matrix. For learnable bias vectors, Indicates transpose. for Activation function This indicates taking its 2-norm and using a loss function based on distance correlation. ; To ensure that any two sub-demand spaces remain relatively independent, where ; The function is used to calculate the covariance between two matrices; The function is used to calculate the covariance of a matrix itself; Step 2-2: In the k-th sub-requirement, for the transformation between items, construct the item input matrix based on the item transformation sequence. Sum of matrices The values in the input matrix are obtained by calculating and normalizing the similarity between the current item and the previous item, while the values in the output matrix are obtained by calculating and normalizing the similarity between the current item and the next item. The input and output matrices are then compared using the formula... ; Constituting items The weighted adjacency matrix after t iterations in the k-th sub-requirement ,in and The weight matrix is a learnable matrix. and For learnable bias vectors, For round t-1 The expression, For the first The input matrix of each item, For the first The out-matrix of each item, and then the weight adjacency matrix of the items. Through formula , , , ; Come and bring the items Integrate with the characteristics of its adjacent items to obtain The representation of the k-th sub-requirement after t iterations ,in This indicates that the door is being reset. Indicates an update to the door. This represents a candidate hidden state. The weight matrix is a learnable matrix. It is a non-linear activation function. The dot product operation of vectors, after t iterations, yields the representation of each item under the current user's sub-demands. ,Right now ; In steps 2-3, in the k-th sub-requirement, the category node not only aggregates the transformation information between categories, but also aggregates the information of the category and the items belonging to that category. Based on the aggregated transformation information between categories, an ingress matrix of the categories is constructed according to the category transformation order. Sum of matrices The values in the input matrix are obtained by calculating and normalizing the similarity between the current category and the previous category, while the values in the output matrix are obtained by calculating and normalizing the similarity between the current category and the next category. The input and output matrices are then compared using the formula... ; Composition Category The weighted adjacency matrix after t iterations in the k-th sub-requirement ,in and The weight matrix is a learnable matrix. and For learnable bias vectors, For round t-1 The expression, For the first The ingress matrix of each category, For the first The output matrix for each category is then used to construct the adjacency matrix of the item weights. Through formula , , , , Come and class Integrate with features of its neighboring categories to obtain The representation of the k-th sub-requirement after t iterations ,in This indicates that the door is being reset. Indicates an update to the door. This represents a candidate hidden state. As a learnable weight matrix, information about the aggregation category and the items belonging to that category is obtained through the formula. ; ; Category and belong to category Adjacent items The category is obtained by integrating information from all adjacent items under the k-th sub-requirement. ,in Indicates belonging to a category All adjacent items, It is the learnable weight matrix of the k-th sub-requirement. This indicates a concatenation operation; finally, the category representation after aggregating adjacent category information will be used. Category representation after aggregating adjacent item information Average pooling is performed to obtain a representation of the category-aggregated neighbor node information. ; Steps 2-4: Based on the last item and category clicked by the user, and the user's item and category requirements, use the formula... ; ; ; ; Get the user's item session representation in the kth sub-demand and demand session representation ,in, This represents the items in the k-th sub-demand space. Weighting coefficients in an item sequence Represents the category in the k-th sub-demand space Weight coefficients in the category sequence, The weight matrix is a learnable matrix. For learnable bias vectors, Indicates the last item in the conversation. The representation in the k-th sub-demand Indicates the last category in the session The representation in the k-th sub-requirement; Step 3: Pool the node representations under the same sub-requirement to obtain the representations of item sub-requirements and category sub-requirements under the same sub-requirement. Through comparative learning, the two representations under the same sub-requirement are made closer. Step 4: Merge all sub-requirements to obtain the final item session representation and category session representation, and then improve the accuracy of item recommendations by predicting items and categories.
2. The graph neural network-based session recommendation method based on decoupled user needs according to claim 1, characterized in that, In step 3, the item representations obtained in steps 2-3, which aggregate the information of adjacent items, are... Average pooling is used to obtain the user's item demand representation in the k-th sub-demand. The category representation that aggregates information on adjacent items and category information Average pooling is used to obtain the user's category requirement representation in the k-th sub-requirement. Then and Input to loss function ; This allows item sub-requirements and category sub-requirements to complement each other, and makes the representations of item requirements and category requirements under the same sub-requirement more similar. This represents the demand for an item under the k-th sub-demand. This represents the requirement representation of categories under the same sub-requirement. This represents other sub-requirements that are different from k. This is a negative sample.
3. The graph neural network-based session recommendation method based on decoupled user needs according to claim 2, characterized in that, In step 4, the candidate categories are... Using the formula in step 2-1 ; Mapped into K sub-demand spaces as node representations within those sub-demand spaces. Indicates candidate category The initial embedding, and then for each sub-requirement, through the formula ; ; Get scores for candidate categories .
4. The graph neural network-based session recommendation method based on decoupled user needs according to claim 3, characterized in that, In step 4, the candidate items are... Using the formula in step 2-1 ; Mapped into K sub-demand spaces as node representations within those sub-demand spaces. Indicates candidate items The initial embedding, and then for each sub-requirement, through the formula ; The similarity between candidate items and the current user's item needs is obtained, and then the similarity is calculated using the formula. ; Similarity between candidate items and the current user's item needs The score corresponding to the category of the candidate item The calculation yields the combined similarity between the item and the item category and the current user's item needs. Then through the formula ; The candidate items are obtained based on a joint predicted score of user item demand and category demand. .
5. The graph neural network-based session recommendation method based on decoupled user needs according to claim 4, characterized in that, In step 4, the predicted loss function is the cross-entropy loss function. ; in, For the true value, For joint prediction scoring.
6. The graph neural network-based session recommendation method based on decoupled user needs according to claim 5, characterized in that, In step 4, the final loss function is: ; in For distance-based loss functions, For the loss function of contrastive learning, This is the cross-entropy loss function.
7. A graph neural network-based session recommendation system using the graph neural network-based session recommendation method for decoupled user needs as described in any one of claims 1 to 6, characterized in that, Includes the following units: The construction unit is used to obtain the transformation sequence of the item and the transformation sequence of the category corresponding to the item based on the item sequence clicked by the user and the category sequence corresponding to the item, and to construct a heterogeneous graph containing two types of nodes: item and category. The transformation sequence of the item clicked by the current user is regarded as the user's item requirement, and the transformation sequence of the category corresponding to the item is regarded as the user's category requirement. The decoupling unit is used to decouple the user's item requirements and category requirements into multiple sub-requirements based on the heterogeneous graph described in the building unit. It obtains the node representation under each sub-requirement through a graph neural network and obtains the item session representation and category session representation under different sub-requirements through an attention mechanism. The processing unit is used to pool the node representations under the same sub-requirement to obtain the representations of the item sub-requirement and the category sub-requirement under the same sub-requirement. Through comparative learning, the two representations under the same sub-requirement are made closer. The recommendation unit is used to merge all sub-requirements to obtain the final item session representation and category session representation, and then improve the accuracy of item recommendation by predicting items and categories.
8. A computer system, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when loaded onto the processor, implements the steps of the graph neural network session recommendation method based on decoupled user needs as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Graph neural network-based session recommendation method and system fused with self-attention mechanism
CN114971784A
Session recommendation method based on heterogeneous graph and comparative learning
CN115018573A