A content item recommendation model training method, content item recommendation method and device

By performing unsupervised training and gradient updates on the content item recommendation model, and combining the label information of the sample test data, the model with the minimum training loss is selected, which solves the problem of false negatives and false positives in the existing technology and improves the accuracy and robustness of the model.

CN116361551BActive Publication Date: 2025-12-09TSINGHUA UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310256862.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-08
Publication Date
2025-12-09
Estimated Expiration
2043-03-08

AI Technical Summary

Technical Problem

Existing content item recommendation models are prone to false negatives and false positives during training, leading to inaccurate recommendations. Current technologies struggle to remove noise from both positive and negative samples simultaneously.

Method used

By performing unsupervised training on pre-trained labeled sample data, a backward weighted loss is obtained. The content item recommendation model is updated using forward and backward gradients. Combining the label information of the sample test data, the model with the minimum training loss is selected as the target recommendation model.

Benefits of technology

It improves the accuracy and robustness of the content recommendation model, and can simultaneously reduce false positives and false negatives, thereby improving the accuracy of recommended content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116361551B_ABST
    Figure CN116361551B_ABST
Patent Text Reader

Abstract

The present disclosure provides a content item recommendation model training method, a content item recommendation method and device, and belongs to the technical field of computers. The method comprises: based on sample training data, unsupervised training is performed on a content item recommendation model pre-trained based on labeled sample pre-training data to obtain a reverse weighted loss of the sample training data; based on the forward gradient and the reverse gradient of the reverse weighted loss, the content item recommendation model is updated respectively to obtain a first temporary model and a second temporary model; based on sample test data and label information of the sample test data, the content item recommendation model, the first temporary model and the second temporary model are trained to obtain a target recommendation model. The method can improve the accuracy of the recommended content items of the content item recommendation model and improve the robustness of the content item recommendation model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, in particular, to a content item recommendation model training method, a content item recommendation method and device. BACKGROUND

[0002] With the development of Internet technology, most application programs can recommend various types of content items such as videos, audios, news information, and items to users through a content item recommendation system to meet the different interests of users. The content item recommendation system is implemented based on a content item recommendation model. Since the positive sample content items are incorrectly classified as negative sample content items or the negative sample content items are incorrectly classified as positive sample content items, i.e., false negatives or false positives, in the training process of the content item recommendation model, noise is introduced into the content item recommendation model. Therefore, how to reduce the noise of the content item recommendation model is a technical problem to be solved.

[0003] In related technologies, a difficult sample sampling method is usually used to remove the noise of the content item recommendation model. However, in the content item recommendation system, false negatives and false positives exist simultaneously. The above scheme can only reduce false negatives from the positive sample content item side or reduce false positives from the negative sample content item side, and cannot completely remove the noise of the content item recommendation model, resulting in inaccurate content items recommended by the content item recommendation model. Therefore, a new content item recommendation model training method is needed to train a content item recommendation model that can accurately recommend. SUMMARY

[0004] The present disclosure provides a content item recommendation model training method, a content item recommendation method and device, which can simultaneously denoise from both positive sample content items and negative sample content items, improve the accuracy of the recommended content items of the content item recommendation model, and improve the robustness of the content item recommendation model. The technical solutions of the present disclosure are as follows:

[0005] According to an aspect of an embodiment of the present disclosure, a content item recommendation model training method is provided, comprising:

[0006] Based on sample training data, an unsupervised training is performed on a content item recommendation model pre-trained based on labeled sample pre-training data, to obtain a reverse weighted loss of the sample training data, the sample training data comprising object features of a first sample object and content item features of a first sample content item, the content item recommendation model being used to predict a probability that a content item corresponding to the content item features is recommended to an object corresponding to the object features based on input object features and content item features, and the reverse weighted loss being used to determine predicted label information of the sample training data;

[0007] update the content item recommendation model based on the forward gradient and the backward gradient of the reverse weighted loss respectively to obtain a first temporary model and a second temporary model;

[0008] train the content item recommendation model, the first temporary model and the second temporary model based on sample test data and label information of the sample test data to obtain a target recommendation model, the sample test data including object features of a second sample object and content item features of a second sample content item, the label information of the sample test data being used to indicate whether the second sample content item is a content item of interest to the second sample object, the sample test data and the sample pre-training data being from a same data set, and the target recommendation model being a model with the minimum training loss among the content item recommendation model, the first temporary model and the second temporary model.

[0009] According to another aspect of the embodiments of the present disclosure, a content item recommendation method is provided, including:

[0010] obtaining object features of a target object and content item features of a plurality of target content items;

[0011] for any target content item, determining a recommendation probability of the target content item based on a content item recommendation model, the object features and the content item features of the target content item, the content item recommendation model being trained according to the training method of the content item recommendation model;

[0012] recommending at least one target content item to the target object based on the recommendation probabilities of the plurality of target content items.

[0013] According to another aspect of the embodiments of the present disclosure, a training device of a content item recommendation model is provided, including:

[0014] a first training unit configured to perform unsupervised training on a content item recommendation model pre-trained based on labeled sample pre-training data based on sample training data to obtain a reverse weighted loss of the sample training data, the sample training data including object features of a first sample object and content item features of a first sample content item, the content item recommendation model being used to predict a probability of recommending a content item corresponding to the content item features to an object corresponding to the object features based on input object features and content item features, and the reverse weighted loss being used to determine predicted label information of the sample training data;

[0015] an updating unit configured to update the content item recommendation model based on a forward gradient and a backward gradient of the reverse weighted loss respectively to obtain a first temporary model and a second temporary model;

[0016] a second training unit configured to train the content item recommendation model, the first temporary model, and the second temporary model based on sample test data and label information of the sample test data to obtain a target recommendation model, the sample test data including object features of a second sample object and content item features of a second sample content item, the label information of the sample test data being used to indicate whether the second sample content item is a content item of interest to the second sample object, the sample test data and the sample pre-training data being from a same data set, and the target recommendation model being a model with a minimum training loss among the content item recommendation model, the first temporary model, and the second temporary model.

[0017] In some embodiments, the first training unit includes:

[0018] a first training subunit configured to perform unsupervised training on a content item recommendation model pre-trained based on labeled training data based on the sample training data to obtain a positive sample loss and a negative sample loss of the sample training data.

[0019] a first determination subunit configured to determine a reverse weighted loss of the sample training data based on the positive sample loss and the negative sample loss.

[0020] In some embodiments, the first determination subunit is configured to determine a normalization coefficient of the sample training data based on the positive sample loss and the negative sample loss, determine a weight of the positive sample loss and a weight of the negative sample loss based on the normalization coefficient, the positive sample loss, and the negative sample loss, and perform weighted summation on the positive sample loss and the negative sample loss based on the weight of the positive sample loss and the weight of the negative sample loss to obtain the reverse weighted loss of the sample training data.

[0021] In some embodiments, the update unit includes:

[0022] a first update subunit configured to update model parameters of the content item recommendation model based on a forward gradient of the reverse weighted loss to obtain the first temporary model.

[0023] a second update subunit configured to update the model parameters of the content item recommendation model based on a reverse gradient of the reverse weighted loss to obtain the second temporary model.

[0024] In some embodiments, the second training unit includes:

[0025] a second training subunit configured to train the content item recommendation model, the first temporary model, and the second temporary model based on the sample test data and label information of the sample test data, to obtain a training loss of the content item recommendation model, a training loss of the first temporary model, and a training loss of the second temporary model;

[0026] a second determination subunit configured to determine, as the target recommendation model, a model with the smallest training loss among the content item recommendation model, the first temporary model, and the second temporary model.

[0027] In some embodiments, the apparatus further includes:

[0028] a pre-training unit configured to pre-train the content item recommendation model based on sample pre-training data and label information of the sample pre-training data, the sample pre-training data including object features of a third sample object and content item features of a third sample content item, the label information of the sample pre-training data being used to indicate whether the third sample content item is a content item of interest to the third sample object.

[0029] In some embodiments, the pre-training unit is configured to, based on the content item recommendation model, predict the sample pre-training data to obtain prediction information of the sample pre-training data, the prediction information being used to indicate whether the third sample content item is a content item of interest to the third sample object; based on the label information and the prediction information, determine a pre-training loss of the content item recommendation model; and based on the pre-training loss, update model parameters of the content item recommendation model.

[0030] According to another aspect of embodiments of the present disclosure, a content item recommendation apparatus is provided, including:

[0031] an acquisition unit configured to acquire object features of a target object and content item features of a plurality of target content items;

[0032] a determination unit configured to, for any target content item, determine a recommendation probability of the target content item based on a content item recommendation model, the object features, and the content item features of the target content item, the content item recommendation model being trained according to the training method of the content item recommendation model;

[0033] a recommendation unit configured to recommend at least one target content item to the target object based on the recommendation probabilities of the plurality of target content items.

[0034] According to another aspect of embodiments of the present disclosure, an electronic device is provided, including:

[0035] one or more processors;

[0036] a memory for storing the processor-executable program code;

[0037] wherein the processor is configured to execute the program code to implement the above content item recommendation model training method.

[0038] According to another aspect of embodiments of the present disclosure, an electronic device is provided, the electronic device comprising:

[0039] one or more processors;

[0040] a memory for storing the processor-executable program code;

[0041] wherein the processor is configured to execute the program code to implement the above content item recommendation method.

[0042] According to another aspect of embodiments of the present disclosure, a computer-readable storage medium is provided, when program code in the computer-readable storage medium is executed by a processor of an electronic device, the electronic device is enabled to perform the above content item recommendation model training method.

[0043] According to another aspect of embodiments of the present disclosure, a computer-readable storage medium is provided, when program code in the computer-readable storage medium is executed by a processor of an electronic device, the electronic device is enabled to perform the above content item recommendation method.

[0044] According to another aspect of embodiments of the present disclosure, a computer program product is provided, comprising computer programs / instructions, which, when executed by a processor, implement the above content item recommendation model training method.

[0045] According to another aspect of embodiments of the present disclosure, a computer program product is provided, comprising computer programs / instructions, which, when executed by a processor, implement the above content item recommendation method.

[0046] The embodiment of the present disclosure provides a content item recommendation model training method. Through unlabeled sample training data, the content item recommendation model pre-trained based on labeled sample pre-training data is unsupervisedly trained, and a reverse weighted loss for determining label information of the sample training data can be obtained. Then, the content item recommendation model is updated based on the forward gradient and the reverse gradient of the reverse weighted loss, and a first temporary model and a second temporary model can be obtained. Thus, the content item recommendation model, the first temporary model and the second temporary model can be trained based on sample test data and label information of the sample test data, and a target recommendation model with minimum training loss can be obtained, that is, the model with minimum training loss in the three models is determined as the target recommendation model. Both the labeled sample test data and the labeled sample test data are used to guide the learning of the content item recommendation model on the unlabeled sample training data, so that the false positive and false negative cases of the content item recommendation model in the training process can be reduced. Thus, the noise is removed from the positive sample content item and the negative sample content item, the accuracy of the recommended content item of the content item recommendation model is improved, and the robustness of the content item recommendation model is improved.

[0047] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0048] The accompanying drawings incorporated in the specification and forming a part of it, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure without imposing undue limitation on the disclosure.

[0049] Figure 1 is a schematic diagram of an implementation environment according to an exemplary embodiment.

[0050] Figure 2 is a flowchart of a content item recommendation model training method according to an exemplary embodiment.

[0051] Figure 3 is a flowchart of another content item recommendation model training method according to an exemplary embodiment.

[0052] Figure 4 is a schematic diagram of a reverse gradient algorithm according to an exemplary embodiment.

[0053] Figure 5 is a flowchart of a content item recommendation method according to an exemplary embodiment.

[0054] Figure 6 is a block diagram of a content item recommendation model training device according to an exemplary embodiment.

[0055] Figure 7 is a block diagram of another content item recommendation model training apparatus according to an example embodiment.

[0056] Figure 8 is a block diagram of a content item recommendation apparatus according to an example embodiment.

[0057] Figure 9 is a block diagram of a terminal according to an example embodiment.

[0058] Figure 10 is a block diagram of a server according to an example embodiment. DETAILED DESCRIPTION

[0059] In order for those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings.

[0060] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in an order other than that illustrated or described herein. The implementation described in the following example embodiments does not represent all implementations consistent with the present disclosure. Rather, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0061] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals involved in the present disclosure are authorized by the user or fully authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions. For example, the sample training data and sample test data involved in the present disclosure are obtained under sufficient authorization.

[0062] Figure 1 is an implementation environment schematic diagram of a content item recommendation model training method according to an example embodiment. Referring to Figure 1 , the implementation environment specifically includes a terminal 101 and a server 102.

[0063] The terminal 101 can be at least one of a smart phone, a smart watch, a desktop computer, a laptop computer, an MP3 player, an MP4 player, and a laptop computer. The terminal 101 can install and run an application for displaying content items. A user can log in to the application through the terminal 101 to obtain services provided by the application. The application is associated with the server 102 and is provided with background services by the server 102. The terminal 101 can be connected to the server 102 through a wireless network or a wired network.

[0064] The terminal 101 can be one of a plurality of terminals, and the embodiment only takes the terminal 101 as an example. Those skilled in the art can know that the number of the above terminals can be more or less. For example, the above terminals can be only a few, or the above terminals can be dozens or hundreds, or more, and the number and type of the terminal are not limited in the embodiment.

[0065] The server 102 can be at least one of a server, a plurality of servers, a cloud computing platform, and a virtualization center. The server 102 can be connected to the terminal 101 and other terminals through a wireless network or a wired network. Optionally, the number of the above servers can be more or less, and the embodiment does not limit this. Of course, the server 102 can also include other functional servers to provide more comprehensive and diversified services.

[0066] Figure 2 FIG. 1 is a flowchart of a method for training a content item recommendation model according to an example embodiment. As shown in FIG. 1, the method is performed by a server and includes the following steps: Figure 2

[0067] In step S201, the server performs unsupervised training on a content item recommendation model pre-trained based on labeled sample pre-training data based on sample training data, to obtain a reverse weighted loss of the sample training data. The sample training data includes object features of a first sample object and content item features of a first sample content item. The content item recommendation model is used to predict a probability that a content item corresponding to the content item features is recommended to an object corresponding to the object features based on input object features and content item features. The reverse weighted loss is used to determine predicted label information of the sample training data.

[0068] ​In the embodiments of the present disclosure, the sample training data is unlabeled training data, and includes object features of a first sample object and content item features of a first sample content item. The server can obtain the sample training data from a local database, from another server, or based on a content item published by a terminal. The first sample object is an account logged in on a content item client installed on the terminal, and through the first sample object, various content items such as videos, audios, and articles can be published or browsed. The first sample content item can be a content item browsed by the first sample object, or a content item not browsed by the first sample object. The object features of the first sample object include an object identifier and an object activity, and the content item features of the first sample content item include a content item identifier, a content item publishing object identifier, a content item duration, and a content item popularity.

[0069] Since the sample training data is unlabeled training data, the server can train the content item recommendation model in an unsupervised training manner to obtain the reverse weighted loss of the sample training data. The unsupervised training manner means that the training data does not have labels in the process of training the model.

[0070] In step S202, the server updates the content item recommendation model based on the forward gradient and the reverse gradient of the reverse weighted loss to obtain a first temporary model and a second temporary model.

[0071] In the embodiments of the present disclosure, the reverse weighted loss can be used to determine the predicted label information of the sample training data. The predicted label information is used to indicate whether the sample content item is a content item of interest to the sample object, and includes a positive label and a negative label. The positive label indicates that the sample content item is a content item of interest to the sample object, and the negative label indicates that the sample content item is a content item of no interest to the sample object. Therefore, in order to predict the label information of the sample training data, the server can update the content item recommendation model based on the forward gradient and the reverse gradient of the reverse weighted loss using different gradients to obtain a first temporary model and a second temporary model. The first temporary model and the second temporary model can predict the probability of recommending a content item corresponding to the content item features to an object corresponding to the object features based on the input object features and content item features.

[0072] In step S203, the server trains the content item recommendation model, the first temporary model and the second temporary model based on the sample test data and the label information of the sample test data to obtain a target recommendation model, the sample test data including the object features of the second sample object and the content item features of the second sample content item, the label information of the sample test data being used to indicate whether the second sample content item is a content item of interest to the second sample object, the sample test data and the sample pre-training data being from the same data set, and the target recommendation model being the model with the minimum training loss among the content item recommendation model, the first temporary model and the second temporary model.

[0073] In the embodiments of the present disclosure, the sample test data is labeled training data including the object features of the second sample object and the content item features of the second sample content item. The server can obtain the sample test data from a local database, from other servers or based on the content items published by terminals. The label information of the sample test data is used to indicate whether the second sample content item is a content item of interest to the second sample object and includes positive labels and negative labels. The positive label indicates that the second sample content item is a content item of interest to the second sample object, i.e., the second sample content item is a positive sample content item. The negative label indicates that the second sample content item is a content item of no interest to the second sample object, i.e., the second sample content item is a negative sample content item.

[0074] The server can train the content item recommendation model, the first temporary model and the second temporary model based on the sample test data and the label information of the sample test data to determine the training loss of the content item recommendation model, the first temporary model and the second temporary model. Since the training loss is used to reflect the accuracy of the model, the training loss is inversely related to the accuracy. Therefore, the server confirms the model with the minimum training loss as the target recommendation model, i.e., the accuracy of the target recommendation model is the highest.

[0075] The embodiments of the present disclosure provide a training method of a content item recommendation model. The content item recommendation model pre-trained based on labeled sample pre-training data is unsupervised trained based on unlabeled sample training data, and a reverse weighted loss for determining label information of the sample training data can be obtained. Then, the content item recommendation model is updated based on the forward gradient and the reverse gradient of the reverse weighted loss, and a first temporary model and a second temporary model can be obtained. Thus, the content item recommendation model, the first temporary model and the second temporary model can be trained based on sample test data and label information of the sample test data, and a target recommendation model with minimum training loss can be obtained, that is, the model with minimum training loss among the three models is determined as the target recommendation model. The labeled sample test data is fully utilized, and the learning of the content item recommendation model on the unlabeled sample training data is guided by the labeled sample test data, so that the false positive and false negative cases in the training process of the content item recommendation model can be reduced. Thus, the noise is removed from the positive sample content item and the negative sample content item, the accuracy of the recommended content item of the content item recommendation model is improved, and the robustness of the content item recommendation model is improved.

[0076] In some embodiments, based on the sample training data, the content item recommendation model pre-trained based on the labeled training data is unsupervised trained, and a reverse weighted loss of the sample training data is obtained, comprising:

[0077] Based on the sample training data, the content item recommendation model pre-trained based on the labeled training data is unsupervised trained, and a positive sample loss and a negative sample loss of the sample training data are obtained.

[0078] Based on the positive sample loss and the negative sample loss, a reverse weighted loss of the sample training data is determined.

[0079] In the embodiments of the present disclosure, since the sample training data is unlabeled training data, and the sample content item in the sample training data can be a positive sample content item or a negative sample content item. Therefore, the server can train the content item recommendation model pre-trained based on the labeled training data in an unsupervised training manner, and a positive sample loss and a negative sample loss of the sample training data can be obtained. Based on the two losses of the positive sample loss and the negative sample loss, a reverse weighted loss for determining the predicted label information of the sample training data is determined, and the robustness of the content item recommendation model is improved.

[0080] In some embodiments, based on the positive sample loss and the negative sample loss, the reverse weighted loss of the sample training data is determined, comprising:

[0081] Based on the positive sample loss and the negative sample loss, a normalization coefficient of the sample training data is determined.

[0082] determine the weight of the positive sample loss and the weight of the negative sample loss based on the normalization coefficient, the positive sample loss and the negative sample loss;

[0083] perform weighted summation on the positive sample loss and the negative sample loss based on the weight of the positive sample loss and the weight of the negative sample loss, to obtain the inverse weighted loss of the sample training data.

[0084] In the embodiments of the present disclosure, the weight of the sample training data includes the weight of the positive sample loss and the weight of the negative sample loss, and the server can determine the weight of the positive sample loss and the weight of the negative sample loss based on the normalization coefficient, the positive sample loss and the negative sample loss. The weight of the positive sample loss is inversely related to the positive sample loss, and the weight of the negative sample loss is inversely related to the negative sample loss. Based on the weight of the positive sample loss and the weight of the negative sample loss, the server can perform weighted summation on the positive sample loss and the negative sample loss of the sample training data to obtain the inverse weighted loss used to determine the predicted label information of the sample training data. By assigning a larger weight to the sample training data with a smaller loss value and a smaller weight to the sample training data with a larger loss value, the accuracy of the content item recommendation model is improved, that is, the accuracy of the content item recommendation model in predicting the label information of the sample training data is improved.

[0085] In some embodiments, the content item recommendation model is updated based on the forward gradient and the backward gradient of the inverse weighted loss, to obtain a first temporary model and a second temporary model, including:

[0086] update the model parameters of the content item recommendation model based on the forward gradient of the inverse weighted loss, to obtain a first temporary model;

[0087] update the model parameters of the content item recommendation model based on the backward gradient of the inverse weighted loss, to obtain a second temporary model.

[0088] In the embodiments of the present disclosure, the server reduces the training loss of the content item recommendation model by using the gradient descent algorithm, and improves the accuracy of the content item recommendation model. That is, the server can update the model parameters of the content item recommendation model based on the gradient of the reverse weighted loss, so as to reduce the reverse weighted loss of the content item recommendation model. Since the gradient of the reverse weighted loss of the sample training data includes the forward gradient and the reverse gradient, the server can update the model parameters of the content item recommendation model based on the forward gradient of the reverse weighted loss to obtain the first temporary model. Similarly, the model parameters of the content item recommendation model are updated based on the reverse gradient of the reverse weighted loss to obtain the second temporary model. Updating the content item recommendation model by using the forward gradient and the reverse gradient respectively can obtain a content item recommendation model with higher accuracy by comparing the training loss of the first temporary model and the second temporary model, and improves the robustness of the content item recommendation model.

[0089] In some embodiments, based on the sample test data and the label information of the sample test data, the content item recommendation model, the first temporary model and the second temporary model are trained to obtain a target recommendation model, including:

[0090] Based on the sample test data and the label information of the sample test data, the content item recommendation model, the first temporary model and the second temporary model are trained to obtain the training loss of the content item recommendation model, the training loss of the first temporary model and the training loss of the second temporary model.

[0091] The model with the minimum training loss among the content item recommendation model, the first temporary model and the second temporary model is determined as the target recommendation model.

[0092] In the embodiments of the present disclosure, the server trains the content item recommendation model, the first temporary model and the second temporary model based on the sample test data and the label information of the sample test data, can determine the predicted label information of the sample test data predicted by the content item recommendation model, the predicted label information of the sample test data predicted by the first temporary model and the predicted label information of the sample test data predicted by the second temporary model respectively. Further, based on the difference between the predicted label information and the label information, the training loss of the content item recommendation model, the training loss of the first temporary model and the training loss of the second temporary model can be determined. The training loss is used to reflect the accuracy of the model, and the training loss is inversely related to the accuracy. Therefore, the server can determine the model with the minimum training loss among the content item recommendation model, the first temporary model and the second temporary model as the target recommendation model, and further improve the accuracy of the content item recommendation model.

[0093] In some embodiments, based on the sample training data, the method further comprises, before unsupervised training the content item recommendation model pre-trained based on the labeled sample training data to obtain the reverse weighted loss of the sample training data, the following steps:

[0094] Pre-training the content item recommendation model based on the sample pre-training data and label information of the sample pre-training data, the sample pre-training data comprising object features of a third sample object and content item features of a third sample content item, and the label information of the sample pre-training data being used to indicate whether the third sample content item is a content item of interest to the third sample object.

[0095] In the embodiments of the present disclosure, the sample pre-training data is labeled training data. In order to make the content item recommendation model converge faster, the server can pre-train the content item recommendation model based on the sample pre-training data and the label information of the sample pre-training data set, thereby improving the accuracy of the content item recommendation model.

[0096] In some embodiments, pre-training the content item recommendation model based on the sample pre-training data and the label information of the sample pre-training data comprises:

[0097] Based on the content item recommendation model, predicting the sample pre-training data to obtain prediction information of the sample pre-training data, the prediction information being used to indicate whether the third sample content item is a content item of interest to the third sample object;

[0098] Based on the label information and the prediction information, determining a pre-training loss of the content item recommendation model;

[0099] Based on the pre-training loss, updating model parameters of the content item recommendation model.

[0100] In the embodiments of the present disclosure, the server can determine the pre-training loss of the content item recommendation model by determining the difference between the prediction information and the label information. Since the pre-training loss is used to reflect the accuracy of the content item recommendation model, the pre-training loss is inversely related to the accuracy. Therefore, the server can update the model parameters of the content item recommendation model based on the pre-training loss, so as to reduce the pre-training loss value of the content item recommendation model, thereby improving the accuracy of the content item recommendation model.

[0101] The above Figure 2 The above Figure 3 is a flowchart of another method for training a content item recommendation model according to an example embodiment. The method is performed by a server, see Figure 3 , the method comprising:

[0102] In step S301, the server pre-trains the content item recommendation model based on sample pre-training data and label information of the sample pre-training data. The sample pre-training data includes object features of the third sample object and content item features of the third sample content item. The label information of the sample pre-training data is used to indicate whether the third sample content item is a content item of interest to the third sample object.

[0103] In the embodiments of the present disclosure, the sample pre-training data is labeled training data, which includes object features of the third sample object and content item features of the third sample content item. The server can obtain the sample pre-training data from a local database, from other servers, or based on content items published by terminals. The label information of the sample pre-training data is used to indicate whether the third sample content item is a content item of interest to the third sample object, including positive labels and negative labels. The positive label indicates that the third sample content item is a content item of interest to the third sample object, i.e., the third sample content item is a positive sample content item. The negative label indicates that the third sample content item is a content item of no interest to the third sample object, i.e., the third sample content item is a negative sample content item. In order to make the content item recommendation model converge faster, the server can pre-train the content item recommendation model based on the sample pre-training data and the label information of the sample pre-training data set, thereby improving the accuracy of the content item recommendation model.

[0104] In some embodiments, the server can determine the label information of the third sample content item based on the interaction behavior of the third sample object to the third sample content item, such as the number of clicks, the viewing time, the like behavior, the dislike behavior, etc. That is, whether the third sample content item is a content item of interest to the third sample object. If it is detected that the third sample object clicks the third sample content item more times or watches it for a longer time, it can be considered that the third sample content item is a content item of interest to the third sample object. If it is detected that the third sample object clicks the third sample content item less times or watches it for a shorter time, it can be considered that the third sample content item is a content item of no interest to the third sample object.

[0105] In some embodiments, the server pre-trains the content item recommendation model based on a difference between predicted information and label information. Accordingly, the server predicts the sample pre-training data based on the content item recommendation model to obtain predicted information of the sample pre-training data, the predicted information being used to indicate whether the third sample content item is a content item of interest to the third sample object. The server determines a pre-training loss of the content item recommendation model based on the label information and the predicted information. The server updates model parameters of the content item recommendation model based on the pre-training loss. The predicted information is predicted label information of the sample pre-training data, and the label information is true label information of the sample pre-training data. The server can determine the pre-training loss of the content item recommendation model by determining the difference between the predicted information and the label information. Since the pre-training loss is used to reflect the accuracy of the content item recommendation model, the pre-training loss is inversely related to the accuracy. Therefore, the server can update the model parameters of the content item recommendation model based on the pre-training loss to reduce the pre-training loss value of the content item recommendation model, thereby improving the accuracy of the content item recommendation model.

[0106] Optionally, the server determines the pre-training loss of the content item recommendation model based on the label information and the predicted information according to the following formula (1) and formula (2).

[0107]

[0108]

[0109] wherein, is the pre-training loss of the content item recommendation model, is the number of labeled sample pre-training data, θ is the content item recommendation model, u is the object identifier of the third sample object in the sample pre-training data, and i is the content item identifier of the third sample content item in the sample pre-training data, is the pre-training sub-loss of the content item recommendation model, is the label information of the sample pre-training data, is the predicted information obtained by predicting the sample pre-training data based on the content item recommendation model.

[0110] In some embodiments, the server divides the labeled training data, which is structured table data, into sample pre-training data and sample test data, each of which is used to reflect an interaction record of a sample object and a sample content item. In order to obtain the training data required for constructing the training content item recommendation model, the server needs to obtain the object features of the sample object, the content item features of the sample content item, and the behavior features of the sample object to the sample content item. Among them, the object features of the sample object include object identification and object activity, etc.; the content item features of the sample content item include content item identification, object identification of a content item publishing object, category identification after content item clustering, category identification after content item publishing object clustering, content item duration, and content item popularity, etc.; and the behavior features include click behavior of the sample object to the sample content item, like behavior of the sample object to the sample content item, and dislike behavior of the sample object to the sample content item, etc. Optionally, the division ratio of the sample pre-training data and the sample test data is 9:1. Among them, the sample pre-training data is used to pre-train the content item recommendation model; and the sample test data is used to test the content item recommendation model to obtain a test error of the content item recommendation model, and based on the test error, the accuracy of the content item recommendation model is analyzed.

[0111] In step S302, the server performs unsupervised training on the content item recommendation model pre-trained based on the labeled training data based on the sample training data, to obtain positive sample loss and negative sample loss of the sample training data.

[0112] In the embodiments of the present disclosure, the sample training data is unlabeled training data, which includes object features of a first sample object and content item features of a first sample content item. The first sample object can be an account logged in on a content item client installed on a terminal, through which various content items can be published or browsed. The first sample content item can be a content item browsed by the first sample object, or a content item not browsed by the first sample object. Among them, the object features of the first sample object include object identification and object activity, etc.; and the content item features of the first sample content item include content item identification, object identification of a content item publishing object, category identification after content item clustering, category identification after content item publishing object clustering, content item duration, and content item popularity, etc.

[0113] Since the sample training data is unlabeled training data, and the first sample content item in the sample training data can be a positive sample content item or a negative sample content item, the server can use an unsupervised training method to train the content item recommendation model pre-trained based on the labeled training data, and can obtain the positive sample loss and the negative sample loss of the sample training data. Based on the positive sample loss and the negative sample loss, the server can determine the predicted label information of the sample training data.

[0114] In some embodiments, the sample training data further comprises a behavior feature of the first sample object to the sample content item, such as a click behavior of the first sample object to the first sample content item, a like behavior of the first sample object to the first sample content item, and a dislike behavior of the first sample object to the first sample content item, etc. The server can predict the label information of the sample training data based on the behavior feature, that is, predict the label of the first sample content item.

[0115] Optionally, the server performs unsupervised training on the content item recommendation model based on the sample training data to obtain a positive sample loss and a negative sample loss of the sample training data according to the following formulas (3) and (4).

[0116]

[0117]

[0118] wherein, the positive sample loss of the sample training data, the negative sample loss of the sample training data, the predicted label information of the sample training data, θ is the content item recommendation model pre-trained based on the labeled training data, u is the object identifier of the first sample object in the sample training data, and i is the content item identifier of the first sample content item in the sample training data.

[0119] In step S303, the server determines a reverse weighted loss of the sample training data based on the positive sample loss and the negative sample loss, and the reverse weighted loss is used to determine the predicted label information of the sample training data.

[0120] In the embodiments of the present disclosure, the positive sample loss is used to reflect the loss when the first sample content item in the sample training data is a positive sample content item, and the negative sample loss is used to reflect the loss when the first sample content item in the sample training data is a negative sample content item. The server can determine the possibility that the first sample content item is a positive sample content item based on the size of the positive sample loss. Similarly, the server can determine the possibility that the first sample content item is a negative sample content item based on the size of the negative sample loss. Wherein, the smaller the positive sample loss of the sample training data is, the higher the possibility that the first sample content item is a positive sample content item is; the smaller the negative sample loss of the sample training data is, the higher the possibility that the first sample content item is a negative sample content item is. In order to determine the predicted label information of the sample training data, that is, to determine the predicted label of the first sample content item, the server can determine the reverse weighted loss of the sample training data based on the positive sample loss and the negative sample loss, which improves the robustness of the content item recommendation model.

