Recommendation model training method, recommendation method, device and storage medium

By configuring differentiated weights for training samples with varying levels of user interaction, and adjusting the parameters of the recommendation model, the problem of insufficient feature learning for non-popular content caused by an overabundance of popular content in existing technologies is solved, resulting in more diverse recommendation results.

CN121456471APending Publication Date: 2026-02-03HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511604810.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-04
Publication Date
2026-02-03

AI Technical Summary

Technical Problem

Existing recommendation models focus too much on popular content during training, resulting in insufficient feature learning for non-popular content, leading to homogenized recommendation results and an unbalanced content ecosystem.

Method used

By configuring differentiated weight coefficients for training samples with varying levels of user interaction, the learning of training samples with low user interaction is enhanced, and the model parameters are adjusted to improve the recommendation rate for non-popular content.

Benefits of technology

It improves the diversity of recommendation models, increases the recommendation opportunities for less popular content, and enhances the diversity of recommendation results and the balance of the content ecosystem.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121456471A_ABST
    Figure CN121456471A_ABST
Patent Text Reader

Abstract

The invention provides a training method of a recommendation model, a recommendation method, equipment and a storage medium, in the training method part, differentiated weight coefficient configuration is carried out on training samples with different user interaction quantities, so that the user interaction quantity is improved; the learning degree of the recommendation model for a training sample with a low user interaction amount in a training process can be enhanced; in the recommendation method part, based on the target recommendation model obtained through training according to the training method, the trained target recommendation model can output more diversified recommendation results, and the problem that in the prior art, the recommendation rate of non-hot content is insufficient is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of games, in particular to a recommendation model training method, a recommendation method, a device and a storage medium. BACKGROUND

[0002] In the prior art, all training samples are indiscriminately processed, and the recommendation model is trained using the training samples processed indiscriminately. Since the user browsing volume of popular content is high, the number of training samples that can be collected by the popular content is more, so that the recommendation model pays more attention to the training samples of the popular content with a quantity advantage in the process of model training, thereby causing the recommendation model to lack feature learning of non-popular content with a small number of samples, so that the trained recommendation model is more inclined to recommend popular content to users in actual application, resulting in a decrease in the recommendation opportunity of non-popular content, and aggravating the singularity of the recommendation result and the imbalance of the content ecology. SUMMARY

[0003] Therefore, the present application provides a recommendation model training method, a recommendation method, a device and a storage medium, which are configured by differentiating the weight coefficients of training samples with different user interaction amounts, so as to strengthen the learning degree of the recommendation model for training samples with low user interaction in the training process, so that the trained target recommendation model can output more diverse recommendation results, effectively solving the problem of insufficient recommendation rate of non-popular content in the prior art.

[0004] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the following preferred embodiments are described in detail below, and the accompanying drawings are described as follows.

[0005] In a first aspect, the embodiments of the present application provide a recommendation model training method, which comprises: According to the historical interaction information corresponding to a plurality of to-be-recommended contents, determine the initial training sample corresponding to each to-be-recommended content; wherein the initial training sample comprises: the to-be-recommended content, the user portrait information corresponding to the user who has interacted with the to-be-recommended content, and the target ranking corresponding to the to-be-recommended content; According to the target ranking contained in the initial training sample, configure a weight coefficient matched with the target ranking for the initial training sample to obtain a target training sample corresponding to the initial training sample; wherein the weight coefficient and the target ranking are in an inverse relationship; inputting the target user portrait information of a target user into a target recommendation model, predicting, by the target recommendation model, an adaptation degree between the target user portrait information and a plurality of to-be-recommended contents, and outputting a content recommendation prediction result corresponding to the target user; wherein the target recommendation model is obtained by training according to any of the training methods described above; According to the weight coefficient corresponding to each target training sample and the prediction loss corresponding to each target training sample, a model loss is calculated, and a model parameter of the original recommendation model is adjusted according to the model loss to obtain a target recommendation model including an adjusted model parameter; wherein the prediction loss represents a loss between the prediction recommendation result corresponding to the target training sample and the to-be-recommended content corresponding to the target training sample.

[0006] In a second aspect, embodiments of the present application provide a recommendation method, which includes: inputting target user portrait information of a target user into a target recommendation model, predicting, by the target recommendation model, an adaptation degree between the target user portrait information and a plurality of to-be-recommended contents, and outputting a content recommendation prediction result corresponding to the target user; wherein the target recommendation model is obtained by training according to any of the training methods described above; From the content recommendation prediction result, at least one to-be-recommended content satisfying a preset recommendation condition in terms of the adaptation degree is determined as a target recommended content; pushing, to a terminal device corresponding to the target user, recommendation information about the target recommended content.

[0007] In a third aspect, embodiments of the present application provide a training device of a recommendation model, which includes: A determination module is configured to determine, according to historical interaction information corresponding to a plurality of to-be-recommended contents, an initial training sample corresponding to each to-be-recommended content; wherein the initial training sample includes the to-be-recommended content, user portrait information corresponding to a user who has interacted with the to-be-recommended content, and a target ranking corresponding to the to-be-recommended content; A configuration module is configured to configure, according to the target ranking included in the initial training sample, a weight coefficient matched with the target ranking for the initial training sample to obtain a target training sample corresponding to the initial training sample; wherein the weight coefficient and the target ranking are in an inverse relationship; A prediction module is configured to input the target training sample into an original recommendation model to output a prediction recommendation result corresponding to the target training sample; wherein the prediction recommendation result represents an adaptation degree between the plurality of to-be-recommended contents and the user portrait information included in the target training sample; The training module is configured to calculate a model loss according to the weight coefficient corresponding to each target training sample and a prediction loss corresponding to each target training sample, and adjust model parameters of the original recommendation model according to the model loss to obtain a target recommendation model including the adjusted model parameters; the prediction loss represents a loss between the prediction recommendation result corresponding to the target training sample and the to-be-recommended content corresponding to the target training sample.

[0008] In a fourth aspect, an embodiment of the present application provides a recommendation device, characterized in that the recommendation device comprises: The result prediction module is configured to input target user portrait information of a target user into a target recommendation model, predict an adaptation degree between the target user portrait information and a plurality of to-be-recommended contents by the target recommendation model, and output a content recommendation prediction result corresponding to the target user; the target recommendation model is obtained by training according to the training method in any one of claims 1 to 8. The result screening module is configured to determine at least one to-be-recommended content whose adaptation degree meets a preset recommendation condition as a target recommended content from the content recommendation prediction result. The recommendation module is configured to push recommendation information about the target recommended content to a terminal device corresponding to the target user.

[0009] In a fifth aspect, an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the training method of the recommendation model or the steps of the recommendation method when executing the computer program.

[0010] In a sixth aspect, an embodiment of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executable on a processor to execute the steps of the training method of the recommendation model or the steps of the recommendation method.

[0011] The technical solution provided by the embodiments of the present application can have the following beneficial effects: The training method, the recommendation method, the device, and the storage medium provided by the embodiments of the present application can have the following beneficial effects: in the training method part, the embodiments of the present application configure different weight coefficients for training samples with different user interaction amounts, which is beneficial to strengthening the learning degree of the recommendation model for training samples with low user interaction amounts in the training process; and in the recommendation method part, based on the target recommendation model trained according to the above training method, the embodiments of the present application enable the trained target recommendation model to output more diverse recommendation results, effectively solving the problem of insufficient recommendation rate for non-popular content in the prior art. Attached Figure Description

[0012] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 A flowchart illustrating a training method for a recommendation model provided in an embodiment of this application is shown. Figure 2 This illustration shows a flowchart of a method for dynamically adjusting the weight coefficients of initial training samples whose recommendation performance has declined, according to an embodiment of this application. Figure 3 This illustration shows a flowchart of another method for dynamically adjusting the weight coefficients of initial training samples whose recommendation performance has declined, as provided in an embodiment of this application. Figure 4 This application illustrates a method for transfer learning of an original recommendation model, as provided in an embodiment of the present application. Figure 5 A flowchart illustrating a recommended method provided in an embodiment of this application is shown; Figure 6 This illustration shows a schematic diagram of the structure of a training device for a recommendation model provided in an embodiment of this application; Figure 7 A schematic diagram of the structure of a recommended device provided in an embodiment of this application is shown; Figure 8 This is a schematic diagram of the structure of an electronic device 800 provided in an embodiment of this application. Detailed Implementation

[0014] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0015] In addition, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0016] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.

[0017] In the prior art, all training samples are indiscriminately processed, and the training samples after indiscriminate processing are used for model training of the recommendation model; wherein, due to the higher user browsing volume of popular content, the number of training samples that can be collected by the popular content is more, thereby causing the recommendation model to pay more attention to the training samples of the popular content with a quantity advantage in the process of model training, and further causing the recommendation model to have insufficient feature learning for the non-popular content with less sample quantity, so that the trained recommendation model will be more inclined to recommend popular content to users in actual application, resulting in reduced recommendation opportunities for non-popular content, and aggravating the singularity of the recommendation result and the imbalance of the content ecology.

[0018] Based on this, the embodiments of the present application provide a training method of a recommendation model, a recommendation method, a device and a storage medium. In the training method part, the embodiments of the present application are advantageous to strengthen the learning degree of the recommendation model for the training samples with low user interaction in the training process by differentiating the weight coefficient configuration of the training samples with different user interaction amounts; and in the recommendation method part, based on the target recommendation model trained according to the above training method, the embodiments of the present application enable the trained target recommendation model to output more diverse recommendation results, effectively solving the problem of insufficient recommendation rate for non-popular content in the prior art.

[0019] In one of the embodiments of the present application, the training method and the recommendation method of the recommendation model can run on a terminal device or a server. Wherein, the terminal device can be a local terminal device. When the training method and the recommendation method of the recommendation model run on the server, the training method and the recommendation method of the recommendation model can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device (i.e. a terminal device).

[0020] To facilitate the understanding of the embodiments of the present application, a method for training a recommendation model, a recommendation method, a device and a storage medium provided by the embodiments of the present application are described in detail below.

[0021] Referring to Figure 1 , as shown in the drawings, Figure 1 A flowchart of a method for training a recommendation model provided by the embodiments of the present application is shown, wherein the training method comprises steps S101-S104; specifically: S101, according to the historical interaction information corresponding to each of the plurality of to-be-recommended contents, determining the initial training sample corresponding to each to-be-recommended content.

[0022] S102, according to the target ranking contained in the initial training sample, configuring a weight coefficient matching the target ranking for the initial training sample, obtaining a target training sample corresponding to the initial training sample.

[0023] S103, inputting the target training sample into the original recommendation model, and outputting the predicted recommendation result corresponding to the target training sample.

[0024] S104, according to the weight coefficient corresponding to each of the target training samples and the predicted loss corresponding to each of the target training samples, calculating a model loss, and adjusting the model parameters of the original recommendation model according to the model loss, to obtain a target recommendation model including adjusted model parameters.

[0025] Based on the above-mentioned training method of the recommendation model provided by the embodiments of the present application, the embodiments of the present application configure different weight coefficients for training samples with different user interaction amounts, which is beneficial to strengthen the learning degree of the recommendation model for training samples with low user interaction amount in the training process.

[0026] The steps of the above-mentioned training method of the recommendation model provided by the embodiments of the present application are described below respectively: S101, according to the historical interaction information corresponding to each of the plurality of to-be-recommended contents, determining the initial training sample corresponding to each to-be-recommended content.

[0027] Here, the plurality of to-be-recommended contents can be a plurality of music works in a music playing platform, a plurality of video works in a video playing platform, a plurality of goods in a shopping platform or a plurality of virtual props in a game platform, etc.; wherein the specific content category and the specific quantity of the plurality of to-be-recommended contents are not limited by the embodiments of the present application.

[0028] Specifically, each piece of content to be recommended corresponds to a set of historical interaction information, which includes: user profile information corresponding to users who have interacted with the content to be recommended; wherein, the aforementioned interaction behavior includes but is not limited to: browsing behavior, purchasing behavior, liking behavior, etc.; the aforementioned user profile information includes but is not limited to: basic user information (user name, user age, gender, etc.) and user preference information (such as the user's areas of interest, the content type of the content to be recommended that the user interacts with most frequently, etc.).

[0029] It should be noted that a piece of content to be recommended may have interacted with multiple different users (e.g., a video may have been viewed by multiple different users), and a user may also have interacted with multiple different pieces of content to be recommended (e.g., a user may also view multiple different videos). Therefore, a piece of content to be recommended may correspond to one initial training sample or multiple initial training samples. The specific number of initial training samples corresponding to each piece of content to be recommended is not limited in this embodiment.

[0030] Here, an initial training sample may include: a piece of content to be recommended (i.e., the content to be recommended corresponding to the initial training sample), user profile information corresponding to a user (i.e., a user who has interacted with the content to be recommended), and a target ranking corresponding to the content to be recommended; wherein, the target ranking represents the ranking of the number of users contained in the historical interaction information corresponding to the recommended content among multiple pieces of content to be recommended; that is, since an initial training sample corresponds to one piece of content to be recommended and also to one user who has interacted with the content to be recommended, the above-mentioned target ranking is also equivalent to a ranking used to measure the number of initial training samples corresponding to each piece of content to be recommended among all multiple pieces of content to be recommended.

[0031] Specifically, as an optional embodiment, the target ranking for each piece of content to be recommended can be determined according to the method shown in steps a1-a3 below: Step a1: Based on the historical interaction information corresponding to the multiple recommended contents, determine the index value of at least one popularity index corresponding to each of the multiple recommended contents.

[0032] Here, the popularity metric can be determined based on the specific interaction behaviors between users and the content to be recommended in the aforementioned historical interaction information; for example, the popularity metric can be the number of views of the content to be recommended, the number of purchases of the content to be recommended, or the number of likes of the content to be recommended, etc.

[0033] Step a2: Determine the popularity of each of the multiple recommended contents based on the index value of at least one popularity index corresponding to each of the multiple recommended contents.

[0034] Here, when the number of indicators of the hotness indicator is one, for each to-be-recommended content, the indicator value of the hotness indicator corresponding to the to-be-recommended content can be directly taken as the hotness corresponding to the to-be-recommended content.

[0035] Here, when the number of indicators of the hotness indicator is multiple, for each to-be-recommended content, the weighted sum result can be taken as the hotness corresponding to the to-be-recommended content by weighting and summing according to the preset weight coefficient corresponding to each hotness indicator and the indicator value of each hotness indicator corresponding to the to-be-recommended content.

[0036] Step a3, according to the hotness corresponding to each of the plurality of to-be-recommended contents, the plurality of to-be-recommended contents are sorted to obtain the hotness ranking corresponding to each of the plurality of to-be-recommended contents, and the hotness ranking corresponding to each of the to-be-recommended contents is taken as the target ranking corresponding to each of the to-be-recommended contents.

[0037] Here, the target ranking is used to measure the initial training sample quantity possessed by a to-be-recommended content relative to other to-be-recommended contents, and the higher the hotness of a to-be-recommended content, the more initial training samples it corresponds to (equivalent to the to-be-recommended content with high hotness can collect more initial training samples because the number of users who have generated interaction behaviors is large). Therefore, as an optional embodiment, the plurality of to-be-recommended contents can be sorted according to the hotness from high to low according to the hotness corresponding to each to-be-recommended content, and the hotness ranking corresponding to each to-be-recommended content is taken as the target ranking corresponding to the to-be-recommended content. That is, when the hotness ranking is taken as the target ranking, the higher the target ranking of a to-be-recommended content, the higher the hotness of the to-be-recommended content, and the more initial training samples the to-be-recommended content corresponds to.

[0038] Specifically, as another optional embodiment, the target ranking corresponding to each to-be-recommended content can also be determined by the method shown in steps b1-b3 as follows: Step b1, determining the content publishing time corresponding to each of the plurality of to-be-recommended contents according to the historical interaction information corresponding to each of the plurality of to-be-recommended contents.

[0039] For example, taking the plurality of to-be-recommended contents as music works on a music playing platform, the online time corresponding to each music work is the content publishing time of the music work.

[0040] Step b2, determining the freshness corresponding to each of the plurality of to-be-recommended contents according to the content publishing time corresponding to each of the plurality of to-be-recommended contents.

[0041] Here, as an optional embodiment, the content publishing time of each to-be-recommended content can be directly used to represent the freshness corresponding to each to-be-recommended content; the earlier the content publishing time, the higher the freshness of the to-be-recommended content.

[0042] Here, as another optional embodiment, the target time period to which the content publishing time of each to-be-recommended content belongs can be determined first according to a plurality of preset time periods, and then the freshness of a plurality of to-be-recommended contents corresponding to the target time period is uniformly configured as the freshness corresponding to the target time period; for example, a plurality of to-be-recommended contents whose content publishing time is within one week from the current time are taken as a group, and the freshness corresponding to the one-week time period is configured as the freshness of the above plurality of to-be-recommended contents; a plurality of to-be-recommended contents whose content publishing time is between one week and one month from the current time are taken as a group, and the freshness corresponding to the one-week-to-one-month time period is configured as the freshness of the above plurality of to-be-recommended contents.

[0043] Step b3, according to the freshness corresponding to each of the plurality of to-be-recommended contents, the plurality of to-be-recommended contents are sorted, the freshness ranking corresponding to each of the plurality of to-be-recommended contents is obtained, and the freshness ranking corresponding to each of the to-be-recommended content is taken as the target ranking corresponding to each of the to-be-recommended content.

[0044] Here, the target ranking is used to measure the number of initial training samples possessed by a to-be-recommended content relative to other to-be-recommended contents, and the higher the freshness, the fewer the number of initial training samples corresponding to the to-be-recommended content (equivalent to the to-be-recommended content with high freshness, because the content publishing time is earlier, the number of users interacting with it is less, and the number of initial training samples that can be collected is also relatively less), therefore, as an optional embodiment, according to the freshness corresponding to each to-be-recommended content, the plurality of to-be-recommended contents are sorted in order of freshness from low to high, and the freshness inverse ranking (i.e. ranking in order of freshness from low to high) corresponding to each to-be-recommended content is taken as the target ranking corresponding to the to-be-recommended content; that is, when the freshness inverse ranking is taken as the target ranking, the earlier the target ranking of a to-be-recommended content, the lower the freshness of the to-be-recommended content, and the more the number of initial training samples corresponding to the to-be-recommended content.

[0045] S102, according to the target ranking contained in the initial training sample, the initial training sample is configured with a weight coefficient matched with the target ranking, and a target training sample corresponding to the initial training sample is obtained.

[0046] It should be noted that the weight coefficient is inversely related to the target ranking; that is, for a to-be-recommended content, the more initial training samples corresponding to the to-be-recommended content (i.e., the higher the target ranking), the smaller the weight coefficient configured for the initial training samples corresponding to the to-be-recommended content.

[0047] Here, the specific configuration method of the weight coefficient is not unique; as an optional embodiment, a fixed weight coefficient matching the target ranking of each initial training sample can be assigned from a plurality of pre-set fixed weight coefficients according to the method described in steps c1-c2, specifically as follows: Step c1, according to the target ranking contained in the initial training sample, determine the target ranking interval containing the target ranking from the plurality of pre-set ranking intervals.

[0048] For example, if the target ranking belongs to the hotness ranking, the plurality of pre-set ranking intervals can include: a first ranking interval where the hotness ranking is in the top 10,000, a second ranking interval where the hotness ranking is between 10,000 and 50,000, a third ranking interval where the hotness ranking is between 50,000 and 100,000, and a fourth ranking interval where the hotness ranking is after 100,000; wherein if the hotness ranking (i.e., the target ranking) of a to-be-recommended content a in an initial training sample A is in the top 10,000, the target ranking interval can be determined as the first ranking interval.

[0049] Step c2, configure the pre-set weight coefficient corresponding to the target ranking interval as the weight coefficient corresponding to the initial training sample.

[0050] It should be noted that in order to increase the diversity of the recommendation results output by the subsequent recommendation model, for example, when configuring a pre-set weight coefficient for each ranking interval, a smaller pre-set weight coefficient can be configured for a hotness ranking interval with higher hotness to reduce the interference of to-be-recommended content with high hotness on the recommendation results output by the model, and to avoid the recommendation model recommending to-be-recommended content with high hotness to a large number of users.

[0051] For example, still taking the plurality of pre-set ranking intervals as the first ranking interval to the fourth ranking interval as an example, if the pre-set weight coefficient corresponding to the first ranking interval is 0.8, the pre-set weight coefficient corresponding to the second ranking interval is 1, the pre-set weight coefficient corresponding to the third ranking interval is 1.2, and the pre-set weight coefficient corresponding to the fourth ranking interval is 1.5, when the target ranking corresponding to an initial training sample is in the first ranking interval (i.e., the target ranking interval is the first ranking interval), the weight coefficient of the initial training sample can be configured as the pre-set weight coefficient 0.8 corresponding to the first ranking interval.

[0052] Here, as another optional embodiment, the corresponding weight coefficient of the initial training sample in each ranking interval can also be dynamically adjusted based on the proportion of the number of initial training samples in the different ranking intervals in the total number of initial training samples according to the method described in steps d1-d3, and specifically: Step d1, according to the target ranking contained in the initial training sample, determine the target ranking interval containing the target ranking from the preset multiple ranking intervals.

[0053] Here, the specific implementation of step d1 can refer to the specific implementation of the foregoing step c1, and the repeated parts will not be described here.

[0054] Step d2, according to the target proportion of the initial training samples contained in the target ranking interval in the total initial training samples, determine a target deviation matched with the target proportion.

[0055] Here, the smaller the target proportion is, the fewer the number of initial training samples contained in the target ranking interval is, and the fewer the interaction behaviors between the initial training samples in the target ranking interval and the user are. Therefore, in order to improve the recommendation model to pay more attention to these relatively niche recommended contents during the model training process, a smaller target proportion can be matched with a larger target deviation.

[0056] Specifically, the target deviation can be a function value of an inverse proportional function of the above-mentioned target proportion, so that the smaller the target proportion is, the larger the target deviation calculated is.

[0057] Step d3, according to the target deviation and the preset basic weight coefficient, determine the weight coefficient configured for the initial training sample.

[0058] Here, the basic weight coefficient can be set to 1, at this time, when the weight coefficient of an initial training sample is configured to 1 (i.e. the basic weight coefficient), it means that the recommendation model will remain neutral to the initial training sample during the model training process, neither focusing on the initial training sample (equivalent to not increasing the contribution of the initial training sample to the model loss), nor deliberately ignoring the initial training sample (equivalent to not reducing the contribution of the initial training sample to the model loss).

[0059] Exemplary, when the target deviation is a function value of an inverse proportional function of the above-mentioned target proportion, for an initial training sample, the above-mentioned calculated target deviation and the preset basic weight coefficient can be multiplied to obtain an operation result as the weight coefficient of the initial training sample.

[0060] S103, inputting the target training sample into the original recommendation model to output a predicted recommendation result corresponding to the target training sample.

[0061] Here, the original recommendation model can be a DNN (Deep Neural Network) model, a model variant of a CNN (Convolutional Neural Network) model in a recommendation scenario, a recommendation model based on a GNN (Graph Neural Network), etc. The specific model structure of the original recommendation model is not limited in the embodiments of the present application.

[0062] Specifically, for each target training sample with a configured weight coefficient, after inputting the target training sample into the original recommendation model, the original recommendation model will predict the fitting degree between each to-be-recommended content and the user portrait information of the user contained in the target training sample (which is equivalent to predicting the probability that each to-be-recommended content meets the user preference of the user) from the plurality of to-be-recommended contents, thereby outputting a predicted recommendation result corresponding to the target training sample (i.e., the predicted recommendation result represents the fitting degree between the plurality of to-be-recommended contents and the user portrait information contained in the target training sample).

[0063] S104, calculating a model loss according to the weight coefficient corresponding to each target training sample and the predicted loss corresponding to each target training sample, and adjusting the model parameters of the original recommendation model according to the model loss to obtain a target recommendation model including adjusted model parameters.

[0064] Here, for each target training sample, the to-be-recommended content corresponding to the target training sample is the to-be-recommended content that the user corresponding to the user portrait information has actually interacted with in the past (which is equivalent to the to-be-recommended content being the content that has been successfully recommended to the user in the past), so the predicted loss can represent the loss between the predicted recommendation result corresponding to the target training sample and the to-be-recommended content corresponding to the target training sample.

[0065] Specifically, when calculating the model loss, the predicted loss corresponding to each target training sample (which is equivalent to the contribution of each target training sample in the calculation of the model loss) can be weighted according to the weight coefficient corresponding to each target training sample, so as to calculate the model loss by means of weighted calculation. The specific loss function used when calculating the model loss can be a cross-entropy loss function or other loss functions suitable for calculating multi-classification prediction loss. The specific function type of the loss function is not limited in the embodiments of the present application.

[0066] In the model training process of the original recommendation model, as an optional embodiment, the recommendation effect of each to-be-recommended content can also be monitored regularly, so that when the recommendation effect of a to-be-recommended content monitored is found to have decreased significantly, the weight coefficient of the to-be-recommended content monitored can be adjusted, thereby ensuring the improvement of the attention of the original recommendation model to the niche to-be-recommended content (i.e., the to-be-recommended content with a small number of users generating interaction behaviors) while guaranteeing the recommendation experience of the user.

[0067] In an optional implementation, Figure 2 A flowchart of a method for dynamically adjusting the weight coefficient of an initial training sample with a decreased recommendation effect is shown, as shown in Figure 2 The method includes steps S201-S204, specifically: S201, according to at least one preset recommendation effect evaluation index, determining the evaluation index value of the recommendation effect evaluation index corresponding to each to-be-recommended content from the real-time monitoring data corresponding to the to-be-recommended content.

[0068] Here, the recommendation effect evaluation index includes but is not limited to: like rate, browsing rate, purchase rate, etc.; wherein the recommendation effect evaluation index can be one or multiple, and the specific index type and the specific index number of the above-mentioned recommendation effect evaluation index are not limited by the embodiments of the present application.

[0069] S202, determining the to-be-recommended content with a decrease amplitude of the evaluation index value greater than or equal to a preset amplitude as a to-be-adjusted recommendation content from the plurality of to-be-recommended contents.

[0070] Here, for each to-be-recommended content, the historical evaluation index value of the recommendation effect evaluation index of the to-be-recommended content can be determined from the historical interaction information of the to-be-recommended content, and the current evaluation index value (i.e., the evaluation index value in step S202) of the recommendation effect evaluation index of the to-be-recommended content can be determined from the real-time monitoring data corresponding to the to-be-recommended content, so that for the same recommendation effect evaluation index, only by comparing the current evaluation index value with the historical evaluation index value, the decrease of the evaluation index value of the recommendation effect evaluation index of a to-be-recommended content and the specific decrease amplitude can be determined.

[0071] S203, for the initial training sample corresponding to the to-be-adjusted recommendation content, adjusting the weight coefficient currently configured for the initial training sample to approach the preset basic weight coefficient, to obtain the adjusted weight coefficient.

[0072] Here, the base weight coefficient can be set as 1, at this time, the base weight coefficient indicates that the recommendation model will remain neutral to the initial training sample configured with the base weight coefficient in the model training process, neither focusing on the initial training sample (equivalent to not increasing the contribution of the initial training sample to the model loss) nor deliberately ignoring the initial training sample (equivalent to not reducing the contribution of the initial training sample to the model loss).

[0073] Based on this, for the above-mentioned to-be-adjusted recommendation content whose recommendation effect has decreased obviously, the weight coefficient of the initial training sample corresponding to the to-be-adjusted recommendation content can be adjusted towards the direction of approaching the base weight coefficient (i.e., taking the base weight coefficient as the target) to reduce the deviation of the weight coefficient of the initial training sample from the base weight coefficient, so as to ensure the improvement of the attention of the original recommendation model to the niche to-be-recommended content (i.e., the to-be-recommended content with a small number of users generating interaction behaviors) while guaranteeing the recommendation experience of the user.

[0074] S204, updating the weight coefficient configured by the initial training sample to the callback weight coefficient.

[0075] Here, after updating the weight coefficient configured by the initial training sample to the callback weight coefficient, the initial training sample with the updated weight coefficient can be used as a target training sample input into the original recommendation model, and then steps S103-S104 are repeatedly executed to continue model training of the original recommendation model.

[0076] In another optional implementation, Figure 3 Another flowchart of a method for dynamically adjusting the weight coefficient of an initial training sample with a decreased recommendation effect is shown, as shown in Figure 3 The method includes steps S301-S305, specifically: S301, determining a target ranking interval containing the target ranking from a plurality of preset ranking intervals according to the target ranking contained in the initial training sample.

[0077] Here, the specific implementation of step S301 can refer to the specific implementation of the aforementioned step c1, and the repeated parts will not be described here.

[0078] S302, determining the evaluation index value of the recommendation effect evaluation index corresponding to each of the plurality of to-be-recommended contents from the real-time monitoring data corresponding to each of the plurality of to-be-recommended contents according to the at least one preset recommendation effect evaluation index.

[0079] Here, the specific implementation of step S302 can be referred to the specific implementation of step S201 mentioned above, and the repeated parts will not be repeated here.

[0080] S303, determine the number of recommended content items whose evaluation index values ​​have decreased from multiple recommended content items belonging to the target ranking range.

[0081] Here, for each ranking interval containing multiple recommended content items, the number of recommended content items whose recommendation effect has decreased (i.e., the evaluation index value has decreased) in each ranking interval can be determined separately.

[0082] S304, when the number of contents is greater than or equal to a preset number threshold, for the initial training samples contained in the target ranking interval, with the goal of approaching the preset basic weight coefficient, the weight coefficient currently configured for the initial training sample is called back to obtain the weight coefficient after the callback.

[0083] Here, when there are a large number of recommended content items whose recommendation effect has decreased (i.e., the evaluation index value has decreased) within a ranking interval (i.e., the number of content items is greater than or equal to a preset number threshold), as an optional embodiment, all the initial training samples included in the ranking interval can be determined as the initial training samples whose weight coefficients need to be adjusted.

[0084] For details on how to adjust the weighting coefficients, please refer to the relevant content in S203 above. Repeated points will not be repeated here.

[0085] S305, update the weight coefficients configured for the initial training sample to the weight coefficients after the callback.

[0086] Here, the specific implementation of step S305 can be referred to the specific implementation of step S204 above, and the repeated parts will not be repeated here.

[0087] It should be noted that, in addition to determining whether to revert the weight coefficients of the initial training samples by real-time monitoring of the recommendation effect of each piece of content to be recommended, as another optional embodiment, A / B testing can be used. The recommendation results output by the trained target recommendation model and those output by the recommendation model trained using existing technology are pushed to different user groups respectively. The like rate, view rate, and purchase conversion rate of the two user groups are compared and analyzed. Based on the comparative analysis results, if it is determined that the recommendation experience provided to users by the recommendation results output by the trained target recommendation model is unsatisfactory, the weight coefficients of the initial training samples can be reverted according to the methods shown in steps S201-S204 or S301-S305 above.

[0088] In the embodiments of the present application, before the model training of the original recommendation model, the transfer learning can also be used to assist the original recommendation model to learn more feature representations about the niche recommended content (i.e., the recommended content with a small number of users generating interaction behaviors) before formally starting the model training.

[0089] In an optional implementation, Figure 4 A method for transfer learning of an original recommendation model is shown, and the method comprises steps S401-S403, and specifically: Figure 4 As shown, the method comprises steps S401-S403, and specifically: S401, according to the historical interaction information corresponding to a plurality of recommended contents respectively, determining, from the plurality of recommended contents, the recommended content with a number of users contained in the historical interaction information less than or equal to a preset user number threshold as a target recommended content.

[0090] Here, the target recommended content is equivalent to the niche recommended content (i.e., the recommended content with a small number of users generating interaction behaviors).

[0091] S402, pre-training the original model according to the pre-training data set containing the target recommended content to obtain a pre-trained original model.

[0092] Here, the training samples containing the target recommended content can be collected according to the sample form of the initial training sample to obtain the pre-training data set.

[0093] It should be noted that the purpose of pre-training here is mainly to enable the pre-trained original model to learn more feature representations about the target recommended content, and therefore, the original model can be the original recommendation model itself or other types of different models; the embodiments of the present application do not make any limitation in this regard.

[0094] S403, updating the original model parameters in the original recommendation model according to the model parameters of the pre-trained original model.

[0095] Specifically, migrating the model parameters of the pre-trained original model to the original recommendation model before formal training is equivalent to updating the original model parameters of the original recommendation model; then the original recommendation model is trained according to the training method shown in steps S101-S104, so that the original recommendation model can continue to adjust the model parameters based on the model loss on the basis of the updated original model parameters until the original recommendation model converges.

[0096] Based on the training method of the recommendation model provided in the embodiments of the present application, the present application configures different weight coefficients for training samples with different user interaction amounts, which is conducive to enhancing the learning degree of the recommendation model for training samples with low user interaction amounts in the training process.

[0097] In the embodiments of the present application, after obtaining the trained target recommendation model, the specific application method of the target recommendation model in the recommendation scene is as follows: In an optional implementation, Figure 5 A flowchart of a recommendation method provided in the embodiments of the present application is shown, as shown in Figure 5 The recommendation method includes steps S501-S503, specifically: S501, input the target user portrait information of a target user into the target recommendation model, predict the adaptation degree between the target user portrait information and a plurality of to-be-recommended contents through the target recommendation model, and output the content recommendation prediction result corresponding to the target user.

[0098] It should be noted that the target recommendation model is obtained after being trained according to the training method of steps S101-S104; the specific training process of the target recommendation model can refer to the specific implementation process of the foregoing steps, and the repeated parts will not be described here.

[0099] S502, determine at least one to-be-recommended content that meets the preset recommendation condition from the content recommendation prediction result as the target recommended content according to the adaptation degree.

[0100] Here, the preset recommendation condition can be that the adaptation degree is higher than the preset adaptation degree threshold, or the adaptation degree ranking is before the preset ranking, and the embodiments of the present application do not limit the specific condition setting mode of the preset recommendation condition.

[0101] S503, push the recommendation information about the target recommended content to the terminal device corresponding to the target user.

[0102] Here, the recommendation information of the target recommended content can be pushed to the target user for viewing.

[0103] Based on the above-mentioned recommendation method provided in the embodiments of the present application, based on the target recommendation model trained according to the above-mentioned training method, the present application enables the trained target recommendation model to output more diverse recommendation results, effectively solving the problem of insufficient recommendation rate for non-popular content in the prior art.

[0104] Based on the same inventive concept, the application further provides a training device corresponding to the training method of the recommendation model, since the training device in the embodiments of the application solves the problem in the same principle as the training method of the recommendation model in the embodiments of the application, and therefore the implementation of the training device can be referred to the implementation of the training method, and the repeated parts will not be described here.

[0105] With reference to Figure 6 as shown in the drawings, Figure 6 The structure of a training device of a recommendation model provided by the embodiments of the application is shown, wherein the training device comprises: A determination module 601 is configured to determine an initial training sample corresponding to each of the to-be-recommended contents according to historical interaction information corresponding to each of the to-be-recommended contents; wherein the initial training sample comprises the to-be-recommended content, user portrait information corresponding to a user who has interacted with the to-be-recommended content, and a target ranking corresponding to the to-be-recommended content. A configuration module 602 is configured to configure a weight coefficient matching the target ranking for the initial training sample according to the target ranking contained in the initial training sample, to obtain a target training sample corresponding to the initial training sample; wherein the weight coefficient and the target ranking are in an inverse relationship. A prediction module 603 is configured to input the target training sample into an original recommendation model, and output a predicted recommendation result corresponding to the target training sample; wherein the predicted recommendation result represents the degree of adaptation between each of the to-be-recommended contents and the user portrait information contained in the target training sample. A training module 604 is configured to calculate a model loss according to the weight coefficient corresponding to each of the target training samples and a prediction loss corresponding to each of the target training samples, and adjust model parameters of the original recommendation model according to the model loss, to obtain a target recommendation model comprising adjusted model parameters; wherein the prediction loss represents a loss between the predicted recommendation result corresponding to the target training sample and the to-be-recommended content corresponding to the target training sample.

[0106] In an optional implementation, the determination module 601 is configured to determine the target ranking corresponding to the to-be-recommended content by the following method: determine an index value of at least one heat index corresponding to each of the to-be-recommended contents according to historical interaction information corresponding to each of the to-be-recommended contents; determine the heat of each of the to-be-recommended contents according to the index value of at least one heat index corresponding to each of the to-be-recommended contents. rank the plurality of to-be-recommended contents according to the hotness corresponding to each of the plurality of to-be-recommended contents, to obtain a hotness ranking corresponding to each of the plurality of to-be-recommended contents, and take the hotness ranking corresponding to each of the to-be-recommended contents as the target ranking corresponding to each of the to-be-recommended contents.

[0107] In an optional implementation, the determining module 601 is configured to determine the target ranking corresponding to the to-be-recommended content by the following method: determine the content publishing time corresponding to each of the plurality of to-be-recommended contents according to the historical interaction information corresponding to each of the plurality of to-be-recommended contents; determine the freshness corresponding to each of the plurality of to-be-recommended contents according to the content publishing time corresponding to each of the plurality of to-be-recommended contents; rank the plurality of to-be-recommended contents according to the freshness corresponding to each of the plurality of to-be-recommended contents, to obtain a freshness ranking corresponding to each of the plurality of to-be-recommended contents, and take the freshness ranking corresponding to each of the to-be-recommended contents as the target ranking corresponding to each of the to-be-recommended contents.

[0108] In an optional implementation, when the weight coefficient matching the target ranking is configured for the initial training sample according to the target ranking contained in the initial training sample, the configuring module 602 is configured to: determine a target ranking interval containing the target ranking from a plurality of preset ranking intervals according to the target ranking contained in the initial training sample; configure a preset weight coefficient corresponding to the target ranking interval as the weight coefficient corresponding to the initial training sample.

[0109] In an optional implementation, when the weight coefficient matching the target ranking is configured for the initial training sample according to the target ranking contained in the initial training sample, the configuring module 602 is further configured to: determine a target ranking interval containing the target ranking from a plurality of preset ranking intervals according to the target ranking contained in the initial training sample; determine a target bias matching a target proportion of initial training samples contained in the target ranking interval in all initial training samples according to the target proportion; determine the weight coefficient configured for the initial training sample according to the target bias and a preset basic weight coefficient.

[0110] In an optional implementation, the training apparatus further includes a first callback module, where the first callback module is configured to: determine, according to the preset at least one recommendation effect evaluation index, an evaluation index value of the recommendation effect evaluation index corresponding to each of the plurality of to-be-recommended contents from real-time monitoring data corresponding to each of the plurality of to-be-recommended contents; determine, from the plurality of to-be-recommended contents, to-be-recommended contents with a decrease in the evaluation index value greater than or equal to a preset amplitude as to-be-adjusted recommended contents; perform a callback on the weight coefficient currently configured for the initial training sample corresponding to the to-be-adjusted recommended content, to obtain a callback weight coefficient, the callback being performed with the goal of approaching a preset base weight coefficient; update the weight coefficient configured for the initial training sample to the callback weight coefficient.

[0111] In an optional implementation, the training apparatus further includes a second callback module, where the second callback module is configured to: determine, from a plurality of ranking intervals, a target ranking interval containing the target ranking according to the target ranking contained in the initial training sample; determine, according to the preset at least one recommendation effect evaluation index, an evaluation index value of the recommendation effect evaluation index corresponding to each of the plurality of to-be-recommended contents from real-time monitoring data corresponding to each of the plurality of to-be-recommended contents; determine, from the plurality of to-be-recommended contents belonging to the target ranking interval, a content quantity of to-be-recommended contents with a decrease in the evaluation index value; when the content quantity is greater than or equal to a preset quantity threshold, perform a callback on the weight coefficient currently configured for an initial training sample contained in the target ranking interval, to obtain a callback weight coefficient, the callback being performed with the goal of approaching a preset base weight coefficient; update the weight coefficient configured for the initial training sample to the callback weight coefficient.

[0112] In an optional implementation, the training apparatus further includes a transfer learning module, where the transfer learning module is configured to: determine, from the plurality of to-be-recommended contents, to-be-recommended contents with a user quantity contained in historical interaction information of the to-be-recommended contents less than or equal to a preset user quantity threshold as target to-be-recommended contents according to the historical interaction information corresponding to each of the plurality of to-be-recommended contents; perform pre-training on an original model according to a pre-training data set containing the target to-be-recommended content, to obtain a pre-trained original model; update an original model parameter in the original recommendation model according to a model parameter of the pre-trained original model.

[0113] Based on the training device of the recommendation model provided in the embodiments of the present application, the present application configures different weight coefficients for training samples with different user interaction amounts, which is beneficial to enhancing the learning degree of the recommendation model for training samples with low user interaction amounts in the training process.

[0114] Based on the same inventive concept, the present application also provides a recommendation device corresponding to the above-mentioned recommendation method. Since the principle of solving problems of the recommendation device in the embodiments of the present application is similar to the above-mentioned recommendation method in the embodiments of the present application, the implementation of the recommendation device can be referred to the implementation of the above-mentioned recommendation method, and the repeated parts will not be described herein.

[0115] Referring to Figure 7 , a structure schematic diagram of a recommendation device provided by the embodiments of the present application is shown, wherein the recommendation device comprises: Figure 7 The structure schematic diagram of the recommendation device is shown in FIG. 7. As shown in FIG. 7, the recommendation device comprises: A result prediction module 701 is configured to input target user portrait information of a target user into a target recommendation model, predict an adaptation degree between the target user portrait information and a plurality of to-be-recommended contents by the target recommendation model, and output a content recommendation prediction result corresponding to the target user; wherein the target recommendation model is obtained after being trained according to any of the above-mentioned training methods. A result screening module 702 is configured to determine at least one to-be-recommended content with an adaptation degree satisfying a preset recommendation condition as a target recommended content from the content recommendation prediction result. A recommendation module 703 is configured to push recommendation information about the target recommended content to a terminal device corresponding to the target user.

[0116] Based on the above-mentioned recommendation device provided by the embodiments of the present application and based on the target recommendation model trained according to the above-mentioned training method, the present application enables the trained target recommendation model to output more diverse recommendation results, effectively solving the problem of insufficient recommendation rate for non-popular content in the prior art.

[0117] Based on the same inventive concept, the present application also provides an electronic device corresponding to the above-mentioned recommendation model training method and the above-mentioned recommendation method. Since the principle of solving problems of the electronic device in the embodiments of the present application is similar to the above-mentioned recommendation model training method and the above-mentioned recommendation method in the embodiments of the present application, the implementation of the electronic device can be referred to the implementation of the above-mentioned recommendation model training method and the above-mentioned recommendation method, and the repeated parts will not be described herein.

[0118] Figure 8A structural schematic diagram of an electronic device 800 provided in an embodiment of the present application includes a processor 801, a memory 802, and a bus 803. The memory 802 stores machine readable instructions executable by the processor 1101. When the electronic device runs a training method of a recommendation model and a recommendation method as in an embodiment, the processor 801 communicates with the memory 802 through the bus 803. The processor 801 executes the machine readable instructions, wherein when the processor 801 executes the machine readable instructions in running the training method of the recommendation model, the following steps are implemented, specifically: According to historical interaction information corresponding to a plurality of to-be-recommended contents, an initial training sample corresponding to each to-be-recommended content is determined. The initial training sample includes the to-be-recommended content, user portrait information corresponding to a user who has interacted with the to-be-recommended content, and a target ranking corresponding to the to-be-recommended content. According to the target ranking contained in the initial training sample, a weight coefficient matching the target ranking is configured for the initial training sample to obtain a target training sample corresponding to the initial training sample. The weight coefficient and the target ranking are in an inverse relationship. The target training sample is input into an original recommendation model to output a predicted recommendation result corresponding to the target training sample. The predicted recommendation result represents the adaptation degree between the plurality of to-be-recommended contents and the user portrait information contained in the target training sample. According to the weight coefficient corresponding to each target training sample and the prediction loss corresponding to each target training sample, a model loss is calculated, and the model parameters of the original recommendation model are adjusted according to the model loss to obtain a target recommendation model including adjusted model parameters. The prediction loss represents the loss between the predicted recommendation result corresponding to the target training sample and the to-be-recommended content corresponding to the target training sample.

[0119] In an optional implementation, the processor 801 is configured to determine the target ranking corresponding to the to-be-recommended content by the following method: According to historical interaction information corresponding to a plurality of to-be-recommended contents, an index value of at least one heat index corresponding to each to-be-recommended content is determined. According to the index value of at least one heat index corresponding to each to-be-recommended content, a heat corresponding to each to-be-recommended content is determined. According to the heat corresponding to each to-be-recommended content, the plurality of to-be-recommended contents are sorted to obtain a heat ranking corresponding to each to-be-recommended content, and the heat ranking corresponding to each to-be-recommended content is taken as the target ranking corresponding to each to-be-recommended content.

[0120] In an optional implementation, the processor 801 is configured to determine the target ranking corresponding to each of the to-be-recommended contents by the following method: determining content publishing times corresponding to the to-be-recommended contents respectively according to historical interaction information corresponding to the to-be-recommended contents respectively; determining freshness corresponding to the to-be-recommended contents respectively according to the content publishing times corresponding to the to-be-recommended contents respectively; ranking the to-be-recommended contents according to the freshness corresponding to the to-be-recommended contents respectively to obtain freshness rankings corresponding to the to-be-recommended contents respectively, and taking the freshness ranking corresponding to each of the to-be-recommended contents as the target ranking corresponding to each of the to-be-recommended contents.

[0121] In an optional implementation, when the processor 801 is configured to configure the weight coefficient matching the target ranking for the initial training sample according to the target ranking contained in the initial training sample, the processor 801 is configured to: determine a target ranking interval containing the target ranking from a plurality of preset ranking intervals according to the target ranking contained in the initial training sample; configure a preset weight coefficient corresponding to the target ranking interval as the weight coefficient corresponding to the initial training sample.

[0122] In an optional implementation, when the processor 801 is configured to configure the weight coefficient matching the target ranking for the initial training sample according to the target ranking contained in the initial training sample, the processor 801 is further configured to: determine a target ranking interval containing the target ranking from a plurality of preset ranking intervals according to the target ranking contained in the initial training sample; determine a target bias matching a target proportion of initial training samples contained in the target ranking interval in all initial training samples according to the target proportion; determine the weight coefficient configured for the initial training sample according to the target bias and a preset basic weight coefficient.

[0123] In an optional implementation, the processor 801 is further configured to: determine evaluation index values of at least one recommendation effect evaluation index corresponding to the to-be-recommended contents respectively from real-time monitoring data corresponding to the to-be-recommended contents respectively according to the at least one recommendation effect evaluation index; determine, from the to-be-recommended contents, to-be-adjusted contents with a decrease amplitude of the evaluation index values greater than or equal to a preset amplitude as the to-be-adjusted contents. According to the initial training sample corresponding to the to-be-adjusted recommended content, the weight coefficient currently configured for the initial training sample is adjusted to approach a preset basic weight coefficient, to obtain an adjusted weight coefficient; The weight coefficient configured for the initial training sample is updated to the adjusted weight coefficient.

[0124] In an optional implementation, the processor 801 is further configured to: According to the target ranking included in the initial training sample, a target ranking interval containing the target ranking is determined from a plurality of preset ranking intervals; According to at least one preset recommendation effect evaluation index, an evaluation index value of the recommendation effect evaluation index corresponding to each of the plurality of to-be-recommended contents is determined from real-time monitoring data corresponding to each of the plurality of to-be-recommended contents; From the plurality of to-be-recommended contents belonging to the target ranking interval, a content quantity of to-be-recommended contents in which the evaluation index value decreases is determined; When the content quantity is greater than or equal to a preset quantity threshold, for an initial training sample included in the target ranking interval, the weight coefficient currently configured for the initial training sample is adjusted to approach a preset basic weight coefficient, to obtain an adjusted weight coefficient; The weight coefficient configured for the initial training sample is updated to the adjusted weight coefficient.

[0125] In an optional implementation, the processor 801 is further configured to: According to historical interaction information corresponding to a plurality of to-be-recommended contents, to-be-recommended contents in which a user quantity included in the historical interaction information is less than or equal to a preset user quantity threshold are determined as target to-be-recommended contents from the plurality of to-be-recommended contents; According to a pre-training data set containing the target to-be-recommended content, an original model is pre-trained to obtain a pre-trained original model; According to model parameters of the pre-trained original model, original model parameters in the original recommendation model are updated.

[0126] In the running of the above recommendation method, the processor 801 implements the following steps when executing the machine readable instructions, in particular: Target user portrait information of a target user is input into a target recommendation model, and the target recommendation model is used to predict an adaptation degree between the target user portrait information and a plurality of to-be-recommended contents, to output a content recommendation prediction result corresponding to the target user; wherein the target recommendation model is obtained by training according to any of the above training methods; From the content recommendation prediction result, at least one to-be-recommended content satisfying a preset recommendation condition in the adaptation degree is determined as a target recommended content; Recommendation information about the target recommended content is pushed to a terminal device corresponding to the target user.

[0127] Through the above electronic device provided by the embodiments of the present application, in the training method part, the present application configures different weight coefficients for training samples with different user interaction amounts, which is conducive to strengthening the learning degree of the recommendation model for training samples with low user interaction amount in the training process; and in the recommendation method part, based on the target recommendation model trained according to the above training method, the present application enables the trained target recommendation model to output more diverse recommendation results, effectively solving the problem of insufficient recommendation rate for non-popular content in the prior art.

[0128] Based on the same inventive concept, the embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the computer program is run by a processor to execute, wherein when the training method of the above recommendation model is run, the processor executes the following steps: According to historical interaction information corresponding to a plurality of to-be-recommended contents, an initial training sample corresponding to each to-be-recommended content is determined; wherein the initial training sample includes: the to-be-recommended content, user portrait information corresponding to a user who has interacted with the to-be-recommended content, and a target ranking corresponding to the to-be-recommended content; According to the target ranking contained in the initial training sample, a weight coefficient matched with the target ranking is configured for the initial training sample, to obtain a target training sample corresponding to the initial training sample; wherein the weight coefficient and the target ranking are in an inverse relationship; The target training sample is input into an original recommendation model, and a prediction recommendation result corresponding to the target training sample is output; wherein the prediction recommendation result represents an adaptation degree between the plurality of to-be-recommended contents and the user portrait information contained in the target training sample; According to the weight coefficient corresponding to each target training sample and the prediction loss corresponding to each target training sample, a model loss is calculated, and according to the model loss, a model parameter of the original recommendation model is adjusted to obtain a target recommendation model including the adjusted model parameter; wherein the prediction loss represents a loss between the prediction recommendation result corresponding to the target training sample and the to-be-recommended content corresponding to the target training sample.

[0129] In an optional embodiment, the processor is configured to determine the target ranking corresponding to the to-be-recommended content by the following method: determine, according to the historical interaction information corresponding to the plurality of to-be-recommended contents respectively, an index value of at least one hotness index corresponding to the plurality of to-be-recommended contents respectively; determine, according to the index value of the at least one hotness index corresponding to the plurality of to-be-recommended contents respectively, a hotness corresponding to the plurality of to-be-recommended contents respectively; sort the plurality of to-be-recommended contents according to the hotness corresponding to the plurality of to-be-recommended contents respectively, to obtain a hotness ranking corresponding to the plurality of to-be-recommended contents respectively, and take the hotness ranking corresponding to each to-be-recommended content as the target ranking corresponding to each to-be-recommended content.

[0130] In an optional implementation, the processor is configured to determine the target ranking corresponding to the to-be-recommended content by the following method: determine, according to the historical interaction information corresponding to the plurality of to-be-recommended contents respectively, a content publishing time corresponding to the plurality of to-be-recommended contents respectively; determine, according to the content publishing time corresponding to the plurality of to-be-recommended contents respectively, a freshness corresponding to the plurality of to-be-recommended contents respectively; sort the plurality of to-be-recommended contents according to the freshness corresponding to the plurality of to-be-recommended contents respectively, to obtain a freshness ranking corresponding to the plurality of to-be-recommended contents respectively, and take the freshness ranking corresponding to each to-be-recommended content as the target ranking corresponding to each to-be-recommended content.

[0131] In an optional implementation, when the processor is configured to configure the weight coefficient matching the target ranking for the initial training sample according to the target ranking contained in the initial training sample, the processor is configured to: determine, according to the target ranking contained in the initial training sample, a target ranking interval containing the target ranking from a plurality of preset ranking intervals; configure a preset weight coefficient corresponding to the target ranking interval as the weight coefficient corresponding to the initial training sample.

[0132] In an optional implementation, when the processor is configured to configure the weight coefficient matching the target ranking for the initial training sample according to the target ranking contained in the initial training sample, the processor is further configured to: determine, according to the target ranking contained in the initial training sample, a target ranking interval containing the target ranking from a plurality of preset ranking intervals; determine a target bias matching a target proportion of initial training samples contained in the target ranking interval in all initial training samples according to the target proportion. According to the target bias and a preset basic weight coefficient, the weight coefficient configured for the initial training sample is determined.

[0133] In an optional implementation, the processor is further configured to: According to at least one preset recommendation effect evaluation index, an evaluation index value of the recommendation effect evaluation index corresponding to each of the plurality of to-be-recommended contents is determined from real-time monitoring data corresponding to each of the plurality of to-be-recommended contents. From the plurality of to-be-recommended contents, a to-be-recommended content whose evaluation index value has a decline amplitude greater than or equal to a preset amplitude is determined as a to-be-adjusted recommended content. For an initial training sample corresponding to the to-be-adjusted recommended content, the weight coefficient currently configured for the initial training sample is adjusted to approach a preset basic weight coefficient, to obtain an adjusted weight coefficient. The weight coefficient configured for the initial training sample is updated to the adjusted weight coefficient.

[0134] In an optional implementation, the processor is further configured to: According to the target ranking contained in the initial training sample, a target ranking interval containing the target ranking is determined from a plurality of preset ranking intervals. According to at least one preset recommendation effect evaluation index, an evaluation index value of the recommendation effect evaluation index corresponding to each of the plurality of to-be-recommended contents is determined from real-time monitoring data corresponding to each of the plurality of to-be-recommended contents. From the plurality of to-be-recommended contents belonging to the target ranking interval, a content quantity of a to-be-recommended content whose evaluation index value has declined is determined. When the content quantity is greater than or equal to a preset quantity threshold, for an initial training sample contained in the target ranking interval, the weight coefficient currently configured for the initial training sample is adjusted to approach a preset basic weight coefficient, to obtain an adjusted weight coefficient. The weight coefficient configured for the initial training sample is updated to the adjusted weight coefficient.

[0135] In an optional implementation, the processor is further configured to: According to historical interaction information corresponding to a plurality of to-be-recommended contents, from the plurality of to-be-recommended contents, a to-be-recommended content whose user quantity contained in the historical interaction information is less than or equal to a preset user quantity threshold is determined as a target to-be-recommended content. According to a pre-training data set containing the target to-be-recommended content, an original model is pre-trained to obtain a pre-trained original model. According to the model parameters of the pre-trained original model, the original model parameters in the original recommendation model are updated.

[0136] In the running of the above recommendation method, the processor implements the following steps when executing the machine readable instructions, in particular: The target user portrait information of the target user is input into the target recommendation model, and the fitting degree between the target user portrait information and the plurality of to-be-recommended contents is predicted by the target recommendation model to output a content recommendation prediction result corresponding to the target user; wherein the target recommendation model is obtained after training according to the training method of any of the above. From the content recommendation prediction result, at least one to-be-recommended content whose fitting degree meets the preset recommendation condition is determined as a target recommended content; The target user corresponding terminal device is pushed to the target recommended content recommendation information.

[0137] Through the above computer readable storage medium provided by the embodiments of the present application, in the training method part, the present application configures different weight coefficients for training samples with different user interaction amounts, which is beneficial to strengthen the learning degree of the recommendation model for training samples with low user interaction amount in the training process; and in the recommendation method part, based on the target recommendation model trained according to the above training method, the present application makes the trained target recommendation model can output more diverse recommendation results, effectively solving the problem of insufficient recommendation rate for non-popular content in the prior art.

[0138] In the embodiments of the present application, the computer readable storage medium can also execute other machine readable instructions when run by the processor, to execute the training method or recommendation method of the recommendation model as described in other embodiments. For specific steps and principles of the training method or recommendation method of the recommendation model, refer to the description of the method side embodiments, which will not be repeated here.

[0139] In the embodiments provided by the present application, it should be understood that the disclosed system and method can be implemented in other ways. The system embodiments described above are only schematic. For example, the division of units is only a logical function division, and there can be another division way in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, and electrical, mechanical or other forms.

[0140] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, i.e. may be located in one place, or may be distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0141] In addition, the functional units in the embodiments provided in the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.

