An item recommendation method based on a time context graph attention mechanism

By constructing a user-item interaction graph and utilizing a graph attention mechanism based on temporal context, the temporal weight coefficient and predicted score are calculated. This addresses the issues of limited interaction data and neglect of context in existing recommendation methods, thereby improving the accuracy of the recommendation system and the user experience.

CN116401444BActive Publication Date: 2026-03-03ANHUI AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310136573.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-10
Publication Date
2026-03-03
Estimated Expiration
2043-02-10

AI Technical Summary

Technical Problem

Existing recommendation methods ignore contextual information, resulting in less than ideal recommendation performance, especially when relying solely on user browsing and purchase history, which fails to accurately capture user preferences.

Method used

By constructing a user-item interaction graph and utilizing a graph attention mechanism based on temporal context, a time weight coefficient is calculated and incorporated into the attention mechanism to generate a second attention mechanism containing time information. This mechanism then calculates predicted scores and ranks recommended items.

Benefits of technology

It improves the effectiveness of item recommendations and user experience, solves the problems of monotonous and overly smooth interactive data, and enhances the accuracy of the recommendation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116401444B_ABST
    Figure CN116401444B_ABST
Patent Text Reader

Abstract

The application discloses an item recommendation method and device based on a graph attention mechanism of time context, and the method comprises the following steps: firstly, constructing a user-item interaction graph according to user and item interaction data information; determining a time weight coefficient according to time information of user and item interaction; integrating the time weight coefficient into a first attention mechanism for modeling; generating a second attention mechanism containing time information; calculating a predicted score based on the second attention mechanism; and recommending items to the user according to the score ranking. The method solves the problems of single interaction data and over-smoothing existing in the current item recommendation system by using the graph attention mechanism of time context, and improves the recommendation effect of items and user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of graph neural network technology, and in particular to a method and apparatus for item recommendation based on a graph attention mechanism with temporal context. Background Technology

[0002] In today's society, the explosive development of the internet has provided people with a massive amount of information and choices. However, people have not benefited from this; instead, they feel overwhelmed by information overload. Therefore, recommendation systems have emerged. A recommendation system is a system that can provide personalized recommendations to users, helping them make better choices and has been proven to effectively solve the problem of information overload. It proactively recommends items that users might be interested in by mining user preference information from their historical behavior, eliminating the need for users to search through massive amounts of information themselves, and allowing users to conveniently access and obtain recommended information anytime, anywhere.

[0003] However, existing recommendation methods, such as collaborative filtering, generally only use user interaction data with items to obtain user preferences. While they are simple to implement and the recommendation process is relatively fast, they often neglect the importance of contextual information, and the recommendation effect needs to be improved.

[0004] Therefore, how to solve the problem of unsatisfactory recommendation results caused by relying solely on user browsing and purchase history to capture user preferences in existing recommendation technologies has become an urgent technical issue. Summary of the Invention

[0005] The purpose of this invention is to provide an item recommendation method and apparatus based on a temporal context graph attention mechanism to address the shortcomings of existing technologies. By utilizing a temporal context graph attention mechanism, it solves the problems of single interactive data and overly smooth interaction in existing item recommendation systems, thereby improving the recommendation effect and user experience.

[0006] One embodiment of this application provides an item recommendation method based on a graph attention mechanism under temporal context, the method comprising:

[0007] Based on user-item interaction data, a user-item interaction graph is constructed, wherein the interaction data includes the time information of user-item interaction, and the user-item interaction graph uses users and items as nodes;

[0008] Based on the time information of user-item interaction, a time weighting coefficient is determined;

[0009] The time weight coefficients are incorporated into the first attention mechanism for modeling to generate a second attention mechanism that includes time information.

[0010] Based on the second attention mechanism, a predicted rating is calculated, and items are recommended to the user according to the rating ranking.

[0011] Optionally, determining the time weighting coefficient based on the time information of the user's interaction with the item includes:

[0012] Calculate the time impact factor based on the time information of user-item interaction;

[0013] Based on the time influence factor, the time weight coefficient is obtained by normalization using the first activation function.

[0014] Optionally, calculating the time influence factor based on the time information of the user's interaction with the item includes:

[0015] The time impact factor is calculated using the following formula:

[0016]

[0017]

[0018] Among them, T u,i To measure the time-related factors influencing the relative timing of user u's interaction with item i, t u,i It is the time when user u interacts with item i. It is the earliest interaction time between user u and all its first-order neighbors. T is the latest time of interaction between user u and all its first-order neighbors. i,u The time-related factor for all users interacting with the same item. It is the earliest interaction time between item i and all its first-order neighbors. It is the latest time of interaction between an item and all its first-order neighbors. The sigmoid is the first activation function, and the sigmoid first activation function can scale the time information to the range (0.5,1).

[0019] Optionally, obtaining the time weight coefficient based on the time influence factor and normalized using the first activation function includes:

[0020] The time weighting coefficient is obtained using the following formula:

[0021]

[0022]

[0023] Where, β u,i β is the time weighting coefficient of items interacting with the user relative to the user. i,uN represents the time weighting coefficient of users interacting with items relative to the items. u Let N represent the set of neighboring nodes of user node u. i Let N represent the set of neighboring nodes of item node i, where i is a subset of set N. u In the set N, u is a node. i The nodes in.

[0024] Optionally, the step of incorporating the time weight coefficients into the first attention mechanism for modeling to generate a second attention mechanism containing time information includes:

[0025] The time weighting coefficients are incorporated into the first attention mechanism for modeling using the following formula to generate a second attention mechanism that includes time information:

[0026]

[0027]

[0028] Where, α u,i and α i,u These are the normalized scores of the second attention mechanism, LeakyReLU is the second activation function, a and W are weight parameters, and e is the normalized score. u Let e ​​be the feature vector of node u. k Let e ​​be the feature vector of node u's neighbor node k. i Let e ​​be the feature vector of node u's neighbor node i. m Let k be the feature vector of node i's neighbor node m, and k represent the set N. u In the node, m represents the set N i The nodes in.

[0029] Optionally, the second attention mechanism includes a subgraph generation module. The step of calculating a predicted score based on the second attention mechanism and recommending items to the user according to the score ranking includes:

[0030] The subgraph generation module is used to divide the subgraph into subgraphs. Based on users with similar embeddings, prediction vectors are generated and assigned to the same subgraph set.

[0031] Based on the aggregation of multiple sub-graph sets, a user item feature representation is obtained, and the user item feature representation is then processed through inner product operation to obtain a predicted score;

[0032] Based on the predicted ratings, the ratings are sorted, and items are recommended to the user based on the sorting results.

[0033] Optionally, the step of using the subgraph generation module to partition the subgraph, generating prediction vectors based on users with similar embeddings, and partitioning them into the same subgraph set includes:

[0034] Using the subgraph generation module and the preset fusion method, the graph structure and ID embedding are fused to obtain the user's feature vector, wherein the ID embedding includes user ID embedding and item ID embedding;

[0035] Based on similar ID embeddings, the obtained user feature vectors are converted into predicted vectors and divided into the same sub-graph set.

[0036] Optionally, obtaining the user's feature vector includes:

[0037] The user's feature vector is obtained using the following formula:

[0038]

[0039] Among them, F u Let be the user's feature vector, σ be the second activation function of LeakyReLU, and W1 be the weight matrix of the preset fusion method. Embed for user ID, It is the user ID embedding after one layer of propagation, and b1 is the bias vector.

[0040] Optionally, converting the obtained user feature vector into a prediction vector includes:

[0041] Using a two-layer neural network, the obtained user feature vector is converted into a prediction vector using the following formula:

[0042] U o =W3U h +b3

[0043] Among them, U o For the prediction vector, W3 is the weight matrix of the second layer of the neural network, and U... h Satisfy U h =σ(W2F u +b2), W2 is the weight matrix of the first layer of the neural network, b2 is the bias vector of the first layer of the neural network, and b3 is the bias vector of the second layer of the neural network.

[0044] Another embodiment of this application provides an item recommendation device based on a temporal context-based graph attention mechanism, the device comprising:

[0045] The construction module is used to construct a user-item interaction graph based on user-item interaction data information, wherein the interaction data information includes the time information of user-item interaction, and the user-item interaction graph uses users and items as nodes;

[0046] The determination module is used to determine the time weighting coefficient based on the time information of the user's interaction with the item;

[0047] A generation module is used to incorporate the time weight coefficients into the first attention mechanism for modeling, and generate a second attention mechanism containing time information.

[0048] The recommendation module is used to calculate predicted ratings based on the second attention mechanism and recommend items to users according to the rating ranking.

[0049] Optionally, the determining module includes:

[0050] The calculation unit is used to calculate the time influence factor based on the time information of the user's interaction with the item;

[0051] The obtaining unit is used to obtain the time weight coefficient based on the time influence factor and by normalizing it using the first activation function.

[0052] Optionally, the recommendation module includes:

[0053] The generation unit is used to divide the subgraph using the subgraph generation module, generate prediction vectors based on users with similar embeddings, and divide them into the same subgraph set;

[0054] The unit is used to obtain a user item feature representation based on the aggregation of multiple sub-graph sets, and to obtain a predicted score by performing an inner product operation on the user item feature representation;

[0055] The recommendation unit is used to sort the predicted ratings and recommend items to the user based on the sorting results.

[0056] Optionally, the generation unit includes:

[0057] Obtain a sub-unit, which is used to fuse the graph structure and ID embedding using the sub-graph generation module and a preset fusion method to obtain the user's feature vector, wherein the ID embedding includes user ID embedding and item ID embedding;

[0058] The sub-units are used to convert the obtained user feature vectors into predicted vectors based on similar ID embeddings and divide them into the same sub-graph set.

[0059] Another embodiment of this application provides a storage medium storing a computer program, wherein the computer program is configured to implement the method described in any of the preceding claims when running.

[0060] Another embodiment of this application provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to implement the method described in any of the preceding claims.

[0061] Compared with existing technologies, this invention first constructs a user-item interaction graph based on user-item interaction data, determines time weight coefficients based on the time information of user-item interactions, integrates the time weight coefficients into a first attention mechanism for modeling, generates a second attention mechanism containing time information, calculates predicted scores based on the second attention mechanism, and recommends items to users according to the score ranking. By utilizing a graph attention mechanism with temporal context, it solves the problems of single interaction data and overly smooth interaction in existing item recommendation systems, thereby improving the item recommendation effect and user experience. Attached Figure Description

[0062] Figure 1 A hardware structure block diagram of a computer terminal for an item recommendation method based on a graph attention mechanism with temporal context, provided in an embodiment of the present invention;

[0063] Figure 2 A flowchart illustrating an item recommendation method based on a graph attention mechanism within a temporal context, provided in an embodiment of the present invention;

[0064] Figure 3 This is a schematic diagram of an item recommendation device based on a graph attention mechanism with temporal context, provided in an embodiment of the present invention. Detailed Implementation

[0065] 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 limiting the present invention.

[0066] This invention first provides an item recommendation method based on a graph attention mechanism with temporal context. This method can be applied to electronic devices, such as computer terminals, specifically ordinary computers, quantum computers, etc.

[0067] The following detailed explanation uses a computer terminal as an example. Figure 1 This is a hardware structure block diagram of a computer terminal for an item recommendation method based on a graph attention mechanism with temporal context, provided as an embodiment of the present invention. Figure 1 As shown, a computer terminal may include one or more ( Figure 1Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. Optionally, the computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, the computer terminal may also include components that are more complex than those described above. Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0068] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / modules corresponding to the item recommendation method based on the time context graph attention mechanism in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0069] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the computer terminal. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0070] See Figure 2 , Figure 2 A flowchart illustrating an item recommendation method based on a graph attention mechanism with temporal context, provided for an embodiment of the present invention, may include the following steps:

[0071] S201: Construct a user-item interaction graph based on user-item interaction data, wherein the interaction data includes the time information of user-item interaction, and the user-item interaction graph uses users and items as nodes.

[0072] Specifically, a user-item interaction graph can be constructed based on a user's historical purchase records. For example, when a user purchases an item, an undirected edge is added between the user node and the item node in the user-item interaction graph.

[0073] S202: Determine the time weighting coefficient based on the time information of the user's interaction with the item.

[0074] Specifically, determining the time weighting coefficient based on the time information of the user's interaction with the item may include:

[0075] Step 1. Calculate the time influence factor based on the time information of the user's interaction with the item.

[0076] Specifically, calculating the time influence factor based on the time information of the user's interaction with the item may include:

[0077] The time impact factor is calculated using the following formula:

[0078]

[0079]

[0080] Among them, T u,i To measure the time-related factors influencing the relative timing of user u's interaction with item i, t u,i It is the time when user u interacts with item i. It is the earliest interaction time between user u and all its first-order neighbors. T is the latest time of interaction between user u and all its first-order neighbors. i,u The time-related factor for all users interacting with the same item. It is the earliest interaction time between item i and all its first-order neighbors. T is the latest interaction time between an item and all its first-order neighbors. The sigmoid function is used as the first activation function. Considering that different purchase times for the same user may vary significantly, the sigmoid first activation function is used to scale the time information to the range (0.5, 1), thus yielding T. u,i This is a time-related factor used to measure the relative time of interaction between user u and item i.

[0081] Step 2. Based on the time influence factor, and using the first activation function to normalize, obtain the time weight coefficient.

[0082] Specifically, the time weighting coefficient can be obtained using the following formula:

[0083]

[0084]

[0085] Where, β u,i β is the time weighting coefficient of items interacting with the user relative to the user. i,u N represents the time weighting coefficient of users interacting with items relative to the items. u Let N represent the set of neighboring nodes of user node u. i Let N represent the set of neighboring nodes of item node i, where i is a subset of set N. u In the set N, u is a node. i The nodes in.

[0086] It should be noted that, based on the time influence factor obtained in step 1, the time influence factor T of all items that interact with the same user will be calculated. u,i And the time influence factor T of all users who interact with the same item. i,u By normalizing using the Softmax function, the corresponding time weighting coefficient β can be obtained. u,i With β i,u .

[0087] S203: Incorporate the time weight coefficients into the first attention mechanism for modeling to generate a second attention mechanism that includes time information.

[0088] Specifically, incorporating the time weight coefficients into the first attention mechanism for modeling to generate a second attention mechanism that includes time information can include:

[0089] The time weighting coefficients are incorporated into the first attention mechanism for modeling using the following formula to generate a second attention mechanism that includes time information:

[0090]

[0091]

[0092] Where, α u,i and α i,u These are the normalized scores of the second attention mechanism, LeakyReLU is the second activation function, a and W are weight parameters, and e is the normalized score. u Let e ​​be the feature vector of node u. k Let e ​​be the feature vector of node u's neighbor node k. i Let e ​​be the feature vector of node u's neighbor node i. m Let k be the feature vector of node i's neighbor node m, and k represent the set N. u In the node, m represents the set N i The nodes in.

[0093] This paper improves the traditional first attention mechanism by incorporating a time weight coefficient. An improved second attention mechanism, incorporating time information, is then used to calculate the attention scores of user node neighbors and item node neighbors in the user-item interaction graph. Multiplying each item feature representation by a time weight coefficient reflects the varying degrees of contribution of items purchased at different times to user interests; similarly, multiplying each user feature by a time weight coefficient reflects the varying degrees of contribution of users who purchased items at different times to the item features. By assigning different attention weights to item nodes and user nodes using the improved second attention mechanism, the learning of user preferences and item features is weighted and aggregated, ultimately yielding user feature representations and item feature representations that integrate temporal context information.

[0094] S204: Based on the second attention mechanism, calculate the predicted rating and recommend items to the user according to the rating ranking.

[0095] Specifically, the second attention mechanism may include a subgraph generation module. The step of calculating predicted scores based on the second attention mechanism and recommending items to the user according to the score ranking may include:

[0096] a. The subgraph generation module is used to divide the subgraph into subgraphs. Based on users with similar embeddings, prediction vectors are generated and assigned to the same subgraph set.

[0097] Specifically, the subgraph generation module and the preset fusion method are used to fuse the graph structure and ID embedding to obtain the user's feature vector, wherein the ID embedding includes user ID embedding and item ID embedding.

[0098] For example, obtaining a user's feature vector can include obtaining the user's feature vector using the following formula:

[0099]

[0100] Among them, F u Let be the user's feature vector, σ be the second activation function of LeakyReLU, and W1 be the weight matrix of the preset fusion method. Embed for user ID, It is the user ID embedding after one layer of propagation, and b1 is the bias vector.

[0101] Based on similar ID embeddings, the obtained user feature vectors are converted into predicted vectors and divided into the same sub-graph set.

[0102] For example, a two-layer neural network is used, and the obtained user feature vector is converted into a prediction vector using the following formula:

[0103] U o =W3U h +b3

[0104] Among them, U o For the prediction vector, W3 is the weight matrix of the second layer of the neural network, and U... h Satisfy U h =σ(W2F u +b2), W2 is the weight matrix of the first layer of the neural network, b2 is the bias vector of the first layer of the neural network, and b3 is the bias vector of the second layer of the neural network.

[0105] It should be noted that graph-structured data is currently a hot research area in the field of data mining. A graph is an important information organization structure, composed of nodes and edges. Neural networks can efficiently model data and accurately capture the potential relationships between data points. For example, the item recommendation method in this application can use users and items as nodes, and simultaneously realize the relationships between items, between users, and between users and items as the state information of the nodes, thereby achieving item recommendation.

[0106] b. Based on the aggregation of multiple sets of the same sub-graph, a user item feature representation is obtained, and the user item feature representation is used to obtain a predicted score through inner product operation;

[0107] c. Based on the predicted ratings, sort the ratings and recommend items to the user based on the sorting results.

[0108] Specifically, the subgraph generation module is used to divide user and item nodes into subgraphs. The first-order embeddings in the subgraphs are weighted and aggregated using attention scores. Higher-order embeddings are aggregated and updated in their respective subgraphs. User nodes are only aggregated and updated in their corresponding subgraphs. For item nodes, the final layer embeddings of all the subgraphs in which they belong are aggregated to obtain the final representation of user and item nodes. The inner product is used to obtain the user's predicted rating for the item node. Based on the predicted ratings, the items are sorted from largest to smallest or smallest to largest, and items are recommended to the user.

[0109] In one alternative implementation, the aggregation process of multiple sub-sets can be represented as follows:

[0110] Since direct interactions between users and items provide the most important and reliable information about user interests, all first-order neighbors participate in graph convolution operations during first-order propagation, i.e.:

[0111]

[0112]

[0113] in, α represents the first-level embedding of user u. u,i This represents the user's attention score for items that the user interacts with. This indicates the embedding of the ID of item i. α represents the first-level embedding of item i. i,u This represents the user's attention score towards the item. This indicates the embedded ID of user u.

[0114] For higher-order propagation, nodes in a subgraph can only be updated using information from their neighboring nodes in that subgraph. Higher-order propagation can be represented by the following formula:

[0115]

[0116]

[0117] in, This represents the k+1 level ID embedding of user u. This represents the k-th level ID embedding of item i. This represents the (k+1)th level ID embedding of item i in subgraph s. Let represent the set of neighboring nodes of item i in subgraph s. This represents the k-th layer ID embedding of user u.

[0118] By convolving the k-th layer graph of all subgraphs containing item i, we obtain the final representation of item i, as shown in the following formula:

[0119]