[0121] In some embodiments, the server can obtain a normalization coefficient for determining the weight of the sample training data based on the positive sample loss and the negative sample loss of the sample training data, and then determine the inversely weighted loss of the sample training data. Accordingly, the server determines the normalization coefficient of the sample training data based on the positive sample loss and the negative sample loss; determines the weight of the positive sample loss and the weight of the negative sample loss based on the normalization coefficient, the positive sample loss and the negative sample loss; and performs weighted summation on the positive sample loss and the negative sample loss based on the weight of the positive sample loss and the weight of the negative sample loss to obtain the inversely weighted loss of the sample training data. The weight of the sample training data includes the weight of the positive sample loss and the weight of the negative sample loss, and the server can determine the weight of the positive sample loss and the weight of the negative sample loss based on the normalization coefficient, the positive sample loss and the negative sample loss, respectively. The weight of the positive sample loss is inversely related to the positive sample loss, i.e., the smaller the positive sample loss, the greater the weight of the positive sample loss; the greater the positive sample loss, the smaller the weight of the positive sample loss. Similarly, the weight of the negative sample loss is also inversely related to the negative sample loss. The server can perform weighted summation on the positive sample loss and the negative sample loss of the sample training data based on the weight of the positive sample loss and the weight of the negative sample loss to obtain the inversely weighted loss for determining the predicted label information of the sample training data. The server assigns a larger weight to the sample training data with a smaller loss value and a smaller weight to the sample training data with a larger loss value, so that the accuracy of the content item recommendation model is improved, i.e., the accuracy of the content item recommendation model in predicting the label information of the sample training data is improved.

[0122] Optionally, the server determines the inversely weighted loss of the sample training data based on the positive sample loss and the negative sample loss according to the following formulas (5)-(8).

[0123]

[0124]

[0125]

[0126]

[0127] wherein, is the inversely weighted loss of the sample training data, D u is the number of sample training data, and θ is a content item recommendation model pre-trained based on labeled training data, is the label information of the sample training data to be predicted, is the predicted label information of the sample training data, is the positive sample loss of the sample training data, is the negative sample loss of the sample training data, and zω is a normalization coefficient of the sample training data, ω 1 is a weight of the positive sample loss, ω 0 is a weight of the negative sample loss, u is an object identifier of a first sample object in the sample training data, and i is a content item identifier of a first sample content item in the sample training data.

[0128] In step S304, the server updates the model parameters of the content item recommendation model based on the forward gradient of the reverse weighted loss to obtain a first temporary model.

[0129] In the embodiments of the present disclosure, the server reduces the training loss of the content item recommendation model by using the gradient descent algorithm to improve the accuracy of the content item recommendation model. That is, the server can update the model parameters of the content item recommendation model based on the gradient of the reverse weighted loss so that the reverse weighted loss of the content item recommendation model is reduced. Since the gradient of the reverse weighted loss of the sample training data includes the forward gradient and the reverse gradient, the server can update the model parameters of the content item recommendation model based on the forward gradient of the reverse weighted loss to obtain the first temporary model, which is used to predict the probability that the content item corresponding to the content item feature is recommended to the object corresponding to the object feature based on the input object feature and content item feature.

[0130] In step S305, the server updates the model parameters of the content item recommendation model based on the reverse gradient of the reverse weighted loss to obtain a second temporary model.

[0131] In the embodiments of the present disclosure, the gradient of the reverse weighted loss of the sample training data includes the forward gradient and the reverse gradient. As described above in step S304, the server can also update the model parameters of the content item recommendation model based on the reverse gradient of the reverse weighted loss to obtain the second temporary model, which is used to predict the probability that the content item corresponding to the content item feature is recommended to the object corresponding to the object feature based on the input object feature and content item feature. By using the forward gradient and the reverse gradient to update the content item recommendation model respectively, a content item recommendation model with higher accuracy can be obtained by comparing the training loss of the first temporary model and the second temporary model, thereby improving the robustness of the content item recommendation model.

[0132] For example, Figure 4 is a schematic diagram of a reverse gradient algorithm according to an exemplary embodiment. Referring to Figure 4 As shown, after the content item recommendation model is trained using the unlabeled sample training data, the reverse weighted loss of the sample training data can be obtained, and the gradient of the reverse weighted loss includes the forward gradient and the reverse gradient. As shown in Figure 4(1) as shown, in the case of a smaller reverse weighted loss of the sample training data, it indicates that the unlabeled sample training data is easy-to-classify sample training data. At this time, the server can update the model parameters of the content item recommendation model based on the forward gradient of the reverse weighted loss function, and the updated content item recommendation model can obtain a smaller test error on the sample test data. For example Figure 4 (2) as shown, in the case of a larger reverse weighted loss of the sample training data, it indicates that the unlabeled sample training data is difficult-to-classify sample training data. At this time, the server can update the model parameters of the content item recommendation model based on the reverse gradient of the reverse weighted loss function, and the updated content item recommendation model can obtain a smaller test error on the sample test data. For example Figure 4 (3) as shown, when the content item recommendation model is approximately optimal, at this time, whether using the forward gradient or the reverse gradient to update the content item recommendation model will make the content item recommendation model deviate from the optimal state. That is, the training loss of the content item recommendation model becomes larger. Therefore, at this time, the model has converged and does not need to be trained, and the batch of unlabeled training data needs to be discarded. For example Figure 4 (4) as shown, 1 represents Figure 4 (1) in the case of updating the content item recommendation model using the forward gradient, 2 represents Figure 4 (3) in the case of using the forward gradient or the reverse gradient to make the training loss of the model larger, 3 represents Figure 4 (2) in the case of updating the content item recommendation model using the reverse gradient.

[0133] In step S306, the server trains the content item recommendation model, the first temporary model and the second temporary model based on the sample test data and the label information of the sample test data, to obtain the training loss of the content item recommendation model, the training loss of the first temporary model and the training loss of the second temporary model.

[0134] In the embodiments of the present disclosure, the sample test data is labeled training data, including the object features of the second sample object and the content item features of the second sample content item. The object features and the content item features are the same as the object features and the content item features in step S302 described above. The label information of the sample test data is used to indicate whether the second sample content item is a content item of interest of the second sample object, including positive labels and negative labels. Among them, the positive label indicates that the second sample content item is a content item of interest of the second sample object, that is, the second sample content item is a positive sample content item; the negative label indicates that the second sample content item is a content item of no interest of the second sample object, that is, the second sample content item is a negative sample content item.

[0135] The server trains the content item recommendation model, the first temporary model and the second temporary model based on the sample test data and the label information of the sample test data, and can determine the predicted label information of the sample test data predicted by the content item recommendation model, the predicted label information of the sample test data predicted by the first temporary model and the predicted label information of the sample test data predicted by the second temporary model respectively. Further, based on the difference between the predicted label information and the label information, the training loss of the content item recommendation model, the training loss of the first temporary model and the training loss of the second temporary model can be determined.

[0136] In some embodiments, the server can determine the label information of the second sample content item based on the interaction behavior of the second sample object to the second sample content item, such as the number of clicks, the viewing time, the like behavior, the dislike behavior, etc., that is, determine whether the second sample content item is the content item of interest to the second sample object. If it is detected that the second sample object has more clicks or longer viewing time on the second sample content item, it can be considered that the second sample content item is the content item of interest to the second sample object; if it is detected that the second sample object has fewer clicks or shorter viewing time on the second sample content item, it can be considered that the second sample content item is the content item of no interest to the second sample object.

[0137] In step S307, the server determines the model with the minimum training loss among the content item recommendation model, the first temporary model and the second temporary model as the target recommendation model.

[0138] In the embodiments of the present disclosure, the first training loss is used to reflect the accuracy of the content item recommendation model, the second training loss is used to reflect the accuracy of the first temporary model, and the third training loss is used to reflect the accuracy of the second temporary model. Since the training loss of the model is inversely related to the accuracy of the model, the smaller the training loss of the model, the higher the accuracy of the model. Therefore, the server can determine the model with the minimum training loss among the content item recommendation model, the first temporary model and the second temporary model as the target recommendation model, and the accuracy of the target content item recommendation model is the highest.

[0139] The embodiments of the present disclosure provide a content item recommendation model training method. The content item recommendation model pre-trained based on labeled training data is unsupervised trained by using unlabeled sample training data, and a reverse weighted loss for determining label information of the sample training data can be obtained. Then, the content item recommendation model is updated based on the forward gradient and the reverse gradient of the reverse weighted loss, and a first temporary model and a second temporary model can be obtained. Thus, the content item recommendation model, the first temporary model and the second temporary model can be trained based on sample test data and label information of the sample test data, and a target recommendation model with minimum training loss can be obtained, that is, the model with minimum training loss among the three models is determined as the target recommendation model. The labeled sample test data is fully utilized, and the learning of the content item recommendation model on the unlabeled sample training data is guided by the labeled sample test data, so that the false positive cases and the false negative cases in the training process of the content item recommendation model can be reduced. Thus, the denoising is realized from two aspects of positive sample content items and negative sample content items, the accuracy of the recommended content items of the content item recommendation model is improved, and the robustness of the content item recommendation model is improved.