[0142] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products, and the computer software products are stored in a storage medium, including a plurality of instructions for making a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, and various media that can store program codes.

[0143] It should be noted that: similar reference numbers and letters represent similar items in the following drawings, therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings, in addition, the terms "first", "second", "third" and the like are only used to distinguish description, and cannot be understood as indicating or implying relative importance.

[0144] Finally, it should be noted that: the above-described embodiments are only specific embodiments of the present application, used to illustrate the technical solutions of the present application, and not to limit them, the protection scope of the present application is not limited thereto, although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any skilled person familiar with the technical field can modify or easily think of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed by the present application, or make equivalent replacement to part of the technical features; and these modifications, changes or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. All should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for training a recommendation model, characterized in that, The training method includes: Based on the historical interaction information corresponding to multiple pieces of content to be recommended, an initial training sample is determined for each piece of content to be recommended; wherein, the initial training sample includes: the content to be recommended, user profile information corresponding to users who have interacted with the content to be recommended, and the target ranking corresponding to the recommended content; Based on the target ranking contained in the initial training samples, weight coefficients matching the target ranking are configured for the initial training samples to obtain the target training samples corresponding to the initial training samples; wherein, the weight coefficients are inversely related to the target ranking. The target training sample is input into the original recommendation model, and the predicted recommendation result corresponding to the target training sample is output; wherein, the predicted recommendation result represents the degree of fit between the multiple items to be recommended and the user profile information contained in the target training sample; The model loss is calculated based on the weight coefficients and prediction loss corresponding to each target training sample. The model parameters of the original recommendation model are then adjusted based on the model loss to obtain a target recommendation model including the adjusted model parameters. The prediction loss represents the loss between the predicted recommendation result corresponding to the target training sample and the content to be recommended corresponding to the target training sample.

