Recommended method, device, electronic equipment and computer readable medium
Patent Information
- Application Number
- CN202410070883.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-17
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2044-01-17
AI Technical Summary
[0007]为此,本发明提供一种推荐方法、装置、电子设备及计算机可读介质,以解决现有技术中由于传统的游戏推荐方法没有充分利用游戏时间导致获得较差推荐效果的问题
[0058]本发明实施例提供了一种推荐方法,获取第一用户使用一个或多个娱乐项目的历史数据,将历史数据输入娱乐项目推荐模型,通过娱乐项目推荐模型可以捕捉第一用户与娱乐项目之间的潜在关系,娱乐项目推荐模型输出第一用户的娱乐推荐信息,娱乐推荐信息包括娱乐项目和每个娱乐项目的推荐得分,基于娱乐推荐信息中每个娱乐项目的推荐得分,精准地向用户推荐相应的娱乐项目,从而获得良好的推荐效果。
Smart Images

Figure CN118377954B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine learning technology, and more specifically to a recommendation method, apparatus, electronic device, and computer-readable medium. Background Technology
[0002] Recommending trending information and popular games that users are interested in is a frequent business operation for relevant platforms. Games that users are interested in can be determined through the following methods:
[0003] First, based on the popular recommendation algorithm, this algorithm determines core indicators such as clicks and purchases according to the business type to evaluate the popularity of the game and recommends the games to users in order of popularity.
[0004] Second, content-based recommendation algorithms. These algorithms build recommendation models based on game-related information, user-related information, and user behavior in the game, providing recommendation services to users.
[0005] Third, based on collaborative filtering methods, this method can be roughly divided into neighborhood-based recommendation and model-based recommendation. Neighborhood-based recommendation essentially uses users with roughly the same interests to expand recommendations, while model-based recommendation uses some machine learning algorithms to find the interaction model between users and items, thereby finding specific patterns in the data and recommending corresponding items or products to users.
[0006] None of the above recommendation methods make full use of time information, resulting in poor recommendation performance. Summary of the Invention
[0007] To address this issue, the present invention provides a recommendation method, apparatus, electronic device, and computer-readable medium to solve the problem in the prior art where traditional game recommendation methods do not make full use of game time, resulting in poor recommendation performance.
[0008] To achieve the above objectives, a first aspect of the present invention provides a recommended method, comprising:
[0009] Obtain historical data of a first user's use of one or more entertainment programs; the historical data includes time information of the entertainment programs.
[0010] Input the historical data into the entertainment project recommendation model;
[0011] The entertainment recommendation model outputs entertainment recommendation information for the first user, which includes entertainment items and a recommendation score for each entertainment item.
[0012] In some implementations, the time information of the entertainment items includes the usage duration of each entertainment item, and before the entertainment item recommendation model outputs the entertainment recommendation information for the first user, it further includes:
[0013] Based on the historical data, the usage duration of each entertainment item, the representation vector of each entertainment item, and the time vector of each entertainment item are obtained.
[0014] The weight of each entertainment activity is determined based on the ratio of the usage time of each entertainment activity to the total usage time of all entertainment activities.
[0015] The representation vector of the first user is obtained based on the representation vector of each entertainment item and the weight of each entertainment item;
[0016] The time vector of the first user is obtained based on the time vector of each entertainment item and the weight of each entertainment item;
[0017] Based on the representation vector of each entertainment item, the time vector of each entertainment item, the representation vector of the first user, and the time vector of the first user, a recommendation rating for each entertainment item is obtained using a rating prediction function.
[0018] In some implementations, after the entertainment recommendation model outputs the entertainment recommendation information for the first user, it further includes:
[0019] Recommendations are made to the first user based on the entertainment items and the time vector of each entertainment item.
[0020] In some implementations, the entertainment recommendation model is trained through the following steps:
[0021] Based on the training samples, the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user are obtained; wherein, the training samples include historical data of the second user using one or more entertainment samples;
[0022] The representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user are input into the entertainment item recommendation model to be trained.
[0023] Based on the representation vector of the entertainment sample and the representation vector of the second user, the representation correlation between the representation vector of the entertainment sample and the representation vector of the second user is obtained;
[0024] Based on the time vector of the entertainment sample and the time vector of the second user, the temporal correlation between the time vector of the entertainment sample and the time vector of the second user is obtained;
[0025] A representation vector score is obtained based on the representation vector of the entertainment sample, the representation vector of the second user, and the representation relevance.
[0026] A time vector score is obtained based on the time vector of the entertainment sample, the time vector of the second user, and the time relevance.
[0027] The representation vector score, the time vector score, the preset representation parameters, the preset time parameters, and the preset loss function are used to update the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user, and the parameters of the entertainment item recommendation model to be trained are adjusted.
[0028] Determine whether the training termination condition is met;
[0029] If the training termination condition is not met, return to the step of inputting the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user into the entertainment item recommendation model to be trained;
[0030] If the training termination condition is met, the entertainment item recommendation model in the last round of training will be used as the trained entertainment item recommendation model.
[0031] In some implementations, updating the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user based on the representation vector score, the time vector score, preset representation parameters, preset time parameters, and a preset loss function includes:
[0032] Based on the preset loss function, the representation vector and time vector of the entertainment sample are updated using the gradient descent method.
[0033] Based on the updated representation vector and time vector of the entertainment sample, update the representation vector and time vector of the second user.
[0034] In some implementations, obtaining the representation correlation between the representation vector of the entertainment sample and the representation vector of the second user based on the representation vector of the entertainment sample includes:
[0035] A joint vector of representation vectors is obtained based on the representation vector of the second user and the representation vector of the entertainment sample;
[0036] The latent representation vector is obtained based on the joint vector of the second user's activity cycle and the representation vector;
[0037] The weights representing the hidden states are obtained based on the hidden vector and the joint vector of the hidden vectors.
[0038] The weights representing the hidden states are normalized.
[0039] Based on the weights of the represented hidden states after normalization and the represented hidden states, the representation correlation between the representation vector of the entertainment sample and the representation vector of the second user is obtained.
[0040] In some implementations, obtaining the temporal correlation between the time vector of the entertainment sample and the time vector of the second user based on the time vector of the second user includes:
[0041] A joint vector of time vectors is obtained based on the time vector of the second user and the time vector of the entertainment sample;
[0042] The latent time vector is obtained based on the joint vector of the second user's active period and the time vector;
[0043] The weights of the temporal hidden states are obtained based on the temporal hidden vector and the joint vector of the temporal vectors.
[0044] The weights of the time-hidden states are normalized.
[0045] Based on the weights of the time hidden states after normalization and the time hidden states themselves, the temporal correlation between the time vector of the entertainment sample and the time vector of the second user is obtained.
[0046] In some implementations, before obtaining the recommended rating for each entertainment item using a rating prediction function based on the representation vector of each entertainment item, the time vector of each entertainment item, the representation vector of the first user, and the time vector of the first user, the method further includes:
[0047] Adjust the scoring prediction function.
[0048] A second aspect of the present invention provides a recommended apparatus, comprising:
[0049] The first acquisition module is used to acquire historical data of a first user's use of one or more entertainment projects; the historical data includes time information of the entertainment projects.
[0050] The first input module is used to input the historical data into the entertainment project recommendation model;
[0051] The first recommendation module is used to output entertainment recommendation information for the first user from the entertainment project recommendation model. The entertainment recommendation information includes entertainment projects and recommendation scores for each entertainment project.
[0052] A third aspect of the present invention provides an electronic device, comprising:
[0053] One or more processors;
[0054] A memory having stored one or more programs that, when executed by one or more processors, cause the one or more processors to implement the recommended method provided according to embodiments of the present invention;
[0055] One or more I / O interfaces are connected between the processor and the memory and configured to enable information interaction between the processor and the memory.
[0056] A fourth aspect of the present invention provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements a recommended method provided according to embodiments of the present invention.
[0057] The present invention has the following advantages:
[0058] This invention provides a recommendation method that obtains historical data of a first user's use of one or more entertainment items, inputs the historical data into an entertainment item recommendation model, captures the potential relationship between the first user and the entertainment items through the entertainment item recommendation model, and outputs entertainment recommendation information for the first user, including entertainment items and a recommendation score for each entertainment item. Based on the recommendation score of each entertainment item in the entertainment recommendation information, the corresponding entertainment items are accurately recommended to the user, thereby achieving a good recommendation effect. Attached Figure Description
[0059] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the following detailed description to explain the invention, but do not constitute a limitation thereof.
[0060] Figure 1 A flowchart of a recommended method provided in an embodiment of the present invention;
[0061] Figure 2 A flowchart for obtaining a recommendation rating for each entertainment item is provided as an embodiment of the present invention;
[0062] Figure 3A flowchart illustrating a training model for recommending entertainment items is provided in an embodiment of the present invention.
[0063] Figure 4 A flowchart illustrating the representation correlation between the representation vector of an entertainment sample and the representation vector of a second user, provided as an embodiment of the present invention;
[0064] Figure 5 A flowchart for obtaining the temporal correlation between the time vector of an entertainment sample and the time vector of a second user, provided as an embodiment of the present invention;
[0065] Figure 6 A flowchart illustrating an update of the representation vector of an entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user, provided for embodiments of the present invention;
[0066] Figure 7 A block diagram of a recommended device provided in an embodiment of the present invention;
[0067] Figure 8 A block diagram of an electronic device is provided as an embodiment of the present invention; Detailed Implementation
[0068] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0069] As used in this invention, the term "and / or" includes any and all combinations of one or more of the associated enumerated entries.
[0070] The terminology used in this invention is for describing particular embodiments only and is not intended to limit the invention. As used herein, the singular forms "a" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise.
[0071] When the terms “comprising” and / or “made of” are used in this invention, the presence of the said feature, integral, step, operation, element and / or component is specified, but the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or groups thereof is not excluded.
[0072] Unless otherwise specified, all terms used in this invention (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in common dictionaries should be interpreted as having the meaning consistent with their meaning in the context of the relevant art and the invention, and will not be interpreted as having an idealized or overly formal meaning unless expressly so defined by the invention.
[0073] In a first aspect, embodiments of the present invention provide a recommended method. Figure 1 A flowchart of a recommended method provided in an embodiment of the present invention is shown below. Figure 1 This invention provides a recommended method, including steps S101-S103:
[0074] Step S101: Obtain historical data of the first user's use of one or more entertainment projects; the historical data includes the time information of the entertainment projects.
[0075] In some embodiments, the first user is a user whose potential interest in entertainment activities needs to be predicted. These entertainment activities include, but are not limited to, games, chat, and movies. Historical data on the first user's use of one or more entertainment activities includes the activity's ID and time information, including the start time and duration of the first user's use of each activity.
[0076] Step S102: Input historical data into the entertainment project recommendation model.
[0077] In some embodiments, the entertainment item recommendation model is based on the entertainment item number i k The first user's start time for using the entertainment program is t. k The corresponding usage time s of the first user's entertainment project k To obtain the historical usage data of the k-th entertainment item, use a triple (i... k , t k s k The expression represents the sequence of triples {(i1, t1, s1), (i2, t2, s2), ..., (i...}. n , t n s n )}, where k is a positive integer less than or equal to n, and n represents the total number of entertainment items used by the user.
[0078] In some embodiments, after obtaining the historical usage data triple sequence, the method further includes: if the corresponding usage time of the first user's entertainment item is less than a preset entertainment usage time, setting the label of the entertainment item as a negative example; if the corresponding usage time of the first user's entertainment item is greater than or equal to the preset entertainment usage time, setting the label of the entertainment item as a positive example. The preset entertainment usage time is used to divide the entertainment items used by the first user into entertainment items with positive labels and entertainment items with negative labels. The preset entertainment usage time can be set according to experience and different usage scenarios. For example, if the preset entertainment usage time is 1 hour, entertainment items with usage time less than 1 hour are labeled as negative examples, and entertainment items with usage time greater than or equal to 1 hour are labeled as positive examples. Here, entertainment items with positive labels indicate that the first user has a greater interest in the entertainment item, and entertainment items with negative labels indicate that the first user has a lesser interest in the entertainment item.
[0079] In some embodiments, the entertainment recommendation model further includes a neural network for learning latent relevance metrics, which comprises an embedding layer, a memory layer, and a relation layer. The entertainment recommendation model can obtain latent relationships between different vectors.
[0080] Step S103: The entertainment recommendation model outputs the entertainment recommendation information for the first user, which includes entertainment items and a recommendation score for each entertainment item.
[0081] In some embodiments, entertainment items are recommended to a first user based on entertainment recommendation information. Each entertainment item has a corresponding recommendation rating, and the ratings are sorted from low to high, with lower-rated items receiving higher priority for recommendation.
[0082] Figure 2 This is a flowchart illustrating how to obtain a recommended rating for each entertainment item, as provided in an embodiment of the present invention. (Reference) Figure 2 In some embodiments, the time information of entertainment items includes the usage duration of each entertainment item. Before the entertainment item recommendation model outputs the entertainment recommendation information for the first user, steps S201-S205 are also included:
[0083] Step S201: Based on historical data, obtain the usage duration of each entertainment item, the representation vector of each entertainment item, and the time vector of each entertainment item.
[0084] In some embodiments, the historical data of a first user's use of one or more entertainment items includes the corresponding usage time of the first user for each entertainment item.
[0085] In some embodiments, after obtaining the triplet sequence based on historical data, the representation vector and time vector of each entertainment item are obtained through random initialization based on the triplet sequence. Specifically, two sets of initial values are randomly set: one set of initial values for the representation vector of each entertainment item and the other set of initial values for the time vector of each entertainment item. The representation vector of an entertainment item reflects the degree of interest or willingness of the first user to use or play that entertainment item. The time vector of an entertainment item reflects the active period of the first user's use or play of that entertainment item. The active period includes the start time and duration of the first user's use of the entertainment item.
[0086] Step S202: Determine the weight of each entertainment item based on the ratio of the usage time of each entertainment item to the total usage time of all entertainment items.
[0087] In some embodiments, for each entertainment item, the proportion of the usage time of that entertainment item to the total usage time of all entertainment items is used as the weight of each entertainment item.
[0088] Step S203: Obtain the representation vector of the first user based on the representation vector of each entertainment item and the weight of each entertainment item.
[0089] In some embodiments, the representation vector of the first user is a weighted average of the representation vectors of each entertainment item. The representation vector of the first user is used to reflect the average level of interest or willingness of the first user towards all entertainment items they have used.
[0090] In some embodiments, the representation vector of the first user can be obtained by formula (1):
[0091]
[0092] Where U_e represents the user's representation vector, W k i_e represents the weight of the k-th entertainment item. k This represents the vector for the k-th entertainment item, where k is a positive integer less than or equal to n, and n represents the total number of entertainment items used by the user (n in total).
[0093] Step S204: Obtain the time vector of the first user based on the time vector of each entertainment item and the weight of each entertainment item.
[0094] In some embodiments, the first user's time vector is a weighted average of the time vectors for each entertainment activity. The first user's time vector is used to reflect the first user's average active period across all entertainment activities they have used. The average active period includes the first user's average start time and average usage duration across all entertainment activities.
[0095] In some embodiments, the time vector of the first user can be obtained by formula (2):
[0096]
[0097] Where U_t represents the user's time vector, W k Let i_t represent the weight of the k-th entertainment item. k This represents the time vector of the k-th entertainment activity, where k is a positive integer less than or equal to n, and n represents the total number of entertainment activities used by the user (n in total).
[0098] In some embodiments, before obtaining a recommendation rating for each entertainment item using a rating prediction function based on the representation vector of each entertainment item, the time vector of each entertainment item, the representation vector of the first user, and the time vector of the first user, the method further includes:
[0099] Adjust the rating prediction function.
[0100] In some embodiments, after the entertainment recommendation model outputs the entertainment recommendation information for the first user, the method further includes:
[0101] Recommendations are made to the first user based on entertainment items and the time vector of each entertainment item.
[0102] In some embodiments, the time vector of an entertainment item reflects the start time and duration of the first user's use of the entertainment item. Based on the start time and duration of the first user's use of the entertainment item, the entertainment item can be recommended to the first user at the right time, thereby achieving a good recommendation effect.
[0103] Figure 3 This is a flowchart illustrating a training model for recommending entertainment items, provided as an embodiment of the present invention. (Reference) Figure 3 In some embodiments, the entertainment item recommendation model is trained through the following steps S301-S307:
[0104] Step S301: Based on the training samples, obtain the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user; wherein, the training samples include historical data of the second user using one or more entertainment samples.
[0105] In some embodiments, training samples are training data used to train an entertainment item recommendation model. The training samples include historical data of a second user using one or more entertainment items. The second user is a user in the training samples, and the entertainment item is one or more entertainment items in the training data. The representation vector of an entertainment item reflects the degree of interest or willingness of the second user to use or play that entertainment item in the training samples. The time vector of an entertainment item reflects the active period of the second user's use or play of that entertainment item. The active period includes the start time and duration of the second user's use of the entertainment item.
[0106] In some embodiments, after obtaining the training samples, the method further includes: obtaining a triplet sequence of the second user's use of each entertainment sample based on the training samples. The triplet sequence of the second user's use of each entertainment sample includes the number of each entertainment sample, the start time of the second user's use of each entertainment sample, and the duration of the second user's use of each entertainment sample.
[0107] In some embodiments, after obtaining the triplet sequence of the second user's use of each entertainment sample based on the training samples, the method further includes:
[0108] If the duration of a second user's use of an entertainment sample is less than the preset duration, the entertainment sample is labeled as a negative example; if the duration of a second user's use of an entertainment sample is greater than or equal to the preset duration, the entertainment sample is labeled as a positive example.
[0109] Step S302: Input the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user into the entertainment item recommendation model to be trained.
[0110] In some embodiments, the entertainment recommendation model can be a neural network for learning latent relevance metrics, which includes an embedding layer, a memory layer, and a relation layer. The representation vectors of the entertainment samples and the second user are input into the first embedding layer, and the time vectors of the entertainment samples and the second user are input into the second embedding layer. The first and second embedding layers have the same structure, both being commonly used embedding layers in neural networks. Both the first and second embedding layers are used to construct a joint vector of different vectors.
[0111] Step S303: Based on the representation vector of the entertainment sample and the representation vector of the second user, obtain the representation correlation between the representation vector of the entertainment sample and the representation vector of the second user.
[0112] In some embodiments, the representation correlation between the representation vector of the entertainment sample and the representation vector of the second user is a relation vector used to represent the potential relationship between the representation vector of the entertainment sample and the representation vector of the second user.
[0113] Figure 4 This is a flowchart illustrating the representation correlation between the representation vector of an entertainment sample and the representation vector of a second user, provided as an embodiment of the present invention. (See reference...) Figure 4 In some embodiments, based on the representation vector of the entertainment sample and the representation vector of the second user, the representation correlation between the representation vector of the entertainment sample and the representation vector of the second user is obtained, including steps S401-S405:
[0114] Step S401: Obtain the joint vector of representation vectors based on the representation vector of the second user and the representation vector of the entertainment sample.
[0115] In some embodiments, the joint vector of representation vectors is a vector generated by crossing the representation vector of the second user and the representation vector of the entertainment sample through a first embedding layer.
[0116] In some embodiments, obtaining the joint vector of representation vectors based on the representation vector of the second user and the representation vector of the entertainment sample includes: performing a Hadamard matrix multiplication operation on the representation vector of the second user and the representation vector of the entertainment sample to obtain the joint vector of representation vectors. The joint vector of representation vectors can be obtained using formula (3):
[0117] j_e=U_e⊙i_e (3)
[0118] Where j_e is the joint vector of representation vectors, U_e is the representation vector of the second user, i_e is the representation vector of entertainment samples with positive labels, and ⊙ is the operator for Hadamard matrix multiplication.
[0119] Step S402: Obtain the latent representation vector based on the joint vector of the second user's active period and representation vector.
[0120] In some embodiments, the activity period of a second user is the period during which the second user frequently uses one or more entertainment samples. The latent vector represents the potential relationship between the representation vector of the second user and the representation vector of an entertainment sample labeled as a positive example. Multiple latent vectors are defined based on the second user's activity period. For example, if the second user's activity period is 24 hours, 24 latent vectors are defined, that is, 24 different potential relationships are defined between the representation vector of the second user and the representation vector of an entertainment sample labeled as a positive example.
[0121] In some embodiments, a memory layer can be introduced, through which multiple memory vectors define multiple different representation latent vectors.
[0122] Step S403: Obtain the weights representing the hidden states based on the joint vector of the latent vector and the representation vector.
[0123] In some embodiments, obtaining the weights of the hidden states based on the latent vectors and their joint vector includes: transposing the joint vector of the representation vectors and performing a dot product with the latent vectors to obtain multiple weights for the hidden states. The weights of the hidden states are the similarity between the latent vectors and their joint vector. The hidden states refer to the possible states existing in the hidden layer of the entertainment item recommendation model.
[0124] In some embodiments, the weights representing the hidden states can be obtained using formula (4):
[0125] a_e i =j_e T ·key_e i (4)
[0126] Among them, a_e i Let j_e be the weight representing the i-th hidden state, j_e be the joint vector representing the vectors, T denote the transpose, and key_e be the weight. i Let p be the i-th implicit vector, where i is a positive integer less than or equal to p, and p represents the total number of implicit vectors, where p is a positive integer.
[0127] Step S404: Normalize the weights representing the hidden states.
[0128] In some embodiments, the weights representing hidden states can be normalized using formula (5):
[0129]
[0130] Where softmax is the normalized exponential function, softmax(a_e) i Let ) be the weight a_e of the i-th hidden state. i The result after normalization is p, which represents a total of p latent vectors, where i is a positive integer.
[0131] Step S405: Based on the weights and representations of the hidden states after normalization, obtain the representation correlation between the representation vector of the entertainment sample and the representation vector of the second user.
[0132] In some embodiments, the representation correlation between the representation vector of the entertainment sample and the representation vector of the second user can be obtained through formula (6):
[0133]
[0134] Where, r e Let a_e be the representation correlation between the representation vector of the entertainment sample and the representation vector of the second user. i For the weight representing the i-th hidden state after normalization, m_e i Let i represent the i-th hidden state, and p represent the total number of p hidden vectors and p hidden states, where i is a positive integer.
[0135] Step S304: Based on the time vector of the entertainment sample and the time vector of the second user, obtain the time correlation between the time vector of the entertainment sample and the time vector of the second user.
[0136] In some embodiments, the temporal correlation between the time vector of the entertainment sample and the time vector of the second user is a relation vector used to represent the potential relationship between the time vector of the entertainment item and the time vector of the user.
[0137] Figure 5 This is a flowchart illustrating the process of obtaining the temporal correlation between the time vector of an entertainment sample and the time vector of a second user, as provided in an embodiment of the present invention. (Reference) Figure 5 In some embodiments, the temporal correlation between the time vector of the entertainment sample and the time vector of the second user is obtained based on the time vector of the entertainment sample and the time vector of the second user, including steps S501-S505:
[0138] Step S501: Obtain the joint vector of time vectors based on the time vector of the second user and the time vector of the entertainment sample.
[0139] In some embodiments, the joint vector of time vectors is a vector generated by crossing the time vector of the second user and the time vector of the entertainment sample through a second embedding layer.
[0140] In one embodiment, obtaining a joint vector of time vectors based on the time vector of the second user and the time vector of the entertainment sample includes: performing Hadamard matrix multiplication on the time vector of the second user and the time vector of the entertainment sample to obtain the joint vector of time vectors.
[0141] The joint vector representing the vectors can be obtained using formula (7):
[0142] j_t=U_t⊙i_t (7)
[0143] Where j_t is the joint vector of time vectors, U_t represents the user's time vector, i_t is the time vector of entertainment samples labeled as positive, and ⊙ represents the Hadamard matrix multiplication operator.
[0144] Step S502: Obtain the time latent vector based on the joint vector of the second user's active cycle and time vector.
[0145] In some embodiments, the temporal latent vector is a potential relationship between the time vector of the second user and the time vector of the entertainment sample labeled as a positive example. Multiple temporal latent vectors are defined based on the activity cycle of the second user. Here, indicates that the number of latent vectors is the same as the number of temporal latent vectors.
[0146] In some embodiments, a memory layer can be introduced, through which multiple different temporal latent vectors can be defined using multiple memory vectors in the memory layer.
[0147] Step S503: Obtain the weights of the temporal hidden states based on the joint vector of the temporal hidden vector and the temporal vector.
[0148] In some embodiments, obtaining the weights of temporal hidden states based on the temporal hidden vector and the joint vector of the temporal vectors includes: transposing the joint vector of the temporal vectors and performing a dot product operation with the temporal hidden vectors to obtain the weights of multiple temporal hidden states. The weight of a temporal hidden state is the similarity between the temporal hidden vector and the joint vector of the temporal vectors. A temporal hidden state refers to each possible state that exists in the hidden layer of an entertainment item recommendation model.
[0149] In some embodiments, the weights of the temporal hidden states can be obtained using formula (8):
[0150] a_t i =j_t T ·key_t i (8)
[0151] Among them, a_t i Let j_t be the weight of the i-th time hidden state, j_t be the joint vector of the time vectors, T denote the transpose, and key_t be the weight of the i-th time hidden state. i Let be the i-th temporal hidden vector, where i is a positive integer less than or equal to p, and p represents the total number of temporal hidden vectors, where p is a positive integer. The number of temporal hidden states is the same as the number of hidden states represented.
[0152] Step S504: Normalize the weights of the time hidden states.
[0153] In some embodiments, the weights of the time-hidden states can be normalized using formula (9):
[0154]
[0155] Where softmax is the normalized exponential function, softmax(a_t) i Let ) be the weight a_t of the i-th time hidden state. iThe result after normalization is p, which represents a total of p latent vectors, where i is a positive integer.
[0156] Step S505: Based on the weights and time hidden states of the normalized time hidden states, obtain the time correlation between the time vector of the entertainment sample and the time vector of the second user.
[0157] In some embodiments, the temporal correlation between the time vector of the entertainment sample and the time vector of the second user can be obtained by formula (10):
[0158]
[0159] Where, r t Let a_t be the temporal correlation between the time vector of the entertainment sample and the time vector of the second user. i The weight of the i-th time hidden state after normalization, m_t i Let p be the i-th time hidden state, where p represents the total number of time hidden vectors and p time hidden states, and i is a positive integer.
[0160] Step S305: Obtain the representation vector score based on the representation vector of the entertainment sample, the representation vector of the second user, and the representation relevance.
[0161] In some embodiments, the representation vector score is used to represent the degree of interest or willingness of a second user to use a certain entertainment sample, and the representation vector score can be obtained by formula (11):
[0162] score e (U_e, i_e) = ||U_e + r e +i_e|| 2 (11)
[0163] Among them, score e (U_e, i_e) represents the representation vector score of the entertainment sample labeled as a positive example, U_e is the representation vector of the second user, i_e is the representation vector of the entertainment sample labeled as a positive example, and r e Let ||U_e+r| represent the representation correlation between the representation vector of the entertainment sample and the representation vector of the second user. e +i_e|| 2 For U_e+r e L2 normal form of +i_e.
[0164] Step S306: Obtain the time vector score based on the time vector of the entertainment sample, the time vector of the second user, and the time relevance.
[0165] In some embodiments, the time vector score is used to represent the active period of a second user using a certain entertainment sample, and the time vector score can be obtained by formula (12):
[0166] score t (U_t, i_t) = ||U_t + r t +i_t|| 2 (12)
[0167] Among them, score t (U_t, i_t) represents the time vector score of the entertainment sample labeled as a positive example, U_t represents the time vector of the second user, i_t represents the time vector of the entertainment sample labeled as a positive example, and r t The temporal correlation between the time vector of the entertainment sample and the time vector of the second user. For U_t+r t L2 normal form of vector +i_t.
[0168] Step S307: Update the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user based on the representation vector score, the time vector score, the preset representation parameters, the preset time parameters, and the preset loss function, and adjust the parameters of the entertainment item recommendation model to be trained.
[0169] In some embodiments, the loss function is set using formulas (11)-(17):
[0170] L=αL e +βL t (13)
[0171] L e =max(0, score) e (U_e,i_e)+λ e +score e (U_e,i_e q (14)
[0172] L t =max(0, score) t (U_t, i_t)+λ t +score t (U_t,i_t q (15)
[0173] scoree(U_e,i_eq)=||U_e+re+i_eq|| 2 (16)
[0174] scoret(U_t,i_tq)=||U_t+rt+i_tq|| 2 (17)
[0175] In this context, the preset loss function uses α and β, which are the same as the user's scores for each entertainment item. These are hyperparameters, and α + β = 1. L is the preset loss function. e Let represent the loss function for a vector, max be the maximum value function, and score be the maximum value function. e (U_e, i_e) is the representation vector score of the entertainment sample with the label "positive example", U_e is the representation vector of the second user, and r e Let i_e be the representation vector of the entertainment sample and the representation vector of the second user, where i_e is the representation vector of the entertainment sample with a positive label. q Let λ be the representation vector of the entertainment sample with negative labels. e λ is a preset representation parameter. e Set as the maximum boundary between U_e and i_e, score e (U_e,i_e q L is the representation vector score of entertainment samples with negative labels. t The loss function for the time vector, score t (U_t, i_t) represents the time vector score of an entertainment sample labeled as a positive example. t (U_t,i_t q ) represents the time vector score of the entertainment sample with negative labels, U_t represents the time vector of the second user, and r t Let i_t be the time correlation between the time vector of the entertainment sample and the time vector of the second user, and let i_t be the time vector of the entertainment sample with a positive label. q Let λ be the time vector of the entertainment sample with negative label. t λ is a preset time parameter. t Set as the maximum boundary between U_t and i_t.
[0176] Figure 6 This is a flowchart illustrating an update of the representation vector of an entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user, provided as an embodiment of the present invention. (See reference...) Figure 6 In some embodiments, updating the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user based on the representation vector score, the time vector score, preset representation parameters, preset time parameters, and preset loss function includes steps S601-S602:
[0177] Step S601: Based on the preset loss function, update the representation vector and time vector of the entertainment sample using the gradient descent method.
[0178] In some embodiments, based on a preset loss function, the partial derivatives of the representation vector and time vector of the entertainment sample are obtained using gradient descent, and the representation vector and time vector of the entertainment sample are adjusted until the preset loss function converges, thereby obtaining the updated representation vector and time vector of the entertainment sample.
[0179] Step S602: Based on the updated representation vector and time vector of the entertainment sample, update the representation vector of the second user and the time vector of the second user.
[0180] In some embodiments, the representation vector of the second user is updated based on the updated representation vector of the entertainment sample and the weight of each entertainment sample, and the time vector of the second user is updated based on the updated time vector of the entertainment sample and the weight of each entertainment sample.
[0181] Step S308: Determine whether the training termination condition is met.
[0182] In some embodiments, the training termination condition includes, but is not limited to, reaching a preset number of training iterations. For example, training is stopped after training the entertainment item recommendation model 100 times.
[0183] In some embodiments, if the training termination condition is not met, the process returns to step S302.
[0184] In some embodiments, if the training termination condition is met, training is stopped and step S309 is executed.
[0185] Step S309: Use the entertainment item recommendation model to be trained in the last round as the trained entertainment item recommendation model.
[0186] In some embodiments, a trained entertainment recommendation model is used to recommend relevant entertainment items to the user.
[0187] Step S205: Based on the representation vector of each entertainment item, the time vector of each entertainment item, the representation vector of the first user, and the time vector of the first user, obtain the recommended rating for each entertainment item using the rating prediction function.
[0188] In some embodiments, the rating prediction function can be formula (18):
[0189] score = α·score e (U e i e )+β·score t (Ut i t (18)
[0190] Where α+β=1, α and β are both hyperparameters of the rating prediction function, and α and β in formula (13) are the same as in formula (18), scor is the recommended score of the entertainment item, score e (U e i e U represents the vector score. e Let i be the representation vector of the first user. e The score is the representation vector of entertainment items with positive labels. t (U t i t ) represents the time vector score, U t Let i be the time vector of the first user. t Let U be the time vector of the entertainment project with a positive label. Here, the representation vector U of the first user is obtained. e Similar to the method described above for obtaining the representation vector U_e of the second user, the representation vector i of the entertainment item with the label "positive example" is obtained. e Similar to the method described above for obtaining the representation vector i_e of entertainment samples labeled as positive, the time vector U of the first user is obtained. t Similar to the method described above for obtaining the time vector U_t of the second user, the time vector i of the entertainment items labeled as positive examples is obtained. t The method used is the same as described above for obtaining the time vector of entertainment samples labeled as positive examples, i_t.
[0191] In some embodiments, the magnitudes of α and β in the rating prediction function can be adjusted to regulate the different weights of users' interest in entertainment items and the active cycle of users using entertainment items, thereby achieving the purpose of adjusting the entertainment recommendation model and realizing an adjustable entertainment recommendation method.
[0192] This invention provides a recommendation method that obtains historical data of a first user's use of one or more entertainment items, inputs the historical data into an entertainment item recommendation model, captures the potential relationship between the first user and the entertainment items through the entertainment item recommendation model, and outputs entertainment recommendation information for the first user, including entertainment items and a recommendation score for each entertainment item. Based on the recommendation score of each entertainment item in the entertainment recommendation information, the corresponding entertainment items are accurately recommended to the user, thereby achieving a good recommendation effect.
[0193] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this patent.
[0194] Secondly, embodiments of the present invention provide a recommended device. Figure 7 A block diagram of a recommended apparatus provided in an embodiment of the present invention. (See reference) Figure 7 This invention provides a recommendation device 700, comprising:
[0195] The first acquisition module 701 is used to acquire historical data of the first user's use of one or more entertainment projects; the historical data includes the time information of the entertainment projects.
[0196] The first input module 702 is used to input historical data into the entertainment project recommendation model.
[0197] The first recommendation module 703 is used to output entertainment recommendation information for the first user from the entertainment project recommendation model. The entertainment recommendation information includes entertainment projects and recommendation scores for each entertainment project.
[0198] In some embodiments, the time information of entertainment items includes the usage duration of each entertainment item. Before the first recommendation module 703 outputs the entertainment recommendation information for the first user using the entertainment item recommendation model, it is further configured to:
[0199] Based on historical data, obtain the usage duration, representation vector, and time vector of each entertainment item;
[0200] The weight of each entertainment activity is determined based on the ratio of the usage time of each entertainment activity to the total usage time of all entertainment activities;
[0201] The representation vector of the first user is obtained based on the representation vector of each entertainment item and the weight of each entertainment item;
[0202] The time vector of the first user is obtained based on the time vector of each entertainment item and the weight of each entertainment item;
[0203] Based on the representation vector of each entertainment item, the time vector of each entertainment item, the representation vector of the first user, and the time vector of the first user, a recommendation rating for each entertainment item is obtained using a rating prediction function.
[0204] In some embodiments, after the first recommendation module 703 outputs the entertainment recommendation information for the first user using the entertainment project recommendation model, it is further configured to:
[0205] Recommendations are made to the first user based on entertainment items and the time vector of each entertainment item.
[0206] In some embodiments, the recommendation device 700 further includes a model training module for: obtaining, based on training samples, a representation vector of an entertainment sample, a time vector of an entertainment sample, a representation vector of a second user, and a time vector of a second user; wherein the training samples include historical data of the second user using one or more entertainment samples;
[0207] Input the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user into the entertainment item recommendation model to be trained;
[0208] Based on the representation vector of the entertainment sample and the representation vector of the second user, the representation correlation between the representation vector of the entertainment sample and the representation vector of the second user is obtained;
[0209] Based on the time vector of the entertainment sample and the time vector of the second user, the temporal correlation between the time vector of the entertainment sample and the time vector of the second user is obtained.
[0210] The representation vector score is obtained based on the representation vector of the entertainment sample, the representation vector of the second user, and the representation relevance.
[0211] Time vector scores are obtained based on the time vectors of entertainment samples, the time vectors of the second user, and time relevance.
[0212] The representation vector, time vector, second user's representation vector, and second user's time vector are updated based on the representation vector score, time vector score, preset representation parameters, preset time parameters, and preset loss function, and the parameters of the entertainment item recommendation model to be trained are adjusted.
[0213] Determine whether the training termination condition is met;
[0214] If the training termination condition is not met, return to the previous step and input the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user into the entertainment item recommendation model to be trained.
[0215] If the training termination condition is met, the entertainment item recommendation model in the last round of training will be used as the trained entertainment item recommendation model.
[0216] In some embodiments, when the model training module updates the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user based on the representation vector score, the time vector score, preset representation parameters, preset time parameters, and a preset loss function, it is specifically used for:
[0217] Based on the preset loss function, the representation vector and time vector of the entertainment sample are updated using the gradient descent method.
[0218] Based on the updated representation vector and time vector of the entertainment sample, update the representation vector of the second user and the time vector of the second user.
[0219] In some embodiments, when the model training module obtains the representation correlation between the representation vectors of entertainment samples and the representation vectors of the second user based on the representation vectors of the entertainment samples and the second user, it specifically performs the following:
[0220] The joint vector of representation vectors is obtained based on the representation vector of the second user and the representation vector of the entertainment sample;
[0221] The latent representation vector is obtained based on the joint vector of the second user's active period and representation vector;
[0222] The weights representing the hidden state are obtained from the joint vector of the latent vector and the representation vector.
[0223] The weights representing hidden states are normalized.
[0224] Based on the weights and representations of the hidden states after normalization, the representation correlation between the representation vectors of entertainment samples and the representation vectors of the second user is obtained.
[0225] In some embodiments, when the model training module is used to obtain the temporal correlation between the time vectors of entertainment samples and the time vectors of second users based on the time vectors of entertainment samples and the time vectors of second users, it is specifically used for:
[0226] The joint vector of time vectors is obtained based on the time vector of the second user and the time vector of the entertainment sample;
[0227] The latent time vector is obtained from the joint vector of the second user's active cycle and time vector;
[0228] The weights of the temporal hidden states are obtained based on the temporal hidden vector and the joint vector of the temporal vectors.
[0229] The weights of the temporal hidden states are normalized.
[0230] Based on the weights and time hidden states of the normalized time hidden states, the temporal correlation between the time vector of the entertainment sample and the time vector of the second user is obtained.
[0231] In some embodiments, before the first recommendation module 703 obtains a recommendation rating for each entertainment item using a rating prediction function based on the representation vector of each entertainment item, the time vector of each entertainment item, the representation vector of the first user, and the time vector of the first user, it is further configured to:
[0232] Adjust the rating prediction function.
[0233] This invention provides a recommendation device. A first acquisition module acquires historical data of a first user's use of one or more entertainment items. A first input module inputs the historical data into an entertainment item recommendation model. The entertainment item recommendation model can capture the potential relationship between the first user and the entertainment items. The first recommendation module outputs entertainment recommendation information for the first user through the entertainment item recommendation model. The entertainment recommendation information includes entertainment items and a recommendation score for each entertainment item. Based on the recommendation score of each entertainment item in the entertainment recommendation information, the corresponding entertainment items are accurately recommended to the user, thereby achieving a good recommendation effect.
[0234] The apparatus provided in the embodiments of the present invention has functions or includes modules that can be used to perform the methods described in the first aspect of the method embodiments above. The specific implementation and technical effects can be referred to the description of the method embodiments above. For the sake of brevity, they will not be repeated here.
[0235] It should be noted that all modules involved in this embodiment are logical modules. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. Furthermore, to highlight the innovative aspects of this invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by this invention; however, this does not mean that other units are absent from this embodiment.
[0236] Reference Figure 8 This invention provides an electronic device comprising:
[0237] One or more processors 801;
[0238] Memory 802, on which one or more programs are stored, such that when one or more programs are executed by one or more processors, the one or more processors implement the recommended method of any of the above.
[0239] One or more I / O interfaces 803 are connected between the processor and memory and configured to enable information exchange between the processor and memory.
[0240] Among them, processor 801 is a device with data processing capabilities, including but not limited to central processing unit (CPU); memory 802 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); I / O interface (read-write interface) 803 is connected between processor 801 and memory 902, and can realize information interaction between processor 801 and memory 802, including but not limited to data bus (Bus).
[0241] In some embodiments, the processor 801, memory 802, and I / O interface 803 are interconnected via a bus, and thus connected to other components of the computing device.
[0242] This embodiment also provides a computer-readable medium having a computer program stored thereon. When the program is executed by a processor, it implements the recommended method provided in this embodiment. To avoid repetition, the specific steps of the recommended method will not be repeated here.
[0243] Those skilled in the art will understand that all or some of the steps, systems, or apparatuses in the methods, systems, and apparatuses described above can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0244] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0245] Those skilled in the art will understand that although some embodiments described herein include certain features that are included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of this embodiment and form different embodiments.
[0246] It is understood that the above embodiments are merely exemplary implementations used to illustrate the principles of the present invention, and the present invention is not limited thereto. For those skilled in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.
Claims
1. A recommendation method, characterized in that, include: Obtain historical data of a first user's use of one or more entertainment programs; the historical data includes time information of the entertainment programs. Input the historical data into the entertainment project recommendation model; The entertainment recommendation model outputs entertainment recommendation information for the first user, which includes entertainment items and a recommendation score for each entertainment item. The entertainment item recommendation model is trained through the following steps: Based on the training samples, the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user are obtained; wherein, the training samples include historical data of the second user using one or more entertainment samples; The representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user are input into the entertainment item recommendation model to be trained. A joint vector of representation vectors is obtained based on the representation vector of the second user and the representation vector of the entertainment sample; The latent representation vector is obtained based on the joint vector of the second user's activity cycle and the representation vector; The weights representing the hidden states are obtained based on the hidden vector and the joint vector of the hidden vectors. The weights representing the hidden states are normalized. Based on the weights of the represented hidden state after normalization and the represented hidden state, the representation correlation between the representation vector of the entertainment sample and the representation vector of the second user is obtained; A joint vector of time vectors is obtained based on the time vector of the second user and the time vector of the entertainment sample; The latent time vector is obtained based on the joint vector of the second user's active period and the time vector; The weights of the temporal hidden states are obtained based on the temporal hidden vector and the joint vector of the temporal vectors. The weights of the time-hidden states are normalized. Based on the weights of the time hidden states after normalization and the time hidden states, the temporal correlation between the time vector of the entertainment sample and the time vector of the second user is obtained. A representation vector score is obtained based on the representation vector of the entertainment sample, the representation vector of the second user, and the representation relevance. A time vector score is obtained based on the time vector of the entertainment sample, the time vector of the second user, and the time relevance. The representation vector score, the time vector score, the preset representation parameters, the preset time parameters, and the preset loss function are used to update the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user, and the parameters of the entertainment item recommendation model to be trained are adjusted. Determine whether the training termination condition is met; If the training termination condition is not met, return to the step of inputting the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user into the entertainment item recommendation model to be trained; If the training termination condition is met, the entertainment item recommendation model in the last round of training will be used as the trained entertainment item recommendation model.
2. The method according to claim 1, characterized in that, The time information of the entertainment items includes the usage duration of each entertainment item. Before the entertainment item recommendation model outputs the entertainment recommendation information for the first user, it also includes: Based on the historical data, the usage duration of each entertainment item, the representation vector of each entertainment item, and the time vector of each entertainment item are obtained. The weight of each entertainment activity is determined based on the ratio of the usage time of each entertainment activity to the total usage time of all entertainment activities. The representation vector of the first user is obtained based on the representation vector of each entertainment item and the weight of each entertainment item; The time vector of the first user is obtained based on the time vector of each entertainment item and the weight of each entertainment item; Based on the representation vector of each entertainment item, the time vector of each entertainment item, the representation vector of the first user, and the time vector of the first user, a recommendation rating for each entertainment item is obtained using a rating prediction function.
3. The method according to claim 2, characterized in that, After the entertainment recommendation model outputs the entertainment recommendation information for the first user, it further includes: Recommendations are made to the first user based on the entertainment items and the time vector of each entertainment item.
4. The method according to claim 1, characterized in that, The step of updating the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user based on the representation vector score, the time vector score, preset representation parameters, preset time parameters, and a preset loss function includes: Based on the preset loss function, the representation vector and time vector of the entertainment sample are updated using the gradient descent method. Based on the updated representation vector and time vector of the entertainment sample, update the representation vector and time vector of the second user.
5. The method according to claim 2, characterized in that, Before obtaining the recommended rating for each entertainment item using a rating prediction function based on the representation vector of each entertainment item, the time vector of each entertainment item, the representation vector of the first user, and the time vector of the first user, the method further includes: Adjust the scoring prediction function.
6. A recommendation device, characterized in that, include: The first acquisition module is used to acquire historical data of a first user's use of one or more entertainment projects; the historical data includes time information of the entertainment projects. The first input module is used to input the historical data into the entertainment project recommendation model; The first recommendation module is used to output the entertainment recommendation information of the first user from the entertainment project recommendation model. The entertainment recommendation information includes entertainment projects and a recommendation score for each entertainment project. The entertainment item recommendation model is trained through the following steps: Based on the training samples, the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user are obtained; wherein, the training samples include historical data of the second user using one or more entertainment samples; The representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user are input into the entertainment item recommendation model to be trained. A joint vector of representation vectors is obtained based on the representation vector of the second user and the representation vector of the entertainment sample; The latent representation vector is obtained based on the joint vector of the second user's activity cycle and the representation vector; The weights representing the hidden states are obtained based on the hidden vector and the joint vector of the hidden vectors. The weights representing the hidden states are normalized. Based on the weights of the represented hidden state after normalization and the represented hidden state, the representation correlation between the representation vector of the entertainment sample and the representation vector of the second user is obtained; A joint vector of time vectors is obtained based on the time vector of the second user and the time vector of the entertainment sample; The latent time vector is obtained based on the joint vector of the second user's active period and the time vector; The weights of the temporal hidden states are obtained based on the temporal hidden vector and the joint vector of the temporal vectors. The weights of the time-hidden states are normalized. Based on the weights of the time hidden states after normalization and the time hidden states, the temporal correlation between the time vector of the entertainment sample and the time vector of the second user is obtained. A representation vector score is obtained based on the representation vector of the entertainment sample, the representation vector of the second user, and the representation relevance. A time vector score is obtained based on the time vector of the entertainment sample, the time vector of the second user, and the time relevance. The representation vector score, the time vector score, the preset representation parameters, the preset time parameters, and the preset loss function are used to update the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user, and the parameters of the entertainment item recommendation model to be trained are adjusted. Determine whether the training termination condition is met; If the training termination condition is not met, return to the step of inputting the representation vector of the entertainment sample, the time vector of the entertainment sample, the representation vector of the second user, and the time vector of the second user into the entertainment item recommendation model to be trained; If the training termination condition is met, the entertainment item recommendation model in the last round of training will be used as the trained entertainment item recommendation model.
7. An electronic device, characterized in that, include: One or more processors; A memory having stored one or more programs thereon, which, when executed by one or more processors, cause the one or more processors to implement the method according to any one of claims 1-5; One or more I / O interfaces are connected between the processor and the memory and configured to enable information interaction between the processor and the memory.
8. A computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method according to any one of claims 1-5.
Citation Information
Patent Citations
Information recommendation method based on gradient shuffling and related equipment
CN116383504A
Video recommendation method and device and electronic equipment
CN117009575A