[0140] All the optional technical solutions described above can be combined to form optional embodiments of the present disclosure, which will not be described here.

[0141] Figure 5 is a flowchart of a content item recommendation method according to an exemplary embodiment, as shown in Figure 5 The method is performed by a server and includes the following steps:

[0142] In step S501, the server obtains object features of a target object and content item features of a plurality of target content items.

[0143] In the embodiments of the present disclosure, the target object is an account logged in on a content item client installed on a terminal, through which various content items can be published or browsed. The target content item can be a content item browsed by the target object, or a content item not browsed by the target object. The object features of the target object include object identification and object activity, etc. The content item features of the target content item include content item identification, content item publishing object identification, content item duration and content item popularity, etc.

[0144] In step S502, for any target content item, the server determines a recommendation probability of the target content item based on a content item recommendation model, the object features and the content item features of the target content item. The content item recommendation model is trained according to the content item recommendation model training method in the above embodiments.

[0145] In the embodiments of the present disclosure, the content item recommendation model is configured to predict a probability that a content item corresponding to content item features is recommended to a user corresponding to user features based on the input user features and content item features. For any target content item, the user features of a target user and the content item features of the target content item are input into the content item recommendation model, and the probability that the target content item is recommended to the target user, i.e., the recommendation probability of the target content item, can be determined.

[0146] In step S503, the server recommends at least one target content item to the target user based on the recommendation probabilities of the plurality of target content items.

[0147] In the embodiments of the present disclosure, the higher the recommendation probability of a target content item is, the higher the probability that the target content item is a content item of interest to the target user is. By comparing the recommendation probabilities of the plurality of target content items, the server can recommend at least one target content item with a higher recommendation probability to the target user, thereby improving the viewing experience of the target user.

[0148] In some embodiments, the server can sort the plurality of target content items in descending order of the recommendation probabilities of the plurality of target content items. The result of the sorting is used to indicate the recommendation order of the plurality of target content items. Based on the result of the sorting, the server can preferentially recommend target content items with higher recommendation probabilities to the target user, thereby improving the viewing experience of the target user.

[0149] The embodiments of the present disclosure provide a content item recommendation method. Since the content item recommendation model is configured to predict a probability that a content item corresponding to content item features is recommended to a user corresponding to user features based on the input user features and content item features, the server can determine the recommendation probabilities of the plurality of target content items based on the content item recommendation model, the user features of the target user, and the content item features of the target content item. Therefore, based on the recommendation probabilities, the server can preferentially recommend target content items with higher recommendation probabilities to the target user, thereby improving the accuracy of the recommended content items of the content item recommendation model and improving the viewing experience of the target user.

[0150] Figure 6 is a block diagram of a training device of a content item recommendation model according to an exemplary embodiment. Referring to Figure 6 The device includes a first training unit 601, an updating unit 602, and a second training unit 603.

[0151] The first training unit 601 is configured to perform unsupervised training on the content item recommendation model pre-trained based on the labeled sample training data based on the sample training data, to obtain a reverse weighted loss of the sample training data, the sample training data comprising object features of a first sample object and content item features of a first sample content item, the content item recommendation model being configured to predict a probability that a content item corresponding to the content item features is recommended to an object corresponding to the object features based on input of the object features and the content item features, and the reverse weighted loss being used to determine predicted label information of the sample training data.

[0152] The updating unit 602 is configured to update the content item recommendation model based on a forward gradient and a reverse gradient of the reverse weighted loss, to obtain a first temporary model and a second temporary model.

[0153] The second training unit 603 is configured to train the content item recommendation model, the first temporary model and the second temporary model based on sample test data and label information of the sample test data, to obtain a target recommendation model, the sample test data comprising object features of a second sample object and content item features of a second sample content item, the label information of the sample test data being used to indicate whether the second sample content item is a content item of interest to the second sample object, the sample test data and the sample pre-training data being from a same data set, and the target recommendation model being a model with a minimum training loss among the content item recommendation model, the first temporary model and the second temporary model.

[0154] In some embodiments, Figure 7 is a block diagram of another training apparatus of a content item recommendation model according to an example embodiment. Referring to Figure 7 As shown, the first training unit 601 comprises:

[0155] The first training sub-unit 701 is configured to perform unsupervised training on the content item recommendation model pre-trained based on the labeled training data based on the sample training data, to obtain a positive sample loss and a negative sample loss of the sample training data.

[0156] The first determination sub-unit 702 is configured to determine a reverse weighted loss of the sample training data based on the positive sample loss and the negative sample loss.

[0157] In some embodiments, the first determination sub-unit 702 is configured to determine a normalization coefficient of the sample training data based on the positive sample loss and the negative sample loss, determine a weight of the positive sample loss and a weight of the negative sample loss based on the normalization coefficient, the positive sample loss and the negative sample loss, and perform weighted summation on the positive sample loss and the negative sample loss based on the weight of the positive sample loss and the weight of the negative sample loss, to obtain the reverse weighted loss of the sample training data.

[0158] In some embodiments, continuing from Figure 7 , the updating unit 602 comprises:

[0159] The first updating sub-unit 703 is configured to update the model parameters of the content item recommendation model based on the forward gradient of the reverse weighted loss to obtain a first temporary model.

[0160] The second updating sub-unit 704 is configured to update the model parameters of the content item recommendation model based on the reverse gradient of the reverse weighted loss to obtain a second temporary model.

[0161] In some embodiments, continuing from Figure 7 , the second training unit 603 comprises:

[0162] The second training sub-unit 705 is configured to train the content item recommendation model, the first temporary model and the second temporary model based on the sample test data and the label information of the sample test data to obtain a training loss of the content item recommendation model, a training loss of the first temporary model and a training loss of the second temporary model.

[0163] The second determining sub-unit 706 is configured to determine the model with the minimum training loss among the content item recommendation model, the first temporary model and the second temporary model as the target recommendation model.

[0164] In some embodiments, continuing from Figure 7 , the apparatus further comprises:

[0165] The pre-training unit 604 is configured to pre-train the content item recommendation model based on sample pre-training data and label information of the sample pre-training data, the sample pre-training data comprising object features of a third sample object and content item features of a third sample content item, the label information of the sample pre-training data being used to indicate whether the third sample content item is a content item of interest to the third sample object.

[0166] In some embodiments, the pre-training unit 604 is configured to predict the sample pre-training data based on the content item recommendation model to obtain prediction information of the sample pre-training data, the prediction information being used to indicate whether the third sample content item is a content item of interest to the third sample object; determine a pre-training loss of the content item recommendation model based on the label information and the prediction information; and update the model parameters of the content item recommendation model based on the pre-training loss.

[0167] The embodiment of the disclosure provides a training device of a content item recommendation model. Through unlabeled sample training data, the content item recommendation model pre-trained based on labeled sample pre-training data is unsupervisedly trained, and a reverse weighted loss for determining label information of the sample training data can be obtained. Then, based on the forward gradient and the reverse gradient of the reverse weighted loss, the content item recommendation model is updated respectively, and a first temporary model and a second temporary model can be obtained. Thus, based on the sample test data and the label information of the sample test data, the content item recommendation model, the first temporary model and the second temporary model can be trained to obtain a target recommendation model with the minimum training loss, that is, the model with the minimum training loss among the three models is determined as the target recommendation model. Both the labeled sample test data is fully utilized, and the learning of the content item recommendation model on the unlabeled sample training data is guided by the labeled sample test data, so that the false positive cases and the false negative cases in the training process of the content item recommendation model can be reduced. Thus, denoising is realized from two aspects of positive sample content items and negative sample content items, the accuracy of the recommended content items of the content item recommendation model is improved, and the robustness of the content item recommendation model is improved.

[0168] It should be noted that the training device of the content item recommendation model provided in the above embodiment is running an application program, and only the division of the above functional units is exemplified. In actual application, the above functions can be completed by different functional units according to needs, that is, the internal structure of the electronic device is divided into different functional units to complete all or part of the functions described above. In addition, the training device of the content item recommendation model and the training method of the content item recommendation model provided in the above embodiment belong to the same concept, and the specific implementation process is described in the method embodiment, which will not be described here.

[0169] As for the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment relating to the method, and will not be described in detail here.

[0170] Figure 8 is a block diagram of a content item recommendation device according to an example embodiment. Referring to Figure 8 The device includes an acquisition unit 801, a determination unit 802, and a recommendation unit 804.

