A Conversational Recommendation Method Based on Graph Comparative Learning and Feature Enhancement

By constructing conversation graphs and global graphs, generating feature vector representations, and using pooling and conversation vector learning modules, the problems of multi-user selection and noise in conversational recommendation systems are solved, and the accuracy and precision of the recommendation system are improved.

CN116796073BActive Publication Date: 2025-09-19UNIV OF SCI & TECH BEIJING
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310826295.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-07
Publication Date
2025-09-19
Estimated Expiration
2043-07-07

AI Technical Summary

Technical Problem

Existing conversational recommendation systems suffer from decreased accuracy when dealing with multiple user choices and noise, and their performance depends on the relevance of the last item with the current session user's preferences, and cannot effectively model the dependencies between items.

Method used

By constructing the session graph and global graph of the user session sequence, the session-level and global-level feature vector representations of the item nodes are generated. The pooling layer and session vector representation learning module are used, combined with the attention mechanism and softmax function for recommendation.

Benefits of technology

It improves the accuracy and precision of recommendations, alleviates the over-smoothing problem, retains more node information, and generates more accurate item click probabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116796073B_ABST
    Figure CN116796073B_ABST
Patent Text Reader

Abstract

The present invention discloses a graph contrast learning conversation recommendation method based on feature enhancement, which improves the recommendation performance of the current conversation by effectively utilizing the paired item conversion information at two levels: the conversation-level feature vector representation and the global-level feature vector representation. In the global-level item representation learning module, global-level features are obtained by fusing deeper neighbor features, which alleviates the over-smoothing problem. The user preferences of the current conversation are modeled by aggregating the two item representations through the attention mechanism, and the input space features are retained through feature enhancement methods, and the predicted probability of the candidate items is finally output. It has been verified that the present invention makes the prediction results of conversation recommendations more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a graph comparative learning conversation recommendation method based on feature enhancement. Background Art

[0002] Recommender systems successfully address the problem of information overload by providing targeted, useful content to users, and therefore play a vital role on various online platforms. However, due to their reliance on user profiles and long-term historical interaction information, traditional recommendation systems can perform poorly in recent real-world scenarios when this information is unavailable or limited. To overcome the shortcomings of traditional recommendation systems, session-based recommendations have attracted widespread attention in recent years. Session-based recommendations predict the next likely item to interact with given a time-ordered, anonymous sequence of behaviors.

[0003] Early session-based recommendation systems were primarily categorized into similarity-based and link-based recommendation systems. Both have their advantages and disadvantages: the former prioritizes the co-occurrence of items within the current session while ignoring sequential behavior patterns; the latter primarily infers all possible sequences of user selections across all items, which can be computationally challenging in real-world scenarios with a large number of items.

[0004] In addition, some deep learning-based recommendation methods have also emerged recently. These recommendation methods use paired item transition information (such as SR-GNN and GCE-GNN) to model user preferences in a given session. Currently, these methods have achieved encouraging results, but still face the following problems:

[0005] (1) Some methods use recurrent neural networks and memory networks to extract the transition information of paired items in a session in chronological order to determine the preferences of anonymous users. However, a session may contain multiple user choices. Excessive choices will cause data accuracy to decrease and even lead to the emergence of noise. Therefore, these methods cannot model the inherently complex sequence of item transitions in the embedding process, and thus cannot generate the correct dependency relationships between all items.

[0006] (2) Neural network-based methods incorporate an attention mechanism. This recommendation system learns the representation of the entire session by calculating the relative importance of each item in the session based on the pairwise item transitions between each item and the last item. However, the performance of this recommendation method depends heavily on the relevance of the last item to the user's preferences in the current session. Summary of the Invention

[0007] In order to solve the problems existing in existing technologies such as the possibility of multiple users’ choices and noise in a conversation and the problem that the recommendation performance of a conversation depends largely on the correlation between the last item and the preference of the current conversation user, the present invention provides a conversation recommendation method based on graph contrast learning with feature enhancement. The overall process is as follows: Figure 1 As shown, the following steps are included:

[0008] S1. Construct a conversation graph of user conversation sequences;

[0009] S2. Generate a session-level feature vector representation for each item node in the session graph;

[0010] S3. Build a global graph and input the session-level feature vector of the project node into the global-level project representation learning module to obtain the global-level feature vector representation of the project node;

[0011] S4. Input the session-level feature vector representation and the global-level feature vector representation of the project node into the pooling layer for pooling operation to obtain the pooled vector representation of the project node;

[0012] S5. Input the pooled vector representation of the project node into the session vector representation learning module to obtain a comprehensive vector representation of the session to be predicted;

[0013] S6. Input the pooled representation vector of the item node and the comprehensive vector representation of the session to be predicted into the softmax function to obtain the probability of all items being clicked, and make recommendations accordingly.

[0014] Furthermore, the step of generating a session-level feature vector representation in S2 includes:

[0015] S21. Get the attention coefficient of each node and its neighboring nodes. The calculation method is:

[0016]

[0017] in and Node v i and neighbor node v j The vector representation of θ ij Represents node v j For node v i The weight of , F is the activation function, is the weight vector, r ij Represents v j and v i The relationship between nodes v i Represents interaction items in a conversation;

[0018] S22, linearly combine the node's attention coefficient with the node's features to obtain the session-level feature vector representation of each node;

[0019] Preferably, in S22, only the attention coefficients of the node and its first-order neighbors are calculated.

[0020] Preferably, the weight vectors for different relationships between nodes include: and

[0021] Furthermore, in S3, the global level item representation learning module includes a averaging layer and a feature propagation unit, and S3 includes:

[0022] S31, input the node's session-level feature vector representation into the averaging layer to calculate the average value of each node v i The eigenvector of and its neighbors' eigenvectors are averaged, and the formula is:

[0023]

[0024] in Represents node v i The feature vector of the k-th layer node in the feature propagation unit, represents the eigenvector obtained after averaging, τ ij Represents node v in the global graph i With node v j The weight of the edge between i d j Represents node v i and node v i The corresponding elements in the diagonal matrix;

[0025] S32. Use matrix operations to simplify the averaging formula in S31. First, use T to represent the normalized adjacency matrix with self-loops:

[0026]

[0027] in I is the unit matrix, is a global graph The corresponding symmetric adjacency matrix is, yes The degree matrix, diagonal matrix D = diag(d1,…,d n ), the diagonal value is the sum of the row elements in the adjacency matrix A, expressed as d i =∑ j τ ij ;

[0028] S33, the update process is as follows:

[0029]

[0030]

[0031] Where β is a hyperparameter used to control the ratio of propagation matrix information to unit matrix information, k∈K represents the kth layer of convolution, and γ is a hyperparameter that controls the ratio between the propagation matrix and the item's own representation. is the weight matrix of the feature propagation unit; represents the input of the kth layer of the feature propagation unit, and the output is expressed as

[0032] Furthermore, the global-level item representation learning module also includes a dropout layer for applying a dropout function to the global-level feature vector representation to avoid overfitting problems.

[0033] Furthermore, in S5, the session vector learning representation layer includes an attention layer, a linear layer, and an activation layer. S5 includes:

[0034] S51. Input the pooled vector representation of the project node into the linear layer and activation layer connected in sequence to obtain the position information z i :

[0035]

[0036] in is the learnable parameter matrix of the linear layer, is the learnable parameter of the linear layer, || represents the connection operation, and tanh is the activation function; is the pooled vector representation of the project node, P = [p1, p2, ..., p l ] is the position embedding matrix, where Is the project node v i The position vector of , l is the length of the current session sequence;

[0037] S52. Calculate the average value of all item feature vectors in the session to be predicted S to obtain the session information s′ of the session to be predicted:

[0038]

[0039] S53. Calculate the weight of the session information s′ through the attention layer:

[0040] ω i =q T σ(W3z i +W4s′+b2),

[0041] in, is the learnable parameter matrix and parameters of the attention layer, σ(·) represents the sigmoid function;

[0042] S54. Calculate the comprehensive session vector representation of the session to be predicted S. The formula is:

[0043]

[0044] Furthermore, S6 includes:

[0045] The output is obtained through the softmax function

[0046]

[0047] in, Indicates project v i The probability of being clicked at the next moment of the session to be predicted, T represents the transposition symbol, Represents the pooled vector representation of the item node.

[0048] Furthermore, the training also includes:

[0049] S7. Calculate the target loss function and use the time-based backpropagation method to train the parameters. The loss function is:

[0050]

[0051] Here, m represents the number of items.

[0052] Furthermore, the objective loss function is:

[0053]

[0054]

[0055] Among them, λ is a hyperparameter that controls the ratio of contrastive learning loss; B represents the sampling batch size during training, and represents the comprehensive conversation vector representation of the i-th and j-th conversations, The session vector representation represents the feature enhancement, and τ is an adjustable hyperparameter; The calculation formula is:

[0056] h s '=h s Q+E,

[0057] in, represents the transformation matrix, and E is a random matrix.

[0058] Furthermore, Q is the unit matrix, and E is a random matrix that conforms to the standard (0,1) normal distribution.

[0059] The beneficial effects of the present invention are as follows:

[0060] (1) More interactive information with global features is obtained through both the conversation graph and the global graph. In the feature propagation stage of the global graph, the method described in this paper simplifies the feature averaging process, thereby alleviating the over-smoothing problem and improving the accuracy of recommendations.

[0061] (2) After obtaining the session vector representation, the contrastive learning loss function is introduced and the mean noise feature enhancement method is used to make the node vector representation more evenly distributed in the two-dimensional space and produce smaller deviations, thereby retaining more node information and improving the accuracy of recommendations. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0063] Figure 1 A flowchart of a recommended method according to an embodiment of the present invention is shown;

[0064] Figure 2 A schematic flow chart of a method for constructing a drawing system according to an embodiment of the present invention;

[0065] Figure 3 A schematic flow chart of a method for constructing a global graph according to an embodiment of the present invention;

[0066] Figure 4 This is a schematic diagram of the final conversation vector representation process according to one embodiment of the present invention;

[0067] Figure 5 This is a structural diagram of a global-level project representation learning module according to an embodiment of the present invention. DETAILED DESCRIPTION

[0068] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings 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 making creative efforts shall fall within the scope of protection of the present invention.

[0069] Existing methods often ignore useful items from other sessions when switching modes. Furthermore, when constructing a global graph, they aggregate neighbor information through graph convolution, which can lead to oversmoothing when obtaining item representations. To address these issues, this paper proposes a session recommendation method based on feature enhancement and graph contrast learning, which includes the following steps:

[0070] S1. Construct a conversation graph of user conversation sequences;

[0071] S2. Generate a session-level feature vector representation for each item node in the session graph;

[0072] S3. Build a global graph and input the session-level feature vector of the project node into the global-level project representation learning module to obtain the global-level feature vector representation of the project node;

[0073] S4. Input the session-level feature vector representation and the global-level feature vector representation of the project node into the pooling layer for pooling operation to obtain the pooled vector representation of the project node;

[0074] S5. Input the pooled vector representation of the project node into the session vector representation learning module to obtain a comprehensive vector representation of the session to be predicted;

[0075] S6. Input the pooled representation vector of the item node and the comprehensive vector representation of the session to be predicted into the softmax function to obtain the probability of all items being clicked, and make recommendations accordingly.

[0076] Session in user session sequence represents each anonymous session, where Indicates project v i Interactions occur in session S, l represents the number of items in session S. Item set V = {v1, v2, ..., v m} represents a series of interactions (e.g., user clicks on items) in a session sequence arranged in chronological order. For the current session S, the goal of the session-based recommendation problem is to recommend the top-K items (1≤K≤|V|) from V that are most likely to be clicked by the user of the current session S.

[0077] Encode each item in the item set V into a unified embedding space, that is, encode each item in the item set V to obtain the feature vector of the item (d represents the dimension of the vector representation of the item), that is, the item v i The initialization vector representation of can be converted using embedding methods such as one-hot encoding.