[0120] in, Let represent the final representation of item i obtained by convolving the k-th layer graph of all subgraphs containing item i. Let S represent the representation of item i in the k-th layer of subgraph s, and let S represent the set of subgraphs to which item i belongs.

[0121] Finally, after obtaining the final representations of user u and item i, the predicted score is obtained using the inner product, as shown in the following formula:

[0122]

[0123] in, e represents the predicted interaction preference value of user u for item i. u e represents the representation of user u obtained after subgraph aggregation.i This represents the representation of item i obtained after subgraph aggregation.

[0124] As can be seen, this invention first constructs a user-item interaction graph based on user-item interaction data, determines a time weight coefficient based on the time information of user-item interaction, integrates the time weight coefficient into the first attention mechanism for modeling, generates a second attention mechanism containing time information, calculates a predicted score based on the second attention mechanism, and recommends items to the user according to the score ranking. It solves the problems of single interaction data and oversmoothing in existing item recommendation systems by utilizing a graph attention mechanism with temporal context, thereby improving the item recommendation effect and user experience.

[0125] Another embodiment of this application provides an item recommendation device based on a graph attention mechanism with temporal context, such as... Figure 3 The diagram shows a structural schematic of an item recommendation device based on a graph attention mechanism under temporal context. The device includes:

[0126] The construction module 301 is used to construct a user-item interaction graph based on user-item interaction data information, wherein the interaction data information includes the time information of user-item interaction, and the user-item interaction graph uses users and items as nodes;

[0127] The determining module 302 is used to determine the time weighting coefficient based on the time information of the user's interaction with the item;

[0128] The generation module 303 is used to integrate the time weight coefficients into the first attention mechanism for modeling, and generate a second attention mechanism containing time information.

[0129] The recommendation module 304 is used to calculate a predicted rating based on the second attention mechanism and recommend items to the user according to the rating ranking.

[0130] Specifically, the determining module includes:

[0131] The calculation unit is used to calculate the time influence factor based on the time information of the user's interaction with the item;

[0132] The obtaining unit is used to obtain the time weight coefficient based on the time influence factor and by normalizing it using the first activation function.

[0133] Specifically, the recommendation module includes:

[0134] The generation unit is used to divide the subgraph using the subgraph generation module, generate prediction vectors based on users with similar embeddings, and divide them into the same subgraph set;

[0135] The unit is used to obtain a user item feature representation based on the aggregation of multiple sub-graph sets, and to obtain a predicted score by performing an inner product operation on the user item feature representation;

[0136] The recommendation unit is used to sort the predicted ratings and recommend items to the user based on the sorting results.

[0137] Specifically, the generation unit includes:

[0138] Obtain a sub-unit, which is used to fuse the graph structure and ID embedding using the sub-graph generation module and a preset fusion method to obtain the user's feature vector, wherein the ID embedding includes user ID embedding and item ID embedding;

[0139] The sub-units are used to convert the obtained user feature vectors into predicted vectors based on similar ID embeddings and divide them into the same sub-graph set.

[0140] Compared with existing technologies, this invention first constructs a user-item interaction graph based on user-item interaction data, determines time weight coefficients based on the time information of user-item interactions, integrates the time weight coefficients into a first attention mechanism for modeling, generates a second attention mechanism containing time information, calculates predicted scores based on the second attention mechanism, and recommends items to users according to the score ranking. By utilizing a graph attention mechanism with temporal context, it solves the problems of single interaction data and overly smooth interaction in existing item recommendation systems, thereby improving the item recommendation effect and user experience.

[0141] This invention also provides a storage medium storing a computer program, wherein the computer program is configured to implement the steps in any of the above method embodiments when it is run.

[0142] Specifically, in this embodiment, the storage medium can be configured to store a computer program for performing the following steps:

[0143] S201: Construct a user-item interaction graph based on user-item interaction data information, wherein the interaction data information includes the time information of user-item interaction, and the user-item interaction graph uses users and items as nodes;

[0144] S202: Determine the time weighting coefficient based on the time information of the user's interaction with the item;

[0145] S203: Incorporate the time weight coefficients into the first attention mechanism for modeling to generate a second attention mechanism containing time information;

[0146] S204: Based on the second attention mechanism, calculate the predicted rating and recommend items to the user according to the rating ranking.

[0147] Compared with existing technologies, this invention first constructs a user-item interaction graph based on user-item interaction data, determines time weight coefficients based on the time information of user-item interactions, integrates the time weight coefficients into a first attention mechanism for modeling, generates a second attention mechanism containing time information, calculates predicted scores based on the second attention mechanism, and recommends items to users according to the score ranking. By utilizing a graph attention mechanism with temporal context, it solves the problems of single interaction data and overly smooth interaction in existing item recommendation systems, thereby improving the item recommendation effect and user experience.

[0148] Specifically, in this embodiment, the storage medium may include, but is not limited to, USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks, and other media capable of storing computer programs.

[0149] This invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0150] Specifically, the aforementioned electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the aforementioned processor, and the input / output device is connected to the aforementioned processor.

[0151] Specifically, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0152] S201: Construct a user-item interaction graph based on user-item interaction data information, wherein the interaction data information includes the time information of user-item interaction, and the user-item interaction graph uses users and items as nodes;

[0153] S202: Determine the time weighting coefficient based on the time information of the user's interaction with the item;

[0154] S203: Incorporate the time weight coefficients into the first attention mechanism for modeling to generate a second attention mechanism containing time information;

[0155] S204: Based on the second attention mechanism, calculate the predicted rating and recommend items to the user according to the rating ranking.

[0156] Compared with existing technologies, this invention first constructs a user-item interaction graph based on user-item interaction data, determines time weight coefficients based on the time information of user-item interactions, integrates the time weight coefficients into a first attention mechanism for modeling, generates a second attention mechanism containing time information, calculates predicted scores based on the second attention mechanism, and recommends items to users according to the score ranking. By utilizing a graph attention mechanism with temporal context, it solves the problems of single interaction data and overly smooth interaction in existing item recommendation systems, thereby improving the item recommendation effect and user experience.

[0157] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0158] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0159] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.

[0160] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0161] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0162] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0163] The embodiments of the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. An item recommendation method based on a graph attention mechanism under temporal context, characterized in that, The method includes: Based on user-item interaction data, a user-item interaction graph is constructed, wherein the interaction data includes the time information of user-item interaction, and the user-item interaction graph uses users and items as nodes; Based on the time information of user-item interaction, a time weighting coefficient is determined; including... Based on the time information of user-item interaction, a time impact factor is calculated using the following formula: ; ; in, To measure users With items The time factor influencing the relative timing of the interaction. User With items The time when the interaction occurs User The earliest interaction time among all its first-order neighbors, User The latest interaction time among all its first-order neighbors, The time-related factor for all users interacting with the same item. It is an item The earliest interaction time among all its first-order neighbors, It is the latest time when an item interacts with all its first-order neighbors. It is the first activation function, and The first activation function can scale the time information to... Between; based on the time influence factor, and using the first activation function for normalization, the time weight coefficient is obtained; the time weight coefficient is obtained through the following formula: ; ; in, The time weighting coefficient of items that interact with the user relative to the user. The time weighting coefficient of users interacting with items relative to the items. Represents user node The set of neighboring nodes, Represents item nodes The set of neighboring nodes, For set The nodes in For set Nodes in; The time weight coefficients are incorporated into the first attention mechanism for modeling to generate a second attention mechanism that includes time information; wherein, the time weight coefficients are incorporated into the first attention mechanism for modeling using the following formula to generate the second attention mechanism that includes time information: ; ; in, and These are the normalized scores for the second attention mechanism. For the second activation function, , For weight parameters, For nodes eigenvectors, For nodes neighboring nodes eigenvectors, For nodes neighboring nodes eigenvectors, For nodes neighboring nodes eigenvectors, Represents a set The nodes in Represents a set Nodes in; Based on the second attention mechanism, a predicted rating is calculated, and items are recommended to the user according to the rating ranking.