[0171] The acquisition unit 801 is configured to acquire object features of a target object and content item features of a plurality of target content items.

[0172] The determination unit 802 is configured to determine, for any target content item, a recommendation probability of the target content item based on a content item recommendation model, the object features and the content item features of the target content item, the content item recommendation model being trained according to the training method of the content item recommendation model.

[0173] The recommendation unit 803 is configured to recommend at least one target content item to the target object based on the recommendation probability of the plurality of target content items.

[0174] The content item recommendation apparatus provided by the embodiments of the present disclosure can determine the recommendation probability of the plurality of target content items based on the content item recommendation model, the object feature of the target object, and the content item feature of the target content item, because the content item recommendation model is used to predict the probability of recommending the content item corresponding to the content item feature to the object corresponding to the object feature based on the input object feature and content item feature. Therefore, the target content item with high recommendation probability can be preferentially recommended to the target object based on the recommendation probability, the accuracy of the recommended content item of the content item recommendation model is improved, and the viewing experience of the target object is improved.

[0175] It should be noted that the content item recommendation apparatus provided by the above embodiments is running an application, and only the division of the above functional units is exemplified, and in actual application, the above functions can be completed by different functional units according to needs, that is, the internal structure of the electronic device is divided into different functional units to complete all or part of the above described functions. In addition, the content item recommendation apparatus and the content item recommendation method provided by the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be described here.

[0176] As for the apparatus in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments relating to the method, and will not be described in detail here.

[0177] When the electronic device is provided as a terminal, Figure 9 is a block diagram of a terminal 900 according to an example embodiment. The terminal Figure 9 A structural block diagram of a terminal 900 according to an example embodiment of the present disclosure is shown. The terminal 900 can be a smartphone, a tablet computer, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a notebook computer, or a desktop computer. The terminal 900 can also be referred to as a user equipment, a portable terminal, a laptop terminal, a desktop terminal, or other names.

[0178] Generally, the terminal 900 includes a processor 901 and a memory 902.

[0179] The processor 901 can include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 901 can be implemented in the form of at least one of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), a PLA (Programmable Logic Array), and the like. The processor 901 can also include a main processor and a co-processor. The main processor is a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit). The co-processor is a low-power consumption processor for processing data in a standby state. In some embodiments, the processor 901 can be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and drawing of content to be displayed on a display screen. In some embodiments, the processor 901 can further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.

[0180] The memory 902 can include one or more computer-readable storage media that can be non-transitory. The memory 902 can also include a high-speed random access memory, and a nonvolatile memory such as one or more disk storage devices, flash storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 902 is used to store at least one program code for being executed by the processor 901 to implement the content item recommendation model training method and the content item recommendation method provided by the method embodiments in the present disclosure.

[0181] In some embodiments, the terminal 900 can also optionally include a peripheral device interface 903 and at least one peripheral device. The processor 901, the memory 902, and the peripheral device interface 903 can be connected through a bus or a signal line. Each peripheral device can be connected to the peripheral device interface 903 through a bus, a signal line, or a circuit board. Specifically, the peripheral device includes at least one of a radio frequency circuit 904, a display screen 905, a camera component 906, an audio circuit 907, a positioning component 908, and a power supply 909.

[0182] The peripheral interface 903 can be used to connect at least one I / O (Input / Output) related peripheral device to the processor 901 and the memory 902. In some embodiments, the processor 901, the memory 902 and the peripheral interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 901, the memory 902 and the peripheral interface 903 can be implemented on a separate chip or circuit board, and the present embodiments are not limited in this regard.

[0183] The radio frequency circuit 904 is configured to receive and send RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 904 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency circuit 904 converts electrical signals to electromagnetic signals for transmission, or converts electromagnetic signals received to electrical signals. Optionally, the radio frequency circuit 904 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like. The radio frequency circuit 904 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to, a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 904 can also include NFC (Near Field Communication) related circuitry, and the present disclosure is not limited in this regard.

[0184] The display screen 905 is configured to display a UI (User Interface). The UI can include graphics, text, icons, video, and any combination thereof. When the display screen 905 is a touch display screen, the display screen 905 is further configured to capture touch signals on or above the surface of the display screen 905. The touch signals can be input to the processor 901 as control signals for processing. In this case, the display screen 905 can also be configured to provide virtual buttons and / or virtual keyboard, also known as soft buttons and / or soft keyboard. In some embodiments, the display screen 905 can be one, arranged on the front panel of the terminal 900; in other embodiments, the display screen 905 can be at least two, arranged on different surfaces of the terminal 900 or in a folding design; in still other embodiments, the display screen 905 can be a flexible display screen, arranged on a curved surface or a folding surface of the terminal 900. Even, the display screen 905 can also be arranged in an irregular shape other than a rectangle, i.e., a special-shaped screen. The display screen 905 can be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc.

[0185] The camera assembly 906 is configured to capture images or videos. Optionally, the camera assembly 906 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is arranged on the front panel of the terminal, and the rear-facing camera is arranged on the back of the terminal. In some embodiments, the rear-facing camera is at least two, which are any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, to realize the background blur function by fusing the main camera and the depth-of-field camera, the panoramic shooting and VR (Virtual Reality) shooting function by fusing the main camera and the wide-angle camera, or other fusion shooting functions. In some embodiments, the camera assembly 906 can further include a flash. The flash can be a single-color-temperature flash or a dual-color-temperature flash. The dual-color-temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation under different color temperatures.

[0186] The audio circuit 907 can include a microphone and a speaker. The microphone is used to collect sound waves of the user and the environment, and convert the sound waves into an electrical signal input to the processor 901 for processing, or input to the radio frequency circuit 904 to realize voice communication. For the purpose of stereo sound collection or noise reduction, the microphone can be multiple, respectively arranged at different parts of the terminal 900. The microphone can also be an array microphone or an omnidirectional collection type microphone. The speaker is used to convert the electrical signal from the processor 901 or the radio frequency circuit 904 into sound waves. The speaker can be a conventional diaphragm speaker, or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only can it convert electrical signals into sound waves that humans can hear, but it can also convert electrical signals into sound waves that humans cannot hear for ranging purposes. In some embodiments, the audio circuit 907 can also include a headphone jack.

[0187] The power supply 908 is used to supply power to various components in the terminal 900. The power supply 908 can be alternating current, direct current, disposable battery or rechargeable battery. When the power supply 908 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0188] In some embodiments, the terminal 900 also includes one or more sensors 909. The one or more sensors 909 include, but are not limited to, an acceleration sensor 910, a gyroscope sensor 911, a pressure sensor 912, an optical sensor 913, and a proximity sensor 914.

[0189] The acceleration sensor 910 can detect the acceleration in three coordinate axes of the coordinate system established by the terminal 900. For example, the acceleration sensor 910 can be used to detect the components of the gravitational acceleration in three coordinate axes. The processor 901 can control the display screen 905 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 910. The acceleration sensor 910 can also be used for game or user motion data collection.

[0190] The gyroscope sensor 911 can detect the body orientation and rotation angle of the terminal 900. The gyroscope sensor 911 can cooperate with the acceleration sensor 910 to collect 3D actions of the user on the terminal 900. The processor 901 can realize the following functions according to the data collected by the gyroscope sensor 911: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization when shooting, game control, and inertial navigation.

[0191] The pressure sensor 912 can be disposed on the side bezel of the terminal 900 and / or the lower layer of the display screen 905. When the pressure sensor 912 is disposed on the side bezel of the terminal 900, it can detect the user's grip signal on the terminal 900, and the processor 901 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 912. When the pressure sensor 912 is disposed on the lower layer of the display screen 905, the processor 901 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 905. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

[0192] An optical sensor 913 is used to collect ambient light intensity. In one embodiment, the processor 901 can control the display brightness of the display screen 905 based on the ambient light intensity collected by the optical sensor 913. Optionally, when the ambient light intensity is high, the display brightness of the display screen 905 is increased; when the ambient light intensity is low, the display brightness of the display screen 905 is decreased. In another embodiment, the processor 901 can also dynamically adjust the shooting parameters of the camera assembly 906 based on the ambient light intensity collected by the optical sensor 913.

