An Inductive Matrix Completion Method Based on Spatiotemporal Session Graph for Recommendation Scenarios
By introducing spatiotemporal conversation graphs and meta-learning technologies into the recommendation system, the user's spatiotemporal interest representation is solved, and the existing recommendation system ignores time factors and lacks feature information is achieved, and more accurate user interest prediction and matrix completion effects are achieved.
Patent Information
- Application Number
- CN202211581727.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-09
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2042-12-09
AI Technical Summary
Existing recommendation systems ignore time factors when dealing with user interactions with items, and in the absence of high-quality content features, it is difficult to achieve effective matrix completion.
A generalized matrix completion method based on spatiotemporal conversation graph is designed. By extracting rating information and time information from user historical interaction data, rating matrix and timestamp matrix are constructed, and the user-project two-part graph and DBSCAN clustering algorithm are used to construct the user's local interest representation and global interest representation, combining the multi-head attention mechanism and MLP for scoring prediction.
This method can effectively tap the potential interests of users while taking into account spatiotemporal information, and achieve high-quality matrix completion in the absence of feature information, improving the accuracy of recommendations.
Smart Images

Figure CN115840852B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of recommendation systems, and specifically designs an inductive matrix completion method based on a spatio-temporal session graph for recommendation scenarios. Background Art
[0002] Recommendation systems are key tools for mining users' potential interests and increasing the system click-through rate, and have been applied to many online services. The essence of recommendation is to learn the latent representations of users and items from past user-item interactions and predict the items that users will interact with in the future. Most work transforms the recommendation task into a matrix completion task. Currently, the collaborative filtering (CF) algorithm is still one of the most widely used recommendation algorithms and plays an important role in the field of recommendation. Formally represented mathematically, the entire collaborative filtering process is actually a matrix completion problem. The basic assumption of the CF method is that if user u1 shares a common item with another user u2, then u1 may also be interested in other items that u2 likes. The rows and columns of the matrix represent users and items respectively, and predicting a user's interest in an item is equivalent to filling in the missing entries in the rating matrix. However, the user-item interaction record matrix is time-independent, which does not conform to the actual situation because users' preferences, item popularity, and users' latent similarities are all related to time. For example, in the commodity field, when a person gets paid, he usually buys more goods than usual; in the movie field, when a good movie is released, more people will choose to watch this movie during this release period. At the same time, research has shown that people who consume the same item at the same time have more similarities. Grasping this changing trend of items helps to obtain better item representations, thus having a positive impact on recommendations. Secondly, in order to make matrix completion inductive, most previous work uses content (side information), such as the age of the user or the genre of the movie, for prediction. However, high-quality content is not always available and may be difficult to extract. In extreme settings, no side information is available except for the matrix. Summary of the Invention
[0003] To solve the above problems, the present invention designs an inductive matrix completion method based on a spatio-temporal session graph to address the current limitations. The method includes that the present invention provides an inductive matrix completion method based on a spatio-temporal session graph for recommendation scenarios, and the method includes: extracting rating information and time information from user historical interaction data, respectively constructing a rating matrix and a timestamp matrix, and constructing a user-item bipartite graph based on the interaction information between users and items. Extracting the one-hop neighbor graph of each training user-item pair based on the user-item bipartite graph, which is defined as a bipartite graph formed by nodes u, v and their one-hop neighbors derived from the bipartite graph. These local graphs contain rich graph pattern information about the rating of u for v. For example, all The paths are all included in the one-hop neighbor graph around (u0, v0). To further capture the similarity between users, the DBSCAN clustering algorithm is used to cluster items according to the interaction time density between users and items, obtaining a sequence of session subgraphs of (u0, v0), such that all items in the path are within the same time period. Corresponding operations are performed on multiple session subgraphs of the user to obtain the local interest representation of the user. Taking the local interest representation of the user as the input of the meta-network, meta-learning is used to obtain the implicit relationship between session subgraphs, and the global representation of the user interest is obtained. Then, the multi-head attention mechanism is used to learn the spatio-temporal neighbor representation vectors of users and items, and the global representation is fused with the spatio-temporal neighbor representations of users and items to obtain the final representation of the user interest. Then, an MLP is used for score prediction. The present invention integrates the spatio-temporal information of users and items, further mines the potential interests of users, and realizes inductive matrix completion based on spatio-temporal session graphs in the case where it is difficult to obtain feature information
[0004] The present invention provides an inductive matrix completion method based on spatio-temporal session graphs for application in recommendation scenarios, and the method includes the following steps:
[0005] S1. Data preprocessing: Extract the rating information of users for items and the time information of the interaction between users and items in the user historical interaction data, and construct a user-item rating matrix and a user-item timestamp matrix;
[0006] S2. Construct a one-hop neighbor graph of user-item pairs: For each user-item pair in the rating matrix, according to the user-item bipartite graph, extract the neighbor nodes of the user and the item respectively, and construct a one-hop neighbor graph of user-item pairs;
[0007] S3. Obtain the session subgraph of the user: Using the DBSCAN algorithm, according to the user-item timestamp matrix, perform clustering based on time density on the interaction items of the user, and then segment the one-hop neighbor graph of user-item pairs according to the clustering result of the items, obtaining a set of session subgraphs of user-item pairs. The items in each session subgraph are the interactions of the user within a period of adjacent time;
[0008] S4. Learn the local interest representation of the user: Use R-GCN to train to obtain the representation vector of the session subgraph, and then splice the representation vectors of the session subgraphs of user-item pairs to obtain the local interest representation vector of the user;
[0009] S5. Learn the global interest representation of the user: Use meta-learning to learn the potential relationship between session subgraphs and obtain the global representation vector of the user interest;
[0010] S6. Learning user-item pairs' spatio-temporal neighbor embeddings: Use the multi-head attention mechanism to obtain the spatio-temporal neighbor embeddings of user-item pairs;
[0011] S7. Regression prediction: Concatenate the user's global interest representation with the spatio-temporal neighbor embeddings of user-item pairs to obtain the user's final interest representation, and then input the user's final interest representation vector into the MLP layer for regression prediction to obtain the predicted score of the user for the item.
[0012] Furthermore, the step S2 specifically includes the following steps:
[0013] S21. Construct a user-item bipartite graph G based on the rating matrix. There are only two types of nodes in G: user nodes u (corresponding to the rows in the rating matrix) and item nodes v (corresponding to the columns in the rating matrix). Edges only exist between user u and item v, and the feature of the edge is the rating information of u for v;
[0014] S22. Obtain the first-hop neighbors of the (u, v) pair. Obtain the first-hop neighbors of u from the bipartite graph G, that is, all user nodes that interact with v, and obtain the first-hop neighbors of v, that is, all item nodes that interact with u. This process can be described as:
[0015] U = {u}, V = {v} (1)
[0016] U neighbor = {u i ∶ u i ~ V}\U (2)
[0017] V neighbor = {v i ∶ v i ~ U}\V (3)
[0018] S23. Construct the first-hop neighbor graph of (u, v)
[0019] U = U ∪ U neighbor (4)
[0020] V = V ∪ V neighbor (5)
[0021] Use the obtained U and V to derive the first-hop neighbor graph of (u, v) from the user-item bipartite graph G Construct the rating matrix of the first-hop neighbor graph.
[0022] The step S4 specifically includes the following steps:
[0023] S41. Node Marking: Use different labels to distinguish the different roles of nodes in the subgraph, that is, to distinguish the nodes of the target user, target project, user category, and project category. Otherwise, the GNN cannot determine between which user and which project to perform rating prediction, and may lose node type information. Mark the target user and target project as 0 and 1, the one-hop user node as 2, and the one-hop project node as 3.
[0024] S42. Use R-GCN for message passing to obtain node representations:
[0025]
[0026] Among them, represents the feature vector of node i at layer l, and are learnable parameter matrices.
[0027] S43. Obtain the local interest representation of the user:
[0028] First, connect the feature vectors obtained by node i at different layers of training to get its potential representation vector h i , and then connect the potential representation vector h u of the user and the potential representation vector h v of the project to perform a connection operation to obtain the representation of the (u, v) session graph. Finally, connect all the session representations of (u, v) to obtain the local interest representation of the user.
[0029]
[0030] g i = concat(h u , h v ) (8)
[0031] g local = concat(g1, g2,..., g i ) (9)
[0032] Among them, h u represents the final potential representation vector of the target user, h v represents the final potential representation vector of the target item, and g i represents a session graph representation vector of (u, v).
[0033] The specific steps of step S5 are as follows:
[0034] S51. Obtain the contribution value of each session subgraph according to the attention mechanism:
[0035] Different session subgraphs have different contributions. When compressing different parts, the attention mechanism can make different parts have different contributions. Therefore, the attention mechanism is first used to obtain the session representation of (u, v). This process can be expressed as:
[0036] a′ j = h(g i ; θ) (10)
[0037]
[0038]
[0039] Among them, represents the session subgraph sequence of user u i ; a j is the attention score of the j-th session subgraph of user u i and can be interpreted as the importance of the j-th session subgraph in the next step of meta-learning; h(·) represents the attention network, and here a two-layer feedforward neural network is used, where θ represents the network parameters.
[0040] S52. Use the meta-network to learn the relationship between user session subgraphs: It takes the session representation of the user as the input and learns a personalized bridging function between different session subgraphs of the user. The meta-network can be expressed as:
[0041]
[0042] Among them, g(·) represents the meta-network, and here a two-layer feedforward neural network is used, is the network parameter. is a vector whose shape depends on the structure of the bridging function.
[0043] S53. Learn the user's global interest representation:
[0044] Use the learned by the meta-network in S52 as the parameter of the bridging function, and take the local interest representation g i of user u local as the input. The personalized bridging function can be expressed as:
[0045]
[0046] For simplicity, a one-layer linear layer is used as the bridging function, and its output is the user's global interest representation:
[0047] Step S6 specifically includes the following steps:
[0048] S61. For each pair (u, v), construct the temporal interaction sequence \(T\) of user \(u\) u =\(\{v_1,\ldots,v\) s \}\) and the temporal interaction sequence \(T\) of item \(v\) = \(\{u_1,\ldots,u\) s \}\), where \(s\) is the number of one-hop neighbors;
[0049] S62. Obtain the initial representation vectors of users and items: For any user \(u\) and item \(v\), perform a lookup operation in the user embedding matrix \(E\) u \(\in\mathbb{R}\) M×d and the item embedding matrix \(E\) V \(\in\mathbb{R}\) M×d to obtain the initial embeddings of user \(u\) and item \(v\). Thus, the temporal representation matrix can be obtained:
[0050]
[0051]
[0052] S63. Use the k-head attention mechanism to learn the one-hop neighbor embedding matrix of \((u, v)\): First, use the dot-product attention function to learn \(k\) one-hop neighbor embedding matrices of \((u, v)\). Specifically, multi-head attention first maps the temporal input embeddings \(X\) u / \(X\) v into \(k\) subspaces with various linear mapping matrices, and then uses the \(k\)-scale dot-product attention function to parallelly generate the output embedding matrices of one-hop neighbors. This process can be expressed as:
[0053]
[0054]
[0055] where \(X\) u / \(X\) v is the temporal input representation matrix of user \(u\) / item \(v\).
[0056] Then, these embedding matrices are concatenated to produce a combined neighborhood embedding matrix. Finally, apply a feed-forward neural network for dimensionality transformation, and the spatio-temporal neighbor embeddings of the central user \(u\) and central item \(v\) can be calculated as:
[0057]
[0058]
[0059] FFN(x) = xW0 + b0 (22)
[0060] where \(W0\in\mathbb{R}\)D′×d , b0 ∈ R d , the spatio-temporal neighbor embedding matrix can be represented in a temporal sequence as
[0061] S64. Use the average pooling operation to aggregate the spatio-temporal neighbor embeddings to obtain the aggregated neighbor embedding n u , n v , and the process can be expressed as:
[0062]
[0063]
[0064] The specific steps of step S7 are as follows:
[0065] S71. Concatenate the global interest representation of the user with the spatio-temporal neighbor embedding of the user-item pair to obtain the final interest representation of the user:
[0066] g = concat(g global , n u , n v ) (25)
[0067] S72. After obtaining the final interest representation of the user, use MLP for rating prediction, and the process can be expressed as:
[0068]
[0069] where W and w are the parameters of MLP, which map the representation g to a scalar rating score, and σ is the activation function, and ReLU is used as its activation function.
[0070] S73. Minimize the root mean square error between and the true rating for optimization, and the loss function is expressed as:
[0071]
[0072] Compared with the existing technologies, the technical effects of the present invention are as follows:
[0073] In the implementation process of an inductive matrix completion method based on spatio-temporal session graph for recommendation scenarios designed by the present invention, the order of the user click time stream is distinguished. Based on DBSCAN density clustering, a sequence of user session subgraphs is constructed according to the user-item bipartite graph, and the relationship between session subgraphs is automatically learned by meta-learning, considering the time stream order of user-item interactions, and further capturing the user interests.
[0074] An inductive matrix completion method based on spatio-temporal session graph for recommendation scenarios designed by the present invention uses a multi-head attention mechanism to learn spatio-temporal neighbor representations of users and items, taking into account that the contributions of items interacted in different time periods to user interests are different. Compared with a variety of the latest methods, this method has a competitive advantage.
[0075] An inductive matrix completion method based on spatio-temporal session graph for recommendation scenarios designed by the present invention adopts an inductive method. In extreme cases, that is, in the case of having no edge information except the interaction information between users and items, it still has a better recommendation effect compared with other baseline methods. Brief Description of the Drawings
[0076] Other features, objectives and advantages of the present application will become more obvious by reading the detailed description of the non-limiting embodiments with reference to the following drawings.
[0077] Figure 1 is a flowchart of an inductive matrix completion method based on spatio-temporal session graph for recommendation scenarios of the present invention;
[0078] Figure 2 is a framework diagram of the algorithm model of the present invention. Detailed Embodiments
[0079] The following further details the present application in conjunction with the drawings and embodiments. It can be understood that the specific embodiments described herein are only for explaining the related invention, rather than limiting the invention. Additionally, it should be noted that for the sake of description, only parts related to the relevant invention are shown in the drawings.
[0080] Figure 1 Shows an inductive matrix completion model based on spatio-temporal session graph of the present invention. This method includes the following steps:
[0081] S1. Data preprocessing: Extract the rating information of users for items and the time information of user-item interactions in the user historical interaction data, and construct a user-item rating matrix and a user-item timestamp matrix;
[0082] S2. Construct a one-hop neighbor graph of user-item pairs: For each user-item pair in the rating matrix, extract the neighbor nodes of the user and the item according to the user-item bipartite graph respectively, and construct a one-hop neighbor graph of user-item pairs;
[0083] S21. Construct a user-item bipartite graph G based on the rating matrix. G only contains two types of nodes: user nodes u (corresponding to the rows in the rating matrix) and item nodes v (corresponding to the columns in the rating matrix). Edges only exist between user u and item v, and the feature of the edge is the rating information of u for v;
[0084] S22. Obtain the first-hop neighbors of the (u, v) pair. Obtain the first-hop neighbors of u from the bipartite graph G, that is, all user nodes that interact with v, and obtain the first-hop neighbors of v, that is, obtain all item nodes that interact with u. This process can be described as follows:
[0085] U = {u}, V = {v} (1)
[0086] U neighbor = {u i ∶ u i ~V}\U (2)
[0087] V neighbor = {v i ∶ v i ~U}\V (3)
[0088] S23. Construct the first-hop neighbor graph of (u, v)
[0089] U = U ∪ U neighbor (4)
[0090] V = V ∪ V neighbor (5)
[0091] Derive the first-hop neighbor graph of (u, v) from the user-item bipartite graph G using the obtained U and V; Construct the rating matrix of the first-hop neighbor graph;
[0092] S3. Obtain the session subgraphs of users: Use the DBSCAN algorithm to perform density-based clustering on the interaction items of users according to the user-item timestamp matrix, and then segment the first-hop neighbor graph of the user-item pair according to the clustering results of the items to obtain the session subgraph set of the user-item pair. The items in each session subgraph are the interactions of the user within a period of adjacent time;
[0093] S4. Learn the local interest representation of users: Use R-GCN to train to obtain the representation vectors of the session subgraphs, and then splice the representation vectors of the session subgraphs of the user-item pair to obtain the local interest representation vector of the user;
[0094] S41. Node labeling: Use different labels to distinguish the different roles of nodes in the subgraph, that is, distinguish the target user, target item, user-category nodes, and item-category nodes. Otherwise, GNN cannot determine which user and which item to perform rating prediction between, and may lose node type information. Label the target user and target item as 0 and 1, the first-hop user nodes as 2, and the first-hop item nodes as 3;
[0095] S42. Use R-GCN for message passing to obtain node representations:
[0096]
[0097] Among them, represents the feature vector of node i at layer l, and are learnable parameter matrices.
[0098] S43. Obtain the local interest representation of the user:
[0099] First, connect the feature vectors obtained by training node i at different layers to obtain its potential representation vector h i , and then connect the potential representation vector h u of the user and the potential representation vector h v of the item to obtain the representation of the (u, v) session graph. Finally, connect all the session representations of (u, v) to obtain the local interest representation of the user.
[0100]
[0101] g i = concat(h u , h v ) (8)
[0102] g local = concat(g1, g2,..., g i ) (9)
[0103] Among them, h u represents the final potential representation vector of the target user, h v represents the final potential representation vector of the target item, and g i represents a session graph representation vector of (u, v).
[0104] S5. Learn the global interest representation of the user: Use meta-learning to learn the potential relationship between session subgraphs to obtain the global representation vector of the user's interest:
[0105] S51. Obtain the contribution value of each session subgraph according to the attention mechanism:
[0106] Different session subgraphs have different contributions. When compressing different parts, the attention mechanism can make different parts have different contributions. Therefore, first use the attention mechanism to obtain the session representation of (u, v) This process can be expressed as:
[0107] a′ j = h(g i ; θ) (10)
[0108]
[0109]
[0110] Among them, represents the session sub-graph sequence of user u i ; a j is the attention score of the j-th session sub-graph of user u i , which can be interpreted as the importance of the j-th session sub-graph in the next step of meta-learning; h(·) represents the attention network, and here a two-layer feed-forward neural network is adopted, where θ represents the network parameters;
[0111] S52. Learn the relationship between user session sub-graphs: It takes the session representation of the user as the input, and learns a personalized bridging function between different session sub-graphs of the user. The meta-network can be expressed as:
[0112]
[0113] Among them, g(·) represents the meta-network, and here a two-layer feed-forward neural network is adopted, are the network parameters. is a vector, and its shape depends on the structure of the bridging function.
[0114] S53. Learn the global interest representation of the user:
[0115] Use the learned by the meta-network in S52 as the parameter of the bridging function, and take the local interest representation g i of user u local as the input. The personalized bridging function can be expressed as:
[0116]
[0117] For simplicity, a one-layer linear layer is used as the bridging function, and its output is the global interest representation of the user:
[0118] S6. Learn the spatio-temporal neighbor embedding of the user-item pair: Use the multi-head attention mechanism to obtain the spatio-temporal neighbor embedding of the user-item pair;
[0119] S61. For each pair (u, v), construct the temporal interaction sequence T u ={v1,..., v s} of user u and the temporal interaction sequence T={u1,..., u s} of item v, where s is the number of one-hop neighbors;
[0120] S62. Obtain the initial representation vectors of users and items: For any user u and item v, perform a lookup operation in the user embedding matrix E u ∈R M×d and the item embedding matrix E V ∈R M×d to obtain the initial embeddings of user u and item v Thus, the representation matrix of time series can be obtained:
[0121]
[0122]
[0123] S63. Use the k-head attention mechanism to learn the one-hop neighbor embedding matrix of (u, v): First, use the dot-product attention function to learn k one-hop neighbor embedding matrices of (u, v). Specifically, multi-head attention first maps the temporal input embeddings X u / X v into k subspaces with various linear mapping matrices, and then uses the k-scale dot-product attention function to parallelly generate the output embedding matrix of one-hop neighbors. This process can be expressed as:
[0124]
[0125]
[0126] where X u / X v is the temporal input representation matrix of user u / item v,
[0127] After that, these embedding matrices are concatenated to produce a combined neighborhood embedding matrix. Finally, apply a feed-forward neural network for dimensional transformation, and the spatio-temporal neighbor embeddings of the central user u and the central item v can be calculated as:
[0128]
[0129]
[0130] FFN(x) = xW0 + b0 (22)
[0131] where W0 ∈ R D′×d , b0 ∈ R d , and the spatio-temporal neighbor embedding matrix can be represented in the form of time series as
[0132] S64. Use the average pooling operation to aggregate the spatio-temporal neighbor embeddings to obtain the aggregated neighbor embeddings n u , n v, The process can be expressed as:
[0133]
[0134]
[0135] S7. Regression Prediction: Concatenate the global interest representation of the user with the spatio-temporal neighbor embeddings of the user-item pair to obtain the final interest representation of the user. Then, input the vector of the user's final interest representation into the MLP layer for regression prediction to obtain the predicted score of the user for the item.
[0136] S71. Concatenate the global interest representation of the user with the spatio-temporal neighbor embeddings of the user-item pair to obtain the final interest representation of the user:
[0137] g = concat(g global , n u , n v ) (25)
[0138] S72. After obtaining the final interest representation of the user, use MLP for rating prediction. The process can be described as:
[0139]
[0140] where W and w are the parameters of the MLP, which map the representation g to a scalar rating score, and σ is the activation function, and ReLU is used as its activation function.
[0141] S73. Minimize the root mean square error between the predicted score and the true score for optimization. The loss function is expressed as:
[0142]
[0143] An inductive matrix completion method based on spatio-temporal session graph for recommendation scenarios designed by the present invention further improves the accuracy of movie recommendation compared with the baseline method in the field of movie recommendation. First, the DBSCAN density clustering algorithm is used to divide the one-hop neighbor graph according to the time information of user-item interaction, obtaining the session subgraph of user-item interaction, and meta-learning is used to autonomously learn the relationship between session subgraphs to obtain the global interest representation of users. This approach considers the influence of the time series information of users' movie watching on interest prediction. Secondly, from the perspective of items, movies watched in different time periods contribute differently to users' interests. Therefore, the multi-head attention mechanism is used to learn the spatio-temporal neighbor embeddings of users and items, and they are aggregated with the global interest representation of users to obtain the final interest representation of users, further improving the accuracy of recommendation. Finally, since it is often difficult to extract high-quality user and item features, we adopt an inductive method, which still has a high recommendation accuracy in extreme cases, that is, when there is no other information available except the interaction information between users and items.
[0144] Using the inductive matrix completion method for movie recommendation, which does not rely on edge information, is a new inductive matrix completion method without using any content, solving the problem that high-quality content information is often difficult to obtain in practice.
[0145] The above is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. An inductive matrix completion method based on spatio-temporal session graph for recommendation scenarios, characterized in that It includes the following steps: S1. Data preprocessing: Extract the rating information of users for items and the time information of user-item interactions in the user's historical interaction data, and construct a user-item rating matrix and a user-item timestamp matrix; S2. Construct a one-hop neighbor graph of user-item pairs: For each user-item pair in the rating matrix, extract the neighbor nodes of the user and the item according to the user-item bipartite graph respectively, and construct a one-hop neighbor graph of user-item pairs; S3. Obtain the session subgraphs of users: Use the DBSCAN algorithm to cluster the interaction items of users based on time density according to the user-item timestamp matrix, and then segment the one-hop neighbor graph of user-item pairs according to the clustering results of the items to obtain a set of session subgraphs of user-item pairs. The items in each session subgraph are the interactions of the user in a neighboring period of time; S4. Learn the local interest representation of users: Use R-GCN to train the representation vectors of the session subgraphs, and then splice the representation vectors of the session subgraphs of user-item pairs to obtain the local interest representation vectors of users; S5. Learn the global interest representation of users: Use meta-learning to learn the potential relationships between session subgraphs to obtain the global representation vectors of user interests; S6. Learn the spatio-temporal neighbor embeddings of user-item pairs: Use the multi-head attention mechanism to obtain the spatio-temporal neighbor embeddings of user-item pairs; S7. Regression prediction: Splice the global interest representation of the user and the spatio-temporal neighbor embeddings of the user-item pair to obtain the final interest representation of the user, and then input the final interest representation vector of the user into the MLP layer for regression prediction to obtain the predicted score of the user for the item; Step S2 specifically includes the following steps: S21. Construct a user-item bipartite graph G according to the rating matrix. There are only two types of nodes in G: user nodes u and item nodes v. Edges only exist between user u and item v, and the feature of the edge is the rating information of u for v; u corresponds to the row in the rating matrix, and v corresponds to the column in the rating matrix; S22. Obtain the one-hop neighbors of the (u, v) pair. Obtain the one-hop neighbors of u from the bipartite graph G, that is, all user nodes that interact with v, and obtain the one-hop neighbors of v, that is, all item nodes that interact with u. This process can be described as: U = {u}, V = {v} (1) U neighbor = {u i ∶ u i ~ V}\U(2) V neighbor = {v i ∶ v i ~ U}\V (3) S23. Construct the one-hop neighbor graph of (u, v) U = U ∪ U neighbor (4) V = V ∪ V neighbor (5) Derive the one-hop neighbor graph of (u, v) from the user-item bipartite graph G using the obtained U and V. Construct the rating matrix of the one-hop neighbor graph.
2. The inductive matrix completion method based on spatio-temporal session graph applied to a recommendation scenario according to claim 1, wherein The said step S4 specifically includes the following steps: S41. Node labeling: Use different labels to distinguish the different roles of nodes in the subgraph, that is, to distinguish the target user, the target item, the nodes of user categories, and the nodes of item categories. Otherwise, the GNN cannot judge which user and which item to perform rating prediction between, and may lose node type information. Label the target user and the target item as 0 and 1, and label the one-hop user nodes as 2 and the one-hop item nodes as 3; S42. Use R-GCN for message passing to obtain node representations; Among them, represents the feature vector of node i at layer l, and are learnable parameter matrices; S43. Obtain the local interest representation of users; First, the feature vectors obtained by training node i at different layers are concatenated to obtain its latent representation vector h i , and then the latent representation vector h of the user u and the latent representation vector h of the item v are concatenated to obtain the representation of the (u, v) session graph. Finally, all session representations of (u, v) are concatenated to obtain the local interest representation of the user; g i = concat(h u , h v ) (8) g local = concat(g1, g2, …, g i ) (9) Among them, h u represents the final latent representation vector of the target user, h v represents the final latent representation vector of the target item, g i represents a session graph representation vector of (u, v).
3. An inductive matrix completion method based on a spatio-temporal session graph for a recommendation scenario according to claim 1, characterized in that The said step S5 specifically includes the following steps: S51. Obtain the contribution value of each session subgraph according to the attention mechanism; Different session subgraphs have different contributions. When compressing different parts, the attention mechanism can make different parts have different contributions. Therefore, the attention mechanism is first used to obtain the session representation of (u, v). This process can be expressed as: a j ′ = h(g i ; θ) (10) Among them, represents the session sub-graph sequence of user u i ; a j is the attention score of the j-th session sub-graph of user u i and can be interpreted as the importance of the j-th session sub-graph in the next meta-learning step; h(·) represents the attention network, which uses a two-layer feed-forward neural network, where θ represents the network parameters. S52. Learning the relationships between user session subgraphs using a meta-network: Using the user's session representation as input, a personalized bridging function is learned between different session subgraphs of the user. The meta-network can be expressed as: Among them, \(g(\cdot)\) represents the meta-network, and here a two-layer feedforward neural network is adopted. are the network parameters. is a vector, and its shape depends on the structure of the bridging function. S53. Learn the global interest representation of users; Use the one obtained by learning with the meta-network in S52 as the parameter of the bridging function, and take the local interest representation g i of user u local as the input. The personalized bridging function can be expressed as: Use a single linear layer as the bridging function, and its output is the user's global interest representation:
4. An inductive matrix completion method based on spatio-temporal session graph for recommendation scenarios according to claim 1, characterized in that: The specific steps of step S6 are as follows: S61. For each pair (u, v), construct the temporal interaction sequence \(T\) of user \(u\) u =\(\{v_1,\ldots,v\) s \(\}\) and the temporal interaction sequence \(T\) of item \(v\) = \(\{u_1,\ldots,u\) s \(\}\), where \(s\) is the number of one-hop neighbors; S62. Obtain the initial representation vectors of users and items: For any user u and item v, perform a lookup operation in the user embedding matrix E U ∈R M ×d and the item embedding matrix E V ∈R M×d to obtain the initial embeddings of user u and item v Thus, the representation matrix of the time series can be obtained: S63. Learning the (u, v) one-hop neighbor embedding matrix using the k-head attention mechanism: First, use the dot-product attention function to learn k (u, v) one-hop neighbor embedding matrices. Specifically, the multi-head attention first maps the temporal input embedding X u / X v into k subspaces with various linear mapping matrices, and then uses the k-scale dot-product attention function to generate the output embedding matrix of one-hop neighbors in parallel. This process can be expressed as: where X u / X v is the temporal input representation matrix for user u / project v, After that, these embedding matrices are concatenated to generate a combined neighborhood embedding matrix, and a feed-forward neural network is applied for dimensionality transformation. The spatio-temporal neighbors embeddings of the central user u and the central item v can be calculated as: where \(W_0\in\mathbb{R}\) D′×d , \(b_0\in\mathbb{R}\) d , the spatio-temporal neighbor embedding matrix can be represented in a temporal sequence form as S64. Aggregate spatio-temporal neighbor embeddings using average pooling to obtain the aggregated neighbor embedding n u , n v , and the process can be expressed as:
5. An inductive matrix completion method based on spatio-temporal session graph applied to a recommendation scenario according to claim 1, characterized in that: The specific steps of step S7 are as follows: S71. Concatenate the user's global interest representation with the spatio-temporal neighbors embeddings of the user-item pair to obtain the user's final interest representation: g = concat(g global , n u , n v ) (25) S72. After obtaining the user's final interest representation, use an MLP for rating prediction, and the process can be expressed as: Where W and w are the parameters of the MLP, which map the representation g to a scalar rating score, and σ is the activation function, using ReLU as its activation function; S73. Minimization Optimize by minimizing the root mean square error between the predicted score and the true score. The loss function is expressed as:
6. The inductive matrix completion method based on spatio-temporal session graph applied to a recommendation scenario according to claim 1, wherein: Using this method for movie recommendation, specifically, in step S3, the DBSCAN density clustering method is used to obtain the session subgraphs of users and movie items. According to the user-item timestamp matrix, the interaction items of users are clustered based on time density. Then, according to the clustering results of the items, the one-hop neighbor graph of the user-item pair is segmented to obtain the session subgraph set of the user-item pair. The items in each session subgraph are the interactions of the user within a neighboring period of time. The items that the user interacts with within a neighboring period of time have higher similarity and contribute more to the user's short-term interest representation.
7. An inductive matrix completion method based on spatio-temporal session graph for a recommendation scenario according to claim 6, characterized in that: When performing movie recommendation, in step S5, meta-learning is used to autonomously learn the temporal relationship between user session subgraphs, and the short-term and long-term interests of users are fused.
Citation Information
Patent Citations
Recommendation method based on multi-behavior session graph fusion
CN113868537A
Graph neural network session recommendation method based on time enhancement
CN114186139A