2. The training method according to claim 1, characterized in that, The method for determining the target ranking corresponding to the content to be recommended includes: Based on the historical interaction information corresponding to the multiple recommended contents, determine the index value of at least one popularity index corresponding to each of the multiple recommended contents; The popularity of each of the multiple recommended contents is determined based on the index value of at least one popularity index corresponding to each of the multiple recommended contents. Based on the popularity of each of the multiple pieces of content to be recommended, the multiple pieces of content to be recommended are sorted to obtain the popularity ranking of each of the multiple pieces of content to be recommended, and the popularity ranking of each piece of content to be recommended is used as the target ranking of each piece of content to be recommended.

3. The training method according to claim 1, characterized in that, The step of configuring weight coefficients for the initial training samples that match the target ranking based on the target ranking contained in the initial training samples includes: Based on the target ranking contained in the initial training samples, a target ranking interval containing the target ranking is determined from a set of multiple preset ranking intervals; Configure the preset weight coefficient corresponding to the target ranking interval as the weight coefficient corresponding to the initial training sample.

4. The training method according to claim 1, characterized in that, The step of configuring weight coefficients matching the target ranking for the initial training samples based on the target ranking contained in the initial training samples further includes: Based on the target ranking contained in the initial training samples, a target ranking interval containing the target ranking is determined from a set of multiple preset ranking intervals; Based on the target proportion of the initial training samples included in the target ranking interval in all initial training samples, determine the target deviation that matches the target proportion. The weight coefficients configured for the initial training samples are determined based on the target deviation and the preset basic weight coefficients.