[0193] The proximity sensor 914, also known as the distance sensor, is installed on the front panel of the terminal 900. The proximity sensor 914 is used to detect the distance between the user and the front of the terminal 900. In one embodiment, when the proximity sensor 914 detects that the distance between the user and the front of the terminal 900 is gradually decreasing, the processor 901 controls the display screen 905 to switch from a screen-on state to a screen-off state; when the proximity sensor 914 detects that the distance between the user and the front of the terminal 900 is gradually increasing, the processor 901 controls the display screen 905 to switch from a screen-off state to a screen-on state.

[0194] Those skilled in the art will understand that Figure 9 The structure shown does not constitute a limitation on terminal 900, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0195] When electronic devices are provided as servers, Figure 10is a block diagram of a server 1000 according to an exemplary embodiment, which can have great differences in configuration or performance, and can include one or more processors (Central Processing Units, CPUs) 1001 and one or more memories 1002, wherein the memory 1002 stores at least one program code, which is loaded and executed by the processor 1001 to implement the content item recommendation model training method and the content item recommendation method provided by each of the above-mentioned method embodiments. Of course, the server can also have a wired or wireless network interface, a keyboard, and an input and output interface, etc., so as to perform input and output, and the server 1000 can also include other components for realizing the functions of the device, which are not described herein.

[0196] In exemplary embodiments, a computer readable storage medium including instructions, such as the memory 902 or the memory 1002 including instructions, is also provided, which can be executed by the processor 901 of the terminal 900 or the processor 1001 of the server 1000 to complete the content item recommendation model training method and the content item recommendation method described above. Optionally, the computer readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0197] A computer program product including computer programs / instructions, which, when executed by a processor, implement the content item recommendation model training method and the content item recommendation method described above.

[0198] Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the features disclosed herein. The disclosure is intended to cover any variations, uses or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure that come within known

[0199] It should be understood that the present disclosure is not limited to the precise structures described above and shown in the drawings and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for training a content item recommendation model, the method comprising: The method comprises: unsupervised training, based on sample training data, of a content item recommendation model pre-trained based on labeled sample pre-training data, to obtain a reverse weighted loss of the sample training data, the sample training data comprising object features of a first sample object and content item features of a first sample content item, the content item recommendation model being configured to predict a probability that a content item corresponding to the content item features is recommended to an object corresponding to the object features based on input of the object features and the content item features, the reverse weighted loss being configured to determine predicted label information of the sample training data; the content item comprises a video, audio or an item; the object features comprise an object identifier and an object activity level; the content item features comprise a content item identifier, a content item publishing object identifier, a content item duration and a content item popularity; updating, based on a forward gradient and a reverse gradient of the reverse weighted loss, the content item recommendation model to obtain a first temporary model and a second temporary model; training, based on sample test data and label information of the sample test data, the content item recommendation model, the first temporary model and the second temporary model to obtain a target recommendation model, the sample test data comprising object features of a second sample object and content item features of a second sample content item, the label information of the sample test data being configured to indicate whether the second sample content item is a content item of interest to the second sample object, the sample test data and the sample pre-training data being from a same data set, and the target recommendation model being a model with a minimum training loss among the content item recommendation model, the first temporary model and the second temporary model. 2.The method of Claim 1, wherein, The unsupervised training, based on sample training data, of a content item recommendation model pre-trained based on labeled training data, to obtain a reverse weighted loss of the sample training data, comprises: unsupervised training, based on the sample training data, of the content item recommendation model pre-trained based on the labeled training data, to obtain a positive sample loss and a negative sample loss of the sample training data; determining, based on the positive sample loss and the negative sample loss, the reverse weighted loss of the sample training data. 3.The method of Claim 2, wherein, The determining, based on the positive sample loss and the negative sample loss, of the reverse weighted loss of the sample training data, comprises: determining, based on the positive sample loss and the negative sample loss, a normalization coefficient of the sample training data; determining, based on the normalization coefficient, the positive sample loss and the negative sample loss, a weight of the positive sample loss and a weight of the negative sample loss; weighting and summing, based on the weight of the positive sample loss and the weight of the negative sample loss, the positive sample loss and the negative sample loss to obtain the reverse weighted loss of the sample training data. 4.The method of Claim 1, wherein, The updating, based on a forward gradient and a reverse gradient of the reverse weighted loss, of the content item recommendation model to obtain a first temporary model and a second temporary model, comprises: updating model parameters of the content item recommendation model based on a forward gradient of the reverse weighted loss, to obtain the first temporary model; updating model parameters of the content item recommendation model based on a reverse gradient of the reverse weighted loss, to obtain the second temporary model. 5.The method of Claim 1, wherein, training the content item recommendation model, the first temporary model and the second temporary model based on the sample test data and label information of the sample test data, to obtain a target recommendation model, comprising: training the content item recommendation model, the first temporary model and the second temporary model based on the sample test data and label information of the sample test data, to obtain a training loss of the content item recommendation model, a training loss of the first temporary model and a training loss of the second temporary model; determining the model with the minimum training loss among the content item recommendation model, the first temporary model and the second temporary model as the target recommendation model. 6.The method of claim 1, wherein, Before the content item recommendation model pre-trained based on the labeled sample pre-training data is unsupervised trained based on the sample training data to obtain a reverse weighted loss of the sample training data, the method further comprises: pre-training the content item recommendation model based on the sample pre-training data and label information of the sample pre-training data, the sample pre-training data comprising object features of a third sample object and content item features of a third sample content item, and the label information of the sample pre-training data being used to indicate whether the third sample content item is a content item of interest to the third sample object. 7.The method of Claim 6, wherein, The pre-training of the content item recommendation model based on the sample pre-training data and label information of the sample pre-training data comprises: predicting the sample pre-training data based on the content item recommendation model to obtain prediction information of the sample pre-training data, the prediction information being used to indicate whether the third sample content item is a content item of interest to the third sample object; determining a pre-training loss of the content item recommendation model based on the label information and the prediction information; updating model parameters of the content item recommendation model based on the pre-training loss.

8. A content item recommendation method characterized by, The method comprises: obtaining object features of a target object and content item features of a plurality of target content items; for any target content item, determining a recommendation probability of the target content item based on a content item recommendation model, the object features and the content item features of the target content item, the content item recommendation model being trained according to the training method of the content item recommendation model of any one of claims 1-7; recommending at least one target content item to the target object based on the recommendation probabilities of the plurality of target content items.

9. A training device for a content item recommendation model, characterized in that, The device comprises: The first training unit is configured to perform unsupervised training on a content item recommendation model pre-trained based on labeled sample pre-training data based on sample training data to obtain a reverse weighted loss of the sample training data, the sample training data comprising object features of a first sample object and content item features of a first sample content item, the content item recommendation model being configured to predict a probability that a content item corresponding to the content item features is recommended to an object corresponding to the object features based on input of the object features and the content item features, and the reverse weighted loss being used to determine predicted label information of the sample training data; the content item comprises a video, audio or an item; the object features comprise an object identifier and an object activity level; and the content item features comprise a content item identifier, a content item publishing object identifier, a content item duration and a content item popularity. The updating unit is configured to update the content item recommendation model based on a forward gradient and a reverse gradient of the reverse weighted loss to obtain a first temporary model and a second temporary model. The second training unit is configured to train the content item recommendation model, the first temporary model and the second temporary model based on sample test data and label information of the sample test data to obtain a target recommendation model, the sample test data comprising object features of a second sample object and content item features of a second sample content item, the label information of the sample test data being used to indicate whether the second sample content item is a content item of interest to the second sample object, the sample test data and the sample pre-training data being from a same data set, and the target recommendation model being a model with a minimum training loss among the content item recommendation model, the first temporary model and the second temporary model.

10. A content item recommendation apparatus characterized by comprising: The apparatus comprises: An obtaining unit configured to obtain object features of a target object and content item features of a plurality of target content items; A determining unit configured to determine, for any target content item, a recommendation probability of the target content item based on a content item recommendation model, the object features and the content item features of the target content item, the content item recommendation model being trained according to the training method of the content item recommendation model of any one of claims 1-7; A recommending unit configured to recommend at least one target content item to the target object based on the recommendation probabilities of the plurality of target content items.

11. An electronic device, comprising: The electronic device comprises: One or more processors; A memory for storing program code executable by the processors; The processors are configured to execute the program code to implement the training method of the content item recommendation model of any one of claims 1-7 or the content item recommendation method of claim 8.

12. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processors of the electronic device, the electronic device is enabled to perform the training method of the content item recommendation model of any one of claims 1-7 or the content item recommendation method of claim 8.