A training method of a recommendation model, a recommendation method, a device, and a storage medium

CN121456471BActive Publication Date: 2026-10-16HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511604810.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-04
Publication Date
2026-10-16
Estimated Expiration
2045-11-04

AI Technical Summary

Technical Problem

[0002]在现有技术中,会无差别的处理所有的训练样本,并使用无差别处理后的训练样本对推荐模型进行模型训练;其中,由于热门内容的用户浏览量较高,使得热门内容能够采集到的训练样本数量更多,从而导致推荐模型在模型训练的过程中会更多地关注于具有数量优势的热门内容的训练样本,进而造成推荐模型对于样本数量较少的非热门内容的特征学习不足,使得训练好的推荐模型在实际应用中会更倾向于向用户推荐热门内容,导致非热门内容能够获得的推荐机会降低,加剧了推荐结果的单一性和内容生态的不平衡

Benefits of technology

本申请实施例提供的一种推荐模型的训练方法、推荐方法、设备及存储介质,在训练方法部分,本申请通过对用户交互量不同的训练样本进行差异化的权重系数配置,有利于强化推荐模型在训练过程中对于低用户交互量的训练样本的学习程度;而在推荐方法部分,基于按照上述训练方法训练得到的目标推荐模型,本申请使得训练好的目标推荐模型可以输出更为多样性的推荐结果,有效地解决了现有技术中对于非热门内容的推荐率不足的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121456471B_ABST
    Figure CN121456471B_ABST
Patent Text Reader

Abstract

The application provides a training method of a recommendation model, a recommendation method, equipment and a storage medium. In the training method part, the application configures different weight coefficients for training samples with different user interaction amounts, which helps to strengthen the learning degree of the recommendation model for the training samples with low user interaction amounts in the training process. In the recommendation method part, based on the target recommendation model trained according to the above training method, the 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.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of game technology, and more specifically, to a training method, recommendation method, device, and storage medium for a recommendation model. Background Technology

[0002] In existing technologies, all training samples are processed indiscriminately and used to train recommendation models. Since popular content receives more user views, a larger number of training samples are collected from it. This causes the recommendation model to focus more on the numerically superior training samples of popular content during training, resulting in insufficient feature learning for less popular content with fewer samples. Consequently, the trained recommendation model tends to recommend popular content to users in practical applications, reducing the recommendation opportunities for less popular content and exacerbating the uniformity of recommendation results and the imbalance of the content ecosystem. Summary of the Invention

[0003] In view of this, this application provides a training method, recommendation method, device, and storage medium for a recommendation model. By configuring differentiated weight coefficients for training samples with different user interaction volumes, it is beneficial to enhance the learning degree of the recommendation model on training samples with low user interaction volumes during the training process. This allows 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.

[0004] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings.

[0005] Firstly, embodiments of this application provide a method for training a recommendation model, the training method comprising: 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.

[0006] Secondly, embodiments of this application provide a recommendation method, the recommendation method comprising: 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 of the training methods described above. 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.

[0007] Thirdly, embodiments of this application provide a training apparatus for a recommendation model, the training apparatus comprising: The determination module is used to determine the initial training sample corresponding to each of the multiple content to be recommended based on the historical interaction information corresponding to each 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; A configuration module is configured to configure a weight coefficient matching the target ranking for the initial training sample based on the target ranking contained in the initial training sample, thereby obtaining a target training sample corresponding to the initial training sample; wherein the weight coefficient is inversely related to the target ranking; The prediction module is used to input the target training sample into the original recommendation model and output the predicted recommendation result corresponding to the target training sample; 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 training module is used to calculate the model loss based on the weight coefficients corresponding to each target training sample and the prediction loss corresponding to each target training sample, and to adjust the model parameters of the original recommendation model based on the model loss to obtain a target recommendation model including the adjusted model parameters; wherein, 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.

[0008] Fourthly, embodiments of this application provide a recommendation device, characterized in that the recommendation device comprises: The result prediction module is used to input the target user profile information of the target user into the target recommendation model, predict the degree of fit between the target user profile information and multiple content to be recommended through the target recommendation model, and output the content recommendation prediction result corresponding to the target user; wherein, the target recommendation model is obtained after training according to any one of the training methods described in claims 1 to 8; The result filtering module is used to determine, from the content recommendation prediction results, at least one content to be recommended that meets the preset recommendation conditions as the target recommended content. The recommendation module is used to push recommendation information about the target recommended content to the terminal device corresponding to the target user.

[0009] Fifthly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the training method for the recommendation model described above or the steps of the recommendation method described above.

[0010] Sixthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the training method for the recommendation model or the steps of the recommendation method described above.

[0011] The technical solutions provided by the embodiments of this application may include the following beneficial effects: This application provides a training method, recommendation method, device, and storage medium for a recommendation model. In the training method, this application uses differentiated weight coefficient configurations for training samples with different user interaction volumes, which helps to enhance the learning degree of the recommendation model for training samples with low user interaction volumes during the training process. In the recommendation method, based on the target recommendation model trained according to the above training method, this 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. 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] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

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

[0017] In existing technologies, all training samples are processed indiscriminately and used to train recommendation models. Since popular content receives more user views, a larger number of training samples are collected from it. This causes the recommendation model to focus more on the numerically superior training samples of popular content during training, resulting in insufficient feature learning for less popular content with fewer samples. Consequently, the trained recommendation model tends to recommend popular content to users in practical applications, reducing the recommendation opportunities for less popular content and exacerbating the uniformity of recommendation results and the imbalance of the content ecosystem.

[0018] Based on this, embodiments of this application provide a training method, a recommendation method, a device, and a storage medium for a recommendation model. In the training method, this application configures differentiated weight coefficients for training samples with different user interaction volumes, which helps to enhance the learning degree of the recommendation model for training samples with low user interaction volumes during the training process. In the recommendation method, based on the target recommendation model trained according to the above training method, this 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.

[0019] In one embodiment of this application, a training method and a recommendation method for a recommendation model can run on a terminal device or a server. The terminal device can be a local terminal device. When the training method and recommendation method of the recommendation model run on a server, they can be implemented and executed based on a cloud interaction system, which includes a server and client devices (i.e., terminal devices).

[0020] To facilitate understanding of the embodiments of this application, the following provides a detailed description of a training method, recommendation method, device, and storage medium for a recommendation model provided in the embodiments of this application.

[0021] Reference Figure 1 As shown, Figure 1 The diagram illustrates a flowchart of a training method for a recommendation model provided in an embodiment of this application, wherein the training method includes steps S101-S104; specifically: S101, Based on the historical interaction information corresponding to multiple content to be recommended, determine the initial training samples corresponding to each content to be recommended.

[0022] S102, Based on the target ranking contained in the initial training sample, configure a weight coefficient matching the target ranking for the initial training sample to obtain the target training sample corresponding to the initial training sample.

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

[0024] S104. Based on the weight coefficients corresponding to each target training sample and the prediction loss corresponding to each target training sample, the 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 the adjusted model parameters.

[0025] Based on the training method of the recommendation model provided in the embodiments of this application, this application configures differentiated weight coefficients for training samples with different user interaction volumes, which is beneficial to enhance the learning degree of the recommendation model for training samples with low user interaction volumes during the training process.

[0026] The following is an exemplary description of each step in the training method of the recommendation model provided in the embodiments of this application: S101, Based on the historical interaction information corresponding to multiple content to be recommended, determine the initial training samples corresponding to each content to be recommended.

[0027] Here, the multiple pieces of content to be recommended can be multiple musical works on a music playback platform, multiple video works on a video playback platform, multiple products on a shopping platform, or multiple virtual items on a game platform, etc.; however, the specific types and quantities of the multiple pieces of content to be recommended are not limited in this embodiment.