2. The method according to claim 1, characterized in that, The second attention mechanism includes a subgraph generation module. The step of calculating predicted scores based on the second attention mechanism and recommending items to the user according to the score ranking includes: The subgraph generation module is used to divide the subgraph into subgraphs. Based on users with similar embeddings, prediction vectors are generated and assigned to the same subgraph set. Based on the aggregation of multiple sub-graph sets, a user item feature representation is obtained, and the user item feature representation is then processed through inner product operation to obtain a predicted score; Based on the predicted ratings, the ratings are sorted, and items are recommended to the user based on the sorting results.

3. The method according to claim 2, characterized in that, The step of using the subgraph generation module to partition the subgraph, generating prediction vectors based on users with similar embeddings, and assigning them to the same subgraph set includes: Using the subgraph generation module and the preset fusion method, the graph structure and ID embedding are fused to obtain the user's feature vector, wherein the ID embedding includes user ID embedding and item ID embedding; Based on similar ID embeddings, the obtained user feature vectors are converted into predicted vectors and divided into the same sub-graph set.

4. The method according to claim 3, characterized in that, The process of obtaining the user's feature vector includes: The user's feature vector is obtained using the following formula: ; in, For the user's feature vector, for Second activation function, The weight matrix of the preset fusion method, Embed for user ID, It is the embedded user ID after one layer of propagation. This is the bias vector.

5. The method according to claim 4, characterized in that, The step of converting the obtained user feature vector into a prediction vector includes: Using a two-layer neural network, the obtained user feature vector is converted into a prediction vector using the following formula: ; in, For the prediction vector, This is the weight matrix of the second layer of the neural network. satisfy , This is the weight matrix of the first layer of the neural network. This is the bias vector for the first layer of the neural network. This is the bias vector for the second layer of the neural network.

6. An item recommendation device based on a graph attention mechanism under temporal context, characterized in that, The device includes: The construction module is used to construct a user-item interaction graph based on user-item interaction data information, wherein the interaction data information includes the time information of user-item interaction, and the user-item interaction graph uses users and items as nodes; The determination module is used to determine a time weighting coefficient based on the time information of the user's interaction with the item; this includes calculating a time influence factor based on the time information of the user's interaction with the item, and calculating the time influence factor using the following formula: ; ; in, To measure users With items The time factor influencing the relative timing of the interaction. User With items The time when the interaction occurs User The earliest interaction time among all its first-order neighbors, User The latest interaction time among all its first-order neighbors, The time-related factor for all users interacting with the same item. It is an item The earliest interaction time among all its first-order neighbors, It is the latest time when an item interacts with all its first-order neighbors. It is the first activation function, and The first activation function can scale the time information to... Between; based on the time influence factor, and using the first activation function for normalization, the time weight coefficient is obtained; the time weight coefficient is obtained through the following formula: ; ; in, The time weighting coefficient of items that interact with the user relative to the user. The time weighting coefficient of users interacting with items relative to the items. Represents user node The set of neighboring nodes, Represents item nodes The set of neighboring nodes, For set The nodes in For set Nodes in; The generation module is used to incorporate the time weight coefficients into the first attention mechanism for modeling, generating a second attention mechanism that includes time information; wherein, the time weight coefficients are incorporated into the first attention mechanism for modeling using the following formula to generate the second attention mechanism that includes time information: ; ; in, and These are the normalized scores for the second attention mechanism. For the second activation function, , For weight parameters, For nodes eigenvectors, For nodes neighboring nodes eigenvectors, For nodes neighboring nodes eigenvectors, For nodes neighboring nodes eigenvectors, Represents a set The nodes in Represents a set Nodes in; The recommendation module is used to calculate predicted ratings based on the second attention mechanism and recommend items to users according to the rating ranking.

7. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to implement the method described in any one of claims 1 to 5 when it is run.

8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to implement the method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Recommendation method based on graph attention mechanism

    CN111782765A

  • Method for constructing target function of recommendation model and terminal

    CN112631560A