5. The training method according to claim 1, characterized in that, The training method further includes: Based on at least one preset recommendation effect evaluation index, the evaluation index value of the recommendation effect evaluation index corresponding to each of the plurality of recommended contents is determined from the real-time monitoring data corresponding to each of the plurality of recommended contents. From the plurality of recommended content, the recommended content whose evaluation index value decreases by a greater than or equal to a preset range is determined as the recommended content to be adjusted. For the initial training sample corresponding to the recommended content to be adjusted, with the goal of approaching the preset basic weight coefficient, the weight coefficient currently configured for the initial training sample is called back to obtain the weight coefficient after the callback. The weight coefficients configured for the initial training sample are updated to the weight coefficients after the callback.

6. The training method according to claim 1, characterized in that, The training method further includes: Based on the target ranking contained in the initial training samples, a target ranking interval containing the target ranking is determined from a set of multiple preset ranking intervals; Based on at least one preset recommendation effect evaluation index, the evaluation index value of the recommendation effect evaluation index corresponding to each of the plurality of recommended contents is determined from the real-time monitoring data corresponding to each of the plurality of recommended contents. From a pool of recommended content belonging to the target ranking range, determine the number of recommended content items whose evaluation index values ​​have decreased. When the number of contents is greater than or equal to a preset number threshold, for the initial training samples contained in the target ranking interval, with the goal of approaching the preset basic weight coefficient, the weight coefficient currently configured for the initial training sample is called back to obtain the weight coefficient after the callback. The weight coefficients configured for the initial training sample are updated to the weight coefficients after the callback.