[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 there is only one popularity metric, for each piece of content to be recommended, the value of the popularity metric corresponding to that content can be directly used as the popularity of that content.

[0035] Here, when there are multiple popularity metrics, for each piece of content to be recommended, the popularity of the content can be determined by weighted summation based on the preset weight coefficients corresponding to each popularity metric and the metric values ​​of each popularity metric corresponding to the content to be recommended.

[0036] Step a3: Sort the multiple recommended content items according to their respective popularity to obtain the popularity ranking of the multiple recommended content items, and use the popularity ranking of each recommended content item as the target ranking of each recommended content item.

[0037] Here, the target ranking is used to measure the number of initial training samples a piece of content to be recommended has relative to other content to be recommended. The higher the popularity of the content to be recommended, the more initial training samples it has (meaning that the more popular the content to be recommended, the more users have interacted with it, and therefore the more initial training samples it can collect). Therefore, as an optional embodiment, multiple content to be recommended can be sorted according to the popularity of each content to be recommended, in descending order of popularity, to obtain the popularity ranking of each content to be recommended as the target ranking of that content to be recommended. That is, when using the popularity ranking as the target ranking, the higher the target ranking of a content to be recommended, the higher its popularity, and the more initial training samples it has.

[0038] Specifically, as another optional embodiment, the target ranking corresponding to each piece of content to be recommended can also be determined according to the method shown in steps b1-b3 below: Step b1: Determine the publication time of each of the multiple recommended content items based on their respective historical interaction information.

[0039] For example, if the content to be recommended is music on a music streaming platform, the online time of each music piece is the content release time of that music piece.

[0040] Step b2: Determine the freshness of each of the multiple recommended contents based on their respective publication times.

[0041] Here, as an optional embodiment, the publication time of each piece of content to be recommended can be used to represent the freshness of each piece of content to be recommended; wherein, the earlier the publication time, the higher the freshness of the content to be recommended.

[0042] Here, as another optional embodiment, it is also possible to first determine the target time period to which the content publication time of each piece of content to be recommended belongs based on multiple preset time periods, and then uniformly configure the freshness of multiple pieces of content to be recommended within the target time period to the freshness corresponding to the target time period; for example, multiple pieces of content to be recommended whose content publication time is within one week from the current time are grouped together, and the freshness corresponding to the one-week time period is configured as the freshness of the above-mentioned multiple pieces of content to be recommended; multiple pieces of content to be recommended whose content publication time is between one week and one month from the current time are grouped together, and the freshness corresponding to the one-week to one-month time period is configured as the freshness of the above-mentioned multiple pieces of content to be recommended.

[0043] Step b3: Sort the multiple recommended contents according to their respective freshness to obtain the freshness ranking of each of the multiple recommended contents, and use the freshness ranking of each of the recommended contents as the target ranking of each of the recommended contents.

[0044] Here, the target ranking is used to measure the number of initial training samples a piece of content to be recommended has relative to other content to be recommended. Content with higher freshness corresponds to fewer initial training samples (meaning that fresher content has been published earlier, resulting in fewer users interacting with it and thus fewer initial training samples). Therefore, as an optional implementation, multiple pieces of content to be recommended can be sorted according to their freshness from low to high to obtain a reverse freshness ranking (i.e., a ranking from low to high freshness) as the target ranking for that content. In other words, when using the reverse freshness ranking as the target ranking, a higher target ranking for a piece of content indicates lower freshness, or a larger number of initial training samples.

[0045] S102, Based on the target ranking contained in the initial training sample, configure a weight coefficient matching the target ranking for the initial training sample to obtain the target training sample corresponding to the initial training sample.

[0046] It should be noted that the weighting coefficients mentioned above are inversely related to the target rankings mentioned above; that is, for a piece of content to be recommended, the more initial training samples the content to be recommended has (i.e., the higher the target ranking), the smaller the weighting coefficients of the initial training samples corresponding to the content to be recommended.

[0047] Here, the specific configuration method of the weight coefficients is not unique; as an optional embodiment, the method described in steps c1-c2 below can be used to assign a fixed weight coefficient matching its target ranking to each initial training sample based on a plurality of pre-set fixed weight coefficients. Specifically: Step c1: Based on the target ranking contained in the initial training samples, determine the target ranking interval containing the target ranking from a set of multiple preset ranking intervals.

[0048] For example, taking the target ranking as a popularity ranking, the preset multiple ranking intervals may include: a first ranking interval where the popularity ranking is in the top 10,000, a second ranking interval where the popularity ranking is between 10,000 and 50,000, a third ranking interval where the popularity ranking is between 50,000 and 100,000, and a fourth ranking interval where the popularity ranking is after 100,000; wherein, if the popularity ranking (i.e. the target ranking) of the content to be recommended a in an initial training sample A is in the top 10,000, then the target ranking interval can be determined to be the first ranking interval mentioned above.

[0049] Step c2: Configure the preset 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 recommendation results output by the subsequent recommendation model, taking the ranking interval as a popularity ranking interval as an example, when configuring the preset weight coefficient for each ranking interval, a smaller preset weight coefficient can be configured for the popularity ranking interval with higher popularity, so as to reduce the interference of the highly popular content to be recommended on the recommendation results output by the model, and avoid the recommendation model recommending highly popular content to a large number of users in a similar way.

[0051] For example, taking the preset ranking intervals as the first ranking interval to the fourth ranking interval as an example, if the preset weight coefficient corresponding to the first ranking interval is 0.8, the preset weight coefficient corresponding to the second ranking interval is 1, the preset weight coefficient corresponding to the third ranking interval is 1.2, and the preset weight coefficient corresponding to the fourth ranking interval is 1.5, then when the target ranking corresponding to an initial training sample is located 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 to the preset weight coefficient of 0.8 corresponding to the first ranking interval.

[0052] Here, as another optional embodiment, the method described in steps d1-d3 below can also be used to dynamically adjust the weight coefficients corresponding to the initial training samples in each ranking interval based on the proportion of the number of initial training samples in different ranking intervals to the total number of initial training samples. Specifically: Step d1: Based on the target ranking contained in the initial training samples, determine the target ranking interval containing the target ranking from a set of multiple preset ranking intervals.

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

[0054] Step d2: Determine the target deviation that matches the target proportion based on the target proportion of the initial training samples included in the target ranking interval in all initial training samples.

[0055] Here, a smaller target weight means fewer initial training samples are included in the target ranking range, and fewer interactions between the recommended content and the user corresponding to the initial training samples in the target ranking range. Therefore, in order to improve the recommendation model to pay more attention to these relatively niche recommended contents during the model training process, a larger target bias can be matched with a smaller target weight.

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

[0057] Step d3: Determine the weight coefficients configured for the initial training samples based on the target deviation and the preset basic weight coefficients.

[0058] Here, the base weight coefficient can be set to 1. When the weight coefficient of an initial training sample is configured to 1 (i.e., the base weight coefficient), it means that the recommendation model will remain neutral to the initial training sample during the model training process. It will neither focus on the initial training sample (which is equivalent to not increasing the contribution of the initial training sample to the model loss) nor deliberately ignore the initial training sample (which is equivalent to not reducing the contribution of the initial training sample to the model loss).

[0059] For example, when the target deviation is a function value of the inverse proportional function of the target weight, for an initial training sample, the target deviation calculated above can be multiplied by the preset basic weight coefficient, and the result can be used as the weight coefficient of the initial training sample.

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

[0061] Here, the original recommendation model can be a DNN (deep neural network) model, a variant of the CNN (convolutional neural network) model in the recommendation scenario, a recommendation model based on GNN (graph neural network), etc.; the specific model structure of the above original recommendation model is not limited in this application embodiment.

[0062] Specifically, for each target training sample with configured weight coefficients, after inputting the target training sample into the original recommendation model, the original recommendation model will predict the degree of fit between each of the multiple recommended contents and the aforementioned user profile information based on the user profile information contained in the target training sample (which is also equivalent to predicting the probability that each recommended content matches the user's preferences), thereby outputting the predicted recommendation result corresponding to the target training sample (that is, the predicted recommendation result represents the degree of fit between the multiple recommended contents and the user profile information contained in the target training sample).

[0063] S104. Based on the weight coefficients corresponding to each target training sample and the prediction loss corresponding to each target training sample, the 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 the adjusted model parameters.

[0064] Here, for each target training sample, the content to be recommended corresponding to the target training sample is the content to be recommended that the user corresponding to the target training sample has actually interacted with in the past (equivalent to the content to be recommended being the content that was successfully recommended to the user corresponding to the user profile information in the past). Therefore, the above prediction loss can represent 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.

[0065] Specifically, when calculating the model loss, the predicted loss corresponding to each target training sample (which is also equivalent to the contribution of each target training sample in the model loss calculation) can be weighted according to the weight coefficient corresponding to each target training sample, and the model loss can be calculated by weighted calculation. The specific loss function used when calculating the model loss can be the cross-entropy loss function or other loss functions suitable for calculating multi-class prediction loss. This application does not limit the specific function type of the loss function.

[0066] In the training process of the original recommendation model, as an optional embodiment, the recommendation effect of each content to be recommended can be monitored periodically. When a content to be recommended is found to have a significantly decreased recommendation effect, the weight coefficient of that content can be adjusted. This ensures that the original recommendation model pays more attention to niche content to be recommended (i.e., content to be recommended with few users who have interacted with it), while also protecting the user's recommendation experience.

[0067] In one alternative implementation, 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 2 As shown, the method includes steps S201-S204, specifically: S201, based on at least one preset recommendation effect evaluation index, determine the evaluation index value of the recommendation effect evaluation index corresponding to each of the plurality of recommended contents from the real-time monitoring data corresponding to each of the plurality of recommended contents.

[0068] Here, the evaluation metrics for recommendation effectiveness include, but are not limited to, like rate, page view rate, purchase rate, etc.; there may be one or more evaluation metrics for recommendation effectiveness, and this application embodiment does not limit the specific type or number of the above-mentioned evaluation metrics for recommendation effectiveness.

[0069] S202, from the plurality of recommended content, determine the recommended content whose evaluation index value decreases by a greater than or equal to a preset range as the recommended content to be adjusted.

[0070] Here, for each piece of content to be recommended, the historical evaluation index value of the recommendation effect evaluation index of the content to be recommended can be determined from the historical interaction information of the content to be recommended, while the current evaluation index value of the recommendation effect evaluation index of the content to be recommended (i.e. the evaluation index value mentioned in step S202) can be determined from the real-time monitoring data corresponding to the content to be recommended. Thus, for the same recommendation effect evaluation index, it is only necessary to compare the current evaluation index value with the historical evaluation index value to determine whether the evaluation index value of the recommendation effect evaluation index of a piece of content to be recommended has decreased and the specific decrease range.

[0071] S203, 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.

[0072] Here, the base weight coefficient can be set to 1. In this case, the base weight coefficient means that the recommendation model will remain neutral to the initial training sample configured with the base weight coefficient during the model training process. It will neither focus on the initial training sample (which is equivalent to not increasing the contribution of the initial training sample to the model loss) nor deliberately ignore the initial training sample (which is equivalent to not reducing the contribution of the initial training sample to the model loss).

[0073] Based on this, for the aforementioned recommended content that shows a significant decline in recommendation performance, the weight coefficients of the initial training samples corresponding to the recommended content can be adjusted to approach the aforementioned basic weight coefficients (i.e., with the goal of approaching the preset basic weight coefficients). This reduces the deviation of the weight coefficients of the initial training samples from the basic weight coefficients, thereby ensuring that the original recommendation model pays more attention to niche recommended content (i.e., recommended content with a small number of users who have interacted with it) while also protecting the user's recommendation experience.

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

[0075] Here, after updating the weight coefficients configured in the initial training samples to the weight coefficients after the above callback, the initial training samples with updated weight coefficients can be used as target training samples for inputting the original recommendation model. Then, steps S103-S104 are repeated to continue training the original recommendation model.

[0076] In another alternative implementation, Figure 3 This document illustrates 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 3 As shown, the method includes steps S301-S305, specifically: S301, based on the target ranking contained in the initial training samples, determine a target ranking interval containing the target ranking from a preset plurality of ranking intervals.

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

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

[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 this embodiment of the application, before training the original recommendation model, transfer learning can be used to help the original recommendation model learn more feature representations of niche recommended content (i.e., recommended content with a small number of users who have interacted with it) before formally starting model training.

[0089] In one alternative implementation, Figure 4 This application illustrates a method for transfer learning of an original recommendation model, as provided in an embodiment. Figure 4 As shown, the method includes steps S401-S403, specifically: S401, based on the historical interaction information corresponding to the multiple pieces of content to be recommended, determine the content to be recommended from the multiple pieces of content to be recommended whose number of users in the historical interaction information is less than or equal to a preset user number threshold as the target content to be recommended.

[0090] Here, the target content to be recommended is equivalent to niche content to be recommended (i.e., content to be recommended that has been interacted with by a small number of users).

[0091] S402, 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.

[0092] Here, referring to the sample format of the initial training samples mentioned above, multiple training samples containing the aforementioned target content to be recommended can be collected to obtain the aforementioned pre-training dataset.

[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 of the target content to be recommended. Therefore, the original model can be the original recommendation model itself, or it can be other types of different models; this application embodiment does not limit this in any way.

[0094] S403, Update the original model parameters in the original recommendation model based on the model parameters of the pre-trained original model.

[0095] Specifically, the model parameters of the pre-trained original model are transferred to the original recommendation model before formal training, which is equivalent to updating the original model parameters of the original recommendation model. Then, the original recommendation model is trained according to the training methods shown in steps S101-S104 above, so that the original recommendation model can continue to adjust the model parameters based on the model loss and the updated original model parameters, until the original recommendation model reaches convergence.

[0096] Based on the training method of the recommendation model provided in the embodiments of this application, this application configures differentiated weight coefficients for training samples with different user interaction volumes, which is beneficial to enhance the learning degree of the recommendation model for training samples with low user interaction volumes during the training process.

[0097] In this embodiment of the application, after obtaining the trained target recommendation model, the specific application method of the target recommendation model in the recommendation scenario is as follows: In one alternative implementation, Figure 5 The illustration shows a flowchart of a recommended method provided in an embodiment of this application, as shown below. Figure 5 As shown, the recommended method includes steps S501-S503, specifically: S501, Input the target user profile information of the target user into the target recommendation model, predict the degree of fit between the target user profile information and multiple content to be recommended 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 training according to the training methods in steps S101-S104 above; the specific training process of the target recommendation model can be referred to the specific implementation process of the aforementioned steps, and the repeated parts will not be repeated here.

[0099] S502, from the content recommendation prediction results, determine at least one content to be recommended that meets the preset recommendation conditions as the target recommended content.

[0100] Here, the preset recommendation condition can be that the degree of fit is higher than the preset degree of fit threshold, or that the degree of fit is ranked higher than the preset ranking, etc. This application embodiment does not limit the specific setting method of the preset recommendation condition.

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

[0102] Here, you can push the recommended content information to the target users for them to view.

[0103] Based on the recommendation method provided in the embodiments of this application, and based on the target recommendation model trained according to the above training method, this 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, this application also provides a training device corresponding to the training method of the above-mentioned recommendation model. Since the principle of the training device in the embodiments of this application is similar to the training method of the above-mentioned recommendation model in the embodiments of this application, the implementation of the training device can refer to the implementation of the above-mentioned training method, and the repeated parts will not be described again.

[0105] Reference Figure 6 As shown, Figure 6 A schematic diagram of a training device for a recommendation model provided in an embodiment of this application is shown, wherein the training device includes: The determining module 601 is used to determine the initial training sample corresponding to each content to be recommended based on the historical interaction information corresponding to multiple 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. The configuration module 602 is used to configure a weight coefficient matching the target ranking for the initial training sample based on the target ranking contained in the initial training sample, so as to obtain the target training sample corresponding to the initial training sample; wherein the weight coefficient is inversely related to the target ranking; The prediction module 603 is used to input the target training sample into the original recommendation model and output the predicted recommendation result corresponding to the target training sample; wherein, the predicted recommendation result represents the degree of fit between the plurality of recommended contents and the user profile information contained in the target training sample; The training module 604 is used to calculate the model loss based on the weight coefficients corresponding to each target training sample and the prediction loss corresponding to each target training sample, and to adjust the model parameters of the original recommendation model based on the model loss to obtain a target recommendation model including the adjusted model parameters; wherein, 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.

[0106] In one optional implementation, the determining module 601 is configured to determine the target ranking corresponding to the content to be recommended by means of the following method: 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.

[0107] In one optional implementation, the determining module 601 is configured to determine the target ranking corresponding to the content to be recommended by means of the following method: Based on the historical interaction information corresponding to the multiple recommended content items, the publication time of each of the multiple recommended content items is determined. The freshness of each of the multiple pieces of content to be recommended is determined based on their respective publication times. Based on the freshness of each of the multiple pieces of content to be recommended, the multiple pieces of content to be recommended are sorted to obtain the freshness ranking of each of the multiple pieces of content to be recommended, and the freshness ranking of each piece of content to be recommended is used as the target ranking of each piece of content to be recommended.

[0108] In an optional implementation, when configuring weight coefficients matching the target ranking for the initial training samples based on the target ranking included in the initial training samples, the configuration module 602 is configured to: 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.

[0109] In an optional implementation, when configuring weight coefficients matching the target ranking for the initial training samples based on the target ranking included in the initial training samples, the configuration module 602 is further configured to: 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.

[0110] In an optional implementation, the training device further includes: a first callback module, wherein the first callback module is used for: 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.

[0111] In an optional implementation, the training device further includes: a second callback module, wherein the second callback module is used for: 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.

[0112] In an optional embodiment, the training apparatus further includes: a transfer learning module, wherein the transfer learning module is used for: 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.

[0113] Based on the training apparatus of the recommendation model provided in the embodiments of this application, this application, by configuring differentiated weight coefficients for training samples with different user interaction volumes, is beneficial to enhance the learning degree of the recommendation model for training samples with low user interaction volumes during the training process.

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

[0115] Reference Figure 7 As shown, Figure 7 A schematic diagram of a recommended device provided in an embodiment of this application is shown, wherein the recommended device includes: The result prediction module 701 is used to input the target user profile information of the target user into the target recommendation model, predict the degree of fit between the target user profile information and multiple content to be recommended through the target recommendation model, and output the content recommendation prediction result corresponding to the target user; wherein, the target recommendation model is obtained after training according to any of the training methods described above; The result filtering module 702 is used to determine, from the content recommendation prediction results, at least one content to be recommended that meets the preset recommendation conditions as the target recommended content. The recommendation module 703 is used to push recommendation information about the target recommended content to the terminal device corresponding to the target user.

[0116] Based on the recommendation device provided in the embodiments of this application, and based on the target recommendation model trained according to the above training method, this 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, this application also provides an electronic device corresponding to the training method of the above-mentioned recommendation model and the above-mentioned recommendation method. Since the principle of the electronic device in the embodiments of this application is similar to that of the training method of the above-mentioned recommendation model and the above-mentioned recommendation method in the embodiments of this application, the implementation of the electronic device can refer to the implementation of the training method of the above-mentioned recommendation model and the above-mentioned recommendation method, and the repeated parts will not be described again.

[0118] Figure 8A schematic diagram of an electronic device 800 provided in this application embodiment includes: a processor 801, a memory 802, and a bus 803. The memory 802 stores machine-readable instructions executable by the processor 801. When the electronic device runs a training method for a recommendation model and a recommendation method as described in the embodiment, the processor 801 communicates with the memory 802 via the bus 803. The processor 801 executes the machine-readable instructions. Specifically, when running the training method for the recommendation model, the processor 801 executes the machine-readable instructions to implement the following steps: 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.

[0119] In one alternative implementation, the processor 801 is configured to determine the target ranking corresponding to the content to be recommended by means of the following method: 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.

[0120] In one alternative implementation, the processor 801 is configured to determine the target ranking corresponding to the content to be recommended by means of the following method: Based on the historical interaction information corresponding to the multiple recommended content items, the publication time of each of the multiple recommended content items is determined. The freshness of each of the multiple pieces of content to be recommended is determined based on their respective publication times. Based on the freshness of each of the multiple pieces of content to be recommended, the multiple pieces of content to be recommended are sorted to obtain the freshness ranking of each of the multiple pieces of content to be recommended, and the freshness ranking of each piece of content to be recommended is used as the target ranking of each piece of content to be recommended.

[0121] In an alternative implementation, when configuring weight coefficients matching the target ranking for the initial training samples based on the target ranking included in the initial training samples, the processor 801 is configured to: 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.

[0122] In an alternative implementation, when configuring weight coefficients matching the target ranking for the initial training samples based on the target ranking included in the initial training samples, the processor 801 is further configured to: 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.

[0123] In an alternative implementation, the processor 801 is further configured to: 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.

[0124] In an alternative implementation, the processor 801 is further configured to: 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.

[0125] In an alternative implementation, the processor 801 is further configured to: 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.

[0126] Specifically, when running the above-recommended method, the processor 801 executes the machine-readable instructions to perform the following steps: 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 of the training methods described above. 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.

[0127] In the training method section, the electronic device provided in this application, by configuring differentiated weight coefficients for training samples with different user interaction volumes, is beneficial to enhancing the learning degree of the recommendation model for training samples with low user interaction volumes during the training process. In the recommendation method section, based on the target recommendation model trained according to the above training method, this 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, embodiments of this application also provide a computer-readable storage medium storing a computer program, which is executed by a processor. When running the training method for the aforementioned recommendation model, the processor performs the following steps: 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.

[0129] In one optional implementation, the processor is configured to determine the target ranking corresponding to the content to be recommended by means of the following method: 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.

[0130] In one optional implementation, the processor is configured to determine the target ranking corresponding to the content to be recommended by means of the following method: Based on the historical interaction information corresponding to the multiple recommended content items, the publication time of each of the multiple recommended content items is determined. The freshness of each of the multiple pieces of content to be recommended is determined based on their respective publication times. Based on the freshness of each of the multiple pieces of content to be recommended, the multiple pieces of content to be recommended are sorted to obtain the freshness ranking of each of the multiple pieces of content to be recommended, and the freshness ranking of each piece of content to be recommended is used as the target ranking of each piece of content to be recommended.

[0131] In an alternative implementation, when configuring weight coefficients matching the target ranking for the initial training samples based on the target ranking included in the initial training samples, the processor is configured to: 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.

[0132] In an optional implementation, when configuring weight coefficients matching the target ranking for the initial training samples based on the target ranking included in the initial training samples, the processor is further configured to: 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.

[0133] In one alternative implementation, the processor is further configured to: 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.

[0134] In one alternative implementation, the processor is further configured to: 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.

[0135] In one alternative implementation, the processor is further configured to: 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.

[0136] Specifically, when running the recommended method described above, the processor executes the machine-readable instructions by performing the following steps: 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 of the training methods described above. 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.

[0137] Through the computer-readable storage medium provided in the embodiments of this application, in the training method section, this application configures differentiated weight coefficients for training samples with different user interaction volumes, which is beneficial to enhance the learning degree of the recommendation model for training samples with low user interaction volumes during the training process; and in the recommendation method section, based on the target recommendation model trained according to the above training method, this 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.

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

[0139] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. The system embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interface; the indirect coupling or communication connection between systems or units may be electrical, mechanical, or other forms.

[0140] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

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

[0142] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0143] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0144] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by 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. 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.

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 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.

6. 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 model parameters of the pre-trained original model are transferred to the original recommendation model before training.

7. 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 6. 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.

8. 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 6 or the steps of the recommendation method as described in claim 7.

9. 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 6, or the steps of the recommendation method as described in claim 7.

Citation Information

Patent Citations

  • Recommendation model training method and device and recommendation method and device

    CN113538079A

  • Article recommendation model training method and device, electronic equipment and storage medium

    CN115841366A