CN115203540A - Content item recommendation method, device, server and storage medium - Google Patents
Content item recommendation method, device, server and storage medium Download PDFInfo
- Publication number
- CN115203540A CN115203540A CN202210766877.6A CN202210766877A CN115203540A CN 115203540 A CN115203540 A CN 115203540A CN 202210766877 A CN202210766877 A CN 202210766877A CN 115203540 A CN115203540 A CN 115203540A
- Authority
- CN
- China
- Prior art keywords
- feature vector
- user
- target
- embedded
- content item
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9535—Search customisation based on user profiles and personalisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Biomedical Technology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The disclosure provides a content item recommendation method, a content item recommendation device, a server and a storage medium, and belongs to the technical field of internet. The method comprises the following steps: determining a user embedded feature vector based on a first long-term state feature vector, a first short-term state feature vector and a first time interval feature vector of a target user; determining a content embedding feature vector 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 target content item; updating the user embedded feature vector based on the content embedded feature vector to obtain an updated user embedded feature vector; content item recommendations are made based on the updated user-embedded feature vectors. The feature vector of the target content item clicked by the target user in a short term is fused in the updated user embedded feature vector, so that the short-term preference of the target user can be represented, and the recommendation result based on the updated user embedded feature vector is more accurate.
Description
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a content item recommendation method, apparatus, server, and storage medium.
Background
Typically users have both short-term and long-term preferences. Over time, the user's short-term preferences may evolve into long-term preferences and may also disappear as demand changes. In order to accurately capture the long-term and short-term preferences of a user for targeted recommendation, the related art performs weighted summation on feature vectors of a plurality of clicked content items in a historical behavior sequence to obtain a global embedding vector, and uses the feature vector of the last interactive content item in a current behavior sequence as a local embedding vector, wherein the global embedding vector is used for representing the long-term preferences of the user, and the local embedding vector is used for representing the short-term preferences of the user, and then a content item recommendation model is constructed based on the global embedding vector and the local embedding vector, and then content item recommendation is performed based on the content item recommendation model.
However, the related art only designates the feature vector of the last interactive content item as a local embedding vector, which does not 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.
Disclosure of Invention
The embodiment of the disclosure provides a content item recommendation method, a content item recommendation device, a server and a storage medium, which can improve the accuracy of a content item recommendation result. The technical scheme is as follows:
in a first aspect, there is provided a content item recommendation method, the method comprising:
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;
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, wherein the target content items are content items of which the time interval between the latest click time and the current time of the target user for carrying out the click operation is smaller than a preset time interval, and the second time interval feature vector is used for indicating the preference attenuation of the target user on the target content items in the time dimension by taking the first time interval feature vector as a reference;
updating the user-embedded feature vector based on the content-embedded feature vectors of the plurality of target content items to obtain an updated user-embedded feature vector;
content item recommendations are made based on the updated user-embedded feature vectors.
In another embodiment of the present disclosure, the determining a user-embedded 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 includes:
adding each feature element in the first long-term state feature vector and the corresponding feature element in the first short-term state feature vector to obtain a first fusion feature vector;
and splicing the first fusion feature vector and the first time interval feature vector to obtain the user embedded feature vector.
In another embodiment of the present disclosure, the determining content-embedded feature vectors for 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 for the plurality of target content items comprises:
for any target content item, adding each feature element in 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 to obtain a second fusion feature vector corresponding to the target content item;
and splicing the second fusion feature vector, the second time interval feature vector and the interactive feature vector to obtain the content embedding feature vector of the target content item.
In another embodiment of the present disclosure, before the splicing the second fused feature vector, the second time interval feature vector, and the interactive feature vector to obtain the content embedding feature vector of the target content item, the method further includes:
acquiring the latest click time of the target user for implementing click operation on the target content item;
and processing the current time and the latest click time by adopting a kernel function to obtain the second time interval characteristic vector.
In another embodiment of the present disclosure, the updating the user-embedded feature vector based on the content-embedded feature vectors of the plurality of target content items to obtain an updated user-embedded feature vector includes:
carrying out linear transformation on the user embedded characteristic vector to obtain a transformed user embedded characteristic vector;
for any target content item, carrying out linear transformation on the content embedding characteristic vector of the target content item to obtain a transformed content embedding characteristic vector;
determining a temporal attention weight vector corresponding to the target content item based on the transformed user embedded feature vector and the transformed content embedded feature vector;
based on the time attention weight vectors corresponding to the target content items, carrying out weighted addition on the content embedding feature vectors of the target content items to obtain weighted content embedding feature vectors;
and adding each feature element in the weighted content embedded feature vector and the corresponding feature element in the user embedded feature vector to obtain the updated user embedded feature vector.
In another embodiment of the disclosure, after the updating the user-embedded feature vector based on the content-embedded feature vectors of the plurality of target content items to obtain an updated user-embedded feature vector, the method further includes:
for any target content item, according to a first splicing sequence, splicing the content embedded feature vector of the target content item, the second time interval feature vector of the target content item, the updated user embedded 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;
acquiring a first target message feature vector from first message feature vectors corresponding to the target content items, wherein the first target message feature vector is a first message feature vector corresponding to a target content item with a minimum time interval between the latest click time and the current time;
and 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.
In another embodiment of the present disclosure, after the updating the user-embedded feature vector based on the content-embedded feature vectors of the plurality of target content items to obtain an updated user-embedded feature vector, the method further includes:
for any target content item, according to a second splicing sequence, splicing the content embedded feature vector of the target content item, a second time interval feature vector of the target content item, the updated user embedded feature vector, the first time interval feature vector and a connection edge feature vector to obtain a second message feature vector of the target user pointing to the target content item;
acquiring a second target message feature vector from second message feature vectors corresponding to a plurality of users, wherein the second target message feature vector is a first message feature vector corresponding to a user with the smallest time interval between the latest click time and the current time;
and updating 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.
In another embodiment of the present disclosure, the content item recommendation based on the updated user-embedded feature vector comprises:
obtaining content embedding feature vectors of a plurality of candidate content items;
splicing the content embedded characteristic vector of each candidate content item with the updated user embedded characteristic vector to obtain a spliced characteristic vector;
inputting the splicing feature vector into a feed-forward neural network, and outputting the recommendation scores of the candidate content items;
and recommending the candidate content items according to the sequence of the recommendation scores from high to low.
In a second aspect, there is provided a content item recommendation apparatus, the apparatus comprising:
the first determining module is used for determining a user embedded 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;
a second determining module, configured to determine content-embedded 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, where the target content items are content items for which a time interval between a latest click time for the target user to perform a click operation and a current time is smaller than a preset time interval, and the second time interval feature vector is used to indicate, with reference to the first time interval feature vector, a preference attenuation of the target user for the target content items in a time dimension;
a first updating module, configured to update the user-embedded feature vector based on the content-embedded feature vectors of the multiple target content items, to obtain an updated user-embedded feature vector;
and the recommending module is used for recommending the content item based on the updated user embedded characteristic vector.
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 fused feature vector; and splicing the first fusion feature vector and the first time interval feature vector to obtain the user embedded feature vector.
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 fused feature vector corresponding to the target content item; and splicing the second fusion feature vector, the second time interval feature vector and the interactive feature vector to obtain the content embedding feature vector of the target content item.
In another embodiment of the present disclosure, the apparatus further comprises:
the first acquisition module is used for acquiring the latest click time of the target user for implementing click operation on the target content item;
and the third determining module is used for processing the current time and the latest click time by adopting a kernel function to obtain the second time interval characteristic vector.
In another embodiment of the present disclosure, the first updating module is configured to perform linear transformation on the user embedded feature vector to obtain a transformed user embedded feature vector; for any target content item, performing linear transformation on the content embedding characteristic vector of the target content item to obtain a transformed content embedding characteristic vector, and determining a time attention weight vector corresponding to the target content item based on the transformed user embedding characteristic vector and the transformed content embedding characteristic vector; based on the time attention weight vectors corresponding to the target content items, carrying out weighted addition on the content embedding feature vectors of the target content items to obtain weighted content embedding feature vectors; and adding each characteristic element in the weighted content embedded characteristic vector and the corresponding characteristic element in the user embedded characteristic vector to obtain the updated user embedded characteristic vector.
In another embodiment of the present disclosure, the apparatus further comprises:
a first splicing module, configured to splice, according to a first splicing order, a content-embedded feature vector of the target content item, a second time interval feature vector of the target content item, the updated user-embedded feature vector, the first time interval feature vector, and a connection edge feature vector to obtain a first message feature vector of the target content item pointing to the target user;
a second obtaining module, configured to obtain a first target message feature vector from first message feature vectors corresponding to the multiple target content items, where the first target message feature vector is a first message feature vector corresponding to a target content item with a smallest time interval between a latest click time and the current time;
and the second updating module is used for 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.
In another embodiment of the present disclosure, the apparatus further comprises:
a second splicing module, configured to splice, according to a second splicing order, a content-embedded feature vector of the target content item, a second time interval feature vector of the target content item, the updated user-embedded feature vector, the first time interval feature vector, and a connection edge feature vector of the target content item, to obtain a second message feature vector that the target user points to the target content item;
a third obtaining module, configured to obtain a second target message feature vector from second message feature vectors corresponding to multiple users, where the second target message feature vector is a first message feature vector corresponding to a user with a smallest time interval between a latest click time and the current time;
and the third updating module is used for updating 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.
In another embodiment of the present disclosure, the recommendation module is configured to obtain content-embedded feature vectors for a plurality of candidate content items; splicing the content embedded characteristic vector of each candidate content item with the updated user embedded characteristic vector to obtain a spliced characteristic vector; inputting the splicing feature vector into a feed-forward neural network, and outputting the recommendation scores of the candidate content items; recommending the plurality of candidate content items in an order of high to low recommendation scores.
In a third aspect, there is provided a server, the terminal comprising a processor and a memory, the memory having stored therein 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.
In a fourth aspect, a computer-readable storage medium is provided, having stored therein at least one program code, which is loaded and executed by a processor, to implement the content item recommendation method according to the first aspect.
In a fifth aspect, there is provided a computer program product comprising computer program code stored in a computer readable storage medium from which a processor of a server reads the computer program code, the processor executing the computer program code to cause the server to perform a content item recommendation method according to the first aspect.
The technical scheme provided by the embodiment of the disclosure has the following beneficial effects:
the last interactive content item is not artificially used as the short-term preference of the target user, but a plurality of target content items are used as the short-term preference of the target user, and the short-term preference of the target user can be accurately reflected because the plurality of target content items are a plurality of content items recently clicked by the target user. The user-embedded feature vectors of the target users are then updated based on the content-embedded feature vectors of the plurality of target content items. Because the first time interval characteristic vector and the second time interval characteristic vector which can represent the attenuation of the user preference are coded in the user embedded characteristic vector of the target user and the content embedded characteristic vectors of a plurality of target content items, the preference transfer condition of the target user can be known based on the user embedded characteristic vector and the content embedded characteristic vector, so that the updated user embedded characteristic vector not only learns the related knowledge of the short-term preference of the target user, but also learns the evolution rule from the short-term preference to the long-term preference of the target user and the attenuation rule of the short-term preference, therefore, the content items recommended based on the updated user embedded characteristic vector better meet the current requirements of the user, and the recommendation result is more accurate.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
FIG. 1 is a schematic diagram of an implementation environment in which a method for recommending content items provided by an embodiment of the present disclosure is involved;
FIG. 2 is a system architecture diagram of a content item recommendation method provided by an embodiment of the present disclosure;
FIG. 3 is a flow chart of a method of content item recommendation provided by an embodiment of the present disclosure;
FIG. 4 is a flow chart of another method of content item recommendation provided by an embodiment of the present disclosure;
FIG. 5 is a schematic structural diagram of a content item recommendation apparatus provided by an embodiment of the present disclosure;
FIG. 6 illustrates a server for content item recommendation, according to an example embodiment.
Detailed Description
To make the objects, technical solutions and advantages of the present disclosure more apparent, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.
It is to be understood that the terms "each," "a plurality," and "any" and the like, as used in the embodiments of the present disclosure, are intended to encompass two or more, each referring to each of the corresponding plurality, and any referring to any one of the corresponding plurality. For example, the plurality of words includes 10 words, and each word refers to each of the 10 words, and any word refers to any one of the 10 words.
It should be noted that all actions of acquiring signals, information or data in the present application are performed under the premise of complying with the corresponding data protection regulation policy of the country of the location and obtaining the authorization given by the owner of the corresponding device.
Before carrying out the embodiments of the present disclosure, terms to which the embodiments of the present disclosure relate will be explained first.
GNN (Graph Neural Networks) as a machine learning algorithm can extract important information from the Graph and make useful predictions. As graphics become more prevalent and information becomes richer, and artificial neural networks become more popular and powerful, GNNs have become a powerful tool for many important applications.
The self-attention mechanism refers to a process of calculating the attention of X to X for a sequence X. The calculation process of the self-attention mechanism is as follows: and calculating the correlation (expressed as similarity in the attention mechanism) between each time point in the sequence X and the rest time points to obtain an attention weight matrix, and further applying the attention weight matrix to the sequence X to obtain a weighted sum of the time points (namely, information of the rest time points is fused into the time points). Q, K and V in the self-attention mechanism essentially represent three independent matrixes, Q, K and V are obtained by performing different linear transformations on the sequence X, and Q, K and V can be used as representatives of the sequence X. In order to obtain the attention weight matrix, the similarity of the representative matrices Q and K of the sequence X needs to be calculated, and then the attention weight matrix and the matrix V are multiplied and summed 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 may be directly dot-multiplied, or MLP (multi layer perceptron) may be used to calculate the matrices Q and K. After the attention weight is obtained, 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 be changed continuously when the attention matrix is adopted). After the attention moment matrix is obtained, the attention weight and the V are multiplied and summed, and then the final result can be obtained.
The Recall rate of Recall @ K is the ratio of the number of relevant results searched in the previous topK result to the number of all relevant results in the library, and is used for measuring the recall rate of the search system.
NDCG (Normalized discrete cumulative gain) is used as an evaluation index of the sequencing result to evaluate the sequencing accuracy. The recommendation system usually returns an item list for a certain user, and assuming that the length of the list is K, the gap between the ordered list and the user real interaction list can be evaluated by NDCG @ K.
MRR (Mean reciprocal rank) is a mechanism that is used internationally to evaluate search algorithms, i.e., 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 the scores.
Referring to fig. 1, an implementation environment related to a content item recommendation method provided by an embodiment of the present disclosure is shown, and includes: a terminal 101 and a server 102. The terminal 101 and the server 102 are connected via a network 103, and the network 103 may be a wired network or a wireless network.
The terminal 101 may be a device having a display screen, such as a smart phone, a tablet computer, a notebook computer, and a desktop computer, and the terminal 101 has a content application, such as a shopping application, a take-out application, and a video application, installed therein. The terminal 101 is capable of displaying each content item recommended by the server 102, and when a click operation on any one content item is detected, the terminal 101 transmits a display request of the content item to the server 102, and further displays the content item upon receiving data related to the content item transmitted by the server 102.
The server 102 may be an independent physical server, or may be a server cluster or a distributed system formed by a plurality of physical servers, and the embodiment of the present disclosure does not specifically limit the server 102. The server 102 is a background server for content application installed in the terminal 101, and the server 102 can determine a user embedded feature vector representing long-term and short-term preferences of a user, acquire a target content item of which a time interval between a latest click time and a current time is smaller than a preset time interval, update the user embedded feature vector of the user based on the content embedded feature vector of the target content item, obtain an updated user embedded feature vector, and recommend the content item based on the updated user embedded feature vector.
Fig. 2 is a block diagram of a dynamic GNN recommendation system employed in a content item recommendation method provided by an embodiment of the present disclosure, the recommendation system including an embedding layer 201, a temporal self-attention collaborative filter 202, a short-term status update module 203, and a prediction layer 204.
The embedded layer 201 is configured to initialize long-term states of each user and each content item, so as to obtain an initialized long-term state feature vector. For example, in FIG. 2, the embedding layer 201 is user u 1 Initialized long-term state feature vector ofAs a content item i 1 The initialized long-term state vector isAs a content item i 2 The initialized long-term state vector isThe embedding layer 201 is further configured to initialize the short-term status of each user and each content item, resulting in an initialized short-term status vector. For example, in FIG. 2, the embedding layer 201 is user u 1 Initialized short-term state feature vector ofAs a content item i 1 Initialized short-term state vector ofAs a content item i 2 Initialized short-term state vector of
The time self-attention collaborative filter 202 is configured to encode a first time interval feature vector based on current time, fuse a long-term state feature vector and a short-term state feature vector of a user, and splice the fused feature vector and the first time interval feature vector to obtain a user embedded feature vector of the user. For example, in FIG. 2, temporal self-attention collaborative filter 202 is user u 1 The first time feature vector of the code is phi (0), and the user u is transmitted 1 Long-term state vector ofAnd short-term state feature vectorsFusing, and splicing the fused feature vector with a first time feature vector phi (0) to obtain a user u 1 The user of (2) embeds the feature vector. The temporal self-attention collaborative filter 202 is also used to encode a second time interval feature vector of the content item, a long term shape of the content item based on a current time and a most recent click time of the content item by the userAnd fusing the state feature vector and the short-term state feature vector, and splicing the fused feature vector, the second time interval feature vector and the interactive feature vector to obtain the content embedding feature vector of the content item. For example, temporal attention collaborative filter 202 in FIG. 2 is content item i 1 The second temporal feature vector of the encoding is, in turn, the content item i 1 Long-term state vector ofAnd short-term state feature vectorsFusing the feature vectors and a second time feature vector phi (t) 3 -t 1 ) And interactive feature vectorsSplicing to obtain a content item i 1 The content of (2) embeds feature vectors. As another example, temporal attention collaborative filter 202 in FIG. 2 is content item i 2 The second temporal feature vector of the code is phi (t) 3 -t 2 ) And further the content item i 2 Long-term state vector ofAnd short-term state feature vectorsFusing the feature vectors and a second time feature vector phi (t) 3 -t 2 ) And interactive feature vectorsSplicing to obtain a content item i 2 The content of (2) embeds feature vectors.
The short-term status update module 203 is used to update the short-term status feature vectors of the user and the content item. Specifically, the short-term status updating module 203 generates a first message feature vector of a content item pointing to a 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 that is closest in time to the user interaction. Meanwhile, the short-term status updating module 203 generates a second message feature vector pointing to the content item by the user based on each user with whom 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 the closest interaction time with the content item.
The prediction layer 204 is configured to recommend each content item by calculating a recommendation score for each candidate content item and the user based on the updated user embedded feature vector and the content embedded feature vector of each candidate content item.
The embodiment of the present disclosure provides a content item recommendation method, taking the server in fig. 1 to execute the embodiment of the present disclosure as an example, referring to fig. 3, a flow of the method provided by the embodiment of the present disclosure includes:
301. and determining a user embedded 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.
302. Determining content-embedded feature vectors for 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 for the plurality of target content items.
The target content item is a content item of which the time interval between the latest click time of the target user for carrying out the click operation and the current time is smaller than a preset time interval, and the second time interval feature vector is used for indicating the preference attenuation of the target user on the target content item in the time dimension by taking the first time interval feature vector as a reference.
303. And updating the user embedded feature vector based on the content embedded feature vectors of the plurality of target content items to obtain an updated user embedded feature vector.
304. Content item recommendations are made based on the updated user-embedded feature vectors.
The method provided by the embodiment of the disclosure does not artificially take the last interactive 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, and since the plurality of target content items are a plurality of content items recently clicked by the target user, the short-term preference of the target user can be accurately reflected. The user-embedded feature vectors of the target users are then updated based on the content-embedded feature vectors of the plurality of target content items. Because the first time interval characteristic vector and the second time interval characteristic vector which can represent the attenuation of the user preference are coded in the user embedded characteristic vector of the target user and the content embedded characteristic vectors of a plurality of target content items, the preference transfer condition of the target user can be known based on the user embedded characteristic vector and the content embedded characteristic vector, so that the updated user embedded characteristic vector not only learns the related knowledge of the short-term preference of the target user, but also learns the evolution rule from the short-term preference to the long-term preference of the target user and the attenuation rule of the short-term preference, therefore, the content items recommended based on the updated user embedded characteristic vector are more in line with the current requirements of the user, and the recommendation result is more accurate.
In another embodiment of the present disclosure, determining a user-embedded 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 comprises:
adding each feature element in the first long-term state feature vector and the corresponding feature element in the first short-term state feature vector to obtain a first fusion feature vector;
and splicing the first fusion feature vector and the first time interval feature vector to obtain a user embedded feature vector.
In another embodiment of the present disclosure, determining content-embedded feature vectors for 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 for the plurality of target content items comprises:
for any target content item, adding each feature element in 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 to obtain a second fusion feature vector corresponding to the target content item;
and splicing the second fusion feature vector, the second time interval feature vector and the interaction feature vector to obtain a content embedding feature vector of the target content item.
In another embodiment of the present disclosure, before the splicing the second fused feature vector, the second time interval feature vector, and the interactive feature vector to obtain the content-embedded feature vector of the target content item, the method further includes:
acquiring the latest click time of the target user for implementing click operation on the target content item;
and processing the current time and the latest click time by adopting a kernel function to obtain a second time interval characteristic vector.
In another embodiment of the present disclosure, updating the user-embedded feature vector based on content-embedded feature vectors of a plurality of target content items to obtain an updated user-embedded feature vector, includes:
carrying out linear transformation on the user embedded characteristic vector to obtain a transformed user embedded characteristic vector;
for any target content item, carrying out linear transformation on the content embedding characteristic vector of the target content item to obtain a transformed content embedding characteristic vector;
determining a time attention weight vector corresponding to the target content item based on the transformed user embedded feature vector and the transformed content embedded feature vector;
carrying out weighted addition on the content embedding feature vectors of the target content items based on the time attention weight vectors corresponding to the target content items to obtain weighted content embedding feature vectors;
and adding each characteristic element of the weighted content embedded characteristic vector and the corresponding characteristic element of the user embedded characteristic vector to obtain an updated user embedded characteristic vector.
In another embodiment of the present disclosure, after updating the user-embedded feature vector based on the content-embedded feature vectors of the plurality of target content items and obtaining an updated user-embedded feature vector, the method further includes:
for any target content item, according to a first splicing sequence, splicing the content embedded characteristic vector of the target content item, the second time interval characteristic vector of the target content item, the updated user embedded characteristic vector, the first time interval characteristic vector and the connection edge characteristic vector to obtain a first message characteristic vector of the target content item pointing to a target user;
acquiring a first target message feature vector from first message feature vectors corresponding to a plurality of target content items, wherein the first target message feature vector is a first message feature vector corresponding to a target content item with the minimum time interval between the latest click time and the current time;
and 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.
In another embodiment of the present disclosure, after updating the user-embedded feature vector based on the content-embedded feature vectors of the plurality of target content items and obtaining an updated user-embedded feature vector, the method further includes:
for any target content item, according to a second splicing sequence, splicing the content embedded characteristic vector of the target content item, a second time interval characteristic vector of the target content item, the updated user embedded characteristic vector, the first time interval characteristic vector and the connection edge characteristic vector to obtain a second message characteristic vector of the target user pointing to the target content item;
acquiring a second target message characteristic vector from second message characteristic vectors corresponding to a plurality of users, wherein the second target message characteristic vector is a first message characteristic vector corresponding to a user with the minimum time interval between the latest click time and the current time;
and updating 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.
In another embodiment of the disclosure, content item recommendations based on updated user-embedded feature vectors comprise:
obtaining content embedding feature vectors of a plurality of candidate content items;
splicing the content embedded characteristic vector of each candidate content item and the updated user embedded characteristic vector to obtain a spliced characteristic vector;
inputting the splicing characteristic vector into a feedforward neural network, and outputting the recommendation scores of the candidate content items;
the plurality of candidate content items are recommended in order of high to low recommendation scores.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
The embodiment of the present disclosure provides a content item recommendation method, taking the server in fig. 1 to execute the embodiment of the present disclosure as an example, referring to fig. 4, a flow of the method provided by the embodiment of the present disclosure includes:
401. and the server determines a first time interval characteristic vector of the target user according to the current time.
With the development of internet technology, applications focusing on contents are rapidly developing. To attract more users to use, the recommendation system needs to mine the user's preferences. Typically, the user will have both short-term and long-term preferences, such as the user clicking on a series of content items that belong to the user's short-term preferences for currently popular content items or for explicit needs. Over time, short-term preferences evolve into long-term preferences, such as preferences for certain specific brands, categories, etc. attributes, and also because of the changing demand, short-term preferences may disappear, which creates a periodicity or fading of the content items in the time dimension for the user. Because the time intervals of different users using the recommendation system are inconsistent, the click behaviors of most users in the time dimension are sparse and irregular, and in order to accurately capture the dynamic preference of the users in the development process and learn the periodicity and the attenuation of the user preference, the next click behavior of the users is predicted, and time interval information needs to be encoded.
Here, the various information of the content item as the user browsing object refers to content that can be electronized (or digitized) by any electronic processing means such as scanning, and content that has been electronized. The content items include documents formed of characters and (still) images, audio, and video of moving images, and the like. The content items are rich in content, which may be music, information, objects, businesses, etc. The time interval information refers to a time interval between a current time and a latest click time of a user for performing a click operation on a certain content item. The server may encode the time interval information using a kernel function in order to simplify the amount of computation for the time interval information encoding process, considering the periodicity and continuity of the time interval information. The kernel function is a statistical term, and includes a linear kernel function, a polynomial kernel function, a gaussian kernel function, and the like, and is used for mapping the input space to the high-dimensional feature space. When the server uses the kernel function to encode the time interval information, the following formula can be adopted:
wherein phi (t) i -t j ) A time interval feature vector, t, representing a target content item j i Representing the current time, t j Represents the latest click time, w, of the target user performing the click operation on the target content item j 1 、…、Representing a vector of parameters, b 1 、…、Representing a bias vector.
For the target user, the latest click time of the target user on the content item can be considered as the current time, and based on the above formula, the server determines the first time interval of the target user according to the current timeThe feature vectors are:because the duration of the time interval information corresponding to the first time interval feature vector is 0, and the preference of the target user is not attenuated at this time, the first time interval feature vector can be used as a reference for the attenuation of the preference of the target user, and the second time interval feature vector of each target item can indicate the attenuation of the preference of the target user for each target content item by comparing with the first time interval feature vector.
402. And the server determines second time interval characteristic vectors of the target content items according to the current time and the latest click time of the target user for performing click operation on the target content items.
The target content item is a content item of which the time interval between the latest click time of the target user for implementing the click operation and the current time is smaller than the preset time interval. And setting the current time as t, and the latest click time of the target user for carrying out click operation on any content item as t ', and taking the content item as a target content item by the server when t-t' is less than a preset time interval. By selecting the target content item of which the time interval between the latest click time and the current time is smaller than the preset time interval, the timeliness of the short-term preference of the user is ensured.
For any target content item, when the server determines the second time interval feature vector of the target content item according to the current time and the latest click time of the target user for performing click operation on the target content item, the formula can be appliedA determination is made. For example, content item i in FIG. 2 1 Has a latest click time of t 1 The current time is t 3 Then the content item i 1 The second time interval feature vector ofAs another example, content item i in FIG. 2 2 Of (2) aClick time of t 2 The current time is t 3 Then the content item i 2 The second time interval feature vector ofThe second time interval feature vector determined by the server for each target content item is used for indicating the preference attenuation of the target user for each target content item in the time dimension by taking the first time interval feature vector as a reference. The server may learn the target user's preference decay for the target content item in the time dimension by encoding the second time interval feature vector.
403. The server determines a user embedded 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.
In the embodiment of the disclosure, in order to better mine the long-term preference and the short-term preference of the user and accordingly recommend the preferred content items to the user in a targeted manner, the server may set corresponding user nodes for each user and set corresponding content nodes for each content item, so that the user nodes and the content nodes, and the content nodes are connected by using directed line segments based on the interaction relationship between each user and each content item, and a graph neural network is constructed.
Based on the constructed graph neural network, the server initializes the short-term state of the user node at the time t to obtain a short-term state feature vector initialized by the user node, wherein the short-term state feature vector is used for representing the short-term preference of the user. When the server initializes the short-term state of the user node, the server can allocate a feature vector of all 0 to the user node as the short-term state feature vector initialized by the user node, and the short-term state feature vector initialized by the user node is expressed as s u (t) of (d). With the interaction of the user and the content item, the server updates the short-term state feature vector initialized by the user node based on the content item clicked by the user. Of course, the server may also initialize the short-term state of the content node at time t to obtain the content itemA node-initialized short-term state feature vector, the content item node-initialized short-term state feature vector characterizing short-term interaction conditions 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 initialized by the content node, and the short-term state feature vector of the content node is expressed as s i (t) of (d). As the content item interacts with the user, the server will update the short-term state feature vector initialized for the content node.
Based on the constructed graph neural network, the server initializes the long-term state of the user node at the time t to obtain a long-term state feature vector initialized by the user node, wherein the long-term state feature vector initialized by the user node is used for representing 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 distributed to the user node according to the one-hot of the node identifier of the user node, and the initialized long-term state feature vector of the user node is represented as l u (t) of (d). Over time, the short-term preference of the user node may 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 may also initialize the long-term state of each content node at time t to obtain a long-term feature vector initialized by each content node, where the long-term feature vector initialized by the content node is used to represent the long-term interaction condition 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 distributed to the content node according to the one-hot of the node identifier of the content node, and the long-term state feature vector is expressed as l i (t) of (d). As the content item interacts with the user, the server will update the long-term state feature vector initialized for the content node.
In the embodiment of the disclosure, in order to better recommend content items meeting the preference of a target user to the target user, a 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 embedded 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, wherein the user embedded feature vector is used for representing the long-term and short-term preference of the target user at the current time. Specifically, the server adds each feature element in the first long-term state feature vector and the corresponding feature element in the first short-term state feature vector to obtain a first fused feature vector, and then splices the first fused feature vector and the first time interval feature vector to obtain a user embedded feature vector.
404. The server determines content-embedded feature vectors for the 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 the interaction feature vector for the plurality of target content items.
In the embodiment of the 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 the plurality of target content items at the current time, where the interaction feature vector is used to characterize an interaction situation between the target user and the target content items, and determines content embedding feature vectors 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 one of the 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 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 then splices the second fusion feature vector, the second time interval feature vector and the interaction feature vector to obtain a content embedding feature vector of the target content item.
405. And the server updates the user embedded feature vector based on the content embedded feature vectors of the target content items to obtain an updated user embedded feature vector.
The server updates the user-embedded feature vector based on the content-embedded feature vectors of the plurality of target content items, and when obtaining the updated user-embedded feature vector, the following method may be adopted:
4051. and the server performs linear transformation on the user embedded characteristic vector to obtain the transformed user embedded characteristic vector.
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.
4053. And the server determines a time attention weight vector corresponding to the target content item based on the transformed user embedded feature vector and the transformed content embedded feature vector.
And the server takes the transformed user embedded characteristic vector as a Q matrix, takes the transformed content embedded characteristic vector as a K matrix and a V matrix, and adopts a self-attention mechanism to process the transformed user embedded characteristic vector and the transformed content embedded characteristic vector to obtain a time attention weight vector corresponding to the target content item. Setting the target user as u and the target content item as i, and then representing the time attention weight vector corresponding to the target content item as beta ui (t)。
Further, to ensure the stability of the numerical value, the server may further perform a normalization operation on the time attention weight vector corresponding to each target content item to obtain a normalized time attention weight vector corresponding to each target content item. The normalized temporal attention weight vector is denoted as α ui (t i )。
4054. And the server carries out weighted addition on the content embedded characteristic vectors of the target content items based on the time attention weight vectors corresponding to the target content items to obtain weighted content embedded characteristic vectors.
Based on the time attention weight vectors corresponding to the target content items, the server multiplies the content embedding feature vector of each target content item by the corresponding time attention weight vector to obtain an intermediate result vector, and then adds feature elements with the same dimension in the intermediate result vector corresponding to each target content item to obtain a weighted content embedding feature vector.
4055. And the server adds each characteristic element in the weighted content embedded characteristic vector and the corresponding characteristic element in the user embedded characteristic vector, and processes the vector obtained by adding by adopting a feedforward neural network to obtain an updated user embedded characteristic vector.
Based on the obtained weighted content embedded feature vector, the server adds each feature element in the weighted content embedded feature vector and the corresponding feature element in the user embedded feature vector, inputs the vector obtained by the addition into a feedforward neural network, and processes the vector through the feedforward neural network to obtain an updated user embedded feature vector.
It should be noted that, considering that the neural network includes a plurality of 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 in the graph neural network directly connected with the user node forms a first network layer of the user node, other content nodes in the graph neural network connected with each content node in the first layer form a second network layer of the user node, and so on until the last layer of the graph neural network. When the user embedded feature vector of the user node of the target user is updated, firstly, the user embedded feature vector of the 0 th layer of the user node and the content embedded feature vector of each content node of the first layer are determined, and then the content embedded feature vectors of each content node of the first layer are fused to the user embedded feature vector of the user node to obtain the user embedded feature vector of the first layer. And then, fusing the content embedding feature vectors of the content nodes of the second layer into the content embedding feature vectors of the connected content nodes of the first layer, fusing the content embedding feature vectors of all the content nodes fused in the first layer into the user embedding feature vectors of the first layer to obtain the user embedding feature vectors of the second layer, and repeating the steps until the user embedding feature vectors of the last layer are obtained. For the fusion process of the user embedded feature vectors of each layer, see the above updating process of the user embedded feature vectors, which is not described herein again.
To further capture the short-term preferences of the target user and the current characteristics of the target content items, the disclosed embodiments will also Update the first short-term state characteristic vector of the target user and the second short-term characteristic vector of each target content item, the Update process including three phases, respectively Message, aggregate, and Update.
The updating process of the first short-term state feature vector aiming at the target user comprises the following steps:
in the Message stage, for any target content item, a connection edge feature vector of a connection edge of a content node corresponding to the target content item and a user node corresponding to a target user in a graph neural network is obtained, and then according to a first splicing sequence, the content embedding feature vector of the target content item, a 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 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, a first message feature vector from the content item i to the user u is obtained by splicing a user embedded feature vector of the user u, a content embedded feature vector of the content item i, a connection edge feature vector, a first time feature vector and a second time interval feature vector, wherein the first message feature vector comprises a time sequence collaborative filtering signal, an edge feature and a time sequence pattern, and can be represented as m u←i (t i )。
In an aggregation stage, a server acquires a first target message feature vector from first message feature vectors corresponding to a plurality of target content items, wherein the first target message feature vector is a first message feature vector corresponding to a target content item with the minimum time interval between the latest click time and the current time, and the first target message feature vector is represented as
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 user u according to the aggregated message and the previous short-term state of user u.
The update procedure for the second short-term state feature vector for the target content item is:
in the Message phase, for any target content item, the server splices the content embedded feature vector of the target content item, the second time interval feature vector of the target content item, the updated user embedded feature vector, the first time interval feature vector and the connecting edge feature vector according to a second splicing sequence to obtain a second Message feature vector of the target user pointing to the target content item.
In an aggregation stage, the server acquires a second target message feature vector from second message feature vectors corresponding to a plurality of users, wherein the second target message feature vector is a first message feature vector corresponding to a user with the minimum time interval between the latest click time and the current time.
In the Update stage, 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.
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 both the target user and each target content item can keep timeliness.
406. The server makes content item recommendations based on the updated user-embedded feature vectors.
Based on the determined updated user embedded feature vector, the server obtains content embedded feature vectors of a plurality of candidate content items, the content embedded feature vector of each candidate content item is spliced with the updated user embedded feature vector to obtain a spliced feature vector, the spliced feature vector is input into a feedforward neural network, and recommendation scores of the candidate content items are output and expressed as y ui (t) then recommending the plurality of candidate content items in an order of high recommendation scores to low recommendation scores.
Further, in order to improve the accuracy of the recommendation result, after the updated user embedded feature vector, the server further 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 into a loss function, calculates a loss value of the loss function, and adjusts each model parameter in the model for determining the updated user embedded feature vector based on the loss value of the loss function, thereby improving the accuracy of the updated user embedded feature vector. The loss function may be a BPR loss function commonly used in topk recommendation tasks. When using the BPR loss function, to prevent overfitting, the embodiment of the present disclosure further performs an L2 regularization process on the first long-term state feature vector of the target user. The loss function is:
where δ denotes the activation function, y ui (t) recommendation score, y, for the target content item uj (t) represents a recommendation score for a content item not previously clicked on by the target user, λ represents a constant, and Θ represents a first long-term state feature vector for the target user.
In order to verify the accuracy of the recommendation based on the trained model, embodiments of the present disclosure will also obtain a test set that includes multiple users and multiple commodities. For a certain user u in the test set, obtaining a commodity which is currently interacted with the user as a unique positive sample, obtaining a certain number of commodities which are not interacted with the user before as negative samples, respectively obtaining the prediction scores of the positive sample pair and the negative sample pair according to the forward propagation of the model, and obtaining a ranking list through descending order of the scores, wherein the order calculation index of the positive sample in the ranking list is Recall @ K, NDCG @ K or MRR.
The method provided by the embodiment of the disclosure does not artificially take the last interactive 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, and since the plurality of target content items are a plurality of content items recently clicked by the target user, the short-term preference of the target user can be accurately reflected. The user-embedded feature vectors of the target users are then updated based on the content-embedded feature vectors of the plurality of target content items. Because the first time interval characteristic vector and the second time interval characteristic vector which can represent the attenuation of the user preference are coded in the user embedded characteristic vector of the target user and the content embedded characteristic vectors of a plurality of target content items, the preference transfer condition of the target user can be known based on the user embedded characteristic vector and the content embedded characteristic vector, so that the updated user embedded characteristic vector not only learns the related knowledge of the short-term preference of the target user, but also learns the evolution rule from the short-term preference to the long-term preference of the target user and the attenuation rule of the short-term preference, therefore, the content items recommended based on the updated user embedded characteristic vector better meet the current requirements of the user, and the recommendation result is more accurate.
Referring to fig. 5, an embodiment of the present disclosure provides a content item recommendation apparatus including:
a first determining module 501, configured to determine a user-embedded 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;
a second determining module 502, configured to determine content-embedded feature vectors of a plurality of target content items based on a second long-term status feature vector, a second short-term status feature vector, a second time interval feature vector, and an interaction feature vector of the plurality of target content items, where the target content items are content items for which a time interval between a latest click time for a target user to perform a click operation and a current time is smaller than a preset time interval, and the second time interval feature vector is used to indicate a preference attenuation of the target user for the target content items in a time dimension with reference to the first time interval feature vector;
a first updating module 503, configured to update the user-embedded feature vector based on the content-embedded feature vectors of the multiple target content items, to obtain an updated user-embedded feature vector;
a recommendation module 504 for making content item recommendations based on the updated user-embedded feature vector.
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 fused feature vector; and splicing the first fusion feature vector and the first time interval feature vector to obtain a user embedded feature vector.
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 fused feature vector corresponding to the target content item; and splicing the second fusion feature vector, the second time interval feature vector and the interaction feature vector to obtain a content embedding feature vector of the target content item.
In another embodiment of the present disclosure, the apparatus further comprises:
the first acquisition module is used for acquiring the latest click time of the target user for implementing the click operation on the target content item;
and the third determining module is used for processing the current time and the latest click time by adopting a kernel function to obtain a second time interval characteristic vector.
In another embodiment of the present disclosure, the first updating module 503 is configured to perform linear transformation on the user embedded feature vector to obtain a transformed user embedded feature vector; for any target content item, carrying out linear transformation on the content embedding feature vector of the target content item to obtain a transformed content embedding feature vector, and 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; based on time attention weight vectors corresponding to a plurality of target content items, carrying out weighted addition on content embedded feature vectors of the plurality of target content items to obtain weighted content embedded feature vectors; and adding each characteristic element of the weighted content embedded characteristic vector and the corresponding characteristic element of the user embedded characteristic vector to obtain an updated user embedded characteristic vector.
In another embodiment of the present disclosure, the apparatus further comprises:
the first splicing module is used for splicing the content embedded characteristic vector of the target content item, the second time interval characteristic vector of the target content item, the updated user embedded characteristic vector, the first time interval characteristic vector and the connecting edge characteristic vector according to a first splicing sequence to obtain a first message characteristic vector of the target content item pointing to a target user;
the second acquisition module is used for acquiring a first target message feature vector from first message feature vectors corresponding to a plurality of target content items, wherein the first target message feature vector is 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;
and the second updating module is used for 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.
In another embodiment of the present disclosure, the apparatus further comprises:
the second splicing module is used for splicing the content embedded characteristic vector of the target content item, the second time interval characteristic vector of the target content item, the updated user embedded characteristic vector, the first time interval characteristic vector and the connecting edge characteristic vector according to a second splicing sequence to obtain a second message characteristic vector of the target user pointing to the target content item;
a third obtaining module, configured to obtain a second target message feature vector from second message feature vectors corresponding to multiple users, where the second target message feature vector is a first message feature vector corresponding to a user with a smallest time interval between a latest click time and a current time;
and the third updating module is used for updating 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.
In another embodiment of the present disclosure, the recommendation module 504 is configured to obtain content-embedded feature vectors of a plurality of candidate content items; splicing the content embedded characteristic vector of each candidate content item and the updated user embedded characteristic vector to obtain a spliced characteristic vector; inputting the splicing characteristic vector into a feedforward neural network, and outputting the recommendation scores of the candidate content items; the plurality of candidate content items are recommended in order of high to low recommendation scores.
In summary, the apparatus provided by the embodiment of the present disclosure no longer artificially takes the last interacted 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, and since the plurality of target content items are a plurality of content items recently clicked by the target user, the short-term preference of the target user can be accurately reflected. The user-embedded feature vectors of the target users are then updated based on the content-embedded feature vectors of the plurality of target content items. Because the first time interval characteristic vector and the second time interval characteristic vector which can represent the attenuation of the user preference are coded in the user embedded characteristic vector of the target user and the content embedded characteristic vectors of a plurality of target content items, the preference transfer condition of the target user can be known based on the user embedded characteristic vector and the content embedded characteristic vector, so that the updated user embedded characteristic vector not only learns the related knowledge of the short-term preference of the target user, but also learns the evolution rule from the short-term preference to the long-term preference of the target user and the attenuation rule of the short-term preference, therefore, the content items recommended based on the updated user embedded characteristic vector are more in line with the current requirements of the user, and the recommendation result is more accurate.
FIG. 6 illustrates a server for content item recommendation, according to an example embodiment. Referring to fig. 6, server 600 includes a processing component 622 that further includes one or more processors and memory resources, represented by memory 632, for storing instructions, such as applications, that are executable by processing component 622. The application programs stored in memory 632 may include one or more modules that each correspond to a set of instructions. Further, the processing component 622 is configured to execute instructions to perform the functions performed by the server in the content item recommendation method described above.
The server 600 may also include a power component 626 configured to perform power management for 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 may operate based on an operating system, such as Windows Server, stored in the memory 632 TM ,Mac OS X TM ,Unix TM ,Linux TM ,FreeBSD TM Or the like.
The server provided by the embodiment of the disclosure does not artificially take the last interactive 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, and since the plurality of target content items are a plurality of content items recently clicked by the target user, the short-term preference of the target user can be accurately reflected. The user-embedded feature vectors of the target users are then updated based on the content-embedded feature vectors of the plurality of target content items. Because the first time interval characteristic vector and the second time interval characteristic vector which can represent the attenuation of the user preference are coded in the user embedded characteristic vector of the target user and the content embedded characteristic vectors of a plurality of target content items, the preference transfer condition of the target user can be known based on the user embedded characteristic vector and the content embedded characteristic vector, so that the updated user embedded characteristic vector not only learns the related knowledge of the short-term preference of the target user, but also learns the evolution rule from the short-term preference to the long-term preference of the target user and the attenuation rule of the short-term preference, therefore, the content items recommended based on the updated user embedded characteristic vector are more in line with the current requirements of the user, and the recommendation result is more accurate.
The disclosed embodiments provide a computer readable storage medium having stored therein at least one program code, the at least one program code being loaded and executed by a processor to implement a content item recommendation method. The computer readable storage medium may be non-transitory. For example, the computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, and the like.
Embodiments of the present disclosure provide a computer program product comprising computer program code stored in a computer readable storage medium, the computer program code being read from the computer readable storage medium by a processor of an electronic device, the processor executing the computer program code to cause the electronic device to perform a content item recommendation method.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is intended only to illustrate the preferred embodiments of the present disclosure, and should not be taken as limiting the disclosure, as any modifications, equivalents, improvements and the like which are within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.
Claims (10)
1. A method of content item recommendation, the method comprising:
determining a user embedded 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;
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, wherein the target content items are content items of which the time interval between the latest click time and the current time of the target user for carrying out the click operation is smaller than a preset time interval, and the second time interval feature vector is used for indicating the preference attenuation of the target user on the target content items in the time dimension by taking the first time interval feature vector as a reference;
updating the user-embedded feature vector based on the content-embedded feature vectors of the plurality of target content items to obtain an updated user-embedded feature vector;
content item recommendations are made based on the updated user-embedded feature vectors.
2. The method of claim 1, wherein determining the user-embedded 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 comprises:
adding each feature element in the first long-term state feature vector and the corresponding feature element in the first short-term state feature vector to obtain a first fusion feature vector;
and splicing the first fusion feature vector and the first time interval feature vector to obtain the user embedded feature vector.
3. The method of claim 1, wherein prior to determining the content-embedded feature vectors for 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 for the plurality of target content items, further comprising:
obtaining the latest click time of the target user for implementing click operation on the target content item;
processing the current time and the latest click time by adopting a kernel function to obtain a second time interval feature vector;
determining content-embedded feature vectors for 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 for the plurality of target content items, comprising:
for any target content item, adding each feature element in 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 to obtain a second fusion feature vector corresponding to the target content item;
and splicing the second fusion feature vector, the second time interval feature vector and the interactive feature vector to obtain the content embedding feature vector of the target content item.
4. The method of claim 1, wherein the updating the user-embedded feature vector based on the content-embedded feature vectors of the plurality of target content items to obtain an updated user-embedded feature vector comprises:
carrying out linear transformation on the user embedded characteristic vector to obtain a transformed user embedded characteristic vector;
for any target content item, carrying out linear transformation on the content embedding characteristic vector of the target content item to obtain a transformed content embedding characteristic vector;
determining a temporal attention weight vector corresponding to the target content item based on the transformed user embedded feature vector and the transformed content embedded feature vector;
based on the time attention weight vectors corresponding to the target content items, carrying out weighted addition on the content embedding feature vectors of the target content items to obtain weighted content embedding feature vectors;
and adding each characteristic element in the weighted content embedded characteristic vector and the corresponding characteristic element in the user embedded characteristic vector to obtain the updated user embedded characteristic vector.
5. The method of claim 1, wherein after updating the user-embedded feature vector based on the content-embedded feature vectors of the plurality of target content items to obtain an updated user-embedded feature vector, the method further comprises:
for any target content item, according to a first splicing sequence, splicing the content embedded feature vector of the target content item, the second time interval feature vector of the target content item, the updated user embedded 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;
acquiring a first target message feature vector from first message feature vectors corresponding to the target content items, wherein the first target message feature vector is 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;
and 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.
6. The method of claim 1, wherein after updating the user-embedded feature vector based on the content-embedded feature vectors of the plurality of target content items to obtain an updated user-embedded feature vector, further comprising:
for any target content item, according to a second splicing sequence, splicing the content embedded feature vector of the target content item, a second time interval feature vector of the target content item, the updated user embedded feature vector, the first time interval feature vector and a connection edge feature vector to obtain a second message feature vector of the target user pointing to the target content item;
acquiring a second target message feature vector from second message feature vectors corresponding to a plurality of users, wherein the second target message feature vector is a first message feature vector corresponding to a user with the smallest time interval between the latest click time and the current time;
and updating 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.
7. The method of any of claims 1-6, wherein the content item recommendation based on the updated user-embedded feature vector comprises:
obtaining content embedding feature vectors of a plurality of candidate content items;
splicing the content embedded characteristic vector of each candidate content item with the updated user embedded characteristic vector to obtain a spliced characteristic vector;
inputting the splicing feature vector into a feed-forward neural network, and outputting the recommendation scores of the candidate content items;
and recommending the candidate content items according to the sequence of the recommendation scores from high to low.
8. An apparatus for recommending content items, the apparatus comprising:
the first determining module is used for determining a user embedded 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;
a second determining module, configured to determine content-embedded 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, where the target content items are content items for which a time interval between a latest click time for the target user to perform a click operation and a current time is smaller than a preset time interval, and the second time interval feature vector is used to indicate, with reference to the first time interval feature vector, a preference attenuation of the target user for the target content items in a time dimension;
a first updating module, configured to update the user-embedded feature vector based on the content-embedded feature vectors of the multiple target content items, to obtain an updated user-embedded feature vector;
and the recommending module is used for recommending the content item based on the updated user embedded characteristic vector.
9. A server, characterized in that the terminal comprises a processor and a memory, in which at least one program code is stored, which is loaded and executed by the processor to implement the content item recommendation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, having stored therein at least one program code, which is loaded and executed by a processor, to implement the content item recommendation method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210766877.6A CN115203540A (en) | 2022-06-30 | 2022-06-30 | Content item recommendation method, device, server and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210766877.6A CN115203540A (en) | 2022-06-30 | 2022-06-30 | Content item recommendation method, device, server and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115203540A true CN115203540A (en) | 2022-10-18 |
Family
ID=83578121
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210766877.6A Pending CN115203540A (en) | 2022-06-30 | 2022-06-30 | Content item recommendation method, device, server and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115203540A (en) |
-
2022
- 2022-06-30 CN CN202210766877.6A patent/CN115203540A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20210027160A1 (en) | End-to-end deep collaborative filtering | |
CN111061946B (en) | Method, device, electronic equipment and storage medium for recommending scenerized content | |
CN111898032B (en) | Information recommendation method and device based on artificial intelligence, electronic equipment and storage medium | |
CN114265979B (en) | Method for determining fusion parameters, information recommendation method and model training method | |
CN111783810B (en) | Method and device for determining attribute information of user | |
CN115917535A (en) | Recommendation model training method, recommendation device and computer readable medium | |
CN111104599B (en) | Method and device for outputting information | |
CN114896454B (en) | Short video data recommendation method and system based on label analysis | |
Huynh et al. | Context-similarity collaborative filtering recommendation | |
CN113515690A (en) | Training method of content recall model, content recall method, device and equipment | |
CN111667024B (en) | Content pushing method, device, computer equipment and storage medium | |
CN116452263A (en) | Information recommendation method, device, equipment, storage medium and program product | |
CN115456707A (en) | Method and device for providing commodity recommendation information and electronic equipment | |
CN110992127A (en) | Article recommendation method and device | |
Li et al. | Probability matrix factorization algorithm for course recommendation system fusing the influence of nearest neighbor users based on cloud model | |
CN114119123A (en) | Information pushing method and device | |
CN113836388A (en) | Information recommendation method and device, server and storage medium | |
CN116401522A (en) | Financial service dynamic recommendation method and device | |
CN113449176A (en) | Recommendation method and device based on knowledge graph | |
CN115203540A (en) | Content item recommendation method, device, server and storage medium | |
CN115423016A (en) | Training method of multi-task prediction model, multi-task prediction method and device | |
CN113094584A (en) | Method and device for determining recommended learning resources | |
CN111860870A (en) | Training method, device, equipment and medium for interactive behavior determination model | |
CN113515689A (en) | Recommendation method and device | |
CN110858235B (en) | Hot start Generalized Additive Mixing Effect (GAME) framework |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |