Content item recommendation method, apparatus, server, and storage medium
By constructing multidimensional feature vectors based on users and content items and updating user embedding feature vectors, the problem that local embedding vectors in existing technologies cannot accurately reflect short-term preferences is solved, thus achieving more accurate content item recommendations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-30
- Publication Date
- 2026-03-20
AI Technical Summary
In existing technologies, using the feature vector of the content item based on the last interaction as a local embedding vector cannot accurately reflect the user's short-term preferences, resulting in low accuracy of the recommendation results of the content item recommendation model.
By constructing content embedding feature vectors based on long-term and short-term state feature vectors, time interval feature vectors, and interaction feature vectors of target users and multiple target content items, updating user embedding feature vectors, and considering user preference decay and evolution patterns, a graph neural network is used for content item recommendation.
It improves the accuracy of content recommendations, enabling it to more accurately reflect users' short-term preferences and their evolution patterns, and the recommendation results are more in line with users' current needs.
Smart Images

Figure CN115203540B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of Internet, and particularly relates to a content item recommendation method and device, a server and a storage medium. BACKGROUND
[0002] Generally, a user has both short-term preference and long-term preference. With the passage of time, the short-term preference of the user can evolve into long-term preference, or can disappear with the change of demand. In order to accurately capture the long-term and short-term preferences of the user for targeted recommendation, the related art weights and sums feature vectors of multiple clicked content items in a historical behavior sequence to obtain a global embedding vector, and takes a feature vector of a content item of last interaction in a current behavior sequence as a local embedding vector, the global embedding vector is used to represent the long-term preference of the user, and the local embedding vector is used to represent the short-term preference of the user, then a content item recommendation model is constructed based on the global embedding vector and the local embedding vector, and content item recommendation is performed based on the content item recommendation model.
[0003] However, the related art only specifies the feature vector of the content item of last interaction as the local embedding vector, which cannot accurately reflect the short-term preference of the user, resulting in low accuracy of the recommendation result based on the constructed content item recommendation model. SUMMARY
[0004] Embodiments of the present disclosure provide a content item recommendation method, device, server and storage medium, which can improve the accuracy of the content item recommendation result. The technical solution is as follows:
[0005] In a first aspect, a content item recommendation method is provided, and the method comprises:
[0006] determining a user embedding feature vector of a target user based on a first long-term state feature vector, a first short-term state feature vector and a first time interval feature vector of the target user;
[0007] determining content embedding feature vectors of a plurality of target content items based on a second long-term state feature vector, a second short-term state feature vector, a second time interval feature vector and an interaction feature vector of the plurality of target content items, the target content items being content items whose time interval between the latest click time of the target user and the current time is less than a preset time interval, the second time interval feature vector being used to indicate the preference decay of the target user on the target content items in the time dimension based on the first time interval feature vector;
[0008] updating the user embedding feature vector based on the content embedding feature vectors of the plurality of target content items to obtain an updated user embedding feature vector;
[0009] recommending a content item based on the updated user embedding feature vector.
[0010] In another embodiment of the present disclosure, the determining the user embedding feature vector of the target user based on the first long-term state feature vector, the first short-term state feature vector and the first time interval feature vector comprises:
[0011] adding each feature element in the first long-term state feature vector to a corresponding feature element in the first short-term state feature vector to obtain a first fusion feature vector;
[0012] concatenating the first fusion feature vector and the first time interval feature vector to obtain the user embedding feature vector.
[0013] In another embodiment of the present disclosure, the determining the content embedding feature vector of the plurality of target content items based on the second long-term state feature vector, the second short-term state feature vector, the second time interval feature vector and the interaction feature vector of the plurality of target content items comprises:
[0014] for any target content item, adding each feature element in the second long-term state feature vector of the target content item to a corresponding feature element in the second short-term state feature vector to obtain a second fusion feature vector corresponding to the target content item;
[0015] concatenating the second fusion feature vector, the second time interval feature vector and the interaction feature vector to obtain the content embedding feature vector of the target content item.
[0016] In another embodiment of the present disclosure, before the concatenating the second fusion feature vector, the second time interval feature vector and the interaction feature vector to obtain the content embedding feature vector of the target content item, the method further comprises:
[0017] obtaining a latest click time at which the target user performs a click operation on the target content item;
[0018] processing the current time and the latest click time by using a kernel function to obtain the second time interval feature vector.
[0019] In another embodiment of the present disclosure, the updating the user embedding feature vector based on the content embedding feature vector of the plurality of target content items comprises:
[0020] performing linear transformation on the user embedding feature vector to obtain a transformed user embedding feature vector;
[0021] For any target content item, performing linear transformation on a content embedding feature vector of the target content item to obtain a transformed content embedding feature vector;
[0022] Based on the transformed user embedding feature vector and the transformed content embedding feature vector, determining a time attention weight vector corresponding to the target content item;
[0023] Based on the time attention weight vectors corresponding to the plurality of target content items, performing weighted addition on the content embedding feature vectors of the plurality of target content items to obtain a weighted content embedding feature vector;
[0024] Adding each feature element in the weighted content embedding feature vector and the corresponding feature element in the user embedding feature vector to obtain an updated user embedding feature vector.
[0025] In another embodiment of the present disclosure, after the user embedding feature vector is updated based on the content embedding feature vectors of the plurality of target content items to obtain an updated user embedding feature vector, the method further comprises:
[0026] For any target content item, according to a first splicing order, splicing the content embedding feature vector of the target content item, the second time interval feature vector of the target content item, the updated user embedding feature vector, the first time interval feature vector and the connection edge feature vector to obtain a first message feature vector of the target content item pointing to the target user;
[0027] From the first message feature vectors corresponding to the plurality of target content items, a first target message feature vector is obtained, the first target message feature vector being a first message feature vector corresponding to a target content item with the smallest time interval between the latest click time and the current time;
[0028] Based on the first target message feature vector, updating a first short-term state feature vector of the target user to obtain an updated first short-term state feature vector.
[0029] In another embodiment of the present disclosure, after the user embedding feature vector is updated based on the content embedding feature vectors of the plurality of target content items to obtain an updated user embedding feature vector, the method further comprises:
[0030] For any target content item, according to a second splicing order, splicing the content embedding feature vector of the target content item, the second time interval feature vector of the target content item, the updated user embedding feature vector, the first time interval feature vector and the connection edge feature vector to obtain a second message feature vector of the target user pointing to the target content item;
[0031] from the second message feature vectors corresponding to the plurality of users, a second target message feature vector is obtained, the second target message feature vector is a first message feature vector corresponding to a user with the smallest time interval between the recent click time and the current time;
[0032] Based on the second target message feature vector, the second short-term state feature vector of the target content item is updated to obtain an updated second short-term state feature vector.
[0033] In another embodiment of the present disclosure, the content item recommendation based on the updated user embedding feature vector comprises:
[0034] obtaining content embedding feature vectors of a plurality of candidate content items;
[0035] Splicing the content embedding feature vector of each candidate content item and the updated user embedding feature vector to obtain a splicing feature vector;
[0036] Input the splicing feature vector into the feedforward neural network to output the recommendation score of the candidate content item;
[0037] According to the order from high to low of the recommendation score, the plurality of candidate content items are recommended.
[0038] In a second aspect, a content item recommendation device is provided, and the device comprises:
[0039] The first determination module is configured to determine the user embedding feature vector of the target user based on the first long-term state feature vector, the first short-term state feature vector and the first time interval feature vector of the target user;
[0040] The second determination module is configured to determine the content embedding feature vectors of the plurality of target content items based on the second long-term state feature vectors, the second short-term state feature vectors, the second time interval feature vectors and the interaction feature vectors of the plurality of target content items, the target content items being content items with a time interval between the recent click time and the current time of the target user being less than a preset time interval, and the second time interval feature vectors being used to indicate the preference decay of the target user for the target content items in the time dimension based on the first time interval feature vector;
[0041] The first update module is configured to update the user embedding feature vector based on the content embedding feature vectors of the plurality of target content items to obtain an updated user embedding feature vector;
[0042] The recommendation module is configured to perform content item recommendation based on the updated user embedding feature vector.
[0043] In another embodiment of the present disclosure, the first determining module is configured to add each feature element in the first long-term state feature vector to a corresponding feature element in the first short-term state feature vector to obtain a first fusion feature vector; and concatenate the first fusion feature vector with the first time interval feature vector to obtain the user embedding feature vector.
[0044] In another embodiment of the present disclosure, the second determining module is configured to, for any target content item, add each feature element in a second long-term state feature vector of the target content item to a corresponding feature element in a second short-term state feature vector to obtain a second fusion feature vector corresponding to the target content item; and concatenate the second fusion feature vector, a second time interval feature vector and an interaction feature vector to obtain a content embedding feature vector of the target content item.
[0045] In another embodiment of the present disclosure, the apparatus further comprises:
[0046] The first obtaining module is configured to obtain a latest click time at which the target user implements a click operation on the target content item.
[0047] The third determining module is configured to process the current time and the latest click time by using a kernel function to obtain the second time interval feature vector.
[0048] In another embodiment of the present disclosure, the first updating module is configured to perform linear transformation on the user embedding feature vector to obtain a transformed user embedding feature vector; perform linear transformation on a content embedding feature vector of any target content item to obtain a transformed content embedding feature vector; determine a time attention weight vector corresponding to the target content item based on the transformed user embedding feature vector and the transformed content embedding feature vector; perform weighted addition on content embedding feature vectors of the plurality of target content items based on time attention weight vectors corresponding to the plurality of target content items to obtain a weighted content embedding feature vector; and add each feature element in the weighted content embedding feature vector to a corresponding feature element in the user embedding feature vector to obtain the updated user embedding feature vector.
[0049] In another embodiment of the present disclosure, the apparatus further comprises:
[0050] The first splicing module is used to splice the content embedding feature vector of the target content item, the second time interval feature vector of the target content item, the updated user embedding feature vector, the first time interval feature vector and the connection edge feature vector of the target content item according to a first splicing order for any target content item, so as to obtain the first message feature vector of the target content item pointing to the target user.
[0051] The second acquisition module is used to acquire a first target message feature vector from the first message feature vectors corresponding to the plurality of target content items, wherein the first target message feature vector is the first message feature vector corresponding to the target content item with the smallest time interval between the most recent click time and the current time;
[0052] The second update module is used to update the first short-term state feature vector of the target user based on the first target message feature vector, so as to obtain the updated first short-term state feature vector.
[0053] In another embodiment of this disclosure, the apparatus further includes:
[0054] The second splicing module is used to splice the content embedding feature vector of the target content item, the second time interval feature vector of the target content item, the updated user embedding feature vector, the first time interval feature vector and the connection edge feature vector of the target content item according to the second splicing order for any target content item, so as to obtain the second message feature vector of the target user pointing to the target content item.
[0055] The third acquisition module is used to acquire a second target message feature vector from the second message feature vectors corresponding to multiple users. The second target message feature vector is the first message feature vector corresponding to the user with the smallest time interval between the most recent click time and the current time.
[0056] The third update module is used to update the second short-term state feature vector of the target content item based on the second target message feature vector, so as to obtain the updated second short-term state feature vector.
[0057] In another embodiment of this disclosure, the recommendation module is configured to obtain content embedding feature vectors of multiple candidate content items; concatenate the content embedding feature vector of each candidate content item with the updated user embedding feature vector to obtain a concatenated feature vector; input the concatenated feature vector into a feedforward neural network to output the recommendation score of the candidate content item; and recommend the multiple candidate content items in descending order of recommendation score.
[0058] In a third aspect, a server is provided, the server comprising a processor and a memory, the memory storing at least one program code, the at least one program code being loaded and executed by the processor to implement the content item recommendation method according to the first aspect.
[0059] In a fourth aspect, a computer-readable storage medium is provided, the storage medium storing at least one program code, the at least one program code being loaded and executed by a processor to implement the content item recommendation method according to the first aspect.
[0060] In a fifth aspect, a computer program product is provided, the computer program product comprising a computer program code stored in a computer-readable storage medium, a processor of a server reading the computer program code from the computer-readable storage medium, the processor executing the computer program code to cause the server to perform the content item recommendation method according to the first aspect.
[0061] The technical scheme provided by the embodiments of the present disclosure has the following beneficial effects:
[0062] Instead of artificially taking the last interaction content item as the short-term preference of the target user, multiple target content items are taken as the short-term preference of the target user, and since the multiple target content items are multiple content items clicked by the target user recently, the short-term preference of the target user can be accurately reflected. Then, the user embedding feature vector of the target user is updated based on the content embedding feature vectors of the multiple target content items. Since the first time interval feature vector and the second time interval feature vector capable of representing user preference decay are encoded in the user embedding feature vector of the target user and the content embedding feature vectors of the multiple target content items, the preference transfer of the target user can be known based on the user embedding feature vector and the content embedding feature vector, which makes the updated user embedding feature vector not only learn the related knowledge of the short-term preference of the target user, but also learn the evolution rule of the short-term preference to the long-term preference of the target user and the decay rule of the short-term preference, and therefore, the content item recommended based on the updated user embedding feature vector is more in line with the current needs of the user, and the recommendation result is more accurate. BRIEF DESCRIPTION OF DRAWINGS
[0063] In order to more clearly illustrate the technical schemes in the embodiments of the present disclosure, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative labor.
[0064] Figure 1is a schematic diagram of an implementation environment involved in a content item recommendation method provided by an embodiment of the present disclosure.
[0065] Figure 2 is a system architecture diagram of a content item recommendation method provided by an embodiment of the present disclosure.
[0066] Figure 3 is a flowchart of a content item recommendation method provided by an embodiment of the present disclosure.
[0067] Figure 4 is a flowchart of another content item recommendation method provided by an embodiment of the present disclosure.
[0068] Figure 5 is a structural schematic diagram of a content item recommendation device provided by an embodiment of the present disclosure.
[0069] Figure 6 is a server for content item recommendation according to an exemplary embodiment. DETAILED DESCRIPTION
[0070] In order to make the purposes, technical solutions and advantages of the present disclosure clearer, the embodiments of the present disclosure will be described in further detail below with reference to the drawings.
[0071] It can be understood that the terms "each", "multiple" and "any" used in the embodiments of the present disclosure include two or more, each refers to each of the corresponding multiple, and any refers to any one of the corresponding multiple. For example, multiple words include 10 words, and each word refers to each of the 10 words, and any word refers to any one of the 10 words.
[0072] It should be noted that all actions of acquiring signals, information or data in the present application are performed in accordance with the corresponding data protection regulations and policies of the country where the device is located, and with the authorization of the corresponding device owner.
[0073] Before performing the embodiments of the present disclosure, the terms involved in the embodiments of the present disclosure are first explained.
[0074] As a machine learning algorithm, GNN (Graph Neural Networks) can extract important information from graphs and make useful predictions. As graphs become more common and information becomes more abundant, artificial neural networks become more popular and powerful, and GNN has become a powerful tool for many important applications.
[0075] Self-attention mechanism refers to the process of calculating the attention of X to X for a sequence X. The calculation process of the self-attention mechanism is as follows: the correlation (represented as similarity in the attention mechanism) between each time point in the sequence X and the remaining time points is calculated to obtain an attention weight matrix, and then the attention weight matrix is applied to the sequence X to obtain the weighted sum of each time point (that is, the information of the remaining time points is fused into each time point). Q, K and V in the self-attention mechanism essentially represent three independent matrices, Q, K and V are obtained by performing different linear transformations on the sequence X, and Q, K and V can all represent the sequence X. In order to obtain the attention weight matrix, the similarity between the representative matrices Q and K of the sequence X needs to be calculated, and then the attention weight matrix is multiplied by the matrix V to obtain the final result. There are many ways to calculate the similarity between the matrices Q and K, for example, the matrices Q and K can be directly multiplied, or an MLP (Multilayer Perception) can be used to calculate the matrices Q and K. After obtaining the attention weight, the calculation result needs to be processed by softmax to ensure that the sum of the output attention weight values is 1 (if the sum of the attention weight values is not 1, the scale of the data will change when the attention matrix is used). After obtaining the attention matrix, the attention weight is multiplied by V to obtain the final result.
[0076] Recall@K is the ratio of the number of relevant results retrieved in the top K results to the number of all relevant results in the library, which is used to measure the recall rate of the retrieval system.
[0077] NDCG (Normalized Discounted cumulative gain) is used as an evaluation index of the ranking result, which evaluates the accuracy of the ranking. The recommendation system usually returns an item list for a user, and assuming that the list length is K, NDCG@K can be used to evaluate the difference between the ranking list and the user's real interaction list.
[0078] MRR (Mean reciprocal rank) is an internationally recognized evaluation mechanism for search algorithms, that is, the matching score of the first search result is 1, the matching score of the second search result is 0.5, the matching score of the nth search result is 1 / n, and the final matching score is the sum of all scores.
[0079] Please refer to Figure 1Fig. 1 is a schematic diagram of an implementation environment of a content item recommendation method according to an embodiment of the present disclosure, which shows an implementation environment involved in the content item recommendation method provided by the embodiment of the present disclosure, and the implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 are connected through a network 103, which can be a wired network or a wireless network.
[0080] The terminal 101 can be a smart phone, a tablet computer, a notebook computer, a desktop computer or the like, which has a display screen and is installed with a content application, such as a shopping application, a take-out application, a video application or the like. The terminal 101 can display each content item recommended by the server 102, and when detecting a click operation on any content item, the terminal 101 sends a display request of the content item to the server 102, and then displays the content item when receiving related data of the content item sent by the server 102.
[0081] The server 102 can be a stand-alone physical server, or a server cluster or a distributed system composed of multiple physical servers, and the embodiment of the present disclosure does not make specific limitation on the server 102. The server 102 is a background server of the content application installed in the terminal 101, which can determine a user embedding feature vector representing long-term and short-term preferences of a user, and obtain a target content item with a time interval between a recent click time and a current time less than a preset time interval, and then update the user embedding feature vector of the user based on a content embedding feature vector of the target content item, to obtain an updated user embedding feature vector, so as to perform content item recommendation based on the updated user embedding feature vector.
[0082] Figure 2 Fig. 2 is a framework diagram of a dynamic GNN recommendation system adopted by the content item recommendation method provided by the embodiment of the present disclosure, and the recommendation system includes an embedding layer 201, a time self-attention collaborative filter 202, a short-term state updating module 203 and a prediction layer 204.
[0083] The embedding layer 201 is configured to initialize long-term states of each user and each content item, to obtain an initialized long-term state feature vector. For example, Figure 2 The embedding layer 201 initializes a long-term state feature vector of the user u1 in Fig. 1 as The embedding layer 201 initializes a long-term state vector of the content item i1 as The embedding layer 201 initializes a long-term state vector of the content item i2 as The embedding layer 201 is also configured to initialize short-term states of each user and each content item, to obtain an initialized short-term state vector. For example, Figure 2 The embedding layer 201 initializes a short-term state feature vector of the user u1 in Fig. 1 as The embedding layer 201 initializes a short-term state vector of the content item i1 as The short-term state vector initialized for the content item i2 is
[0084] The time self-attention collaborative filter 202 is configured to encode the first time interval feature vector based on the current time, fuse the long-term state feature vector and the short-term state feature vector of the user, and splice the fused feature vector with the first time interval feature vector to obtain the user embedding feature vector of the user. For example, Figure 2 The first time feature vector encoded by the time self-attention collaborative filter 202 for the user u1 is φ(0), and the long-term state vector and the short-term state feature vector of the user u1 are fused, and then the fused feature vector is spliced with the first time feature vector φ(0) to obtain the user embedding feature vector of the user u1. The time self-attention collaborative filter 202 is also configured to encode the second time interval feature vector of the content item based on the current time and the latest click time of the user on the content item, fuse the long-term state feature vector and the short-term state feature vector of the content item, and splice the fused feature vector with the second time interval feature vector and the interaction feature vector to obtain the content embedding feature vector of the content item. For example, Figure 2 The second time feature vector encoded by the time self-attention collaborative filter 202 for the content item i1 is φ(t3-t1), and then the long-term state vector and the short-term state feature vector of the content item i1 are fused, and then the fused feature vector is spliced with the second time feature vector φ(t3-t1) and the interaction feature vector to obtain the content embedding feature vector of the content item i1. For another example, Figure 2 The second time feature vector encoded by the time self-attention collaborative filter 202 for the content item i2 is φ(t3-t2), and then the long-term state vector and the short-term state feature vector of the content item i2 are fused, and then the fused feature vector is spliced with the second time feature vector φ(t3-t2) and the interaction feature vector to obtain the content embedding feature vector of the content item i2.
[0085] The short-term state updating module 203 is configured to update the short-term state feature vector of the user and the content item. Specifically, the short-term state updating module 203 generates a first message feature vector of the content item pointing to the user based on each content item with which the user interacts, and then updates the short-term feature vector of the user based on the first message feature vector corresponding to the content item with which the user interacts most recently. Meanwhile, the short-term state updating module 203 generates a second message feature vector of the user pointing to the content item based on each user with which the content item interacts, and then updates the short-term feature vector of the content item based on the second message feature vector corresponding to the user with which the content item interacts most recently.
[0086] The prediction layer 204 is configured to recommend each candidate content item to the user by calculating a recommendation score of each candidate content item to the user based on the updated user embedding feature vector and the content embedding feature vector of each candidate content item.
[0087] The embodiments of the present disclosure provide a content item recommendation method. Figure 1 For example, the server in the embodiments of the present disclosure is taken as an example, and the method provided by the embodiments of the present disclosure includes the following steps: Figure 3 The method provided by the embodiments of the present disclosure includes the following steps:
[0088] 301. Determine a user embedding feature vector of a target user based on a first long-term state feature vector, a first short-term state feature vector and a first time interval feature vector of the target user.
[0089] 302. Determine content embedding feature vectors of a plurality of target content items based on a second long-term state feature vector, a second short-term state feature vector, a second time interval feature vector and an interaction feature vector of the plurality of target content items.
[0090] The target content item is a content item whose time interval between the most recent click time of the target user and the current time is less than a preset time interval, and the second time interval feature vector is used to indicate the preference decay of the target user to the target content item in the time dimension based on the first time interval feature vector.
[0091] 303. Update the user embedding feature vector based on the content embedding feature vectors of the plurality of target content items to obtain an updated user embedding feature vector.
[0092] 304. Perform content item recommendation based on the updated user embedding feature vector.
[0093] The method provided by the embodiments of the present disclosure no longer artificially takes the content item of the last interaction as the short-term preference of the target user, but takes multiple target content items as the short-term preference of the target user. Since the multiple target content items are multiple content items clicked by the target user recently, the short-term preference of the target user can be accurately reflected. Then, the user embedding feature vector of the target user is updated based on the content embedding feature vectors of the multiple target content items. Since the first time interval feature vector and the second time interval feature vector capable of representing the user preference decay are encoded in the user embedding feature vector of the target user and the content embedding feature vectors of the multiple target content items, the preference transfer of the target user can be known based on the user embedding feature vector and the content embedding feature vector. This makes the updated user embedding feature vector not only learn the related knowledge of the short-term preference of the target user, but also learn the evolution rule of the short-term preference to the long-term preference and the decay rule of the short-term preference. Therefore, the content item recommended based on the updated user embedding feature vector is more in line with the current needs of the user, and the recommendation result is more accurate.
[0094] In another embodiment of the present disclosure, the user embedding feature vector of the target user is determined based on the first long-term state feature vector, the first short-term state feature vector, and the first time interval feature vector of the target user, and includes:
[0095] The first long-term state feature vector and the corresponding feature element in the first short-term state feature vector are added to obtain a first fusion feature vector;
[0096] The first fusion feature vector and the first time interval feature vector are spliced to obtain the user embedding feature vector.
[0097] In another embodiment of the present disclosure, the content embedding feature vector of the multiple target content items is determined based on the second long-term state feature vector, the second short-term state feature vector, the second time interval feature vector, and the interaction feature vector of the multiple target content items, and includes:
[0098] For any target content item, the second long-term state feature vector of the target content item and the corresponding feature element in the second short-term state feature vector are added to obtain a second fusion feature vector corresponding to the target content item;
[0099] The second fusion feature vector, the second time interval feature vector, and the interaction feature vector are spliced to obtain the content embedding feature vector of the target content item.
[0100] In another embodiment of the present disclosure, before the second fusion feature vector, the second time interval feature vector, and the interaction feature vector are spliced to obtain the content embedding feature vector of the target content item, it further includes:
[0101] obtaining a latest click time at which the target user implements a click operation on the target content item;
[0102] adopting a kernel function to process the current time and the latest click time to obtain a second time interval feature vector.
[0103] In another embodiment of the present disclosure, the user embedding feature vector is updated based on the content embedding feature vectors of the plurality of target content items to obtain an updated user embedding feature vector, comprising:
[0104] linearly transforming the user embedding feature vector to obtain a transformed user embedding feature vector;
[0105] For any target content item, linearly transforming the content embedding feature vector of the target content item to obtain a transformed content embedding feature vector;
[0106] determining a time attention weight vector corresponding to the target content item based on the transformed user embedding feature vector and the transformed content embedding feature vector;
[0107] weighting and adding the content embedding feature vectors of the plurality of target content items based on the time attention weight vectors corresponding to the plurality of target content items to obtain a weighted content embedding feature vector;
[0108] adding each feature element in the weighted content embedding feature vector and the corresponding feature element in the user embedding feature vector to obtain an updated user embedding feature vector.
[0109] In another embodiment of the present disclosure, after the user embedding feature vector is updated based on the content embedding feature vectors of the plurality of target content items to obtain an updated user embedding feature vector, further comprising:
[0110] For any target content item, the content embedding feature vector of the target content item, the second time interval feature vector of the target content item, the updated user embedding feature vector, the first time interval feature vector and the connection edge feature vector are spliced in a first splicing order to obtain a first message feature vector of the target content item pointing to the target user;
[0111] From the first message feature vectors corresponding to the plurality of target content items, a first target message feature vector is obtained, the first target message feature vector being the first message feature vector corresponding to the target content item with the smallest time interval between the latest click time and the current time;
[0112] updating the first short-term state feature vector of the target user based on the first target message feature vector to obtain an updated first short-term state feature vector.
[0113] In another embodiment of the present disclosure, after updating the user embedding feature vector based on the content embedding feature vectors of the plurality of target content items, the method further comprises:
[0114] For any target content item, the content embedding feature vector of the target content item, the second time interval feature vector of the target content item, the updated user embedding feature vector, the first time interval feature vector and the connection edge feature vector are spliced in the second splicing order to obtain a second message feature vector of the target user pointing to the target content item.
[0115] From the second message feature vectors corresponding to the plurality of users, a second target message feature vector is obtained, the second target message feature vector being the first message feature vector corresponding to the user with the smallest time interval between the latest click time and the current time.
[0116] Based on the second target message feature vector, the second short-term state feature vector of the target content item is updated to obtain an updated second short-term state feature vector.
[0117] In another embodiment of the present disclosure, the content item recommendation based on the updated user embedding feature vector comprises:
[0118] Obtaining content embedding feature vectors of a plurality of candidate content items;
[0119] Splicing the content embedding feature vector of each candidate content item and the updated user embedding feature vector to obtain a spliced feature vector;
[0120] Inputting the spliced feature vector into a feedforward neural network to output a recommendation score of the candidate content item;
[0121] According to the order of the recommendation score from high to low, the plurality of candidate content items are recommended.
[0122] All the optional technical solutions described above can be combined to form optional embodiments of the present disclosure, which will not be described one by one here.
[0123] The embodiments of the present disclosure provide a content item recommendation method, which comprises: Figure 1 The server executes the embodiments of the present disclosure, for example, referring to Figure 4 The method provided by the embodiments of the present disclosure comprises:
[0124] 401. The server determines the first time interval feature vector of the target user according to the current time.
[0125] With the development of Internet technology, applications focusing on content are rapidly developed. In order to attract more users to use, the recommendation system needs to mine the preferences of users. Usually, users will have short-term preferences and long-term preferences, such as users will click a series of content items because of the current popular content items or explicit needs, which belong to the short-term preferences of the user. With the change of time, short-term preferences will evolve into long-term preferences, such as preferences for certain specific brands, categories and other attributes, and at the same time, short-term preferences may disappear because of the change of needs, which forms the periodicity or decay of the user's content items in the time dimension. Because the time interval of different users using the recommendation system is also inconsistent, most of the user's click behavior in the time dimension is sparse and irregular. In order to accurately capture the dynamic preferences of users in the development process, learn the periodicity and decay of user preferences, and thus predict the next click behavior of the user, it is necessary to encode the time interval information.
[0126] Among them, the various information of the content item as the user browsing object refers to the content that can be electrified (or digitized) by any electronic processing method such as scanning, and the content that has been electrified. The content item includes documents, images, audio and video of moving images formed by characters and (still) images, etc. The content of the content item is very rich, which can be music, information, goods, merchants, etc. The time interval information refers to the time interval between the current time and the latest click time of the user implementing the click operation on a certain content item. Considering the periodicity and continuity of the time interval information, the server can use the kernel function to encode the time interval information to simplify the operation amount of the encoding process of the time interval information. Among them, the kernel function is a statistical term, including linear kernel function, polynomial kernel function, Gaussian kernel function, etc., which is used to map the input space to a high-dimensional feature space. When the server encodes the time interval information using the kernel function, the following formula can be used:
[0127]
[0128] Among them, φ (t i -t j ) represents the time interval feature vector of the target content item j, t i represents the current time, t j represents the latest click time of the target user implementing the click operation on the target content item j, w1, …, represents the parameter vector, b1, …, represents the bias vector.
[0129] For the target user, the latest click time of the target user on the content item can be considered as the current time. Based on the above formula, the first time interval feature vector of the target user determined by the server according to the current time is: Since the duration of the time interval information corresponding to the first time interval feature vector is 0, the target user's preference has not decayed at this time. Therefore, the first time interval feature vector can be used as a benchmark for the decay of the target user's preference. By comparing the second time interval feature vector of each target item with the first time interval feature vector, the decay of the target user's preference for each target content item can be indicated.
[0130] 402. The server determines the second time interval feature vector of multiple target content items based on the current time and the most recent click time of the target user's click operation on multiple target content items.
[0131] The target content item is defined as any content item for which the time interval between the most recent click by the target user and the current time is less than a preset time interval. Let the current time be t, and the most recent click time of any content item by the target user be t'. Then, if t - t' is less than the preset time interval, the server will select that content item as the target content item. By selecting target content items whose time interval between the most recent click and the current time is less than the preset time interval, the timeliness of users' short-term preferences is ensured.
[0132] When determining the second time interval feature vector of any target content item based on the current time and the most recent click time of the target user's click operation on that target content item, the above formula can be applied. To determine. For example, Figure 2 If the most recent click time of content item i1 is t1 and the current time is t3, then the second time interval feature vector of content item i1 is: For example, Figure 2 If the most recent click time for content item i2 is t2 and the current time is t3, then the second time interval feature vector for content item i2 is: The second time interval feature vector determined by the server for each target content item is used to indicate the decay of the target user's preference for each target content item over time, based on the first time interval feature vector. By encoding the second time interval feature vector, the server can learn the decay of the target user's preference for the target content item over time.
[0133] 403. The server determines the user embedding feature vector of the target user based on the target user's first long-term state feature vector, first short-term state feature vector, and first time interval feature vector.
[0134] In the embodiments of the present disclosure, in order to better mine the long-term preference and short-term preference of the user, and thus recommend the preferred content item to the user, the server can set a corresponding user node for each user, and set a corresponding content node for each content item, so as to connect the user node and the content node, and the content node and the content node by using a directed line segment based on the interaction relationship between each user and each content item, and construct a graph neural network.
[0135] Based on the constructed graph neural network, the server will initialize the short-term state of the user node at time t, and obtain the short-term state feature vector of the user node initialized, which is used to represent the short-term preference of the user. When the server initializes the short-term state of the user node, a feature vector of all 0 can be allocated to the user node as the short-term state feature vector of the user node initialized, which is represented as s u (t). With the interaction operation of the user and the content item, the server updates the short-term state feature vector of the user node initialized based on the content item clicked by the user. Of course, the server will also initialize the short-term state of the content node at time t, and obtain the short-term state feature vector of the content node initialized, which is used to represent the short-term interaction of the content item. When the server initializes the short-term state of the content node, a feature vector of all 0 can be allocated to each content node as the short-term state feature vector of the content node initialized, which is represented as s i (t). With the interaction operation of the content item and the user, the server will update the short-term state feature vector of the content node initialized.
[0136] Based on the constructed graph neural network, the server will initialize the long-term state of the user node at time t, and obtain the long-term state feature vector of the user node initialized, which is used to represent the long-term preference of the target user. When the server initializes the long-term state of the user node, a learnable long-term state feature vector can be allocated to the user node according to the one-hot of the node identifier of the user node, and the long-term state feature vector of the user node initialized is represented as l u(t) With the passage of time, the short-term preference of the user node can evolve into a long-term preference, and based on the evolved long-term preference, the server updates the long-term state feature vector initialized by the user node. Of course, the server also initializes the long-term state of each content node at time t to obtain a long-term feature vector initialized by the content node, which is used to represent the long-term interaction of the content item. When the server initializes the long-term state of the content node, a learnable long-term state feature vector can be assigned to the content node according to the one-hot of the node identifier of the content item node, which is denoted as l i (t) With the passage of time, the short-term preference of the user node can evolve into a long-term preference, and based on the evolved long-term preference, the server updates the long-term state feature vector initialized by the user node. Of course, the server also initializes the long-term state of each content node at time t to obtain a long-term feature vector initialized by the content node, which is used to represent the long-term interaction of the content item. When the server initializes the long-term state of the content node, a learnable long-term state feature vector can be assigned to the content node according to the one-hot of the node identifier of the content item node, which is denoted as l
[0137] In the embodiments of the present disclosure, in order to better recommend content items meeting the preferences of the target user to the target user, the server obtains a first long-term state feature vector, a first short-term state feature vector and a first time interval feature vector of the target user at the current time, and determines a user embedding feature vector of the target user based on the first long-term state feature vector, the first short-term state feature vector and the first time interval feature vector of the target user, the user embedding feature vector being used to represent the long-term and short-term preferences of the target user at the current time. Specifically, the server adds each feature element in the first long-term state feature vector to the corresponding feature element in the first short-term state feature vector to obtain a first fusion feature vector, and then splices the first fusion feature vector with the first time interval feature vector to obtain the user embedding feature vector.
[0138] 404. The server determines a content embedding feature vector of the plurality of target content items based on the second long-term state feature vector, the second short-term state feature vector, the second time interval feature vector and the interaction feature vector of the plurality of target content items.
[0139] In the embodiments of the present disclosure, the server obtains a second long-term state feature vector, a second short-term state feature vector, a second time interval feature vector and an interaction feature vector of a plurality of target content items at the current time, the interaction feature vector being used to represent the interaction between the target user and the target content item, and determines a content embedding feature vector of the plurality of target content items based on the second long-term state feature vector, the second short-term state feature vector, the second time interval feature vector and the interaction feature vector of the plurality of target content items. Taking any target content item in the plurality of target content items as an example, the server adds each feature element in the second long-term state feature vector of the target content item to the corresponding feature element in the second short-term state feature vector to obtain a second fusion feature vector corresponding to the target content item, and then splices the second fusion feature vector, the second time interval feature vector and the interaction feature vector to obtain the content embedding feature vector of the target content item.
[0140] 405. The server updates the user embedding feature vector based on the content embedding feature vectors of the plurality of target content items, to obtain an updated user embedding feature vector.
[0141] When the server updates the user embedding feature vector based on the content embedding feature vectors of the plurality of target content items, to obtain an updated user embedding feature vector, the following method can be used:
[0142] 4051. The server performs linear transformation on the user embedding feature vector, to obtain a transformed user embedding feature vector.
[0143] 4052. For any target content item, the server performs linear transformation on the content embedding feature vector of the target content item, to obtain a transformed content embedding feature vector.
[0144] 4053. The server determines the time attention weight vector corresponding to the target content item based on the transformed user embedding feature vector and the transformed content embedding feature vector.
[0145] The server uses the transformed user embedding feature vector as the Q matrix, and uses the transformed content embedding feature vector as the K matrix and the V matrix, and uses the self-attention mechanism to process the transformed user embedding feature vector and the transformed content embedding feature vector, to obtain the time attention weight vector corresponding to the target content item. Let the target user be represented as u, and the target content item be represented as i, then the time attention weight vector corresponding to the target content item is represented as β ui (t).
[0146] Further, to ensure the stability of the values, the server will also normalize the time attention weight vector corresponding to each target content item, to obtain the normalized time attention weight vector corresponding to each target content item. The normalized time attention weight vector is represented as α ui (t i ).
[0147] 4054. The server performs weighted addition on the content embedding feature vectors of the plurality of target content items based on the time attention weight vectors corresponding to the plurality of target content items, to obtain a weighted content embedding feature vector.
[0148] Based on the time attention weight vectors corresponding to the plurality of target content items, the server multiplies the content embedding feature vector of each target content item with the corresponding time attention weight vector, to obtain an intermediate result vector, and then adds the feature elements of the same dimension in the intermediate result vectors corresponding to each target content item, to obtain the weighted content embedding feature vector.
[0149] 4055. The server adds each feature element in the weighted content embedding feature vector to the corresponding feature element in the user embedding feature vector, and processes the vector obtained by the addition using a feedforward neural network to obtain an updated user embedding feature vector.
[0150] Based on the obtained weighted content embedding feature vector, the server adds each feature element in the weighted content embedding feature vector to the corresponding feature element in the user embedding feature vector, and inputs the vector obtained by the addition into a feedforward neural network for processing by the feedforward neural network to obtain an updated user embedding feature vector.
[0151] It should be noted that, considering that the graph neural network includes multiple network layers, the feature vectors output by different network layers are different. Taking the user node of the target user as an example, each content node directly connected to the user node in the graph neural network constitutes the first network layer of the user node, other content nodes connected to each content node in the first layer in the graph neural network constitute the second network layer of the user node, and so on until the last layer of the graph neural network. When updating the user embedding feature vector of the user node of the target user, the user embedding feature vector of the 0th layer of the user node and the content embedding feature vectors of each content node in the first layer are first determined, and then the content embedding feature vectors of each content node in the first layer are fused into the user embedding feature vector of the user node to obtain the user embedding feature vector of the first layer. Next, the content embedding feature vectors of the content nodes in the second layer are fused into the content embedding feature vectors of the connected content nodes in the first layer, and then the content embedding feature vectors of each content node in the first layer after fusion are fused into the user embedding feature vector of the first layer to obtain the user embedding feature vector of the second layer, and so on until the user embedding feature vector of the last layer is obtained. For the fusion process of the user embedding feature vector of each layer, see the above-mentioned updating process of the user embedding feature vector, which will not be repeated here.
[0152] In order to further capture the short-term preferences of the target user and the current features of the target content items, the embodiments of the present disclosure also update the first short-term state feature vector of the target user and the second short-term feature vector of each target content item, and the updating process includes three stages, namely Message, Aggregate and Update.
[0153] The updating process for the first short-term state feature vector of the target user is as follows:
[0154] In the Message stage, for any target content item, the server obtains the connection edge feature vector of the connection edge between the content node corresponding to the target content item and the user node corresponding to the target user in the graph neural network, and then concatenates the content embedding feature vector of the target content item, the second time interval feature vector of the target content item, the updated user embedding feature vector, the first time interval feature vector and the connection edge feature vector according to a first concatenation order, to obtain a first message feature vector of the target content item pointing to the target user. For example, for a user u and a content item i in an interaction, the first message feature vector of the content item i pointing to the user u is obtained by concatenating the user embedding feature vector of the user u, the content embedding feature vector of the content item i, the connection edge feature vector, the first time feature vector and the second time interval feature vector, and the first message feature vector contains the time series collaborative filtering signal, the edge feature and the time series pattern, and can be represented as m u←i (t i ).
[0155] In the Aggregate stage, the server obtains a first target message feature vector from the first message feature vectors corresponding to a plurality of target content items, the first target message feature vector being the first message feature vector corresponding to the target content item with the smallest time interval between the latest click time and the current time, and the first target message feature vector is represented as
[0156] In the Update stage, the server updates the first short-term state feature vector of the target user based on the first target message feature vector to obtain an updated first short-term state feature vector. For example, the server updates the first short-term state feature vector of the user u according to the aggregated message and the previous short-term state of the user u.
[0157] The updating process of the second short-term state feature vector of the target content item is as follows:
[0158] In the Message stage, for any target content item, the server concatenates the content embedding feature vector of the target content item, the second time interval feature vector of the target content item, the updated user embedding feature vector, the first time interval feature vector and the connection edge feature vector according to a second concatenation order, to obtain a second message feature vector of the target user pointing to the target content item.
[0159] In the Aggregate stage, the server obtains a second target message feature vector from the second message feature vectors corresponding to a plurality of users, the second target message feature vector being the first message feature vector corresponding to the user with the smallest time interval between the latest click time and the current time.
[0160] In the update phase, the server updates the second short-term state feature vector of the target content item based on the second target message feature vector, to obtain an updated second short-term state feature vector.
[0161] The server updates the first short-term state feature vector of the target user and the second short-term state feature vector of each target content item, so that the short-term state feature vectors of the target user and each target content item can be kept timely.
[0162] 406. The server performs content item recommendation based on the updated user embedding feature vector.
[0163] Based on the determined updated user embedding feature vector, the server obtains content embedding feature vectors of a plurality of candidate content items, splices the content embedding feature vector of each candidate content item and the updated user embedding feature vector to obtain a spliced feature vector, and then inputs the spliced feature vector into a feedforward neural network to output a recommendation score of the candidate content item, which is represented as y ui (t). Then, the plurality of candidate content items are recommended in order of the recommendation scores from high to low.
[0164] Further, in order to improve the accuracy of the recommendation result, after the updated user embedding feature vector, the server also inputs the recommendation score of the target content item and the recommendation score of the content item that has not been clicked by the target user before into a loss function, and calculates the loss value of the loss function, and then adjusts each model parameter in the model used to determine the updated user embedding feature vector based on the loss value of the loss function, thereby improving the accuracy of the updated user embedding feature vector. The loss function can be the BPR loss function commonly used in topk recommendation tasks. When using the BPR loss function, in order to prevent overfitting, the first long-term state feature vector of the target user is also subjected to L2 regularization processing. The loss function is:
[0165]
[0166] Wherein, δ represents an activation function, y ui (t) represents the recommendation score of the target content item, y uj (t) represents the recommendation score of the content item that has not been clicked by the target user before, and λ represents a constant. Θ represents the first long-term state feature vector of the target user.
[0167] To verify the accuracy of the recommendation result based on the trained model, the embodiments of the present disclosure further acquire a test set including a plurality of users and a plurality of commodities. For a certain user u in the test set, the commodities that the user currently interacts with are acquired as unique positive samples, and a certain number of commodities (that the user has not interacted with before) are acquired as negative samples, and then the prediction scores of the positive sample pairs and the negative sample pairs are obtained respectively according to the forward propagation of the model, and the ranking list is obtained by descending order of the scores, wherein the order of the positive samples in the ranking list is calculated as Recall@K, NDCG@K or MRR.
[0168] The method provided by the embodiments of the present disclosure no longer artificially takes the last interaction content item as the short-term preference of the target user, but takes a plurality of target content items as the short-term preference of the target user. Since the plurality of target content items are a plurality of content items clicked by the target user recently, the short-term preference of the target user can be accurately reflected. Then, the user embedding feature vector of the target user is updated based on the content embedding feature vectors of the plurality of target content items. Since the first time interval feature vector and the second time interval feature vector capable of representing the user preference decay are encoded in the user embedding feature vector of the target user and the content embedding feature vectors of the plurality of target content items, the preference transfer of the target user can be known based on the user embedding feature vector and the content embedding feature vector. This makes the updated user embedding feature vector not only learn the related knowledge of the short-term preference of the target user, but also learn the evolution rule of the short-term preference to the long-term preference and the decay rule of the short-term preference. Therefore, the content item recommended based on the updated user embedding feature vector is more in line with the current needs of the user, and the recommendation result is more accurate.
[0169] Referring to Figure 5 The embodiments of the present disclosure provide a content item recommendation device, which comprises:
[0170] The first determination module 501 is configured to determine the user embedding feature vector of the target user based on the first long-term state feature vector, the first short-term state feature vector and the first time interval feature vector of the target user.
[0171] The second determination module 502 is configured to determine the content embedding feature vectors of a plurality of target content items based on the second long-term state feature vectors, the second short-term state feature vectors, the second time interval feature vectors and the interaction feature vectors of the plurality of target content items. The target content item is a content item whose time interval between the latest click operation and the current time is less than a preset time interval. The second time interval feature vector is used to indicate the preference decay of the target user for the target content item in the time dimension based on the first time interval feature vector.
[0172] The first updating module 503 is configured to update the user embedding feature vector based on the content embedding feature vectors of the plurality of target content items, to obtain an updated user embedding feature vector.
[0173] The recommendation module 504 is configured to perform content item recommendation based on the updated user embedding feature vector.
[0174] In another embodiment of the present disclosure, the first determining module 501 is configured to add each feature element in the first long-term state feature vector to a corresponding feature element in the first short-term state feature vector to obtain a first fusion feature vector; and concatenate the first fusion feature vector with the first time interval feature vector to obtain the user embedding feature vector.
[0175] In another embodiment of the present disclosure, the second determining module 502 is configured to, for any target content item, add each feature element in the second long-term state feature vector of the target content item to a corresponding feature element in the second short-term state feature vector to obtain a second fusion feature vector corresponding to the target content item; and concatenate the second fusion feature vector, the second time interval feature vector and the interaction feature vector to obtain the content embedding feature vector of the target content item.
[0176] In another embodiment of the present disclosure, the device further comprises:
[0177] The first obtaining module is configured to obtain a latest click time at which the target user performs a click operation on the target content item.
[0178] The third determining module is configured to process the current time and the latest click time by using a kernel function to obtain the second time interval feature vector.
[0179] In another embodiment of the present disclosure, the first updating module 503 is configured to perform linear transformation on the user embedding feature vector to obtain a transformed user embedding feature vector; perform linear transformation on the content embedding feature vector of any target content item to obtain a transformed content embedding feature vector; determine a time attention weight vector corresponding to the target content item based on the transformed user embedding feature vector and the transformed content embedding feature vector; perform weighted addition on the content embedding feature vectors of the plurality of target content items based on the time attention weight vectors corresponding to the plurality of target content items, to obtain a weighted content embedding feature vector; and add each feature element in the weighted content embedding feature vector to a corresponding feature element in the user embedding feature vector to obtain an updated user embedding feature vector.
[0180] In another embodiment of the present disclosure, the device further comprises:
[0181] The first splicing module is configured to, for any target content item, splice the content embedding feature vector of the target content item, the second time interval feature vector of the target content item, the updated user embedding feature vector, the first time interval feature vector and the connection edge feature vector in a first splicing order to obtain a first message feature vector of the target content item pointing to a target user.
[0182] The second obtaining module is configured to obtain a first target message feature vector from the first message feature vectors corresponding to the plurality of target content items, the first target message feature vector being the first message feature vector corresponding to the target content item with the smallest time interval between the latest click time and the current time.
[0183] The second updating module is configured to update the first short-term state feature vector of the target user based on the first target message feature vector to obtain an updated first short-term state feature vector.
[0184] In another embodiment of the present disclosure, the apparatus further comprises:
[0185] The second splicing module is configured to, for any target content item, splice the content embedding feature vector of the target content item, the second time interval feature vector of the target content item, the updated user embedding feature vector, the first time interval feature vector and the connection edge feature vector in a second splicing order to obtain a second message feature vector of the target user pointing to the target content item.
[0186] The third obtaining module is configured to obtain a second target message feature vector from the second message feature vectors corresponding to the plurality of users, the second target message feature vector being the first message feature vector corresponding to the user with the smallest time interval between the latest click time and the current time.
[0187] The third updating module is configured to update the second short-term state feature vector of the target content item based on the second target message feature vector to obtain an updated second short-term state feature vector.
[0188] In another embodiment of the present disclosure, the recommendation module 504 is configured to obtain content embedding feature vectors of a plurality of candidate content items; splice the content embedding feature vector of each candidate content item and the updated user embedding feature vector to obtain a spliced feature vector; input the spliced feature vector into a feedforward neural network to output a recommendation score of the candidate content item; and recommend the plurality of candidate content items in an order from high to low according to the recommendation scores.
[0189] In summary, the device provided by the embodiments of the present disclosure no longer artificially takes the last interaction content item as the short-term preference of the target user, but takes multiple target content items as the short-term preference of the target user. Since the multiple target content items are multiple content items clicked by the target user recently, the short-term preference of the target user can be accurately reflected. Then, the user embedding feature vector of the target user is updated based on the content embedding feature vectors of the multiple target content items. Since the first time interval feature vector and the second time interval feature vector capable of representing the user preference decay are encoded in the user embedding feature vector of the target user and the content embedding feature vectors of the multiple target content items, the preference transfer of the target user can be known based on the user embedding feature vector and the content embedding feature vector. This makes the updated user embedding feature vector not only learn the related knowledge of the short-term preference of the target user, but also learn the evolution law of the short-term preference to the long-term preference of the target user and the decay law of the short-term preference. Therefore, the content item recommended based on the updated user embedding feature vector is more in line with the current needs of the user, and the recommendation result is more accurate.
[0190] Figure 6 A server for content item recommendation is shown according to an exemplary embodiment. Referring to Figure 6 , the server 600 includes a processing component 622, which further includes one or more processors, and memory resources represented by a memory 632, for storing instructions executable by the processing component 622, such as application programs. The application programs stored in the memory 632 can include one or more modules each corresponding to a set of instructions. In addition, the processing component 622 is configured to execute the instructions to perform the functions performed by the server in the content item recommendation method described above.
[0191] The server 600 can also include a power supply component 626 configured to perform power management of the server 600, a wired or wireless network interface 650 configured to connect the server 600 to a network, and an input / output (I / O) interface 658. The server 600 can operate based on an operating system stored in the memory 632, such as Windows Server TM , Mac OSX TM , Unix TM , Linux TM , FreeBSD TM or the like.
[0192] The server provided by the embodiments of the present disclosure no longer artificially takes the content item of the last interaction as the short-term preference of the target user, but takes multiple target content items as the short-term preference of the target user. Since the multiple target content items are multiple content items clicked by the target user recently, the short-term preference of the target user can be accurately reflected. Then, the user embedding feature vector of the target user is updated based on the content embedding feature vectors of the multiple target content items. Since the first time interval feature vector and the second time interval feature vector capable of representing user preference decay are encoded in the user embedding feature vector of the target user and the content embedding feature vectors of the multiple target content items, the preference transfer of the target user can be known based on the user embedding feature vector and the content embedding feature vector. This makes the updated user embedding feature vector not only learn the related knowledge of the short-term preference of the target user, but also learn the evolution rule of the short-term preference to the long-term preference of the target user and the decay rule of the short-term preference. Therefore, the content item recommended based on the updated user embedding feature vector is more in line with the current needs of the user, and the recommendation result is more accurate.
[0193] The embodiments of the present disclosure provide a computer readable storage medium, the storage medium stores at least one program code, the at least one program code is loaded and executed by a processor to implement a content item recommendation method. The computer readable storage medium can be non-transitory. For example, the computer readable storage medium can be a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a CD-ROM (Compact Disc Read-Only Memory, Read-Only Optical Disk Memory), a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0194] The embodiments of the present disclosure provide a computer program product, the computer program product includes computer program code, the computer program code is stored in a computer readable storage medium, and a processor of an electronic device reads the computer program code from the computer readable storage medium. The processor executes the computer program code, so that the electronic device executes a content item recommendation method.
[0195] Those of ordinary skill in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by programs instructing relevant hardware to complete, and the programs can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a disk or an optical disk, etc.
[0196] The above description is merely an optional embodiment of this disclosure and is not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the protection scope of this disclosure.
Claims
1. A content item recommendation method, characterized in that, The method includes: Based on the first long-term state feature vector, the first short-term state feature vector, and the first time interval feature vector of the target user, the user embedding feature vector of the target user is determined. Based on the second long-term state feature vector, the second short-term state feature vector, the second time interval feature vector, and the interaction feature vector of multiple target content items, the content embedding feature vector of the multiple target content items is determined. The target content item is the content item whose time interval between the most recent click time and the current time is less than a preset time interval. The second time interval feature vector is used to indicate the decay of the target user's preference for the target content item in the time dimension, based on the first time interval feature vector. Based on the content embedding feature vectors of the multiple target content items, the user embedding feature vector is updated to obtain the updated user embedding feature vector; Content item recommendation is performed based on the updated user embedding feature vector; After updating the user embedding feature vector based on the content embedding feature vectors of the multiple target content items to obtain the updated user embedding feature vector, the process further includes: For any target content item, the content embedding feature vector of the target content item, the second time interval feature vector of the target content item, the updated user embedding feature vector, the first time interval feature vector, and the connection edge feature vector of the target content item are concatenated according to the second concatenation order to obtain the second message feature vector of the target user pointing to the target content item. From the second message feature vectors corresponding to multiple users, obtain the second target message feature vector, where the second target message feature vector is the first message feature vector corresponding to the user with the smallest time interval between the most recent click time and the current time; Based on the second target message feature vector, the second short-term state feature vector of the target content item is updated to obtain the updated second short-term state feature vector.
2. The method according to claim 1, characterized in that, The step of determining the user embedding feature vector of the target user based on the first long-term state feature vector, the first short-term state feature vector, and the first time interval feature vector of the target user includes: Each feature element in the first long-term state feature vector is added to the corresponding feature element in the first short-term state feature vector to obtain the first fused feature vector. The first fused feature vector is concatenated with the first time interval feature vector to obtain the user embedded feature vector.
3. The method according to claim 1, characterized in that, Before determining the content embedding feature vector of the multiple target content items based on the second long-term state feature vector, the second short-term state feature vector, the second time interval feature vector, and the interaction feature vector of multiple target content items, the method further includes: Obtain the most recent click time of the target user's click operation on the target content item; A kernel function is used to process the current time and the most recent click time to obtain the second time interval feature vector; The determination of the content embedding feature vector of the multiple target content items based on the second long-term state feature vector, the second short-term state feature vector, the second time interval feature vector, and the interaction feature vector includes: For any target content item, each feature element in the second long-term state feature vector of the target content item is added to the corresponding feature element in the second short-term state feature vector to obtain the second fusion feature vector corresponding to the target content item. The second fused feature vector, the second time interval feature vector, and the interaction feature vector are concatenated to obtain the content embedding feature vector of the target content item.
4. The method according to claim 1, characterized in that, The step of updating the user embedding feature vector based on the content embedding feature vectors of the multiple target content items to obtain the updated user embedding feature vector includes: A linear transformation is performed on the user embedding feature vector to obtain the transformed user embedding feature vector; For any target content item, perform a linear transformation on the content embedding feature vector of the target content item to obtain the transformed content embedding feature vector; Based on the transformed user embedding feature vector and the transformed content embedding feature vector, the time attention weight vector corresponding to the target content item is determined; Based on the time attention weight vectors corresponding to the multiple target content items, the content embedding feature vectors of the multiple target content items are weighted and summed to obtain a weighted content embedding feature vector. The updated user embedding feature vector is obtained by adding each feature element in the weighted content embedding feature vector to the corresponding feature element in the user embedding feature vector.
5. The method according to claim 1, characterized in that, After updating the user embedding feature vector based on the content embedding feature vectors of the multiple target content items to obtain the updated user embedding feature vector, the process further includes: For any target content item, the content embedding feature vector of the target content item, the second time interval feature vector of the target content item, the updated user embedding feature vector, the first time interval feature vector and the connection edge feature vector of the target content item are concatenated according to the first concatenation order to obtain the first message feature vector of the target content item pointing to the target user. From the first message feature vectors corresponding to the plurality of target content items, obtain the first target message feature vector, wherein the first target message feature vector is the first message feature vector corresponding to the target content item with the smallest time interval between the most recent click time and the current time; Based on the first target message feature vector, the first short-term state feature vector of the target user is updated to obtain the updated first short-term state feature vector.
6. The method according to any one of claims 1 to 5, characterized in that, The content item recommendation based on the updated user embedded feature vector includes: Obtain the content embedding feature vectors of multiple candidate content items; The content embedding feature vector of each candidate content item is concatenated with the updated user embedding feature vector to obtain the concatenated feature vector. The concatenated feature vector is input into a feedforward neural network, which outputs the recommendation score of the candidate content item. The candidate content items are recommended in descending order of their recommendation scores.
7. A content item recommendation device, characterized in that, The device includes: The first determining module is used to determine the user embedding feature vector of the target user based on the first long-term state feature vector, the first short-term state feature vector, and the first time interval feature vector of the target user. The second determining module is used to determine the content embedding feature vector of the multiple target content items based on the second long-term state feature vector, the second short-term state feature vector, the second time interval feature vector, and the interaction feature vector of the multiple target content items. The target content item is the content item whose time interval between the most recent click time and the current time is less than a preset time interval. The second time interval feature vector is used to indicate the decay of the target user's preference for the target content item in the time dimension based on the first time interval feature vector. The first update module is used to update the user embedding feature vector based on the content embedding feature vector of the plurality of target content items, so as to obtain the updated user embedding feature vector. The recommendation module is used to recommend content items based on the updated user embedding feature vector; After updating the user embedding feature vector based on the content embedding feature vectors of the multiple target content items to obtain the updated user embedding feature vector, the process further includes: For any target content item, the content embedding feature vector of the target content item, the second time interval feature vector of the target content item, the updated user embedding feature vector, the first time interval feature vector, and the connection edge feature vector of the target content item are concatenated according to the second concatenation order to obtain the second message feature vector of the target user pointing to the target content item. From the second message feature vectors corresponding to multiple users, obtain the second target message feature vector, where the second target message feature vector is the first message feature vector corresponding to the user with the smallest time interval between the most recent click time and the current time; Based on the second target message feature vector, the second short-term state feature vector of the target content item is updated to obtain the updated second short-term state feature vector.
8. A server, characterized in that, The server includes a processor and a memory, the memory storing at least one line of program code, which is loaded and executed by the processor to implement the content item recommendation method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The storage medium stores at least one piece of program code, which is loaded and executed by a processor to implement the content item recommendation method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Article recommendation method and device and storage medium
CN114491267A
Next recommendation method integrating long-term preference and short-term preference of user
CN114662004A