Session Recommendation Method, Device, Electronic Device and Medium Based on Hypergraph Learning
By building a hypergraph model, using hyper-edge information aggregation and node feature learning, the problem of inability to accurately model multi-type association relationships in the existing session recommendation system is solved, and more accurate session recommendations are achieved.
Patent Information
- Application Number
- CN202310877538.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-17
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2043-07-17
AI Technical Summary
Due to structural limitations, the existing session recommendation system cannot accurately model the relationship between neighbors and categories between information, resulting in inaccurate recommendations.
A hypergraph based on hypergraph learning is used to build a hypergraph model, through hypergraph information aggregation and node feature learning, combined with reverse position embedding vectors, to generate session recommendation results. The hypergraph contains session hypergraph, neighbor hypergraph super edge, and category hyper edge, which is used to connect items and item neighbors in the session and characterize user interest preferences.
Improves the accuracy of session recommendations, can more accurately capture users' interest preferences in the current session, and generate more accurate item recommendations.
Smart Images

Figure CN117076763B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers and artificial intelligence technologies, and particularly to a session recommendation method, apparatus, electronic device and medium based on hypergraph learning. Background Art
[0002] With the explosive growth of Internet information, as an effective means to alleviate the problem of information overload, recommendation systems have become an important research hotspot in the field of artificial intelligence and are widely used in various real-world scenarios such as e-commerce, social media, and video and audio recommendations, aiming to help people make accurate choices when facing rich and diverse information and services on online platforms, achieving a win-win situation for users and platforms.
[0003] However, with the increasing attention of all sectors of society to user privacy, it is difficult to obtain the historical interaction information of some users, especially newly registered users or anonymously logged-in users; in addition, with the advent of the fragmented network era, users' interests are changeable, and recent interactions within a short period of time become particularly important. Traditional recommendation systems that model based on users' long-term interactions gradually show limitations in some real-world scenarios. Against this background, session-based recommendation is proposed, aiming to model accurate user interest preferences based on the limited historical interaction information of users within a short period of time, so as to provide accurate personalized recommendations. However, there are still some deficiencies in existing methods. For example, due to the limitations of the structure, ordinary graphs cannot accurately model multi-type association relationships such as neighbors and categories between information, which will lead to inaccurate session recommendations. Summary of the Invention
[0004] The main purpose of the embodiments of the present invention is to propose a session recommendation method, apparatus, electronic device and medium based on hypergraph learning, which improves the accuracy of session recommendations.
[0005] One aspect of the present invention provides a session recommendation method based on hypergraph learning, including:
[0006] Responding to a session recommendation request, obtaining user session content, where the session content includes sessions, session sequences and items, and the items have category identifiers;
[0007] Analyzing the session content using a session recommendation model based on hypergraph learning to obtain a session recommendation result;
[0008] The training of the session recommendation model includes:
[0009] Creating a hypergraph, where the hypergraph is used to represent the hyperedges of the session content, and the hyperedges include at least one connection of the items, the neighbors of the items in the session, and the category identifiers;
[0010] Performing hyperedge information aggregation learning on the hypergraph to obtain first item features;
[0011] Perform node feature learning on the hypergraph to obtain node features, aggregate the node features with reverse position embedding vectors to obtain second item features, where the second item features are used to represent user interest preferences, and the reverse position embedding vectors are used to represent the importance of the item in the session;
[0012] Find a target item from the candidate item set according to the second item feature, and generate the session recommendation result.
[0013] According to the session recommendation method based on hypergraph learning, where the hyperedges in the hypergraph include session hyperedges, neighbor hyperedges, and category hyperedges, the session hyperedges are used to connect the items in the session, the neighbor hyperedges are used to connect the item and the neighbors of the item in the session, and the category hyperedges are used to connect the items with the same category identifier.
[0014] According to the session recommendation method based on hypergraph learning, where performing hyperedge information aggregation learning on the hypergraph to obtain the first item feature includes:
[0015] Initialize the initial embedding vectors of the nodes in the hypergraph, where the nodes include item nodes and neighbor nodes, and the initial embedding vectors include an embedding layer and an embedding dimension;
[0016] Construct a node set of the nodes with an association relationship in the hyperedge, where the association relationship is used to represent that the nodes have the same hyperedge;
[0017] Perform hyperedge aggregation learning on the hyperedge information of the nodes in the node set to obtain the neighbors and category information of the item.
[0018] According to the session recommendation method based on hypergraph learning, where hyperedge aggregation learning includes:
[0019] Perform hyperedge information aggregation on node information, and the formula is
[0020]
[0021] where is the hyperedge information aggregation in the l-th layer of hypergraph learning, is the node set, is the embedding vector obtained from the (l - 1)-th layer of hypergraph learning, i and j are the sequence identifiers of the nodes, i is the sequence identifier of the item that has been clicked, and j is the sequence identifier of the item that has not been clicked; where
[0022]
[0023]
[0024] where \(W_0\in\mathbb{R}\) 2d , \(W_1, W_2\in\mathbb{R}\) d×d represent training parameters, [;] is the concatenation operation, \(\sigma\) is the activation function, \(d\) is the embedding dimension, is the set of the items for interaction, and \(\mathbb{R}\) is the domain.
[0025] According to the session recommendation method based on hypergraph learning described above, where node feature learning is performed on the hypergraph to obtain node features, and the node features are aggregated with reverse position embedding vectors to obtain second item features, including:
[0026] According to the neighbors of the item and the category information, perform node information aggregation and update, and the node information aggregation and update is
[0027]
[0028] where \(W_3\) represents learnable parameters, is a hyperparameter;
[0029] Recover the session sequence from the session hyperedges to obtain the first item features in the session arranged in time;
[0030] Represent the importance degree in the session through a reverse position embedding matrix, and obtain the first item features and position vectors in the session through hypergraph learning, and obtain second item features through an aggregation operation. The formula for the aggregation operation is
[0031] \(z\) i =\(\tanh(W_4[z\) i ||p n-i+1 +b_3)\)
[0032] where \(\{z_1, z_2, \ldots, z\) n \}, \(i\) is the position identifier, \(z\) i represents the first item feature at position \(i\), \(W_4\) is a learnable parameter, \(P = [p_1, p_2, \ldots, p\) n , where \(p\) i is the position vector at position \(i\), and \(n\) is the length of the current session sequence.
[0033] According to the session recommendation method based on hypergraph learning described above, where the target item is found from the candidate item set according to the second item features to generate the session recommendation result, including:
[0034] Calculate the session feature in the session according to the second item features by using an attention mechanism. The session feature is used to characterize the user's interest preference, and the calculation method is
[0035]
[0036] γ i = Softmax(β i )
[0037]
[0038] where u is the session feature, softmax is the normalized exponential function, σ represents the sigmoid activation function, W5 ∈ R d , W6 and W7 ∈ R d×d , and W5, W6, and W7 are trainable parameters
[0039]
[0040] Calculate the product of the session feature u and the embedding feature v of the candidate item, and use softmax to calculate the probability of each candidate item being recommended<00 chemo i The calculation process is The calculation process is
[0041]
[0042] where represents the probability that the item v i becomes the next item to be recommended to the user, and v i represents the initial embedding feature of the candidate item v i , and T is the transpose calculation
[0043] According to the session recommendation method based on hypergraph learning described above, the method further includes:
[0044] Use the cross-entropy loss as the loss function for each session to learn the trainable parameters of the hypergraph model based on neighbor and category awareness, and perform the next item recommendation. The cross-entropy loss function is
[0045]
[0046] where y i is the one-hot encoded feature of the true item, and y i is used to generate the corresponding one-hot encoding when determining whether the candidate item v i in the candidate item set is the next item to be recommended;
[0047] Use the backpropagation algorithm to train and optimize the session recommendation model
[0048] Another aspect of the embodiments of the present invention provides a session recommendation device based on hypergraph learning, including:
[0049] A session receiving module, configured to obtain user session content in response to a session recommendation request, where the session content includes sessions, session sequences, and items, and the items have category identifiers;
[0050] A session recommendation module, configured to analyze the session content by using a session recommendation model based on hypergraph learning to obtain a session recommendation result;
[0051] A model training module, configured to create a hypergraph, where the hypergraph is used to represent hyperedges of the session content, and the hyperedges include connections of at least one of the items, neighbors of the items in the session, and the category identifiers; perform hyperedge information aggregation learning on the hypergraph to obtain first item features; perform node feature learning on the hypergraph to obtain node features, aggregate the node features with a reverse position embedding vector to obtain second item features, where the second item features are used to represent user interest preferences, and the reverse position embedding vector is used to represent the importance degree of the items in the session; and find target items from a candidate item set according to the second item features to generate the session recommendation result.
[0052] Another aspect of the embodiments of the present invention provides an electronic device, including a processor and a memory;
[0053] The memory is used to store a program;
[0054] The processor executes the program to implement the method described above.
[0055] The embodiments of the present invention also disclose a computer program product or a computer program, where the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method described above.
[0056] The beneficial effects of the present invention are as follows: By using session hyperedges, neighbor hyperedges, and category hyperedges to describe the complex relationships in a user session, the session description becomes accurate; by performing hyperedge information aggregation through an attention mechanism and obtaining node features through node feature learning, and combining them with a reverse position embedding vector to generate user interest preferences, the user's interest preferences in the current session can be captured more accurately; and more accurate item recommendations are performed according to the interest preferences.
[0057] Additional aspects and advantages of the present invention will be given in part in the following description, become apparent in part from the following description, or be learned through the practice of the present invention. Description of the Drawings
[0058] The above and / or additional aspects and advantages of the present invention will become apparent and be readily understood from the following description of embodiments in conjunction with the accompanying drawings, where:
[0059] Figure 1 It is a schematic structural diagram of a session recommendation system according to an embodiment of the present invention.
[0060] Figure 2 It is a schematic flowchart of a session recommendation method based on hypergraph learning according to an embodiment of the present invention.
[0061] Figure 3 It is a schematic diagram of a hypergraph model based on neighbor and category awareness for session-based recommendation according to an embodiment of the present invention.
[0062] Figure 4 It is a schematic flowchart of hyperedge information aggregation learning according to an embodiment of the present invention.
[0063] Figure 5 It is a schematic flowchart of node feature learning according to an embodiment of the present invention.
[0064] Figure 6 It is a schematic flowchart of a session recommendation process according to an embodiment of the present invention.
[0065] Figure 7 It is a schematic flowchart of the training and optimization of a session recommendation model according to an embodiment of the present invention.
[0066] Figure 8 It is a hyperparameter The influence diagram of the model performance.
[0067] Figure 9 It is the influence diagram of the number of hypergraph learning layers on the model performance according to an embodiment of the present invention.
[0068] Figure 10 It is a diagram of an analysis device for session recommendation based on hypergraph learning according to an embodiment of the present invention. Detailed implementation manners
[0069] Embodiments of the present invention will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals represent the same or similar elements or elements with the same or similar functions throughout. In the following description, suffixes such as "module", "component", or "unit" used to represent elements are only for the convenience of explaining the present invention and have no specific meaning by themselves. Therefore, "module", "component", or "unit" can be used interchangeably. "First", "second", etc. are only used to distinguish technical features and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features or implicitly indicating the sequence of the indicated technical features. In the following description, the consecutive numbering of method steps is for the convenience of review and understanding. Considering the overall technical solution of the present invention and the logical relationship between each step, adjusting the execution order between steps will not affect the technical effect achieved by the technical solution of the present invention. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention and should not be construed as a limitation of the present invention.
[0070] Reference Figure 1 , which is a schematic diagram of the session recommendation system structure. It includes a client 100 and a server 200. The client 100 is an intelligent device with an interactive interface, such as a mobile phone, a personal computer (PC), a tablet computer, etc. The client 100 is connected to the server 200, and the connection methods include 4G / 5G / Wi-Fi / Internet, etc. The client 100 is used to send a session to the server 200. The server 200 obtains the user session content according to the session. The session content includes a session, a session sequence, and items. The items have category identifiers; the session content is analyzed using a session recommendation model based on hypergraph learning to obtain a session recommendation result. At the same time, the server 200 is also used to perform the training of the session recommendation model. The training includes: creating a hypergraph, which is used to represent the hyperedges of the session content. The hyperedges include at least one connection of an item, the neighbors of the item in the session, and the category identifier; performing hyperedge information aggregation learning and node feature learning on the hypergraph to obtain the first item feature; aggregating the node feature and the reverse position embedding vector to obtain the second item feature, which is used to represent the user interest preference, and the reverse position embedding vector is used to represent the importance of the items in the session; finding the target item from the candidate item set according to the second item feature to generate the session recommendation result.
[0071] Reference Figure 2 , Figure 2 is a schematic flowchart of the session recommendation method based on hypergraph learning according to an embodiment of the present invention, which includes a session recommendation process and a training process.
[0072] The session recommendation process includes:
[0073] S100, in response to a session recommendation request, obtain user session content, where the session content includes sessions, session sequences, and items, and the items have category identifiers.
[0074] In some embodiments, the session can represent a product search request input by the user through an interaction interface, or chat information during a chat, etc.
[0075] S200, analyze the session content using a session recommendation model based on hypergraph learning to obtain a session recommendation result.
[0076] In some embodiments, the session recommendation model is obtained through training using a hypergraph based on neighbors and category awareness (HL-NCA).
[0077] The training process includes:
[0078] S300, create a hypergraph, where the hypergraph is used to represent the hyperedges of the session content, and the hyperedges include connections of at least one of items, neighbors of the items in the session, and category identifiers.
[0079] In some embodiments, refer to Figure 3 , Figure 3 is a schematic diagram of a hypergraph model based on neighbors and category awareness. Among them, given all sessions in the training set, first construct a hypergraph to reflect the complex association relationships between information, including three types of hyperedges, namely session hyperedges, neighbor hyperedges, and category hyperedges. Session hyperedges connect all items in a session, neighbor hyperedges connect an item and its neighbors in all sessions, and category hyperedges connect all items in the same category; this hypergraph can show multi-type association relationships between items. Then, aggregate hyperedge information through an attention mechanism and obtain node features through node feature learning, combine them with reverse position embedding vectors to generate the user's interest preferences, and accordingly perform the next recommendation of the model and model optimization.
[0080] Exemplarily, let V = {v1, v2, …, v |V|} represent the item set, which includes all items, and each item has a category identifier, denoted as represents the item v i ∈ belongs to the category Let U = {S1, S2, …, S |U|} represent all sessions, where |U| indicates the number of sessions. S i = {v1, v2, …, v t , …, v n} is the i-th session in the session set U, which includes n items arranged in chronological order, where v t represents the item in session S iItems that interact at timestamp t. Given a current session S i , the job is to first learn the item features and user preferences in the session with the help of neighbor and category information, and then generate the prediction scores of all items in the candidate set, and recommend the k items with the highest scores to the user. It can be understood that an ordinary graph can only represent pairwise node relationships. However, in the real world, there are complex multi - variable connection relationships between information. For example, in session - based recommendation, in addition to using the information of neighbor nodes in the graph, if we want to use the category information of items to enhance information representation, an ordinary graph cannot well integrate the category information at the same time. In contrast, a hypergraph with hyperedges that can connect two or more nodes can better model such complex multi - variable association relationships between information.
[0081] Exemplarily, represent the hypergraph as where the node set includes all items. Define three types of hyperedges, namely session hyperedge connects all items that occur in the same session S k , where represents that in session S k the user has clicked on v j before interacting with v i ; neighbor hyperedge connects the current node and its neighbor nodes in all sessions; category hyperedge connects item nodes with the same category.
[0082] According to the embodiments of the present invention, it has at least the following beneficial effects: The constructed hypergraph aggregates the current session information, global neighbor information, and category information, can obtain neighbor information and category information to enhance item feature learning, and effectively models the multi - variable association relationship based on neighbors and categories between information, making the description of user session information more accurate.
[0083] S400, perform hyperedge information aggregation learning on the hypergraph to obtain the first item feature.
[0084] In some embodiments, refer to Figure 4 the schematic diagram of the hyperedge information aggregation learning process. It includes but is not limited to steps S410 - S430:
[0085] S410, initialize the initial embedding vectors of the nodes in the hypergraph. The nodes include item nodes and neighbor nodes, and the initial embedding vectors include an embedding layer and an embedding dimension;
[0086] S420, construct a set of nodes with an association relationship in the hyperedge, and the association relationship is used to characterize that the nodes have the same hyperedge;
[0087] S430. Perform hyperedge aggregation learning on the hyperedge information of the nodes in the node set to obtain the neighbor and category information of the items.
[0088] Exemplarily, after constructing the hypergraph First, initialize the initial embedding vector x i for each node v i in it, which is represented as follows:
[0089]
[0090] where Embedding represents the embedding layer, refers to the initialized embedding representation of x i , d is the dimension of the embedding representation, and R is the domain.
[0091] For each node v in the session hyperedge i , since it is also associated with neighbor hyperedges and category hyperedges, it is necessary to aggregate the information from neighbor hyperedges and category hyperedges. Since a hyperedge connects different nodes and different nodes have different importance levels for node v i , the node features associated with the hyperedge are taken as a set The information from the hyperedge can be weighted and aggregated through the attention mechanism. In the l-th layer of hypergraph learning, the hyperedge information aggregation can be expressed as: ]
[0092]
[0093] where, α j can be obtained through the following calculation:
[0094]
[0095]
[0096] where W0 ∈ R 2d and W1, W2 ∈ R d×d represent training parameters, [;] refers to the concatenation operation, and σ represents the LeakyRelu activation function.
[0097] In some embodiments, referring to Figure 5 the process schematic diagram of node feature learning shown, which includes but S500. Perform node feature learning on the hypergraph to obtain node features, aggregate the node features with the reverse position embedding vector to obtain the second item feature, the second item feature is used to characterize the user's interest preference, and the reverse position embedding vector is used to characterize the importance level of the items in the session.
[0098] In some embodiments, referring to Figure 5Schematic diagram of the process of node feature learning and aggregation, including but not limited to steps S440 to S460:
[0099] S440, perform node information aggregation and update according to the neighbor and category information of the item;
[0100] S450, recover the session sequence from the session hyperedge to obtain the first item features arranged in time in the session;
[0101] S460, represent the importance degree in the session through the inverse position embedding matrix, obtain the first item features and position vectors in the session through hypergraph learning, and obtain the second item features through an aggregation operation.
[0102] Exemplarily, after learning the neighbor and category information of item v on the session hyperedge, perform node information aggregation and update to obtain node features as follows: i After hyperedge information aggregation and node feature learning, obtain the item features in the session, that is, x
[0103]
[0104] where W3 represents learnable parameters, is a hyperparameter.
[0105] i After that, recover the session sequence from the session hyperedge to obtain the item features arranged in chronological order in the current session, in the form of {z1, z2, …, z n n}. The contributions of different items in a session to the user's interest preference are different. Generally speaking, the items closer to the end include more valid information and are closer to the true user preference. Therefore, a learnable inverse position embedding matrix is used to represent the importance degree P = [p1, p2, …, p n of different items in the current session, where p i is the position vector at position i, and n is the length of the current session sequence. Aggregate the session item features and position vectors obtained through hypergraph learning to obtain the final item features as follows:
[0106] z i = tanh(W4[z i || p n-i+1 + b3)
[0107] where W4 represents learnable parameters.
[0108] Calculate the session features in the session according to the second item features using the attention mechanism. The session features are used to characterize the user's interest preference
[0109] S600. Find the target item from the candidate item set according to the second item feature, and generate a conversation recommendation result.
[0110] In some embodiments, referring to Figure 6 the schematic diagram of the conversation recommendation process, which includes but is not limited to steps S510 - S520:
[0111] S510. Calculate the conversation feature in the conversation using the attention mechanism according to the second item feature, and the conversation feature is used to represent the user's interest preference;
[0112] S520. Calculate the product of the conversation feature and the embedding feature of the candidate item, and use the softmax function to calculate the probability of each candidate item being recommended.
[0113] Exemplarily, after obtaining the final item feature that fuses neighbor and category information and the reverse position embedding vector, use the attention mechanism to calculate the current conversation feature, that is, the user's interest preference in the current conversation, as shown in the following formula:
[0114]
[0115] γ i = Softmax(β i ),
[0116]
[0117] where σ represents the sigmoid function; W5 ∈ R d and W6, W7 ∈ R d×d represent trainable parameters, which can be obtained through the following calculation:
[0118]
[0119] After obtaining the conversation feature u, the final recommended probability of each candidate item can be generated by combining u with the embedding representation v i of the item v in the candidate item set i Specifically, first calculate the product of the conversation feature u and the embedding representation v i of the candidate item, and then use the softmax function to calculate the probability of each candidate item being recommended The calculation process is as follows:
[0120]
[0121] where represents the probability that the item v i becomes the next item recommended to the user, and v i represents the candidate item vi Initial embedding features.
[0122] Reference Figure 7 , embodiments of the present invention also disclose the execution of training and optimization of the session recommendation model, and the process includes but is not limited to steps S610 to S620:
[0123] For each session, use cross-entropy loss as the loss function to learn the trainable parameters of the neighbor and category-aware hypergraph model, and perform the next item recommendation
[0124] S620, use the backpropagation algorithm to perform training and optimization on the session recommendation model.
[0125] Exemplarily, for each session, use cross-entropy loss as the loss function to learn the trainable parameters of the neighbor and category-aware hypergraph model and perform the next item recommendation. The cross-entropy loss function can be expressed as:
[0126]
[0127] where y i represents the one-hot encoding representation of the true item. When the candidate v in the candidate item set i is the correct next recommended item, the value of y i is 1, otherwise 0. After that, use the backpropagation algorithm to perform model training and optimization.
[0128] The present invention also discloses an embodiment for experimental verification of session-based recommendation based on hypergraph learning.
[0129] Apply two real-world datasets widely used in session-based recommendation research, namely Diginetica and Cosmetics, to conduct experiments.
[0130] The Diginetic dataset was released in the CIKM Cup 2016 competition, which records the behavior data of users on an e-commerce platform; the Cosmetics dataset was released in the kaggle competition, which records the user behavior in a large beauty website.
[0131] To better apply the datasets to the recommendation task, the datasets were preprocessed before training. Specifically, data augmentation was performed on the session sequences to expand the training data. Since there are short sessions with little value and items that appear less frequently in the datasets, referring to previous work, sessions with a sequence length less than 2 and items that appear less than 10 times in the datasets were deleted. The detailed information of the preprocessed datasets is shown in Table 1.
[0132] Table 1 Dataset detailed information
[0133]
[0134]
[0135] To evaluate the performance of the proposed neighbor- and class-aware hypergraph session-based recommendation model, it is selected to be compared with the following representative state-of-the-art benchmark models: GRU4Rec uses recurrent neural units to model the user's item interaction sequence and generates recommendations accordingly; NARM uses recurrent neural networks and attention mechanisms to aggregate both global and local information and obtain the user's main intention; SR-GNN converts each session into a session graph and uses gated graph neural networks to model the pairwise transition relationships between items on the graph; GCE-GNN uses graph neural networks to simultaneously obtain the global-level and local-level pairwise transition relationships between items to model the user's preferences; LESSR designs fast graph attention and edge-order-preserving aggregation layers to address the information loss problem that often occurs when using graph neural networks in the field of session-based recommendation and enhance the performance of the recommendation system; S 2 -DHCN designs two hypergraphs to model the high-order association relationships between items and adopts self-supervised contrast learning to enhance item features.
[0136] The first 70% of the sessions in the Diginetica and Cosmetics datasets are used as the training set, 20% as the validation set for tuning the model and hyperparameters, and the remaining 10% as the test set to reflect the model's performance. Referring to previous work, the embedding representation dimension of items is set to 128, the batch size is specified as 100, the learning rate is initialized to 0.001, and Adam is used as the optimizer to train and optimize the model. The recommended list size K is set to 20 for model performance evaluation. In addition, grid search is used to adjust the size of the hyperparameters in the middle to control the degree of aggregation of various types of information to find the best performance of HL-NCA on the two datasets.
[0137] The HL-NCA model is compared with the state-of-the-art recommendation benchmark models in terms of the Recall@20 and MRR@20 evaluation metrics on two real-world datasets. The experimental results are shown in Table 2, where the results of the best-performing model and the best benchmark model in each column are represented in bold and underlined respectively. △ represents the statistical significance of HL-NCA relative to the best benchmark model using paired t-tests (p < 0.01). The following results can be observed from it:
[0138] Table 2 Model Performance
[0139]
[0140]
[0141] Although both GRU4Rec and NARM are session-based recommendation models based on recurrent neural networks, NARM performs far better than GRU4Rec on the two datasets Recall@20 and MRR@20. This is considered to be because, compared with GRU4Rec, the NARM model introduces an attention mechanism, which can more accurately simulate the true intentions of users.
[0142] In session-based recommendation models based on graph neural networks, although the GCE-GNN model that simultaneously uses global information and current session information for item feature learning performs better than SR-GNN in most cases, it performs poorly on the MRR@20 of the Cosmetics dataset. This may be due to the interference of irrelevant interaction information in other sessions with the modeling of user interest preferences. In addition, although the LESSR model solves the problem of information loss in graph neural networks, it also performs poorly on relevant datasets. This may also be due to the interference of additional information from other sessions, resulting in the model being unable to more accurately capture the user's interest preferences in the current session.
[0143] Generally speaking, the HL-NCA method outperforms the competitive baseline models in terms of the evaluation metrics Recall@20 and MRR@20 of the two experimental datasets Diginetica and Cosmetics, which proves its effectiveness in session-based recommendation tasks. The reasons can be summarized as follows: Introducing the category information of items can enrich item feature learning and more accurately simulate the true intentions of users. Comparing with the S 2 -DHCN which is also a hypergraph session-based recommendation, the proposed hypergraph method that fuses neighbor and category information performs better, which can also prove this point. The S 2 -DHCN model only uses the neighbor association relationship between items singly. Incorporating both neighbor and category information will further enrich the representation learning of items. In addition, hypergraph recommendation can overcome the bottleneck that ordinary graph learning can only represent pairwise transformation relationships, and more accurately model the association relationships between multiple types of items such as neighbors and categories, so as to generate more accurate recommendations.
[0144] HL-NCA outperforms the best baseline model by 0.65% and 6.73% respectively in terms of the Recall@20 and MRR@20 evaluation metrics on the Diginetica dataset; the corresponding improvements are 7.13% and 5.44% respectively on Cosmetics. It can be found that the proposed neighbor- and category-aware hypergraph session-based recommendation model has a greater improvement rate in MRR@20 than in Recall@20 on the Diginetica dataset, which indicates that the proposed model can more effectively rank the target item in the correct position compared to hitting the target item in the recommendation list. However, the improvement effect on the Cosmetics dataset is the opposite, and it is considered that this difference is mainly caused by the data differences of the two datasets themselves.
[0145] For the ablation experiment, three variants of HL-NCA were designed, namely Base, Base-H, and Base-C, to explore the contribution degree of each type of information by comparing the experimental effects of HL-NCA and its variant models on the Diginetica and Cosmetics datasets. Specifically, the variant Base only uses the graph attention network to model the current session sequence without using the neighbor and item category information among different sessions. Base-H and Base-C respectively represent removing the category information aggregation and neighbor information aggregation parts from the HL-NCA model. The experimental results of the variants and HL-NCA on the two datasets are shown in Table 3.
[0146] Table 3 Ablation Experiment
[0147]
[0148] According to Table 3, it can be found that both the neighbor and category information of items contribute to the improvement of the recommendation model performance. In addition, removing the neighbor information of items leads to a greater decline in model performance than removing the category information of items. This may be because the global neighbors of items can play a more important role in the recommendation system compared to category information. Compared with HL-NCA, the model performance of Base-C decreased by 3.00% and 1.35% respectively in terms of the Recall@20 and MRR@20 evaluation metrics on the Diginetica dataset, and the corresponding changes on the Cosmetics dataset were 2.96% and 0.81%. Similarly, compared with the HL-NCA model, the performance of Base-N decreased by 1.26% and 0.87% respectively on Diginetica, and decreased by 1.76% and 0.65% respectively on Cosmetics. It can be clearly seen from the experimental results that the neighbor information and category information of items contribute more to correctly hitting the next item in the recommendation list than to ranking it in the correct position.
[0149] Hyperparameters Analysis shows that in the proposed HL-NCA model, a hyperparameter is introduced to control the degree to which neighbor information and category information participate in node feature update. Specifically, by adjusting the hyperparameter within {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9} to test the performance of HL-NCA and study the impact of the degree of incorporating neighbor and category information of items on the performance of the recommendation model. The experimental results are as Figure 8 shown.
[0150] The hyperparameter on the model performance. According to the experimental results presented in Figure 8 , introducing an appropriate degree of neighbor and category information can effectively improve the performance of the recommendation system. This is because neighbor and category information between items can introduce information from other sessions, thereby enriching the representation learning of items and making the modeling of user interest preferences closer to the real user behavior pattern. On the two datasets, as increases, the performance of HL-NCA on the Recall@20 and MRR@20 evaluation metrics both shows a trend of first increasing and then decreasing. Specifically, on the Digientica dataset, the model performance is best when is 0.6; on the Cosmetics dataset, it is is 0.7 when the model performance reaches the best. Compared with the Diginetica dataset, Cosmetics requires more neighbor information, which is considered to be possibly because the average number of clicks on items in Cosmetics is less, so more neighbor information is needed to enrich the representation. In addition, it can be seen that more neighbor information is needed in both datasets, which is also consistent with the result presented in the ablation experiment in Section 4.2 that neighbor information contributes more to the model performance.
[0151] Hypergraph learning layer analysis. Experiments are conducted to explore the impact of the number of hypergraph learning layers on the performance of the HL-NCA model. Specifically, by adjusting the number of hypergraph learning layers within {1, 2, 3, 4, 5} to test the performance of HL-NCA. The experimental results are as Figure 9 shown.
[0152] Figure 9 The impact of the number of hypergraph learning layers on the model performance. According to Figure 9From the experimental results presented, it can be seen that as the number of layers of hypergraph learning increases, the trends of both Recall@20 and MRR@20 evaluation metrics on the two datasets first increase and then decrease. Specifically, when the number of layers is 4, the performance of the model on the Diginetica dataset reaches the best in both evaluation metrics. However, on the Cosmetics dataset, when the number of layers is 4, the model performs best in the Recall@20 evaluation metric, while in MRR@20, the performance is optimal when the number of layers is 3. It is considered that the reason for this change trend on the dataset is that as the number of layers increases, the representation learned by the items through hypergraphs becomes more accurate, and the recommendation system performs better; but when the number of layers reaches a certain large size, the over-smoothing problem commonly faced by deep graph neural networks will inevitably occur, which will lead to a decline in the model performance.
[0153] Figure 10 It is a diagram of the session recommendation analysis device based on hypergraph learning according to an embodiment of the present invention. The device includes a session receiving module 1010, a session recommendation module 1020, and a model training module 1030.
[0154] Among them, the session receiving module is used to obtain user session content in response to a session recommendation request. The session content includes sessions, session sequences, and items, and the items have category identifiers; the session recommendation module is used to analyze the session content using a session recommendation model based on hypergraph learning to obtain a session recommendation result; the model training module is used to create a hypergraph, where the hypergraph is used to represent hyperedges of the session content, and the hyperedges include connections of at least one of items, neighbors of the items in the session, and category identifiers; perform hyperedge information aggregation learning on the hypergraph to obtain first item features; perform node feature learning on the hypergraph to obtain node features, aggregate the node features with reverse position embedding vectors to obtain second item features, where the second item features are used to represent user interest preferences, and the reverse position embedding vectors are used to represent the importance of items in the session; and find target items from the candidate item set according to the second item features to generate a session recommendation result.
[0155] Exemplarily, in a reference voltage module, a virtual vector module, an alternative module, a midpoint balancing module, and an output module in a device, the device in the embodiment can implement any of the foregoing session recommendation methods based on hypergraph learning, that is, in response to a session recommendation request, obtain user session content, where the session content includes a session, a session sequence, and items, and the items have category identifiers; analyze the session content using a session recommendation model based on hypergraph learning to obtain a session recommendation result; the training of the session recommendation model includes: creating a hypergraph, where the hypergraph is used to represent hyperedges of the session content, and the hyperedges include connections of at least one of an item, neighbors of the item in the session, and a category identifier; performing hyperedge information aggregation learning on the hypergraph to obtain first item features; performing node feature learning on the hypergraph to obtain node features, aggregating the node features with a reverse position embedding vector to obtain second item features, where the second item features are used to represent user interest preferences, and the reverse position embedding vector is used to represent the importance degree of the items in the session; and searching for target items from a candidate item set according to the second item features to generate a session recommendation result. The beneficial effects of the present invention are as follows: The complex relationships in the user session are described through session hyperedges, neighbor hyperedges, and category hyperedges, making the session description accurate; hyperedge information aggregation is performed through an attention mechanism, and node features are obtained through node feature learning, and they are combined with the reverse position embedding vector to generate the user's interest preferences, more accurately capturing the user's interest preferences in the current session; and more accurate item recommendations are performed according to the interest preferences.
[0156] An embodiment of the present invention further provides an electronic device, which includes a processor and a memory;
[0157] The memory stores a program;
[0158] The processor executes the program to execute the foregoing session recommendation method based on hypergraph learning; the electronic device has the function of carrying and running the software system of the session recommendation based on hypergraph learning provided by the embodiment of the present invention.
[0159] An embodiment of the present invention further provides a computer-readable storage medium, where the storage medium stores a program, and the program is executed by a processor to implement the session recommendation method based on hypergraph learning as described above.
[0160] In some alternative embodiments, the functions / operations recited in the block diagrams may not occur in the order noted in the operational illustrations. For example, depending upon the functionality / operation involved, two blocks shown in succession may actually be executed substantially concurrently or the blocks may sometimes be executed in the reverse order. Further, the embodiments presented and described in the flowcharts of the present invention are provided by way of example in order to provide a more thorough understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is altered and in which sub-operations described as part of a larger operation are executed independently.
[0161] Embodiments of the present invention also disclose a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device may read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to execute the foregoing session recommendation method based on hypergraph learning.
[0162] In addition, although the present invention has been described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the functions and / or features described may be integrated in a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It should also be understood that a detailed discussion of the actual implementation of each module is not necessary for an understanding of the present invention. Rather, given the attributes, functions, and internal relationships of the various functional modules in the devices disclosed herein, the actual implementation of the modules will be understood within the ordinary skill of an engineer. Thus, those of ordinary skill in the art can implement the present invention as set forth in the claims without undue experimentation. It should also be understood that the particular concepts disclosed are illustrative only and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0163] If the above-mentioned functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.
[0164] The logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a definite sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch instructions from the instruction execution system, apparatus, or device and execute the instructions), or in combination with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in combination with an instruction execution system, apparatus, or device.
[0165] More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, a computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or, if necessary, other appropriate processing, and then storing it in a computer memory.
[0166] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits with logic gate circuits for implementing logical functions on data signals, application specific integrated circuits with appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
[0167] In the description of this specification, the descriptions referring to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0168] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the claims and their equivalents.
[0169] The above has specifically described the preferred embodiments of the present invention, but the present invention is not limited to the described embodiments. Those skilled in the art can also make various equivalent deformations or substitutions without departing from the spirit of the present invention, and these equivalent deformations or substitutions are all included within the scope defined by the claims of this application.
Claims
1. A session recommendation method based on hypergraph learning, characterized in that, including: In response to a session recommendation request, obtain user session content, where the session content includes sessions, session sequences, and items, and the items have category identifiers; Analyze the session content using a session recommendation model based on hypergraph learning to obtain a session recommendation result; The training of the session recommendation model includes: Create a hypergraph, where the hypergraph is used to represent the hyperedges of the session content, and the hyperedges include connections of at least one of the items, neighbors of the items in the session, and the category identifiers; Perform hyperedge information aggregation learning on the hypergraph to obtain first item features; Perform node feature learning on the hypergraph to obtain node features, aggregate the node features with reverse position embedding vectors to obtain second item features, where the second item features are used to represent user interest preferences, and the reverse position embedding vectors are used to represent the importance of the items in the session; Find target items from a candidate item set according to the second item features to generate the session recommendation result; The hyperedge aggregation learning includes: Perform hyperedge information aggregation on node information, and the formula is , wherein is the hyperedge information aggregation in the -th layer of hypergraph learning, is the node set, is the -th layer of hypergraph learning obtained embedding vector, and are the sequence identifiers of the nodes, is the sequence identifier of the item that has been clicked, is the sequence identifier of the item that has not been clicked; wherein , , Among them , represents the training parameters, is the connection operation, is the activation function, is the embedding dimension, is the set of the items for interaction, and R is the domain; The performing node feature learning on the hypergraph to obtain node features, and aggregating the node features with reverse position embedding vectors to obtain second item features includes: According to the neighbors of the item and the category information, perform node information aggregation and update, and the node information aggregation and update is Among them, represents learnable parameters, which are hyperparameters; Restore the session sequence from the session hyperedges to obtain the first item features arranged in time in the session; Represent the importance in the session through a reverse position embedding matrix, obtain the first item features and position vectors in the session through hypergraph learning, and obtain second item features through an aggregation operation.
2. The session recommendation method based on hypergraph learning according to claim 1, wherein The hyperedges in the hypergraph include session hyperedges, neighbor hyperedges, and category hyperedges. The session hyperedges are used to connect the items in the session, the neighbor hyperedges are used to connect the items and the neighbors of the items in the session, and the category hyperedges are used to connect the items with the same category identifier.
3. The session recommendation method based on hypergraph learning according to claim 2, wherein The performing hyperedge information aggregation learning on the hypergraph to obtain the first item features includes: Initialize the initial embedding vectors of the nodes in the hypergraph, where the nodes include item nodes and neighbor nodes, and the initial embedding vectors include an embedding layer and an embedding dimension; Construct a node set of the nodes with an association relationship in the hyperedges, where the association relationship is used to represent that the nodes have the same hyperedge; Perform hyperedge aggregation learning on the hyperedge information of the nodes in the node set to obtain the neighbors and category information of the items.
4. The session recommendation method based on hypergraph learning according to claim 3, wherein The formula of the aggregation operation is Among them, , is the location identifier, Indicates location The first item feature, is a learnable parameter, ,in It's location The position vector on The length of the current session sequence.
5. The session recommendation method based on hypergraph learning according to claim 4, characterized in that The finding target items from the candidate item set according to the second item features to generate the session recommendation result includes: Calculate the session features in the session according to the second item features using an attention mechanism, where the session features are used to represent user interest preferences, and the calculation method is , , , Among them, is the session feature, and softmax is the normalized exponential function, represents the sigmoid activation function, , and , 、 and , Calculate session features and the embedding features of candidate items to calculate the probability of each candidate item being recommended using softmax The calculation process is , , wherein represents an item is the probability of becoming the next item to be recommended to the user, represents a candidate item is the initial embedding feature of, and T is the transpose calculation.
6. The session recommendation method based on hypergraph learning according to claim 5, wherein The method further includes: For each session, use the cross-entropy loss as the loss function to learn the trainable parameters of the neighbor- and category-aware hypergraph model, and perform the next item recommendation. The cross-entropy loss function is , wherein is the one-hot encoded feature of the true value item, and is used to generate the corresponding one-hot encoding when determining whether an item in the candidate item set is the next item to be recommended; Use the backpropagation algorithm to train and optimize the session recommendation model.
7. A session recommendation device based on hypergraph learning, characterized in that, It includes: A session receiving module, configured to obtain user session content in response to a session recommendation request. The session content includes a session, a session sequence, and items, and the items have category identifiers; A session recommendation module, configured to analyze the session content using a session recommendation model based on hypergraph learning to obtain a session recommendation result; A model training module, configured to create a hypergraph, where the hypergraph is used to represent the hyperedges of the session content, and the hyperedges include connections of at least one of the items, the neighbors of the items in the session, and the category identifiers; perform hyperedge information aggregation learning on the hypergraph to obtain first item features; perform node feature learning on the hypergraph to obtain node features, and aggregate the node features with the reverse position embedding vector to obtain second item features, where the second item features are used to represent user interest preferences, and the reverse position embedding vector is used to represent the importance of the items in the session; It is configured to find a target item from a candidate item set according to the second item features to generate the session recommendation result; The hyperedge aggregation learning includes: Perform hyperedge information aggregation on node information, and the formula is , Among them is the hyperedge information aggregation in the -th layer of hypergraph learning, is the node set, is the -th layer of embedding vector obtained by hypergraph learning, and are the sequence identifiers of the nodes, is the sequence identifier of the item that has been clicked, is the sequence identifier of the item that has not been clicked; among them , , Among them , represents training parameters, is a connection operation, is an activation function, is the embedding dimension, is the set of the items for interaction, and R is the domain; Performing node feature learning on the hypergraph to obtain node features, and aggregating the node features with the reverse position embedding vector to obtain second item features includes: According to the neighbors of the item and the category information, perform node information aggregation update, and the node information aggregation update is Among them, represents learnable parameters, which are hyperparameters; Restore the session sequence from the session hyperedges to obtain the first item features arranged in time in the session; Represent the importance in the session through a reverse position embedding matrix, and obtain the first item features and position vectors in the session through hypergraph learning, and obtain second item features through an aggregation operation.
8. An electronic device, characterized in that, It includes a processor and a memory; The memory is used to store programs; The processor executes the program to implement the session recommendation method based on hypergraph learning as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The storage medium stores a program, and the program is executed by the processor to implement the session recommendation method based on hypergraph learning as described in any one of claims 1-6.
Citation Information
Patent Citations
Session recommendation method based on capturing user long and short term interest heterogeneous hypergraph
CN114428912A
Contrast learning session recommendation method fusing hypergraph
CN116186390A