7. The training method according to claim 1, characterized in that, Before inputting the target training samples into the original recommendation model, the training method further includes: Based on the historical interaction information corresponding to multiple pieces of content to be recommended, the content to be recommended from the multiple pieces of content to be recommended that contains a number of users less than or equal to a preset number of users is determined as the target content to be recommended. Based on the pre-training dataset containing the target content to be recommended, the original model is pre-trained to obtain the pre-trained original model. The original model parameters in the original recommendation model are updated based on the model parameters of the pre-trained original model.

8. A recommendation method, characterized in that, The recommendation method includes: The target user profile information of the target user is input into the target recommendation model. The target recommendation model predicts the degree of fit between the target user profile information and multiple content to be recommended, and outputs the content recommendation prediction result corresponding to the target user. The target recommendation model is obtained by training according to any one of the training methods described in claims 1 to 8. From the content recommendation prediction results, at least one piece of content to be recommended that meets the preset recommendation conditions is determined as the target recommended content; Recommendation information about the target recommended content is pushed to the terminal device corresponding to the target user.

9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions that the processor executes. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps of the training method of the recommendation model as described in any one of claims 1 to 7 or the steps of the recommendation method as described in claim 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the training method for the recommendation model as described in any one of claims 1 to 7, or the steps of the recommendation method as described in claim 8.