[0078] In S1, each session item (the interaction sequence generated by the user in different time periods) is converted into a session graph The method of constructing the conversation graph is as follows Figure 2 As shown, the definition of the session graph is as follows: for a given session make Its corresponding session graph, where is the set of all items in session S. The two adjacent items in session S are and A directed edge is established between two items, that is, if two items appear in adjacent positions in the same session, they are considered to have a directed connection (for example, if the user's interaction order for items in a specific session is 1→2→3, then in the session graph it is considered that there is a directed edge from node 1 to node 2, and a directed edge from node 2 to node 3). represents the edge set of the session graph, where Represents two adjacent items in session S The edges between the items are input into the attention mechanism by inputting the initialization vector representation of the items, which can capture the relationship between the items. Different sessions can be connected. Since an item appears in one session, it may also appear in other sessions. Therefore, the session graph It is proposed to capture the relationship between all items and is used to learn the characteristics of items.

[0079] In one embodiment, the session graph includes four different types of edges, namely r in , r out , r in-out and r self , the type of these edges depends on the relationship between item i and item j. Specifically, for the edge r in Refers only to arrive There is a boundary, r out Refers only to arrive There is a boundary, r in-out Refers to arrive and from arrive There are edges, and r self Refers to the edges connecting an item with itself. Through the connection of these edges, the conversation graph can capture the temporal relationship and proximity relationship between items in the conversation sequence, thereby better learning the representation of conversation-level items.

[0080] In step S2, the session-level vector representation is obtained through the attention mechanism. The attention mechanism is a technique for calculating the weights between nodes in a graph. The present invention uses the attention mechanism to learn the weights between different nodes and use these weights to calculate the representation vectors of the nodes. Specifically, it includes:

[0081] S21. Calculate the attention coefficient between each project node in the conversation graph. The calculation formula is:

[0082]

[0083] in and Node v i and its neighbor node v j The eigenvector representation of θ ij Represents node v j For node v i The weight of , F is the activation function, preferably, LeakyReLU is used as the activation function, is the weight vector, r ij Represents v j and v i For different relationships between nodes, there are four corresponding weight vectors, namely and ⊙ represents element-wise product.

[0084] S22. Linearly combine the attention coefficients of node i’s neighbors to node i with the vector representation of node i to obtain a session-level feature vector representation of each node.

[0085]

[0086] In one embodiment, since not all nodes are connected to each other, in order to inject information from the entire graph, only the first-order neighbors of the nodes are considered. in is node v i In order to make the coefficients between different nodes comparable, the attention coefficients are normalized by the softmax function to better express the relationship between these nodes and obtain a more accurate vector representation:

[0087] α ij =softmax(θ ij ), (3) where θ ij is the initial attention coefficient between neighboring nodes. Note that the neighbors of each node are different, so the contributions of nodes to each other are not equal. Therefore, the normalized attention coefficient α in formula (2) is ij is asymmetric. In this case, the attention coefficient of node i’s first-order neighbors to node i is linearly combined with the vector representation of node i to obtain the session-level feature vector representation of each node with its neighbors’ attention information.

[0088]

[0089] where α ij is the normalized attention coefficient, For node v i The vector representation of .

[0090] Through the above steps, the session-level feature vector representation of each node in each session is obtained.

[0091] In step S3, a global graph is constructed for the conversation sequence Its node set consists of nodes in the session sequence, and the edge set of the global graph is obtained by weighting the edges corresponding to the item nodes in the session graph generated in S1, where the weights are calculated through the attention mechanism. The construction of the global graph is to capture the relationship between all items and learn the global level features of all items. This construction method can use and reuse information from all sessions to make better recommendations. A node set representing all items in a conversation sequence, represents an edge set, each item corresponds to two items in all sessions, where Represents node v i The ε-neighborhood is obtained by fixing the radius ε. i , its ε-neighborhood Refers to and v i The set of all nodes whose distance is less than or equal to ε, ε is set manually, preferably, ε is 1, that is, node v i The first-order neighbors of .

[0092] Set all project nodes v i The session-level feature vector is input to the global-level item representation learning module, namely:

[0093]

[0094] in It is the superposition of the session-level feature vectors of all nodes in the session graph, that is, X = [x1,…,x n ] T , where x i is node v i Session-level vector representation, i.e. n represents the number of nodes in the session sequence.

[0095] The global-level project representation learning module includes: an averaging layer and a feature propagation unit. The feature propagation unit is the feature propagation part of the existing graph convolutional neural network. Its function is to obtain the high-order neighbor features of the node. Since this is an existing technology, the structure and internal principles will not be repeated here.

[0096] The node feature vector of the k-1th layer GCN of the feature propagation unit is expressed as The output node, i.e. the node feature vector of the k-th layer GCN, is expressed as

[0097] In the feature propagation unit, the feature vector of each project node will be updated and improved. The new feature vector representation of all nodes (that is, the feature vector representation of the output node) is obtained by feature propagation between the node feature vector and the adjacency matrix of the previous layer node. Through training, the weights and bias parameters between the nodes in the feature propagation unit of the global graph can be adjusted to learn and obtain the feature vector of the global level project, thereby removing the nonlinear transformation in the graph convolution operation. The final node representation is It does not include the influence of nonlinear transformation and can improve the accuracy of conversational recommendation.

[0098] Conventional GCN-based methods suffer from over-smoothing, i.e., the performance of the model decreases as the number of network layers k increases. Therefore, in one embodiment, in order to limit over-smoothing and superimpose high-order neighbor features, the following method is performed:

[0099] S31, for each node v in the averaging layer i The eigenvector of is averaged with the eigenvectors of its neighbors, and the formula is:

[0100]

[0101] in Represents node v i The feature vector of the k-th layer node, represents the eigenvector obtained after averaging, u ij Represents node v in the global graph i With node v j The weight of the edge between i d j Represents node v i and node v i The corresponding elements in the diagonal matrix, where the diagonal matrix is ​​the degree matrix of the adjacency matrix, which is an n×n matrix, where the i-th diagonal element d i , represents the i-th node v i The degree of d (i.e. the number of adjacent nodes). i and d j The function of is to normalize the feature vector after averaging to prevent larger nodes from having too much influence on smaller nodes.

[0102] S32. Give a larger weight to the nearest neighbor of each node in proportion, and then update the feature vector. The final feature vector update process is expressed as follows:

[0103]

[0104] where k∈K represents the k-th layer neighbor of the feature propagation unit, and γ is a hyperparameter that controls the ratio between the propagation matrix and the item’s own representation. is the weight matrix, is the propagation matrix. These parameters are all parameters of the feature propagation unit, which is the existing technology.

[0105] During feature propagation, the nearest neighbors of each node are proportionally assigned edge weights to limit the over-smoothing problem, i.e., the weight of each node is calculated using an attention mechanism, and these weights are used to update the feature representation of the node.

[0106] In one embodiment, since the amount of calculation of formula (5) is too large, in order to simplify formula (5), matrix operations are used to simplify the eigenvector averaging process:

[0107]

[0108] in I is the unit matrix, is a symmetric adjacency matrix, which is similar to the global graph correspond, yes The degree matrix, diagonal matrix D = diag(d1,…,d n ), the diagonal value is the sum of the row elements in the adjacency matrix A, expressed as d i =∑ j τ ij .

[0109] Then calculate the propagation matrix It is used to limit the noise interference that may be brought by other nodes and improve the self-attention information in the matrix. The formula is as follows:

[0110]

[0111] Among them, β is a hyperparameter used to control the ratio of propagation matrix information and unit matrix information, and controls the proportion of repeated nodes in information absorption layer by layer.

[0112] In one embodiment, the global-level item representation learning module further includes a dropout layer for applying a dropout function to the global-level feature vector representation to avoid overfitting problems:

[0113]

[0114] In step S4, the pooling layer is used to sum the pooling to obtain the pooled vector representation of the item node:

[0115]

[0116] In step S5, the session vector learning module includes an attention layer, a linear layer, and an activation layer. The activation layer introduces nonlinear characteristics through the tanh activation function to improve the expressiveness of the model.

[0117] Step S5 specifically includes:

[0118] S51. For each session, calculate the position matrix P of the items in the session = [p1, p2, ..., p l ], Represents the position vector of the item in the session. Its value is randomly initialized. l is the number of items in the session. The position vector is a method of embedding position information into the vector space, which can better understand and utilize the position information. Then the pooled vector representation of the item node is input into the linear layer and activation layer connected in sequence to obtain the position information z i :

[0119]

[0120] in is the learnable parameter matrix of the linear layer, is the learnable parameter of the linear layer, || represents the connection operation, and tanh is the activation function; is the pooled vector representation of the project node, P = [p1, p2, ..., p l ] is the position embedding matrix, where Is the project node v i The position vector of the item v is the length of the current session sequence. i The pooled vector representations of are combined to obtain a richer and more accurate feature representation.

[0121] S52. Obtain the information s′ of the session to be predicted by calculating the average value of the pooled vector representations of all items in the session to be predicted S:

[0122]

[0123] S53. Calculate the weight of the session information s′ through the attention layer:

[0124] ω i =q T σ(W3z i +W4s′+b2), (13)

[0125] in, are the learnable parameter matrices and parameters in the attention layer, and σ(·) represents the sigmoid function.

[0126] S54, linearly combine the pooled vector representations of the items to obtain a comprehensive vector representation of the session to be predicted.

[0127]

[0128] It consists of all items of the session to be predicted.

[0129] In step S6, based on the comprehensive vector representation of the session to be predicted, a recommendation is generated, as follows:

[0130] The output is obtained through the softmax function

[0131]

[0132] in Represents project history project v i The probability of being clicked at the next moment of the predicted session S is higher, the higher the probability, the higher the probability of v i The more likely it is to be recommended, T represents the transpose of the vector, For project node v i The pooled vector representation of .

[0133] During training, S7 is also included: using multi-task learning to optimize the recommendation performance, that is, optimizing the parameters of the above method using the weighted sum of the recommendation task loss and the contrastive learning task loss:

[0134]

[0135] Among them, λ represents the hyperparameter that controls the ratio of contrastive learning loss.

[0136] For the recommendation task, in one embodiment, a cross entropy loss function is used for optimization, namely:

[0137]

[0138] in, It is project v i The probability of being recommended, m represents the total number of all candidate recommended items, y i Express The result after normalization.

[0139] For contrastive learning tasks, in one embodiment, the InfoNCE loss function is used as the optimization of the auxiliary task:

[0140]

[0141] Among them, B represents the sampling batch size during training, and represents the comprehensive conversation vector representation of the i-th and j-th conversations, represents the feature-enhanced session vector representation, and τ is an adjustable hyperparameter. The calculation formula is:

[0142]

[0143] in, represents the transformation matrix, and E is a random matrix. In one embodiment, Q is the identity matrix, and E is a random matrix that conforms to the standard (0,1) normal distribution.

[0144] Steps S1-S6 are iteratively trained using a time-based backpropagation algorithm to update the parameter matrices and parameters (such as W1, W2, W3, W4, b1, b2, q, etc.) in the training method. The training method is a prior art and will not be described in detail.

[0145] Experimental analysis:

[0146] 1. Experimental Dataset

[0147] To evaluate the effectiveness of this method, we used the public datasets CIKM Cup Diginetica, IJCAI-15Tmall, and Nowplaying. The Diginetica dataset contains user purchase process data for successful transactions, the Tmall dataset records anonymous users' shopping logs on the Tmall online shopping platform, and the Nowplaying dataset records users' music listening behavior.

[0148] To improve the training effect, this method uses a preprocessing method similar to that used in SR-GNN and other works. In the three datasets, sessions of length 1 and items with fewer than 5 occurrences are filtered out. Similar to the work of STAMP, this study sets the last week of sessions as test data, and the remaining historical data is used for training. For each session S = [v1, v2, ..., v n ,],This method trains and tests the above three datasets by splitting the input sequence to generate corresponding sequences and corresponding labels.

[0149] Finally, the preprocessed data set was statistically analyzed, and the results are shown in Table 1.

[0150] Table 1 Experimental data set statistics

[0151]

[0152] 2. Evaluation Criteria

[0153] In the experiments, two metrics are adopted to evaluate the performance of our method, which are frequently used in session sequence based recommendation.

[0154] (1) P@20 (Precision) is one of the metrics for prediction accuracy, which represents the proportion of correct recommendations among the top 20 items in the method recommendation results.

[0155] (2) MRR@20 (Mean Reciprocal Rank) is the mean reciprocal ranking of the correct recommended items in the method's recommendation results. When the true result is above 20 in the method's recommendation ranking, the corresponding reciprocal ranking is 0. The MRR metric takes the recommendation order into account. A higher MRR value indicates that the true result is at the top of the recommendation list, which proves the effectiveness of the recommendation system.

[0156] 3. Experimental Setup

[0157] In this paper, the hyperparameters of all models are kept consistent, including the dimension of the feature vector and the size of the mini-batch, which are all fixed to 100. For fair comparison, the memory size is set to 100 for CSRM, which is consistent with the batch size.

[0158] In this method, a Gaussian distribution function with a mean of 0 and a standard deviation of 0.1 is used to initialize all hyperparameters. The Adam optimizer is used to optimize the parameters. The initial learning rate is set to 0.001, and the learning rate is decayed by 0.1 after every three iterations. In addition, L2 is set to 10 -5 , and the dropout is set to {0.1, 0.2, …, 0.9}, and a 10% random subset of the training set is used as the validation set. In addition, the number of neighbors and the maximum distance ε between neighbors are set to 12 and 3, respectively.

[0159] 4. Analysis of experimental results

[0160] Comparing various baseline methods, graph neural network (GNN)-based methods perform better on the Diginetica and Nowplaying datasets. By modeling each conversation sequence as a subgraph and using GNNs to encode the entries, SR-GNN and FGNN validate the effectiveness of GNNs for session-based recommendations. This demonstrates that graph modeling is more suitable for session-based recommendations than sequence modeling (RNN) or attention modeling. GCE-GNN outperforms SR-GNN and FGNN on all three datasets, demonstrating that global and local context enhance session-based recommendations. The proposed method outperforms all baseline methods on all three datasets, outperforming the current best GCE-GNN by up to 0.6% on Diginetica, 5.2% on Tmall, and 2.8% on Nowplaying. This method mitigates the oversmoothing problem by constructing a global graph to better aggregate high-order neighbor information, resulting in superior performance. According to the research of this invention, GFE-SR has a smaller performance improvement in the Diginetica dataset than the other two datasets. This may be because the average length of conversations in the Diginetica dataset is shorter, and GFE-SR uses an inverted position embedding representation, which is more suitable for processing longer conversation sequences.

[0161] Table 2 Comparison of experimental results

[0162]

[0163] Finally, it should be noted that the above are preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention. In addition, it should be pointed out that once those skilled in the art have mastered the basic creative concepts of the present invention, they can make improvements and modifications without departing from the principles of the present invention, and such improvements and modifications should also be considered within the scope of protection of the present invention. Therefore, the appended claims should be interpreted as including the preferred embodiments and all changes and modifications as long as they fall within the scope of implementation of the present invention.

Claims

1. A graph contrast learning conversation recommendation method based on feature enhancement, characterized in that: The method comprises: S1. Construct a conversation graph of user conversation sequences; S2. Generate a session-level feature vector representation for each item node in the session graph; S3. Build a global graph and input the session-level feature vector of the project node into the global-level project representation learning module to obtain the global-level feature vector representation of the project node; S4. Input the session-level feature vector representation and the global-level feature vector representation of the project node into the pooling layer for pooling operation to obtain the pooled vector representation of the project node; S5. Input the pooled vector representation of the project node into the session vector representation learning module to obtain a comprehensive vector representation of the session to be predicted; S6. Input the pooled representation vector of the item node and the comprehensive vector representation of the session to be predicted into the softmax function to obtain the probability of all items being clicked, and make recommendations based on this probability. In S3, the global level item representation learning module includes a averaging layer and a feature propagation unit. S3 includes: S31, input the node's session-level feature vector representation into the averaging layer to calculate the value of each node v i The eigenvector of and its neighbors' eigenvectors are averaged, and the formula is: in Represents node v i The feature vector of the k-th layer node in the feature propagation unit, represents the eigenvector obtained after averaging, τ ij Represents node v in the global graph i With node v j The weight of the edge between i d j Represents node v i and node v i The corresponding elements in the diagonal matrix; S32. Use matrix operations to simplify the averaging formula in S31. First, use T to represent the normalized adjacency matrix with self-loops: in I is the unit matrix, is a global graph The corresponding symmetric adjacency matrix is, yes The degree matrix, diagonal matrix D = diag(d1,…,d n ), the diagonal value is the sum of the row elements in the adjacency matrix A, expressed as d i =∑ j τ ij ; S33, the update process is as follows: Where β is a hyperparameter used to control the ratio of propagation matrix information to unit matrix information, k∈K represents the kth layer of convolution, and γ is a hyperparameter that controls the ratio between the propagation matrix and the item's own representation. is the weight matrix of the feature propagation unit; represents the input of the kth layer of the feature propagation unit, and the output is expressed as 2. The recommendation method according to claim 1, characterized in that The steps to generate session-level feature vector representation in S2 include: S21. Get the attention coefficient of each node and its neighboring nodes. The calculation method is: in and Node v i and neighbor node v j The vector representation of θ ij Represents node v j For node v i The weight of , F is the activation function, is the weight vector, r ij Represents v j and v i The relationship between nodes v i Represents interaction items in a conversation; S22. Linearly combine the node’s attention coefficient with the node’s features to obtain the session-level feature vector representation of each node.

3. The recommendation method according to claim 2, characterized in that: In S22, only the attention coefficients of the node and its first-order neighbors are calculated.

4. The recommendation method according to claim 1, characterized in that: The global-level item representation learning module also includes a dropout layer, which is used to use the dropout function on the global-level feature vector representation to avoid overfitting problems.

5. The recommendation method according to claim 1, characterized in that: In S5, the session vector learning representation layer includes an attention layer, a linear layer, and an activation layer. S5 includes: S51. Input the pooled vector representation of the project node into the linear layer and activation layer connected in sequence to obtain the position information z i : in is the learnable parameter matrix of the linear layer, is the learnable parameter of the linear layer, || represents the connection operation, and tanh is the activation function; is the pooled vector representation of the project node, P = [p1, p2, ..., p l ] is the position embedding matrix, where Is the project node v i The position vector of , l is the length of the current session sequence; S52. Calculate the average value of all item feature vectors in the session to be predicted S to obtain the session information s of the session to be predicted. ′ : S53. Calculate session information s through the attention layer ′ Weight: oh i =q T σ(W3z i +W4s ′ +b2), in, is the learnable parameter matrix and parameters of the attention layer, σ(·) represents the sigmoid function; S54. Calculate the comprehensive session vector representation of the session to be predicted S. The formula is:

6. The recommendation method according to claim 1, characterized in that S6 include: The output is obtained through the softmax function in, Indicates project v i The probability of being clicked at the next moment of the session to be predicted, T represents the transposition symbol, Represents the pooled vector representation of the item node.

7. The recommendation method according to claim 1, characterized in that: The training also includes: S7. Calculate the target loss function and use the time-based backpropagation method to train the parameters. The loss function is: Here, m represents the number of items.

8. The recommendation method according to claim 7, characterized in that: The objective loss function is: Among them, λ is a hyperparameter that controls the ratio of contrastive learning loss; B represents the sampling batch size during training, and represents the comprehensive conversation vector representation of the i-th and j-th conversations, The session vector representation represents the feature enhancement, and τ is an adjustable hyperparameter; The calculation formula is: h s ’=h s Q+E, in, represents the transformation matrix, and E is a random matrix.

9. The recommendation method according to claim 8, characterized in that: Q is the unit matrix, and E is a random matrix that conforms to the standard (0,1) normal distribution.

Citation Information

Patent Citations

  • Global context enhancement graph neural network method based on session recommendation

    CN113487018A

  • Project recommendation method of graph neural network based on directed and undirected structure information

    CN114117229A