Media resource recommendation, multi-task prediction model training method, device and medium
Patent Information
- Application Number
- CN202510525897.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2026-10-27
AI Technical Summary
[0003]然而,相关技术中,在对多目标推荐模型进行训练过程中,媒体资源的固有时长与播放时长影响很大
[0113]本公开实施例中,通过多任务预测模型,基于对象的第一特征信息以及多个候选媒体资源各自的第二特征信息进行预测,从而得到各个候选媒体资源的推荐分数,进而确定目标媒体资源并推荐给对象。其中,多任务预测模型通过第一损失函数进行训练,第一损失函数基于样本媒体资源的消偏后播放时长和模型的预测播放时长来计算。而消偏后播放时长是依据样本媒体资源的实际播放时长以及目标分布规律得出的,目标分布规律能够清晰指示实际播放时长随样本媒体资源时长的变化。例如,在面对不同媒体资源时长的媒体资源时,可以根据目标分布规律,对不同媒体资源时长的媒体资源的实际播放时长进行消偏处理。这样一来,就能更准确地反映出对象对不同媒体资源的真实兴趣程度。通过这种基于消偏后播放时长训练的多任务预测模型,在推荐过程中可以更精准地把握对象的兴趣偏好,从而能够为对象精准推送契合其兴趣的媒体资源,增强对象与推荐系统的交互粘性,提高了媒体资源推荐的准确性。
Smart Images

Figure CN122986161A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to a method, apparatus, and medium for media resource recommendation and multi-task prediction model training. Background Technology
[0002] In multi-task prediction models, accurately estimating the playback duration of media resources for a given user is a core element for achieving high-quality recommendations and meeting the user's personalized needs. Accurate duration estimation helps multi-task prediction models precisely push media resources that match the user's interests, enhancing user engagement.
[0003] However, in related technologies, the inherent duration and playback duration of media resources have a significant impact on the training of multi-objective recommendation models. For example, an object's interest in watching a 10-second video after a 2-minute clip is much greater than that of watching a 10-second video after a 15-second clip. However, related technologies tend to recommend these videos equally, causing the recommendations from multi-task prediction models to often deviate from the object's true interest, resulting in low accuracy. Although some related technologies have taken into account the influence of the inherent duration of media resources, the accuracy remains low. Summary of the Invention
[0004] This disclosure provides a method, apparatus, and medium for media resource recommendation and multi-task prediction model training, which can improve the accuracy of media resource recommendation.
[0005] According to one aspect of this disclosure, a media resource recommendation method is provided, comprising:
[0006] Obtain the first feature information of the object, and the second feature information of each of the multiple candidate media resources;
[0007] Based on the first feature information and the second feature information, a multi-task prediction model is used to make predictions and obtain the recommendation scores of each candidate media resource.
[0008] Based on the recommendation scores of each candidate media resource, a target media resource is determined from the plurality of candidate media resources, and the target media resource is recommended to the object;
[0009] The multi-task prediction model is trained using a first loss function, which is calculated based on the debiased playback duration of the sample media resources and the predicted playback duration of the multi-task prediction model for the sample media resources. The debiased playback duration is determined based on the actual playback duration of the sample media resources and the target distribution pattern, where the target distribution pattern indicates the change in the actual playback duration as the media resource duration of the sample media resources changes.
[0010] According to one aspect of this disclosure, a method for training a multi-task prediction model is provided, comprising:
[0011] Acquire multiple sample media resources, wherein the sample media resources have actual playback duration;
[0012] Based on the actual playback duration of each of the multiple sample media resources, a target distribution pattern is determined; the target distribution pattern indicates the change of the actual playback duration with the media resource duration of the sample media resources;
[0013] Based on the target distribution pattern, determine the debiasing parameters corresponding to the sample media resources;
[0014] Based on the actual playback duration of the sample media resources and the anti-biasing parameters, calculate the playback duration after anti-biasing.
[0015] Based on the sample media resources, the predicted playback duration is obtained by using the multi-task prediction model.
[0016] Based on the debiased playback duration and the predicted playback duration, a first loss function is calculated, and the multi-task prediction model is trained based on the first loss function.
[0017] According to one aspect of this disclosure, a media resource recommendation device is provided, comprising:
[0018] The feature acquisition module is used to acquire the first feature information of the object and the second feature information of each of the multiple candidate media resources;
[0019] The prediction module is used to make predictions based on the first feature information and the second feature information through a multi-task prediction model to obtain the recommendation score of each candidate media resource.
[0020] The recommendation module is used to determine the target media resource from the multiple candidate media resources based on the recommendation scores of each candidate media resource, and recommend the target media resource to the object;
[0021] The multi-task prediction model is trained using a first loss function, which is calculated based on the debiased playback duration of the sample media resources and the predicted playback duration of the multi-task prediction model for the sample media resources. The debiased playback duration is determined based on the actual playback duration of the sample media resources and the target distribution pattern, where the target distribution pattern indicates the change in the actual playback duration as the media resource duration of the sample media resources changes.
[0022] Optionally, the media resource recommendation device further includes a training module;
[0023] The training module is specifically used for:
[0024] The multi-task prediction model is pre-trained in the following manner:
[0025] Acquire multiple sample media resources, each sample media resource having the actual playback duration;
[0026] The target distribution pattern is determined based on the actual playback duration of each of the multiple sample media resources.
[0027] Based on the target distribution pattern, determine the debiasing parameters corresponding to the sample media resources;
[0028] Based on the actual playback duration of the sample media resources and the anti-biasing parameters, calculate the playback duration after anti-biasing.
[0029] Based on the sample media resources, the predicted playback duration is obtained by using the multi-task prediction model.
[0030] Based on the debiased playback duration and the predicted playback duration, the first loss function is calculated, and the multi-task prediction model is trained based on the first loss function.
[0031] Optionally, the debiasing parameters include the average playback duration and the standard deviation of playback duration; the target distribution pattern includes a first distribution pattern and a second distribution pattern, wherein the first distribution pattern indicates the change of the average playback duration with the duration of the media resource, and the second distribution pattern indicates the change of the standard deviation of playback duration with the duration of the media resource;
[0032] The training module is specifically used for:
[0033] Based on the duration of the media resources and the first distribution pattern, the average playback duration is determined;
[0034] Based on the duration of the media resources and the second distribution pattern, the standard deviation of the playback duration is determined.
[0035] Optionally, the training module is specifically used for:
[0036] Based on the actual playback duration and the average playback duration, calculate the deviation value of the actual playback duration;
[0037] The playback duration after debiasing is calculated based on the ratio of the deviation value to the standard deviation of the playback duration.
[0038] Optionally, the training module is specifically used for:
[0039] The sample media resources are grouped together, wherein sample media resources with the same duration are grouped together.
[0040] Calculate the average of the actual playback duration of the sample media resources within the same group, and use it as the average playback duration of the group;
[0041] Calculate the standard deviation of the actual playback duration of the sample media resources within the same group, and use it as the standard deviation of the playback duration of the group;
[0042] Based on the average playback duration of each group, a first curve is generated, which indicates the change of the average playback duration as the media resource duration of each group changes.
[0043] Based on the standard deviation of playback duration for each group, a second curve is generated, which indicates the change of the standard deviation of playback duration with the duration of the media resources for each group.
[0044] Generate a first function that fits the first curve as the first distribution law, and generate a second function that fits the second curve as the second distribution law.
[0045] Optionally, the first function has a first general function formula, the first general function formula has a first function parameter, and the second function has a second general function formula, the second general function formula has a second function parameter;
[0046] The training module is specifically used for:
[0047] For each group, the average playback duration of the group is determined based on the media resource duration of the group and the first curve;
[0048] Substituting the duration of the media resources in the group into the general formula of the first function, we obtain the first result;
[0049] The first function is generated based on the average playback duration of each group and the first result;
[0050] For each group, the standard deviation of the playback duration of the group is determined based on the duration of the media resources in the group and the second curve;
[0051] Substituting the duration of the media resources in the group into the general formula of the second function, we obtain the second result;
[0052] The second function is generated based on the standard deviation of the playback duration for each group and the second result.
[0053] Optionally, the training module is specifically used for:
[0054] The first fitting error is calculated based on the difference between the average playback duration of each group and the first result.
[0055] The first function is generated by minimizing the first fitting error to determine the parameters of the first function.
[0056] The second function is generated based on the standard deviation of the playback duration of each group and the second result, including:
[0057] The second fitting error is calculated based on the difference between the standard deviation of the playback duration of each group and the second result.
[0058] The second function is generated by minimizing the second fitting error to determine the parameters of the second function.
[0059] Optionally, the first function is a monotonically increasing function, and when the duration of the media resource approaches positive infinity, the value of the first function approaches a first constant, the first constant is positive, and the parameters of the first function include the first constant, the first coefficient, the first exponent and the second exponent.
[0060] The first function formula is generated in the following way:
[0061] Calculate the first product based on the first exponent power of the media resource duration and the first coefficient;
[0062] Calculate the first power of the product;
[0063] Calculate the first difference between 1 and the first power.
[0064] The first function general formula is generated based on the second exponent of the first difference and the first constant.
[0065] Optionally, the second function is a monotonically increasing linear function, and the parameters of the second function include a second coefficient and a second constant;
[0066] The second function's general formula is generated in the following way:
[0067] Calculate the second product based on the media resource duration and the second coefficient;
[0068] Based on the second product and the second constant, the general formula of the second function is generated.
[0069] Optionally, the training module is specifically used for:
[0070] The debiased playback duration is converted into a first probability, and the predicted playback duration is converted into a second probability. The first probability and the second probability are probabilities that satisfy a Bernoulli distribution.
[0071] The first loss function is calculated based on the first probability and the second probability.
[0072] Optionally, the training module is specifically used for:
[0073] Calculate the duration difference between the debiased playback duration and the predicted playback duration;
[0074] Based on the time difference, calculate the second loss function;
[0075] The multi-task prediction model is trained based on the first loss function and the second loss function.
[0076] Optionally, the training module is specifically used for:
[0077] Calculate the second power of the negative of the playback duration after debiasing;
[0078] Calculate the first sum of 1 and the second power;
[0079] The first probability is calculated based on the reciprocal of the first sum.
[0080] Optionally, the training module is specifically used for:
[0081] Calculate the third power of the predicted playback duration;
[0082] Calculate the second sum of 1 and the third power;
[0083] The second probability is calculated based on the reciprocal of the second sum.
[0084] Optionally, the training module is specifically used for:
[0085] Calculate the first logarithm of the reciprocal of the second probability;
[0086] Calculate the third product based on the first probability and the first logarithm;
[0087] Calculate the second difference between 1 and the first probability, and the third difference between 1 and the second probability;
[0088] Calculate the second logarithm of the reciprocal of the third difference;
[0089] Calculate the fourth product based on the second difference and the second logarithm;
[0090] The first loss function is calculated based on the third product and the fourth product.
[0091] Optionally, the training module is specifically used for:
[0092] Obtain the loss function for each of the other tasks besides the playback duration task;
[0093] Based on the first loss function and the respective other task loss functions of each other task, calculate the multi-task loss function;
[0094] The multi-task prediction model is trained based on the multi-task loss function.
[0095] Optionally, the training module is specifically used for:
[0096] Calculate the multi-sample loss function based on the multi-task loss function of each of the sample media resources;
[0097] The multi-task prediction model is trained based on the multi-sample loss function.
[0098] Optionally, the multi-task prediction model includes multiple expert networks and multiple prediction networks corresponding to each of the multiple prediction tasks; the multiple prediction networks include a duration prediction network corresponding to the playback duration task; the duration prediction network includes a first gating network and a first task tower network;
[0099] The training module is specifically used for:
[0100] The first feature information and the second feature information of the sample media resources are input into the multiple expert networks;
[0101] The outputs of the multiple expert networks are weighted and calculated by the first gating network to obtain a first vector corresponding to the duration prediction network.
[0102] The first vector is input into the first task tower network to obtain the predicted playback duration.
[0103] According to one aspect of this disclosure, a training apparatus for a multi-task prediction model is provided, comprising:
[0104] The sample acquisition module is used to acquire multiple sample media resources, wherein the sample media resources have actual playback duration;
[0105] The pattern determination module is used to determine a target distribution pattern based on the actual playback duration of each of the multiple sample media resources; the target distribution pattern indicates the change of the actual playback duration with the media resource duration of the sample media resources;
[0106] The first debiasing determination module is used to determine the debiasing parameters corresponding to the sample media resources based on the target distribution pattern.
[0107] The second anti-bias determination module is used to calculate the playback duration after anti-biasing based on the actual playback duration of the sample media resources and the anti-biasing parameters.
[0108] The duration prediction module is used to predict the playback duration based on the sample media resources and through the multi-task prediction model.
[0109] The model training module is used to calculate a first loss function based on the debiased playback duration and the predicted playback duration, and to train the multi-task prediction model based on the first loss function.
[0110] According to one aspect of this disclosure, an electronic device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the media resource recommendation method and the training method for the multi-task prediction model as described above.
[0111] According to one aspect of this disclosure, a computer-readable storage medium is provided, the storage medium storing a computer program that, when executed by a processor, implements the media resource recommendation method and the training method for the multi-task prediction model as described above.
[0112] According to one aspect of this disclosure, a computer program product is provided, comprising a computer program that is read and executed by a processor of a computer device, causing the computer device to perform the media resource recommendation method and the multi-task prediction model training method as described above.
[0113] In this embodiment, a multi-task prediction model is used to predict the target media resource based on the first feature information of the target and the second feature information of each of the multiple candidate media resources. This prediction results in a recommendation score for each candidate media resource, which is then used to determine the target media resource and recommend it to the target. The multi-task prediction model is trained using a first loss function, calculated based on the debiased playback duration of the sample media resource and the model's predicted playback duration. The debiased playback duration is derived from the actual playback duration of the sample media resource and the target distribution pattern, which clearly indicates how the actual playback duration changes with the duration of the sample media resource. For example, when faced with media resources of different durations, the actual playback duration of media resources of different durations can be debiased according to the target distribution pattern. This more accurately reflects the target's true interest in different media resources. Through this multi-task prediction model trained on the debiased playback duration, the recommendation process can more accurately grasp the target's interests and preferences, thereby precisely pushing media resources that match the target's interests, enhancing the interaction between the target and the recommendation system, and improving the accuracy of media resource recommendations.
[0114] Other features and advantages of this disclosure will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the disclosure. The objectives and other advantages of this disclosure may be realized and obtained by means of the structures particularly pointed out in the description, claims and drawings. Attached Figure Description
[0115] The accompanying drawings are provided to further understand the technical solutions of this disclosure and constitute a part of the specification. They are used together with the embodiments of this disclosure to explain the technical solutions of this disclosure and do not constitute a limitation on the technical solutions of this disclosure.
[0116] Figure 1 This is a system architecture diagram of the media resource recommendation method according to an embodiment of this disclosure;
[0117] Figure 2A This is a schematic diagram of the interface of an embodiment of the present disclosure applied to a video recommendation platform scenario;
[0118] Figure 2B This is a schematic diagram of the interface of an embodiment of the present disclosure applied to a music recommendation platform scenario;
[0119] Figure 3 This is one of the flowcharts of a media resource recommendation method according to an embodiment of the present disclosure;
[0120] Figure 4 This is a flowchart of training a multi-task prediction model;
[0121] Figure 5 yes Figure 4 A flowchart of step 430;
[0122] Figure 6 yes Figure 4 A flowchart of step 440;
[0123] Figure 7 yes Figure 4 A flowchart of step 420;
[0124] Figure 8 yes Figure 7 A flowchart of step 760;
[0125] Figure 9 yes Figure 8 A flowchart of step 830;
[0126] Figure 10 yes Figure 8 A flowchart of step 860;
[0127] Figure 11 It is a flowchart for generating the general formula of the first function;
[0128] Figure 12 This is a line graph showing the average media resource duration versus playback duration of a sample media resource in one embodiment of this disclosure;
[0129] Figure 13 This is a line graph of the average media resource duration versus playback duration and a curve of the first function in one embodiment of this disclosure;
[0130] Figure 14 It is a flowchart for generating the general formula of the second function;
[0131] Figure 15 This is a line graph of the media resource duration versus the standard deviation of the playback duration and a curve of the second function in one embodiment of this disclosure.
[0132] Figure 16 yes Figure 4 A flowchart of step 460, which calculates the first loss function based on the debiased playback duration and the predicted playback duration;
[0133] Figure 17 yes Figure 16 A flowchart of step 1610;
[0134] Figure 18 yes Figure 16 A flowchart of step 1620;
[0135] Figure 19 yes Figure 4 A flowchart of step 460;
[0136] Figure 20 yes Figure 19 A flowchart of step 1930;
[0137] Figure 21 yes Figure 4 A flowchart of step 460;
[0138] Figure 22 yes Figure 4 A flowchart of step 450;
[0139] Figure 23 This is a comparison chart of the total number of video views for the control group and the experimental group;
[0140] Figure 24 This is a comparison chart of the total video playback time between the control group and the experimental group;
[0141] Figure 25 This is a flowchart of a multi-task prediction model training method according to an embodiment of the present disclosure;
[0142] Figure 26A and Figure 26B These are detailed implementation diagrams of the multi-task prediction model training method according to an embodiment of this disclosure;
[0143] Figure 27 This is a block diagram of a media resource recommendation device according to an embodiment of the present disclosure;
[0144] Figure 28 This is a block diagram of a multi-task prediction model training device according to an embodiment of the present disclosure;
[0145] Figure 29 Based on embodiments of this disclosure Figure 3 The terminal structure diagram of the media resource recommendation method shown;
[0146] Figure 30 Based on embodiments of this disclosure Figure 3 The diagram shows the server architecture of the media resource recommendation method. Detailed Implementation
[0147] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this disclosure.
[0148] Before providing a further detailed description of the embodiments of this disclosure, the terms and concepts used in these embodiments are explained, and they are subject to the following interpretations:
[0149] Artificial Intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to have perception, reasoning, and decision-making capabilities. AI technology is a comprehensive discipline involving a wide range of fields, encompassing both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly include computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0150] Machine learning is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills, and reorganize existing knowledge structures to continuously improve their performance. Compared to data mining, which focuses on finding mutual characteristics among large datasets, machine learning emphasizes algorithm design, enabling computers to automatically "learn" patterns from data and use these patterns to predict unknown data. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, and inductive learning. Reinforcement learning (RL), also known as reward learning, evaluation learning, or enhancement learning, is one of the paradigms and methodologies of machine learning. It is used to describe and solve problems where intelligent agents learn strategies to maximize rewards or achieve specific goals during interactions with their environment.
[0151] Deep neural networks are multi-layered unsupervised neural networks. They learn features by using the output features of the previous layer as input to the next layer. Through layer-by-layer feature mapping, they map the features of existing spatial samples to another feature space, thereby learning a better feature representation of the existing input. Deep neural networks possess multiple non-linear feature transformations, enabling them to fit highly complex functions.
[0152] Gradient descent algorithm: a loss function minimization method that calculates the gradient of the loss function at the current position, updates the parameters in the direction of gradient descent, and finds the optimal solution that minimizes the value of the loss function.
[0153] System architecture and scenario description of the embodiments disclosed herein
[0154] Figure 1 This is a system architecture diagram for media resource recommendations applied according to embodiments of the present disclosure. It includes: server 110, gateway 120, Internet 130, and terminal 140.
[0155] Server 110 refers to a computer system that can provide certain services to terminal 140. Compared to ordinary terminal 140, server 110 has higher requirements in terms of stability, security, and performance. Server 110 can be a single high-performance computer in a network platform, a cluster of multiple high-performance computers, a portion of a single high-performance computer (e.g., a virtual machine), or a combination of portions of multiple high-performance computers (e.g., virtual machines).
[0156] Gateway 120, also known as an internetwork connector or protocol converter, is a computer system or device that enables network interconnection at the transport layer and acts as a translator. It bridges the gap between two systems using different communication protocols, data formats, languages, or even completely different architectures. Gateway 120 also provides filtering and security functions. Messages sent from terminal 140 to server 110 are forwarded to the corresponding server 110 via gateway 120. Messages sent from server 110 to terminal 140 are also forwarded to the corresponding terminal 140 via gateway 120.
[0157] Terminal 140 can take various forms, including desktop computers, laptops, personal digital assistants (PDAs), mobile phones, in-vehicle terminals, home theater terminals, and dedicated terminals. Furthermore, it can be a single device or a collection of multiple devices. For example, multiple devices can be connected via a local area network, sharing a single display device to work collaboratively, forming a single terminal 140. Terminal 140 can also communicate with the Internet 130 via wired or wireless means to exchange data.
[0158] The media resource recommendation method of this disclosure can be implemented entirely on the terminal 140, entirely on the server 110, or partially on the terminal 140 and partially on the server 110.
[0159] When the media resource recommendation method is implemented entirely on the target terminal 140, it typically involves acquiring the target's first feature information and the second feature information of multiple candidate media resources on the target terminal 140. A multi-task prediction model is pre-stored and trained on the terminal 140. Based on the acquired feature information, the multi-task prediction model makes predictions to obtain recommendation scores for each candidate media resource. Then, the terminal 140 determines the target media resource from among the multiple candidate media resources based on these recommendation scores and directly recommends it to the target on the local terminal 140. This method does not rely on network interaction with the server 110, enabling rapid response to recommendation requests and achieving personalized media resource recommendations on the target terminal 140. It is particularly suitable for scenarios with poor network conditions or high privacy requirements, such as when a target uses local music or video applications on an airplane, recommendations can be made based on existing local media resources and the target's usage data.
[0160] In a media resource recommendation method where one part is implemented on terminal 140 and the other part on server 110, terminal 140 is typically responsible for collecting the first feature information of the target media resource. Simultaneously, terminal 140 sends this first feature information to server 110. Server 110 receives this first feature information and, combined with the second feature information of each candidate media resource, calculates a recommendation score for each candidate media resource. Then, server 110 returns the recommendation scores to terminal 140, which then uses these scores to determine the target media resource and recommend it to the target media resource. This approach combines the advantages of terminal 140 and server 110, reducing the load on server 110, utilizing terminal 140's local data for rapid response to recommendation requests, and leveraging server 110's powerful computing capabilities and rich data resources to improve the accuracy and comprehensiveness of the recommendations.
[0161] The embodiments disclosed herein can be applied in various scenarios, such as Figures 2A-2B The examples shown are scenarios used for media resource recommendation methods.
[0162] like Figure 2A As shown, in the recommendation scenario of video recommendation platforms, the aim is to recommend suitable video content, including short videos and long videos, based on the user's interests. Related technologies use the actual playback time of a user as the basis for interest judgment, but this has a significant problem: the actual playback time of a video is easily affected by the inherent media length of the video itself, leading to misjudgments of the user's true interests. For example, if a 60-second short video is played for 30 seconds, and a 15-second short video is played in its entirety, the recommendation methods in these technologies might prioritize the former because of its longer actual playback time, ignoring the higher level of interest reflected by the latter's 100% completion rate.
[0163] The media resource recommendation method of this disclosure, based on the target distribution pattern (i.e. the statistically derived pattern of the change of actual video playback duration with video media duration), converts the actual playback duration of sample videos into a debiased playback duration, which is then used as the training label for a multi-task prediction model to eliminate the interference of video media resource duration on the judgment of object interest.
[0164] For example, in a short video platform's terminal 140, object A enjoys watching short videos, especially food-related ones. When object A opens the short video platform on terminal 140, the platform collects first feature information related to object A and sends it to server 110. Server 110 obtains second feature information from numerous candidate videos, including a 2-minute food preparation video A and a 15-second food creation video B. According to related recommendation methods, a duration prediction model might predict the playback duration of the 2-minute food preparation video A to be 10 seconds, while the 15-second food creation video B would be 8 seconds. Video A's predicted 10-second playback duration is longer, thus giving it a higher recommendation score. However, the media resource recommendation method of this embodiment makes a comprehensive judgment based on the debiased playback duration. If a multi-task prediction model calculates that the debiased playback duration of the 15-second food creation video B corresponds to a higher recommendation score, then server 110 will prioritize recommending the 15-second food creation video B to object A.
[0165] like Figure 2B As shown, in a music recommendation platform scenario, suppose object B likes to listen to pop music and frequently listens to short pop music clips. When object B opens the music recommendation platform on terminal 140, the platform collects first feature information related to object B and sends it to server 110. Server 110 obtains second feature information from numerous candidate songs, including a 5-minute pop song A and a 30-second pop song B. Calculations using the multi-task prediction model of this embodiment show that the 30-second pop song B has a higher recommendation score corresponding to its debiased playback duration. For example, the actual playback duration of the 30-second song B is 30 seconds (100% completion rate), while the actual playback duration of the 5-minute song A is 100 seconds (approximately 33% completion rate). After debiasing, song B has a higher recommendation score, therefore server 110 will prioritize recommending the 30-second pop song B to object B.
[0166] General Description of Embodiments in this Disclosure
[0167] According to one embodiment of this disclosure, a media resource recommendation method is provided.
[0168] like Figure 3 As shown, according to one embodiment of this disclosure, the media resource recommendation method includes:
[0169] Step 310: Obtain the first feature information of the object and the second feature information of each of the multiple candidate media resources;
[0170] Step 320: Based on the first feature information and the second feature information, a multi-task prediction model is used to make predictions and obtain the recommendation scores for each candidate media resource;
[0171] Step 330: Based on the recommendation scores of each candidate media resource, determine the target media resource from multiple candidate media resources and recommend the target media resource to the object;
[0172] The multi-task prediction model is trained using a first loss function, which is calculated based on the debiased playback duration of the sample media resources and the predicted playback duration of the multi-task prediction model for the sample media resources. The debiased playback duration is determined based on the actual playback duration of the sample media resources and the target distribution pattern. The target distribution pattern indicates the change of the actual playback duration with the media resource duration of the sample media resources.
[0173] Steps 310-330 are described in detail below.
[0174] Detailed description of step 310
[0175] In step 310, the "object" refers to the object for which media resources need to be recommended. This object can include real objects or virtual objects. Real objects include anything from people to animals. Virtual objects can refer to objects that use virtual avatars for live streaming.
[0176] The primary feature information of an object refers to the set of information related to the object's own attributes, behavioral habits, etc., that are being recommended media resources. This primary feature information is used to characterize the object's features and preferences, helping the multi-task prediction model understand the object's needs and thus recommend media resources more accurately. For example, the primary feature information of an object may include, but is not limited to, at least one of the following features: basic attribute features, historical behavior features, and usage scenario features.
[0177] Basic attributes are used to describe the basic information of an object, including but not limited to industry, education level, and region. Objects from different industries, with different education levels, and from different regions may have different preferences for media resources.
[0178] Historical behavioral characteristics describe an object's past behavior on media platforms, including but not limited to browsing history, search records, and interactive behaviors. Browsing history reflects which media resources an object has viewed and for how long; keywords in search records reveal the object's interests; and interactive behaviors (such as liking, commenting on, and saving media resources) demonstrate the object's preference for different content. For example, an object who frequently browses sports news, searches for sports-related keywords, and likes and comments on numerous sports videos indicates a high level of interest in sports-related media resources.
[0179] Use case features describe the scenarios in which an object uses a media platform, including but not limited to access time and the terminal device used. Different times and terminal devices may indicate different needs of the object. For example, while commuting to work, an object may be more inclined to use a mobile phone to listen to audio media resources; while at night when resting, an object may use a TV or computer to watch long videos.
[0180] Note that you must obtain the subject's consent before acquiring their primary characteristic information. Furthermore, the collection, use, and processing of this primary characteristic information must comply with relevant laws, regulations, and standards. When obtaining the subject's consent, you can use methods such as pop-ups or redirects to a confirmation page to obtain their individual permission or consent.
[0181] Candidate media resources are a set of resources that have the potential to be recommended to an object in a media resource recommendation method. In this embodiment of the disclosure, candidate media resources are defined as resource formats with media resource duration, such as video resources like movies, TV series, and short videos; music resources like singles, albums, and playlists; and audiobooks, etc., which are playable resource formats with media resource duration attributes.
[0182] Secondary feature information describes the attributes and characteristics of candidate media resources. This secondary feature information helps multi-task prediction models understand the uniqueness of each candidate media resource, enabling them to more accurately assess the matching degree between candidate media resources and objects. For example, in media resource recommendation scenarios, the secondary feature information of candidate media resources may include, but is not limited to, at least one of the following features: basic attribute features, time features, creation features, popularity features, and content description features.
[0183] Basic attribute characteristics are used to describe the fundamental attributes of media resources, including but not limited to the type of media resource (e.g., video types can be further subdivided into movies, TV series, short videos, documentaries, advertisements, etc.; music styles, in addition to rock, pop, and classical, may also include folk, electronic, hip-hop, etc.) and the duration of media resources (media resources of different durations, such as short videos which may be less than 1 minute and feature films which may exceed 2 hours, have different target audiences and applicable scenarios; short videos are suitable for watching in fragmented time, while long videos require the audience to invest more time and effort). Different basic attribute characteristics will attract audiences with different needs and preferences. For example, busy office workers may prefer to choose short media resources to watch during breaks.
[0184] The time characteristic is mainly reflected in the release time. Newly released media resources often have a sense of novelty and topicality, which is more attractive to those who pursue trends and fresh content; while media resources that have been released for a long time still have high value for those who have a nostalgic sentiment because they have accumulated a good reputation and audience base in the past.
[0185] Creative characteristics encompass creator information, such as the video creator's personal style. Some creators excel at telling humorous and witty stories about everyday life, attracting a large following with their unique style. The stylistic features of their videos become a key element in attracting viewers. The creator's fame also plays a significant role; videos from well-known creators with a large fan base tend to gain more exposure and attention because the target audience has a higher level of trust in them. For music, the singer's performance style and fame, as well as the songwriter's talent, can all be factors that attract viewers.
[0186] Popularity can be reflected in data such as play counts, download counts, and discussion volume. High play counts and download counts indicate that the media resource is widely welcomed by the audience, has high quality, or conforms to current trends; discussion volume reflects the topicality of the media resource on the conversation platform or related community. For example, a popular TV series will trigger a lot of discussion and sharing on conversation media, and this popularity will attract more audiences to pay attention and try watching it.
[0187] Content description features can include information such as a brief summary or tags. A brief summary helps multi-task prediction models and users quickly understand the core content of media resources. For example, a short video about making food, with a summary clearly stating "Teach you how to make super delicious internet-famous tomato meat sauce spaghetti in 5 minutes, simple and easy to follow," allows users to understand the core content of the video and determine whether they are interested in the food preparation process. Similarly, music theme tags (such as inspirational, lyrical, upbeat, etc.) allow users to choose suitable music based on their current mood. Detailed and accurate content description features help improve the matching degree between media resources and users, reducing the time cost for users to filter media resources.
[0188] Note that prior consent from the publisher of candidate media resources must be obtained when acquiring their secondary characteristic information. Furthermore, the collection, use, and processing of this secondary characteristic information will comply with relevant laws, regulations, and standards. The specific methods are the same as those for obtaining consent, and will not be repeated here.
[0189] There are multiple ways to obtain the primary characteristic information of an object. In some implementations, basic attributes can be collected through object registration information. For example, information such as industry and education level filled in by an object when registering on a music platform.
[0190] In other implementations, information such as an object's browsing history, search history, and interaction behavior can be captured by logging the object's behavior across different platforms. For example, on video platforms, if an object frequently watches science fiction videos, their browsing history reflects a preference for the science fiction genre; while actions such as liking, commenting, and saving videos further demonstrate the object's level of liking for specific content. Additionally, device information and timestamps from the object's terminal device can be used to obtain information about the object's usage scenarios, such as whether the object frequently accesses media platforms at night.
[0191] In some implementations, candidate media resources can be obtained through multiple methods. For example, all media resources in the corresponding recommendation platform can be directly used as candidate media resources. The biggest advantage of this approach is its comprehensiveness and inclusiveness, covering all content of the recommendation platform without omission. This is especially crucial when dealing with new subjects, because at this time the platform knows almost nothing about the subject's interests and preferences. By including all media resources in the scope of candidate media resources for prediction, the subject's interest direction can be probed.
[0192] A portion of the pre-screened media resources can also be used as candidate media resources. Preliminary screening of media resources can be based on various factors, such as the viewer's historical behavior, current trends, and the platform's personalized recommendation strategy. The significant advantage of this approach is that it greatly improves recommendation efficiency, avoids blindly sifting through massive amounts of media resources, and effectively saves computing resources and time costs. Taking video platforms as an example, if a viewer's past viewing history shows a high frequency of watching science fiction content, the recommendation platform will specifically select recently popular science fiction videos and newly released science fiction videos as candidate media resources, ensuring that the recommended media resources highly match the viewer's interests and greatly improving the accuracy of the recommendations.
[0193] After obtaining multiple candidate media resources, it is necessary to obtain the second feature information of each candidate media resource. For example, the basic attributes of the media resources can be determined by obtaining their metadata. The metadata of a media resource is a set of key information describing the attributes and characteristics of the media resource. For example, the metadata of an audio media resource may include basic audio information (such as song name, artist name, album, etc.) and content attributes (such as music genre, media duration, etc.).
[0194] Secondary feature information can also be obtained through content analysis techniques. For example, image recognition technology can be used to analyze keyframes in video media resources in detail, extracting unique features such as scene and color style. Taking a travel video as an example, image recognition technology can identify that it is filled with natural scenery, thus including the characteristic of "abundant natural scenery" in the category of secondary feature information for the video. Keyframes are specific frames in a video sequence that are representative and significant. In a video, keyframes are those frames that summarize the video content and reflect the main plot or scene changes.
[0195] When music resources are involved, audio analysis techniques can be used to obtain information such as the tempo, melodic characteristics, and harmonic complexity of a song. For example, algorithms such as the autocorrelation function can be used to accurately detect periodic repetition patterns in the audio signal, thereby determining the beat position of the song and calculating its tempo, i.e., the number of beats per minute. For instance, by analyzing a popular song, if the beat intervals are identified as relatively regular and close, the calculated number of beats per minute is high, indicating that the song has a brisk rhythm. Furthermore, algorithms such as Fourier transform can be used to convert the audio signal from the time domain to the frequency domain, clearly showing the distribution of different frequency components. By detecting the changes in the dominant frequency over time, the fluctuations of the song's melody can be depicted. For example, when analyzing a folk song, if the dominant frequency is found to rise gently within a certain pitch range and then gradually decrease, it reflects the lyrical and melodious characteristics of the song's melody.
[0196] In addition, feedback data from the audience regarding media resources can also be incorporated into the second feature information system. Taking short video platforms as an example, the number of likes, comments, and shares a video receives clearly reflects the degree to which the video is popular and attracts attention from the audience.
[0197] In practical applications, organically combining the acquired object's first feature information with the candidate media resource's second feature information can provide a comprehensive data foundation for subsequent media resource recommendation steps.
[0198] Detailed description of step 320
[0199] In step 320, based on the first feature information and the second feature information, a multi-task prediction model is used to predict and obtain the recommendation score of each candidate media resource. The multi-task prediction model is trained using a first loss function, which is calculated based on the debiased playback duration of the sample media resource and the predicted playback duration predicted by the multi-task prediction model for the sample media resource. The debiased playback duration is determined based on the actual playback duration of the sample media resource and the target distribution pattern, where the target distribution pattern indicates the change of the actual playback duration with the media resource duration of the sample media resource.
[0200] The multi-task prediction model takes the primary feature information of the target audience and the secondary feature information of the candidate media resources as input to complete multiple prediction tasks. These tasks may include predicting the playback duration of candidate media resources and predicting their click-through rate, etc., and ultimately generate a recommendation score for each candidate media resource. This recommendation score comprehensively considers both the primary feature information of the target audience and the secondary feature information of the candidate media resources, reflecting the degree to which the candidate media resources are recommended for a specific target audience. For example, in a music recommendation scenario, the multi-task prediction model might predict whether the target audience will listen to a new song and the likely duration of their listening based on the target audience's past history of liking rock music (primary feature information) and the rock style, artist popularity, song popularity, and media duration of a new song (secondary feature information), and then assign a recommendation score. If the target audience is a rock music enthusiast and the new song is sung by a well-known rock artist with high popularity, the multi-task prediction model might predict that the target audience will listen to the new song for a longer period of time and assign a higher recommendation score.
[0201] In this embodiment, the multi-task prediction model can take various forms. For example, it can be a neural network model within the machine learning framework of artificial intelligence. Neural network models possess powerful nonlinear fitting capabilities, enabling them to accurately capture the complex and subtle relationships between input features and the output results of multiple prediction tasks. When processing media resource recommendation tasks, faced with complex first and second feature information, the neural network model can uncover the hidden patterns behind the data through the nonlinear transformations of its multi-layered neurons, thereby achieving accurate predictions for multiple tasks such as playback duration prediction and click-through rate estimation.
[0202] Sample media resources are individual media resources in the training dataset used to train multi-task prediction models. In order for the multi-task prediction model to accurately predict the attractiveness and recommendation value of candidate media resources to objects, a large amount of representative media resource data is needed for learning and training. These media resources used for training are the sample media resources.
[0203] The training dataset serves to provide learning material for the multi-task prediction model. By analyzing and learning from the sample media resources in the training dataset, the model attempts to identify the relationship between media resource features and the object's response to those resources. For example, the training dataset might contain sample media resources of different music genres, along with information such as the actual playback duration of these tracks for different objects. During training, the multi-task prediction model analyzes this data, learning that rock music, for example, might have a longer actual playback duration for objects like rock enthusiasts under certain feature combinations, thus establishing corresponding prediction rules and parameters. Through continuous learning and adjustment on the training dataset, the multi-task prediction model gradually becomes able to predict the object's possible response to candidate media resources, such as predicting playback duration, and providing a corresponding recommendation score, based on the input object's primary feature information and the candidate media resource's secondary feature information, thereby achieving accurate media resource recommendations.
[0204] Sample media resources contain several important attributes, among which the actual playback duration and the media resource duration are two key attributes. The actual playback duration refers to the time spent by an object watching or listening to the sample media resource in a real-world scenario. The actual playback duration is affected by various factors, such as the object's current interest, the viewing environment, and the attractiveness of the media resource itself.
[0205] The media resource duration of a sample media resource refers to the fixed length of time inherent in the media resource itself. For video, it is the total duration from start to finish; for music, it is the total playback duration of the song. It is an inherent attribute of the media resource and will not change due to the viewing or listening behavior of the audience. For example, a song with a duration of 3 minutes will always have a media resource duration of 3 minutes, regardless of how long the audience actually plays it.
[0206] The first loss function is the loss function corresponding to one of the prediction tasks (i.e., the playback duration prediction task) in the multi-task prediction model. The multi-task prediction model can handle multiple prediction tasks simultaneously. In this embodiment, one of the prediction tasks of the multi-task prediction model is to predict the playback duration of the sample media resource. The first loss function is used to evaluate the degree of fit between the predicted playback duration and the actual situation (i.e., the debiased playback duration). Specifically, the first loss function is calculated based on the debiased playback duration of the sample media resource and the predicted playback duration predicted by the multi-task prediction model for the sample media resource. The predicted playback duration is a predicted value given by the multi-task prediction model for the media resource in the context of media resource recommendation. The multi-task prediction model receives the first feature information of the object and the second feature information of the candidate media resource, and predicts the playback duration of the media resource through its internal algorithm; the resulting prediction is the predicted playback duration.
[0207] By calculating the difference between the debiased playback duration and the predicted playback duration using the first loss function, the multi-task prediction model can continuously optimize its parameters to make the predicted playback duration as close as possible to the debiased playback duration, thereby improving the accuracy of the playback duration prediction task, and thus improving the performance of the entire multi-task prediction model, ultimately achieving more accurate media resource recommendations.
[0208] Debiased playback duration refers to a standardized metric obtained by calibrating the actual playback duration of a media resource. Its core purpose is to eliminate evaluation bias caused by differences in the duration of media resources themselves, thereby more fairly measuring the intensity of an individual's true interest in media resources of different durations. Specifically, an individual's playback behavior is influenced not only by their interest in the content but also by the duration of the media resource itself. For example, between a 3-minute video and a 15-second video, the 15-second video typically has a shorter actual playback duration. If ranked directly by actual playback duration, the 3-minute video would be prioritized because it is more likely to have a larger predicted playback duration, leading to bias in the recommendation results. Debiased playback duration aims to remove this unreasonable influence caused by the duration of media resources, more accurately reflecting the individual's true interest in the media resource.
[0209] The target distribution pattern is a regular relationship indicating the variation of the actual playback duration of a sample media resource with its own media resource duration. It is derived by collecting, organizing, and analyzing the actual playback durations of a large number of sample media resources. Specifically, media resources of different durations often trigger different viewing or listening behavior patterns in users; the target distribution pattern quantifies and summarizes these behavioral patterns. By identifying this target distribution pattern, we can more accurately understand the actual level of user engagement with media resources of different durations, thus providing more valuable reference information for multi-task prediction models and optimizing recommendation results.
[0210] For example, in video recommendation scenarios, analysis of viewing behavior across a large number of users on a certain short video platform revealed that for short videos under 15 seconds in length, approximately 70% of users watch them completely, meaning the average actual playback time is close to or equal to 15 seconds. However, for short videos around one minute in length, only about 40% of users watch them completely, with an average actual playback time of around 40 seconds. This demonstrates a pattern where, as the duration of short video media resources increases, the proportion of users watching completely decreases, and the ratio of actual playback time to the total media resource duration also decreases. This represents a target distribution pattern for short videos on this platform.
[0211] In music recommendation scenarios, taking a certain online music platform as an example, for songs under 3 minutes in length, many listeners may listen to them in their entirety, with the actual playback time roughly equal to the song's length. However, for songs longer than 5 minutes, some listeners may switch songs midway due to their length or because they don't suit their mood, resulting in an actual playback time of only 2-3 minutes. After extensive data statistical analysis, a target distribution pattern of actual playback time variations for songs of different lengths can be obtained. For example, as the song length increases from 3 minutes to over 5 minutes, the average actual playback time gradually decreases from nearly the song's length to about half of the song's length.
[0212] The distribution patterns of target information provide valuable reference information for multi-task prediction models, enabling them to more accurately understand the actual level of user engagement with media resources of different durations. This allows for a more thorough consideration of media resource duration as a key factor in the recommendation process, improving the match between recommendation results and the user's actual needs. Secondly, by applying target distribution patterns, the bias caused by media resource duration can be effectively eliminated, allowing multi-task prediction models to focus more on the user's interest in the content itself, rather than simply being influenced by media resource duration. This results in higher-quality, more personalized media resource recommendations, significantly enhancing the user experience.
[0213] In one embodiment, during the training of the multi-task prediction model, the parameters of the multi-task prediction model can be optimized using a first loss function, enabling the multi-task prediction model to more accurately predict playback duration. After the multi-task prediction model is trained, it can be used to predict and obtain recommendation scores for each candidate media resource based on the first feature information and the second feature information.
[0214] Specifically, the first feature information of the acquired object and the second feature information of each of the multiple candidate media resources can be preprocessed. For the first feature information of the object, including years of experience, education level, and region, years of experience can be normalized by numerical scaling to fit within a specific range, while education level and region can be converted into vector form using one-hot encoding. For historical behavior data in the object's first feature information, browsing history can organize browsed media resources into vectors, while browsing duration and other data can be normalized; search records can use word vector technology from natural language processing to convert search keywords into vectors that the model can process; interactive behaviors such as likes, comments, and favorites can be quantitatively encoded, such as by counting or setting specific numerical identifiers. Regarding usage scenario information, access time can be extracted and encoded with specific time features such as hour, date, and day of the week; the type of terminal device used can also be encoded into a corresponding vector.
[0215] For the second feature information of multiple candidate media resources, the basic attributes of the media resources, such as video type (movie, TV series, short video, etc.) and music style (rock, pop, classical, etc.), can be classified and coded; the media duration can be normalized to make its value fall within a suitable range for easy model calculation; creator information can be converted into numerical representation based on factors such as the creator's popularity and influence; the release time can be converted into numerical forms such as the time difference with the current time; popularity information such as play count, download count, and discussion popularity can be normalized or otherwise appropriately transformed; and the content description or tags can be converted into vector form using word vector models in natural language processing.
[0216] After preprocessing the first and second feature information, this processed feature information can be input into an existing multi-task prediction model. Internally, the multi-task prediction model performs a series of calculations and processes. For example, if the multi-task prediction model is a deep neural network type, it receives the preprocessed feature information at the input layer, then performs nonlinear transformations and feature extraction using activation functions through calculations by multiple layers of neurons in the hidden layer. Finally, it outputs recommendation scores for each candidate media resource at the output layer. Each score represents the degree of matching between the corresponding candidate media resource and the object, and the probability of it being recommended. The higher the recommendation score, the higher the degree of matching between the candidate media resource and the object, and the greater the probability that it will be selected and recommended to the object in the subsequent recommendation process, thus providing an important basis for subsequently determining the target media resource.
[0217] Detailed description of step 330
[0218] In step 330, based on the recommendation scores of each candidate media resource, a target media resource is determined from the plurality of candidate media resources, and the target media resource is recommended to the object.
[0219] Target media resources refer to the media resources most suitable for recommendation to the target audience, determined from multiple candidate media resources based on their recommendation scores. In this embodiment, the number of target media resources is not fixed; it can be one or multiple, depending on the specific application scenario. When pursuing precise and focused recommendations and aiming to provide the target audience with single content highly aligned with their interests, there can be only one target media resource. However, in scenarios aimed at broadening the target audience's horizons, increasing content diversity, or meeting diverse needs, there may be multiple target media resources. Taking the homepage recommendation of a video platform as an example, the platform needs to consider the diverse needs of the target audience at different times and in different moods. Suppose a target audience enjoys watching science fiction movies, browsing cooking videos, and also follows sports events. The recommendation scores calculated by the multi-task prediction model show that a popular new science fiction film, a recent cooking tutorial from a well-known food blogger, and an upcoming live broadcast of a major sporting event are all related to the target audience's interests and have high recommendation scores. At this point, the video platform will recommend these multiple different types of media resources together as target media resources to the user's homepage, allowing the user to access a variety of content that matches their interests on the same interface, satisfying their diverse browsing needs, and increasing the user's desire to explore and retention rate on the platform.
[0220] In one embodiment, recommending the target media resource to the object includes: determining filtering rules; filtering the target media resource; and performing a recommendation operation.
[0221] The steps for determining the screening rules can be approached from aspects such as recommendation score thresholds, ranking selection, and combining other factors. Recommendation score threshold screening involves setting a fixed recommendation score threshold, such as 0.8, so only candidate media resources with recommendation scores higher than this threshold enter the subsequent screening process. Its advantage is its simplicity and directness. Ranking selection involves ranking candidate media resources in descending order based on their recommendation scores, selecting a certain number of top-ranked candidate media resources as target media resources, such as the top 10. This ensures that resources most likely to be of interest to the target audience are selected. Combining other factors involves, in addition to recommendation scores, comprehensively considering the timeliness of media resources, such as prioritizing recently released resources related to news hotspots, and resource diversity, such as considering different types of video resources, such as movies, documentaries, and short videos.
[0222] The process of selecting target media resources can be based on defined selection rules. If the selection rule is singular, such as selecting only based on a recommendation score threshold, then all candidate media resources can be iterated through, and resources with recommendation scores higher than the threshold can be marked as target media resources. For example, a loop can be used to check the recommendation score of each candidate media resource in turn; if the score is greater than the set threshold of 0.8, it can be added to the target media resource list. When the selection rule includes multiple conditions, each selection condition needs to be considered comprehensively. For example, it is necessary to satisfy both the recommendation score threshold and the timeliness of the resources. A portion of resources can be selected first based on the recommendation score threshold, and then these resources can be sorted according to timeliness to further select recently released resources as target media resources. In implementation, nested loops or conditional statements can be used to first select resources that meet the recommendation score condition, and then the timeliness of these resources can be judged.
[0223] The recommendation process can be implemented through various channels and methods. For example, information about target media resources can be sent to the recipient via push notifications. In a mobile application, a system notification can be sent to inform the recipient that new media resources of interest are available. The push notification can include the media resource's title, description, cover image, etc., to attract the recipient's attention. The timing of the push is also crucial and can be chosen based on the recipient's usage habits and the context, such as pushing during the recipient's most active time periods.
[0224] You can also display a list of target media resources within the application's interface on the target device. This list can be displayed in prominent locations such as the application's homepage or recommendation page. Various display methods are available, such as card-style or list-style displays. During display, target media resources can be sorted according to their recommendation scores, with higher-scoring resources appearing first for easier viewing. Furthermore, interactive elements such as like, favorite, and play buttons can be added to each media resource to increase user engagement.
[0225] You can also create personalized recommendation pages for users, categorizing and displaying target media resources according to certain rules. For example, video resources can be divided into categories such as movies, TV series, and variety shows, while music resources can be divided into categories such as pop, rock, and classical. This makes it easier for users to find resources that interest them. Personalized recommendation pages can also provide filtering and sorting functions, allowing users to further filter and arrange resources according to their needs.
[0226] In this embodiment, a multi-task prediction model is used to predict the target media resource based on the first feature information of the target and the second feature information of each of the multiple candidate media resources. This prediction results in a recommendation score for each candidate media resource, which is then used to determine the target media resource and recommend it to the target. The multi-task prediction model is trained using a first loss function, calculated based on the debiased playback duration of the sample media resource and the model's predicted playback duration. The debiased playback duration is derived from the actual playback duration of the sample media resource and the target distribution pattern, which clearly indicates how the actual playback duration changes with the duration of the sample media resource. For example, when faced with media resources of different durations, the actual playback duration of media resources of different durations can be debiased according to the target distribution pattern. This more accurately reflects the target's true interest in different media resources. Through this multi-task prediction model trained on the debiased playback duration, the recommendation process can more accurately grasp the target's interests and preferences, thereby precisely pushing media resources that match the target's interests, enhancing the interaction between the target and the recommendation system, and improving the accuracy of media resource recommendations.
[0227] In one embodiment, such as Figure 4 As shown, the multi-task prediction model is pre-trained in the following manner:
[0228] Step 410: Obtain multiple sample media resources, wherein the sample media resources have the actual playback duration;
[0229] Step 420: Determine the target distribution pattern based on the actual playback duration of each of the multiple sample media resources;
[0230] Step 430: Based on the target distribution pattern, determine the debiasing parameters corresponding to the sample media resources;
[0231] Step 440: Calculate the playback duration after offsetting based on the actual playback duration of the sample media resources and the offsetting parameters;
[0232] Step 450: Based on the sample media resources, the predicted playback duration is obtained by using the multi-task prediction model.
[0233] Step 460: Based on the debiased playback duration and the predicted playback duration, calculate the first loss function, and train the multi-task prediction model based on the first loss function.
[0234] In video recommendation scenarios, the media resource duration of different videos generally varies, and the actual playback time of a video is affected by this duration. For example, a 3-minute video will typically play longer than a 10-second video. This is the bias that the video's media resource duration introduces to the actual playback time. If the media resource duration is ignored and only the actual playback time is considered, the model's recommendation results may be inaccurate. For instance, a 3-minute video that plays for 12 seconds is different from a 10-second video that plays for 10 seconds. Looking only at the actual playback time, the former plays longer, and if the model directly fits the playback time, it will be more likely to recommend the 3-minute video. However, the former only plays a small portion of the video before exiting, while the latter plays the entire video. Therefore, in terms of the video's appeal to the target audience, the latter is more attractive, and the model's recommendation of the latter might be more likely to attract the target audience. This example shows that if the bias introduced by the video's media resource duration is not considered during model training, it can easily lead to inaccurate recommendation results. Therefore, in the process of analyzing and processing sample media resources through the debiasing parameters in the embodiments disclosed in this application, the key value used to eliminate the influence of the media resource duration on the actual playback duration is...
[0235] For step 410, sample media resources can be obtained from the media resource libraries of different platforms via a server. For example, a video platform may have a large number of uploaded and copyrighted video resources with detailed media attribute information, including the duration and actual playback time. Specifically, these resources can be extracted from the video platform's database according to certain rules, such as randomly selecting a certain number of videos, or selecting them according to the order of video release time, popularity ranking, etc., ensuring the diversity of sample media resources. After obtaining multiple sample media resources, these resources need to be organized and labeled. Specifically, the collected sample media resource data can be deduplicated to avoid duplicate samples interfering with model training. For example, duplicate data can be identified and deleted by comparing the unique identifier of the sample media resources (such as video ID). Next, the integrity of the data is checked to see if there are any samples with missing actual playback time. For missing data, data imputation methods can be used, such as filling with the average actual playback time of similar samples, or using machine learning algorithms for prediction imputation. During the annotation process, the actual playback duration of each sample media resource should be clearly annotated to ensure the accuracy and consistency of the data and provide reliable data support for the training of the multi-task prediction model.
[0236] For step 420, the sample media resources can first be grouped according to their duration. For example, video samples can be divided into different ranges based on duration, such as less than 1 minute, 1-5 minutes, 5-10 minutes, 10-30 minutes, and more than 30 minutes. This grouping can intuitively show the actual playback duration characteristics of media resources with different durations. After completing the data grouping, the actual playback duration of the sample media resources can be statistically analyzed. For each group, multiple characteristics of the actual playback duration should be statistically analyzed. Specifically, the average actual playback duration can be calculated. For example, in a media resource duration group, the actual playback durations of all sample media resources in the group can be added together and then divided by the number of sample media resources to obtain the average actual playback duration of the group. In addition to the mean, the median can also be calculated, which can better reflect the central tendency of the data, especially when there are outliers. At the same time, the standard deviation of the actual playback duration can also be calculated to measure the dispersion of the data. The larger the standard deviation, the greater the fluctuation of the actual playback duration within the group. In addition, it is possible to count the proportion of sample media resources in different playback duration ranges. For example, in a certain group, the proportion of samples with actual playback duration in the ranges of 0-20%, 20%-40%, 40%-60%, 60%-80%, and 80%-100% (relative to the duration of media resources) can be counted to gain a more detailed understanding of the distribution of playback duration.
[0237] After the above statistical analysis, the data points for each group can be organized based on these results, forming the target distribution pattern. For example, the media resource duration interval for each group can be used as the x-axis, and the corresponding average actual playback duration, median, and other statistical values can be used as the y-axis to plot the data points. This visually presents the distribution of actual playback duration with media resource duration, thus determining the target distribution pattern and providing basic data for subsequent steps. Alternatively, machine learning algorithms can be used, such as a linear regression model, with media resource duration as the independent variable and actual playback duration as the dependent variable. By training on a large number of sample media resource statistics, a functional relationship between actual playback duration and media resource duration can be obtained, which can then be used as the target distribution pattern.
[0238] For step 430, after determining the target distribution pattern (i.e., the actual data point curve), these data points need to be analyzed. Carefully observe the direction and trend of the data point curve showing the target distribution pattern, as well as the concentration and dispersion of the data.
[0239] Specifically, if the data points exhibit a certain trend in their distribution, fitting these data points is necessary to more accurately describe this distribution and determine the debiasing parameters. When the data points show a relatively simple linear trend, linear regression can be used for fitting. The least squares method is used to find a straight line equation that minimizes the sum of squared errors between the line and the data points, resulting in a linear function. The parameters in this function constitute part of the debiasing parameters. If the data points exhibit complex nonlinear relationships, such as curves or inflections observed through observation, a multinomial regression model can be used. Increasing the degree of the polynomial better fits the data points, resulting in a multinomial function. The parameters in this function are components of the debiasing parameters. Alternatively, more complex machine learning models, such as decision tree regression models, can be used to automatically classify and predict based on the characteristics of the data points, constructing a decision tree structure that reflects the actual playback duration distribution. Debiasing parameters can then be extracted from the relevant parameters of the decision tree. Neural network models can also be used. Through the connection of numerous neurons and complex weight adjustments, the data points are deeply mined and fitted to obtain a function that describes the target distribution pattern. The weights and other parameters in this function can serve as debiasing parameters.
[0240] For step 440, the relationship between the debiasing parameters and the actual playback duration can be clarified, and the debiased playback duration can then be calculated. Several methods can be used at this point. One approach is to determine the debiased playback duration using a scaling method based on the mean squared error (MSE). In this method, the debiasing parameters are closely related to the scaling formula of the mean squared error. Assuming the media resource duration of the sample media resource is T, and the actual playback duration is t, the debiased playback duration y can be calculated using the formula... To calculate, or you can use Similar scaling formulas are used for calculation. Here, such as... The computational parts related to the media resource duration T, such as lnT, are essentially constructing a debiasing parameter relationship. By performing scaling operations on the actual playback duration t in relation to the media resource duration T, the bias effect of the media resource duration on the actual playback duration is eliminated.
[0241] On the other hand, the debiased playback duration can be calculated using a segmented duration fitting method based on binary cross entropy (BCE). Specifically, the sample media resources are grouped according to their duration, such as by different media resource duration intervals. The average actual playback duration for each group is calculated, and this average actual playback duration serves as a key debiasing parameter for that group, i.e., a binary classification threshold. When the actual playback duration of a sample falls within a certain group, if the actual playback duration is greater than the binary classification threshold for that group, it is considered a positive sample; otherwise, it is considered a negative sample.
[0242] Taking a group with an actual playback duration of 5 minutes (this is the debiasing parameter) as an example, suppose there is a sample video whose media resource duration happens to belong to this group, and its actual playback duration is 7 minutes. Since 7 minutes is greater than the binary classification threshold of 5 minutes, this sample video is classified as a positive sample. The debiased playback duration of a positive sample can be a value calculated based on the data features of the group (such as the longest actual playback duration in the group, which can be regarded as the debiasing parameter), or adjusted according to the proportional relationship with the binary classification threshold (debiasing parameter) (for example, a multiple relationship relative to the binary classification threshold), thus obtaining the final debiased playback duration.
[0243] For negative samples, the debiased playback duration can be adjusted by setting it to the shortest actual playback duration within the group (the debiasing parameter). This provides a relatively uniform duration representation that reflects the characteristics of negative samples during multi-task prediction model training. Alternatively, a specific value can be calculated based on the characteristics of the data group, such as using the lower quartile of the actual playback duration within the group (the debiasing parameter) as the debiased playback duration for negative samples. Another approach is to adjust the debiased playback duration according to a proportional relationship with the binary classification threshold (the debiasing parameter). For example, the debiased playback duration for negative samples can be set to a small proportion of the threshold, such as one-third or one-quarter of the binary classification threshold. This approach takes into account the short actual playback duration of negative samples. By reasonably utilizing the debiasing parameter and its derived values for scaling, the bias effect of media resource duration on playback duration can be effectively eliminated, laying the foundation for subsequent multi-task prediction model training using these debiased playback durations.
[0244] In other implementations, if the debiasing parameters are determined by a function model (such as a polynomial function, a neural network model, etc.), then the actual playback duration can be used as the input to the function, and the debiased playback duration can be obtained through the function's operation.
[0245] For step 450, firstly, the sample media resources need to be organized to adapt them to the input requirements of the multi-task prediction model. This process requires adapting the sample media resource data based on the structure and characteristics of the multi-task prediction model. Taking a multi-task prediction model with a deep neural network structure as an example, its input layer has specific requirements for data dimensions and format. If the model expects to receive concatenated feature vectors, then the various feature vectors of the sample media resources must be concatenated into a long vector in a strict order. If the model has multiple input branches, then different categories of features need to be accurately input into the corresponding branches. For example, when the sample media resources contain both image features and text features, and the model has a convolutional neural network branch specifically for processing images and a recurrent neural network branch for processing text, then the image features must first undergo an image preprocessing step to convert them into a format that meets the input requirements of the convolutional neural network before being input into the convolutional neural network branch; the text features must first undergo text vectorization before being input into the recurrent neural network branch. After adapting the sample media resource data, it is input into the multi-task prediction model to execute the prediction task, thereby obtaining the predicted playback duration. Within the model, each layer performs calculations based on the weights and parameters learned during training. In the hidden layers of a deep neural network, neurons perform weighted summations on the input data, which are then processed by activation functions to gradually extract high-level features. As data is passed through each layer of the model, a prediction result is finally generated at the output layer. For multi-task prediction models with multiple outputs, it is necessary to accurately extract the results related to the playback duration prediction from the numerous outputs and use them as the predicted playback duration for that sample media resource.
[0246] Step 460 mainly involves two aspects: calculating the first loss function and training the model based on the first loss function. In multi-task prediction models, playback duration prediction is one of many tasks, and the first loss function is a key means of optimizing this task. There are various ways to construct the first loss function. For example, in some implementations, the first loss function can be constructed using the mean squared error (MSE). For n sample media resources, if the predicted playback durations are y1_pred, y2_pred, ..., yn_pred, and the corresponding debiased playback durations are y1_true, y2_true, ..., yn_true, then the first loss function... By minimizing this MSE value, the multi-task prediction model can continuously adjust its parameters to make the predicted playback duration closer to the debiased playback duration. In other implementations, the first loss function can be constructed using the Mean Absolute Error (MAE), which calculates the average of the absolute values of the differences between the predicted playback duration and the debiased playback duration; this is the first loss function.
[0247] During the training of the multi-task prediction model, the first and second feature information of the sample media resources are input into the model, which then predicts the playback duration based on this input information. Next, by calculating the value of the first loss function, optimization algorithms (such as stochastic gradient descent, Adam algorithm, etc.) are used to adjust the model's parameters, continuously reducing the value of the first loss function. For example, in the stochastic gradient descent algorithm, based on the gradient of the first loss function with respect to the parameters of the multi-task prediction model, the parameters are gradually adjusted in the opposite direction of the gradient. After multiple iterations of training, the multi-task prediction model can more accurately predict playback durations close to the debiased values based on the input features, thus achieving effective training of the multi-task prediction model in the playback duration prediction task using the first loss function.
[0248] The training process for other training tasks in the multi-task prediction model, such as predicting user interactions like liking or commenting on media resources, is similar. First, a corresponding loss function is defined, which might be the cross-entropy loss function used for classification problems. Then, the multi-task prediction model predicts these interactions based on the first and second input features. By calculating the value of the loss function and using similar optimization algorithms to adjust the model parameters, the multi-task prediction model can be continuously optimized for these interaction prediction tasks, thereby improving the overall performance of the multi-task prediction model.
[0249] In summary, the calculation of the first loss function requires a combination of the debiased playback duration and the predicted playback duration. In this embodiment, the debiased playback duration can be approximated as a reference value for the processed "true" playback duration. After obtaining the value of the first loss function, the model parameters are adjusted using an optimization algorithm, thereby achieving effective training of the multi-task prediction model on the playback duration prediction task, and finally completing the training of the entire multi-task prediction model.
[0250] In these alternative embodiments, acquiring a large number of sample media resources and their actual playback durations provides a rich data foundation for subsequent training. Determining the target distribution pattern and debiasing parameters can eliminate data bias, enabling the multi-task prediction model to more accurately capture data features. Calculating the debiased playback duration allows the multi-task prediction model to learn based on more realistic and effective data. By training the multi-task prediction model through calculating the first loss function, the model parameters can be continuously optimized, improving the accuracy and reliability of the multi-task prediction model's predictions. This allows for more precise recommendations of media resources that meet the user's needs, enhancing the user's experience.
[0251] In one embodiment, the debiasing parameters include the average playback duration and the standard deviation of playback duration; the target distribution pattern includes a first distribution pattern and a second distribution pattern, wherein the first distribution pattern indicates the change of the average playback duration with the duration of the media resource, and the second distribution pattern indicates the change of the standard deviation of playback duration with the duration of the media resource;
[0252] like Figure 5 As shown, step 430, which involves determining the debiasing parameters corresponding to the sample media resources based on the target distribution pattern, includes:
[0253] Step 510: Determine the average playback duration based on the media resource duration and the first distribution pattern;
[0254] Step 520: Determine the standard deviation of the playback duration based on the media resource duration and the second distribution pattern.
[0255] The average playback duration is a value calculated by averaging the actual playback duration of sample media resources under specific conditions. Taking video resources as an example, suppose there are 100 video samples, each 5 minutes long, with actual playback durations of 3 minutes, 4 minutes, 2.5 minutes, and so on. Adding these 100 actual playback durations together and dividing by 100 gives the average playback duration of this set of 5-minute video samples. It represents the typical playback duration of this type of media resource.
[0256] The standard deviation of playback duration measures the dispersion of the actual playback duration of a set of sample media resources relative to its mean. Continuing with the example of 100 5-minute video samples, if the actual playback duration of most samples is close to the mean, for example, within 0.5 minutes above or below the mean, then the standard deviation of playback duration is small, indicating that the playback duration is relatively concentrated and stable. Conversely, if some samples have a playback duration of 1 minute and others 4.5 minutes, differing significantly from the mean, the standard deviation will be large, meaning that the playback duration is more dispersed.
[0257] The first distribution law shows how the average playback duration changes with the duration of media resources. For example, analysis of a large number of video samples with different media resource durations reveals that as the video duration gradually increases from 1 minute to 10 minutes, the corresponding average playback duration also gradually increases from 0.5 minutes to 3 minutes, exhibiting an approximately linear upward relationship. This is a first distribution law. It helps to understand the changing trend of the average playback duration corresponding to different media resource durations.
[0258] The second distribution law reflects the change in the standard deviation of playback duration as the duration of media resources changes. For example, analysis of a large number of video samples with different media resource durations reveals that when the video duration is between 1 and 3 minutes, the standard deviation of playback duration is small and relatively stable; however, when the video duration exceeds 10 minutes, the standard deviation of playback duration increases significantly. This indicates that as the duration of media resources increases, the dispersion of playback duration increases. This is the information revealed by the second distribution law, which helps to more comprehensively grasp the data distribution characteristics of the sample media resources.
[0259] In one embodiment, there are multiple ways to determine the average playback duration based on the media resource duration and the first distribution law in step 510. If the first distribution law is approximately linear, the media resource duration can be treated as the independent variable and the average playback duration as the dependent variable to construct a linear equation. By collecting a large number of data points on different media resource durations and their corresponding average playback durations, the maximum likelihood estimation method is used to maximize the likelihood function, thereby determining the value to be determined for the linear equation. After obtaining the linear equation, the sample media resource durations can be substituted into the equation to calculate the corresponding average playback duration.
[0260] If the primary distribution exhibits complex nonlinear characteristics, kernel regression can be used to determine the average playback duration by applying a local weighted average to the data using a kernel function. Specifically, first, a suitable kernel function is selected, such as the Gaussian kernel function or the multinomial kernel function, as different kernel functions are suited to different data distributions. Taking the Gaussian kernel function as an example, it assigns weights to surrounding data points based on their distance from the data point, with closer points receiving greater weights. When implementing kernel regression, for each media resource duration to be predicted, its distance to all known data points is calculated. The weight of each data point is determined according to the kernel function, and then the average playback durations of these data points are weighted and summed to obtain an estimated average playback duration for that media resource duration.
[0261] The process of determining the standard deviation of playback duration is the same as the process of obtaining the average playback duration, and will not be repeated here.
[0262] In these optional embodiments, determining the average playback duration based on the first distribution law and the media resource duration reveals the average playback trend of media resources of different durations, providing a benchmark for subsequent analysis. Determining the standard deviation of the playback duration using the second distribution law and the media resource duration reflects the dispersion of the playback duration around the average value, revealing data fluctuations. Combining these two methods comprehensively characterizes the playback duration features of media resources, eliminates data bias, and makes subsequent calculations of the debiased playback duration more accurate. This provides more realistic and effective data for the multi-task prediction model, improving the model's prediction accuracy and reliability.
[0263] In one embodiment, such as Figure 6As shown, step 440, which involves calculating the post-biased playback duration based on the actual playback duration of the sample media resources and the bias reduction parameters, includes:
[0264] Step 610: Calculate the deviation value of the actual playback duration based on the actual playback duration and the average playback duration;
[0265] Step 620: Calculate the debiased playback duration based on the ratio of the deviation value to the standard deviation of the playback duration.
[0266] The deviation value is a numerical measure of the difference between the actual playback duration of a sample media resource and its average playback duration. Specifically, the deviation value reflects how much the actual playback duration of a particular sample media resource deviates from the average playback duration of media resources of the same type or under the same conditions. For example, suppose the average playback duration of a group of media resources (e.g., videos all 5 minutes long) is calculated to be 3 minutes. Now, there is a specific video sample within this group whose actual playback duration is 4 minutes. The deviation value for this video sample is 4 - 3 = 1 minute, meaning its actual playback duration is 1 minute longer than the average playback duration of the group. If another video sample in the same group has an actual playback duration of 2 minutes, its deviation value is 2 - 3 = -1 minute, indicating that its actual playback duration is 1 minute shorter than the average playback duration. This deviation value is an important basis for calculating the debiased playback duration. It helps to understand the position of each sample media resource's playback duration relative to the overall average level, and then, combined with the standard deviation of playback duration, adjusts the actual playback duration to obtain a more valuable debiased playback duration.
[0267] In some implementations, the deviation value can be determined by directly subtracting the average playback duration from the actual playback duration. Let the actual playback duration of the sample media resource be t, and the average playback duration under the corresponding media resource duration be μ, then the deviation value d = t - μ. Alternatively, weights can be introduced when different sample media resources have different levels of importance. Assuming the weight of the sample media resource is w, then the deviation value d = (w * t - μ). For example, popular videos can be assigned higher weights to highlight their impact on the overall analysis. As for determining the debiased playback duration, the standard score method can be used, specifically expressed by the following formula 1:
[0268]
[0269] Where d is the deviation value and σ is the standard deviation of playback duration. The standard score method converts the actual playback duration into a value within a standard normal distribution, facilitating comparison with other samples. For example, if the deviation value is 2 minutes and the standard deviation of playback duration is 1 minute, then the adjusted playback duration is 2 minutes. This means that the playback duration of this sample media resource deviates from the average level by 2 standard deviations.
[0270] When playback duration data exhibits a complex distribution pattern, nonlinear functions can be used for transformation. For example, logarithmic or exponential functions can be employed. Nonlinear transformations can better handle outliers and asymmetric distributions in the data. Specifically, this can be expressed by the following formulas 2 and 3:
[0271]
[0272] In one specific implementation, assuming the actual playback duration is t, the media duration is T, the average playback duration is f(T), the standard deviation is g(T), and the debiased playback duration is... The playback duration after offset correction can be expressed by the following formula 4:
[0273]
[0274] Formula 4 essentially standardizes the playback duration using the mean and standard deviation of the playback duration. Since the mean and standard deviation of playback duration differ for different media resource durations, Formula 4 standardizes the actual playback duration of a video within a given media resource duration T. Therefore, the standardized playback durations of different media resource durations will fall into the same space, making the standardized, debiased playback durations comparable and eliminating the bias caused by different media resource durations. When modeling the playback duration prediction task, the multi-task prediction model uses the debiased playback duration... As a target to be fitted, it can eliminate the bias caused by the duration of different media resources and improve the recommendation effect.
[0275] In one embodiment, such as Figure 7 As shown, step 420, determining the target distribution pattern based on the actual playback duration of each of the multiple sample media resources, includes:
[0276] Step 710: Group the multiple sample media resources, wherein sample media resources with the same media resource duration are grouped into the same group;
[0277] Step 720: Calculate the average actual playback duration of the sample media resources within the same group, and use it as the average playback duration of the group;
[0278] Step 730: Calculate the standard deviation of the actual playback duration of the sample media resources within the same group, and use it as the standard deviation of the playback duration of the group;
[0279] Step 740: Based on the average playback duration of each group, generate a first curve, the first curve indicating the change of the average playback duration with the duration of the media resources in each group;
[0280] Step 750: Based on the standard deviation of playback duration for each group, generate a second curve, the second curve indicating the change of the standard deviation of playback duration with the duration of the media resources for each group;
[0281] Step 760: Generate a first function that fits the first curve as the first distribution law, and generate a second function that fits the second curve as the second distribution law.
[0282] The first curve is generated based on the average playback duration of each group. With media resource duration on the x-axis and the corresponding average playback duration on the y-axis, the first curve visually displays the trend of average playback duration as media resource duration changes, helping to intuitively observe the distribution of average playback duration under different media resource durations.
[0283] The first function is the function that fits the first curve, representing the first distribution law. This first function precisely describes the relationship between the average playback duration and the total duration of the media resource through a mathematical expression. Using this first function, the corresponding average playback duration can be accurately calculated based on a given media resource duration, providing a quantitative tool for analysis and prediction.
[0284] The second curve is generated based on the standard deviation of playback duration for each group. Similarly, with the media resource duration as the horizontal axis and the corresponding standard deviation of playback duration as the vertical axis, this second curve reflects the variation of the standard deviation of playback duration with the media resource duration, which helps to understand the degree of dispersion of playback duration under different media resource durations.
[0285] The second function is the function that fits the second curve, i.e., the second distribution law. The second function accurately expresses the relationship between the standard deviation of playback duration and the duration of the media resource in mathematical form. Using this second function, the corresponding standard deviation of playback duration can be calculated based on the duration of the media resource.
[0286] In one implementation, the grouping of multiple sample media resources in step 710 is based on the key feature of media resource duration. This can be achieved by traversing all sample media resources, recording the media resource duration information for each sample media resource, and then creating multiple sets or data structures to place sample media resources with the same duration into the same set. For example, a hash table can be used to store the data, with the media resource duration as the key and the corresponding sample media resource set as the value. This allows for the rapid grouping of samples with the same media resource duration into a single set.
[0287] In step 720, the actual playback durations of all sample media resources within a group can be summed and then divided by the number of sample media resources in the group to obtain the average playback duration for each group. Alternatively, a weighted average method can be used to calculate the average playback duration for each group based on the weight of each sample media resource, in order to highlight the influence of certain important sample media resources.
[0288] In step 730, the standard deviation of the actual playback duration of sample media resources within the same group is calculated. This can be done by first calculating the square of the difference between the actual playback duration of each sample media resource and the average playback duration based on the average playback duration mentioned above, then calculating the average of these squared values, and finally taking the square root to obtain the standard deviation of the playback duration for the group.
[0289] In steps 740-750, plotting tools or plotting libraries in a programming language can be used. The media resource duration for each group is used as the x-axis, and the corresponding average playback duration is used as the y-axis. Connecting these coordinate points sequentially forms a first curve reflecting the change in the average playback duration with the media resource duration. Alternatively, a smooth curve fitting method can be used to make the first curve smoother, better displaying the trend. The process for determining the second curve is the same as that for the first curve, and will not be repeated here. Note that different plotting styles and colors can be selected for the second curve to distinguish it from the first curve and more clearly show the changes in the standard deviation of playback duration.
[0290] In step 760, the first function that fits the first curve is used as the first distribution law, which can be determined using methods such as linear regression or multinomial regression. If the first curve exhibits a linear trend, linear regression can be used to determine the slope and intercept of the function; if the first curve is more complex, multinomial regression can be used, and the degree of the polynomial can be determined based on the characteristics of the first curve. The method for generating the second function that fits the second curve as the second distribution law is similar to that for the first curve, and will not be elaborated here.
[0291] In these optional embodiments, the characteristics of each group of sample media resources can be quantified by calculating the average and standard deviation of playback duration. The generated first and second curves visually demonstrate the changing trends of the average and standard deviation of playback duration with the duration of the media resources. The obtained first and second functions accurately describe the distribution pattern in mathematical form, providing an accurate basis for subsequent calculation of the debiased playback duration, improving the accuracy and reliability of the multi-task prediction model, and thus optimizing the recommendation effect.
[0292] In one embodiment, the first function has a first function formula, the first function formula has a first function parameter, the second function has a second function formula, and the second function formula has a second function parameter;
[0293] like Figure 8 As shown, step 760 generates a first function to fit the first curve as the first distribution law, and generates a second function to fit the second curve as the second distribution law, including:
[0294] Step 810: For each group, based on the media resource duration of the group and the first curve, determine the average playback duration of the group;
[0295] Step 820: Substitute the duration of the media resources in the group into the first function formula to obtain the first result;
[0296] Step 830: Based on the average playback duration of each group and the first result, generate the first function;
[0297] Step 840: For each group, determine the standard deviation of the playback duration of the group based on the media resource duration of the group and the second curve;
[0298] Step 850: Substitute the duration of the media resources of the group into the general formula of the second function to obtain the second result;
[0299] Step 860: Based on the standard deviation of the playback duration of each group and the second result, generate the second function.
[0300] The general formula for the first function is a mathematical expression with a general form, used to describe the variation of the average playback duration with the duration of media resources. However, it contains some parameters that need to be determined; these parameters are the parameters of the first function. The general formula for the first function is a framework; by determining the specific values of the parameters of the first function, the specific first function, or the first distribution law, can be obtained. For example, if the general formula for the first function is set as f(T) = aT 2+bT+c (where T is the duration of the media resource), where a, b, and c are the parameters of the first function. Different parameter values will cause the general formula of the first function to take on different forms to adapt to different data distributions.
[0301] The second function formula describes the variation of the standard deviation of playback duration with the duration of the media resource. Like the first function formula, the second function formula also includes parameters to be determined, i.e., the second function parameters. Similar to the first function formula, the second function formula is a general expression template. Once the specific values of the second function parameters are determined, the specific second function, i.e., the second distribution law, can be obtained. For example, the second function formula is g(T) = mT + n (T is the duration of the media resource), where m and n are the second function parameters. The values of the second function parameters determine the specific manifestation of the second function formula.
[0302] The first result is the calculation result obtained by substituting the media resource duration of each group into the general formula of the first function. Since the general formula of the first function contains parameters, the first result is an expression containing parameters when the specific values of these parameters are not determined. By substituting the media resource duration of each group into the general formula of the first function in sequence, a series of first results can be obtained. These first results will be used to compare with the actual average playback duration to determine the values of the parameters of the first function, thereby generating the first function.
[0303] The second result is the calculation result obtained by substituting the media resource duration of each group into the general formula of the second function. Similar to the first result, the second result may also be an expression that includes parameters of the second function. By comparing the standard deviation of the playback duration of each group with the corresponding second result, the specific values of the parameters of the second function can be determined, and thus the second function can be generated.
[0304] In one embodiment, the first function can be determined using maximum likelihood estimation. Specifically, assuming the average playback duration data corresponding to the sample media resources follows a certain probability distribution, a likelihood function can be constructed. By maximizing the value of the first function parameter in this likelihood function, the first function is obtained. The process for determining the second function is similar to that of the first function, except that the data processed and the function form correspond to the second curve and the general formula of the second function, respectively. However, the principle and process are basically the same as those for determining the first function, and will not be elaborated here.
[0305] In these optional embodiments, a first function is generated using a first curve and a first function formula to accurately fit the change in average playback duration with media resource duration, thus accurately predicting the average playback performance of media resources of different durations. The standard deviation of playback duration is processed to generate a second function, characterizing the dispersion of playback duration. The combination of these two methods comprehensively and accurately describes the distribution pattern of media resource playback duration, providing a solid foundation for subsequently determining debiasing parameters based on this distribution pattern. This effectively eliminates the bias caused by media duration, improving the accuracy and recommendation performance of the multi-task prediction model.
[0306] In one embodiment, such as Figure 9 As shown, step 830 generates the first function based on the average playback duration of each group and the first result, including:
[0307] Step 910: Calculate the first fitting error based on the difference between the average playback duration of each group and the first result;
[0308] Step 920: Determine the parameters of the first function by minimizing the first fitting error, thereby generating the first function.
[0309] like Figure 10 As shown, step 860, which generates the second function based on the standard deviation of the playback duration for each group and the second result, includes:
[0310] Step 1010: Calculate the second fitting error based on the difference between the standard deviation of the playback duration of each group and the second result;
[0311] Step 1020: Determine the parameters of the second function by minimizing the second fitting error, thereby generating the second function.
[0312] The first fitting error is calculated based on the difference between the average playback duration of each group and the first result. In step 910, for each group, the average playback duration of the group is determined based on the media resource duration and the first curve. These values reflect the actual average playback duration and can be considered as true values. In step 920, the first result obtained by substituting the media resource duration of the group into the general formula of the first function can be considered as a predicted value. Since the parameters of the first function in the general formula of the first function are not yet determined, there is a deviation between the predicted value and the true value. The first fitting error quantifies and synthesizes this deviation for all groups. By minimizing the first fitting error, the parameters of the first function are adjusted, and finally, a first function that can fit the first curve well is determined, so that the predicted value of the first function more accurately reflects the change of the standard deviation of playback duration with the media resource duration. The principle of the second fitting error is similar to that of the first fitting error and will not be elaborated here.
[0313] In one embodiment, the mean squared error can be used to determine the first function. Specifically, the number of sample groups can be set to n, and the average playback duration of the i-th group can be... The first result is the duration T of this group of media resources. i Substituting into the general formula of the first function f(T) i The value obtained by θ1), where θ1 represents the first function parameter (e.g., θ1 = [a, b, c, ...]), then the first fitting error The mean squared error method squares and averages the errors of each group, amplifying the impact of larger errors. Subsequently, the first fitting error can be minimized using gradient descent to obtain the values of the first function parameters. The gradient of the first fitting error with respect to the first function parameters is iteratively updated until the first fitting error converges to a small value. The resulting θ1 is the first function parameter that allows the general formula of the first function to fit the first curve well, thus generating the first function. The process of determining the second function is similar to that of the first function, except that the data processed and the function form correspond to the second curve and the general formula of the second function, respectively. However, the principle and process are basically the same as those for determining the first function, and will not be elaborated further here.
[0314] In these alternative embodiments, calculating and minimizing the first fitting error allows the first function to accurately fit the relationship between the average playback duration and the media resource duration, effectively reflecting the true distribution of the data and improving the accuracy of the prediction of the average playback duration. Similarly, calculating and minimizing the second fitting error enables the second function to accurately describe the pattern of the standard deviation of playback duration and the media resource duration. Both functions together provide a reliable basis for subsequent data analysis and prediction, helping to more accurately understand the characteristics of media resource playback duration and optimize the performance of the multi-task prediction model.
[0315] In one embodiment, the first function is a monotonically increasing function, and when the duration of the media resource approaches positive infinity, the value of the first function approaches a first constant, the first constant being positive, and the parameters of the first function include the first constant, the first coefficient, the first exponent, and the second exponent.
[0316] like Figure 11 As shown, the first function formula is generated in the following way:
[0317] Step 1110: Calculate the first product based on the first power of the media resource duration and the first coefficient;
[0318] Step 1120: Calculate the first power with the first product as the exponent;
[0319] Step 1130: Calculate the first difference between 1 and the first power.
[0320] Step 1140: Generate the general formula of the first function based on the second exponent of the first difference and the first constant.
[0321] A monotonically increasing function is a function whose value increases as the independent variable increases within its domain. In this embodiment, the first function is a monotonically increasing function, meaning that as the duration of the media resource increases, the average playback duration represented by the first function will also increase. This reflects the trend that, within a certain range, the longer the media resource duration, the longer the average playback duration.
[0322] As the duration of media resources approaches positive infinity, the value of the first function will approach the first constant. This first constant can be understood as an upper limit to the average playback duration. As the duration of media resources increases, the average playback duration will not grow indefinitely, but will approach this first constant. For example, regardless of the video's length, the average playback duration will approach a stable value due to limitations imposed by factors such as the user's own time and attention span; this stable value is the first constant.
[0323] The first coefficient, first exponent, and second exponent are all adjustable parameters in the general formula of the first function. They work together to determine the specific form and characteristics of the first function. These three parameters interact to influence the growth rate, trend of change, and fit of the first function to actual data. By adjusting their values, the first function can better reflect the relationship between the average playback duration and the duration of media resources. For example, increasing the first coefficient or the first exponent can accelerate the growth rate of the general formula of the first function, while adjusting the second exponent can change the growth characteristics of the general formula of the first function at different stages.
[0324] In one specific embodiment, in a video recommendation scenario, videos with different media resource durations exhibit their own distribution patterns in terms of playback duration. For example, a 5-second video has an average playback duration of approximately 3 seconds, a 10-second video has an average playback duration of approximately 6 seconds, and a 120-second video has an average playback duration of approximately 40 seconds. The first function t = f(T) is a mapping from the media resource duration T to the average playback duration t of all videos with that media resource duration, used to estimate the average playback duration of videos with a media resource duration of T. In this embodiment, the curve corresponding to the first function t = f(T) is referred to as the mean curve.
[0325] Specifically, the determination of the first function can be achieved as follows: First, by statistically analyzing a large number of sample media resources, data points (T0, T1, T2) corresponding to the average playback duration t of different media resource durations T are obtained. i ,t i ), i = 1, 2, ..., M, where M is the number of samples. For example, ... Figure 12 As shown, from T i=Starting at 5 seconds, the sample media resources are grouped every 1 second until T. i =600 seconds, at which point M=596. The following... Figure 12 It shows all (T) i ,t i The line graph plotted by i = 1, 2, ..., M.
[0326] Depend on Figure 12 It is evident that when the media resource duration is less than 300 seconds, the average playback duration increases with the increase in media resource duration; however, when the media resource duration exceeds 300 seconds, the average playback duration remains essentially unchanged. Therefore, this embodiment of the disclosure designs a mechanism that satisfies... Figure 12 The first general formula of the data pattern is used to fit the data. Figure 12 From the data in the line graph shown, the first function t = f(T) is obtained. Based on... Figure 12 Given the characteristics of the data, the first function t = f(T) needs to satisfy the following three conditions:
[0327] (1) The range of values for t and T is (0, +∞).
[0328] (2) t is monotonically increasing with respect to T; (i.e., the first function is a monotonically increasing function)
[0329] (3)lim T→+∞ f(T) = d, where d (i.e. the first constant) is a constant greater than zero (i.e., the value of the first function approaches the first constant when the duration of the media resource approaches positive infinity).
[0330] Regarding the above three conditions, condition (1) requires that the average duration of media resources and playback duration must be positive, while conditions (2) and (3) are determined by... Figure 12 This is determined by the characteristics of the data.
[0331] Under the premise of satisfying the above conditions, f(T) also needs to fit the actual data well, that is, the fitting error should be as small as possible. Therefore, the embodiments of this disclosure design the following first general formula:
[0332]
[0333] Where d is the first constant; a is the first coefficient; b is the first exponent; c is the second exponent; T is the duration of the media resource; and f(T) is the estimated value of the average playback duration when the media resource duration is T. Where -aT b For the first product mentioned above, For the first power above, This is the first difference mentioned above.
[0334] After obtaining the general formula of the first function, the parameters of the first function can be determined through steps 910-920, thereby generating the first function. In a specific embodiment, the first function can be generated by... Figure 12 All data points (T) i ,t i The values of i, i = 1, 2, ..., M are obtained by fitting the data using the least squares method. The objective function of the fit is:
[0335]
[0336] pass Figure 12 All data points (T) i ,t i After fitting, as shown Figure 13 As shown, the original data points (T) are displayed. i ,t i The graph shows a broken line graph connecting the media resource duration and a first function t = f(T) obtained through fitting, where the horizontal axis represents the duration of the media resource and the vertical axis represents the average playback duration of all videos corresponding to that media resource duration. After fitting f(T), for any media resource duration, the average playback duration of the media resource can be quickly and accurately estimated using f(T).
[0337] It should be noted that, for the above three conditions, this disclosed embodiment is merely an exemplary illustration based on the statistical analysis of the average playback duration of specific sample media resources. The specific general formula of the first function can be determined according to the actual first distribution law of different sample media resources. For example, under certain conditions, the average playback duration may exhibit a logarithmic growth trend. In this case, the general formula of the first function can be designed as f(T) = a + b * ln(T + c). Here, a is a constant term that affects the initial value of the general formula of the first function, similar to the first constant in the previous example, and plays a key role in the value of the general formula of the first function when the media resource duration is small; b is similar to the first coefficient, which determines the growth rate of the logarithmic function. The larger the value of b, the faster the general formula of the first function grows; c is used to adjust the domain of the logarithmic function to prevent the logarithm from being meaningless, and also has a certain influence on the overall shape of the general formula of the first function, which can be compared to a special exponential adjustment parameter.
[0338] For example, if the average playback duration of sample media resources exhibits a segmented variation characteristic—when the media resource duration is short, the average playback duration increases linearly with the media resource duration, but the growth trend changes when the media resource duration exceeds a certain threshold—then the general formula for the first function can be designed as a piecewise function: when T≤T0), f(T)=k1*T+m1; when T>T0), f(T)=k2*(T-T0) α+m2. Here, k1 and k2 are similar to the first coefficients of different stages, controlling the slope of the function in different stages; m1 and m2 are constant terms, affecting the starting position of the function in different stages; α is similar to the second exponent, determining the rate of growth or decay of the function in the second stage. By adjusting these parameters, the general formula of the first function can be made to fit the piecewise data distribution pattern.
[0339] In these optional embodiments, the first function formula satisfies a monotonically increasing condition, and the function value approaches a positive constant as the media resource duration approaches positive infinity. Overall, the first function formula generated using the first coefficient, the first exponent, and the second exponent can better fit the relationship between the media resource duration and the average playback duration, providing accurate data for subsequent data analysis and prediction based on this first function formula, effectively improving the accuracy and reliability of the multi-task prediction model recommendation.
[0340] In one embodiment, the second function is a monotonically linearly increasing function, and the parameters of the second function include a second coefficient and a second constant;
[0341] like Figure 14 As shown, the second function formula is generated in the following way:
[0342] Step 1410: Calculate the second product based on the media resource duration and the second coefficient;
[0343] Step 1420: Generate the general formula of the second function based on the second product and the second constant.
[0344] A monotonically increasing linear function is a special type of function. In a Cartesian coordinate system, the graph of a monotonically increasing linear function is a straight line. That is, in this embodiment of the present disclosure, for the second function, as the duration of the media resource gradually increases, the standard deviation of the playback duration will continuously increase at a fixed rate of change.
[0345] The second coefficient is a coefficient multiplied by the media resource duration when generating the general formula of the second function. It determines the rate at which the standard deviation of playback duration changes with the media resource duration. The larger the second coefficient is, the faster the standard deviation of playback duration increases.
[0346] The second constant is a fixed value added to the second product when calculating the general formula of the second function, and it determines the intercept of the graph of the second function on the vertical axis.
[0347] In one specific embodiment, taking the video recommendation scenario in steps 1110-1140 above as an example, the generation process of the second function will be explained.
[0348] In video recommendation scenarios, to comprehensively depict the target distribution pattern when the media resource duration is T, in addition to estimating the average playback duration f(T), accurately estimating the standard deviation of playback duration g(T) (i.e., the second function) is equally crucial. Just as with the definition of the first function, the function mapping from the media resource duration T to the standard deviation of playback duration g(T) of all videos with that media resource duration is determined as the second function.
[0349] First, for media resources in the sample media resources with a duration of T i The playback duration of all videos was statistically analyzed, and its standard deviation was obtained as s. i Let i = 1, 2, ..., M. By processing the data from these sample media resources, a series of data points (T) can be obtained. i ,s i ), i = 1, 2, ..., M. For example... Figure 15 As shown, connecting these data points sequentially forms a line graph.
[0350] The line graph clearly shows that, within the range of media resources with a duration of less than 300 seconds, the standard deviation of playback duration exhibits a linear increasing trend with the media duration. Based on this data pattern, a second function formula needs to be designed to fit the standard deviation data of playback duration, thus obtaining the second function s = g(T). According to the characteristics reflected in the line graph, the second function s = g(T) needs to satisfy two conditions:
[0351] (1) The range of values for s and T is (0, +∞);
[0352] (2) s increases linearly with respect to T.
[0353] from Figure 15 Looking at the line graph, it exhibits a clear linear characteristic, so a linearly increasing function can be used for fitting. In this embodiment, the general formula for the second function of s = g(T) can be set as g(T) = uT + v. Here, T is the duration of the media resource, and g(T) is the estimated value of the standard deviation of the playback duration when the media resource duration is T. u is the second coefficient, and v is the second constant; both are parameters in the function that need to be determined by the second fitting error.
[0354] Specifically, statistically obtained data points (T) can be used. i ,s i For each i = 1, 2, ..., M, the least squares method is used for fitting. The objective function for fitting is:
[0355]
[0356] By continuously adjusting the values of u and v, the value of the fitted objective function is minimized, thereby determining the most suitable second coefficient u and second constant v.
[0357] like Figure 15 As shown, the original data points (T) are displayed. i ,s i The graph shows a solid line connecting i = 1, 2, ..., M, and the second function obtained through fitting (dashed line) s = g(T). Figure 15 In the diagram, the horizontal axis represents the duration T of the media resource, and the vertical axis represents the standard deviation of the playback duration of all videos corresponding to that media resource duration. Through this fitting process, the resulting second function accurately reflects the relationship between the standard deviation of playback duration and the duration of the media resource, providing strong support for further in-depth data analysis and the optimization of the video recommendation system.
[0358] It should be noted that the above general formula for the second function is merely an example based on statistical analysis of the standard deviation of playback duration for a specific sample of media resources. In practical applications, the specific formula for the second function needs to be determined based on the actual data distribution patterns of different sample media resources.
[0359] In one embodiment, such as Figure 16 As shown, step 460, which involves calculating the first loss function based on the debiased playback duration and the predicted playback duration, includes:
[0360] S1610, the debiased playback duration is converted into a first probability, and the predicted playback duration is converted into a second probability, wherein the first probability and the second probability are probabilities that satisfy a Bernoulli distribution;
[0361] S1620, Calculate the first loss function based on the first probability and the second probability.
[0362] The first probability is a Bernoulli distribution probability derived from the debiased playback duration. The debiased playback duration is transformed in a specific way and mapped to a probability value between 0 and 1. This probability value represents the likelihood of an event related to the debiased playback duration occurring, conforming to the characteristics of a Bernoulli distribution, that is, the event has only two possible outcomes (e.g., success or failure).
[0363] The second probability is a Bernoulli distribution probability obtained by transforming the predicted playback duration. Similarly, the predicted playback duration, through a corresponding transformation method, yields a numerical value representing the probability of the event corresponding to the predicted playback duration, also following a Bernoulli distribution, used to measure the likelihood of a specific event occurring based on the predicted playback duration. These two probabilities, from the perspectives of the debiased playback duration and the predicted playback duration respectively, provide the basis for subsequently calculating the first loss function, in order to evaluate the difference between the two. Therefore, in one embodiment, as... Figure 17 As shown, step 1610, which involves converting the debiased playback duration into a first probability, includes:
[0364] Step 1710: Calculate the second power of the negative of the playback duration after debiasing;
[0365] Step 1720: Calculate the first sum of 1 and the second power;
[0366] Step 1730: Calculate the first probability based on the reciprocal of the first sum.
[0367] According to Formula 4, the playback duration after offset correction is calculated using Formula 4. It will be mapped to a new scale. Since the debiased playback duration is a relative measure based on the average playback duration and the standard deviation of the playback duration, and considering the general characteristics of the data distribution, it makes... The values are roughly concentrated in the range [-1, 1]. That is, when the actual playback duration equals the average playback duration for that media resource, When the actual playback duration exceeds the average playback duration of the media resource, It is a positive value; when it is less than the average playback duration, It is a negative value. And because the calculation yields... Most of them are concentrated in a certain range around the mean, so This roughly falls within the range of [-1, 1], becoming a continuous value. To facilitate fitting the playback duration after debiasing and to minimize information loss, this embodiment uses the sigmoid function to... This is converted to probability q (i.e., the first probability). Specifically, this can be achieved using the following formula (8):
[0368]
[0369] Where q is the first probability. To adjust the playback duration after offset correction, The second power, Let q be the first sum; then consider q as the parameter q in the Bernoulli distribution Ber(q).
[0370] And such Figure 17 As shown, in one embodiment, the step 1610 of converting the predicted playback duration into a second probability includes:
[0371] Step 1740: Calculate the third power of the predicted playback duration, with the negative of the predicted playback duration as the exponent;
[0372] Step 1750: Calculate the second sum of 1 and the third power;
[0373] Step 1760: Calculate the second probability based on the reciprocal of the second sum.
[0374] Let the predicted playback duration of the multi-task prediction model be . Similarly, the sigmoid function is used to... This is transformed into probability p (i.e., the second probability). This can be achieved using the following formula (9):
[0375]
[0376] Where p is the second probability. To predict playback duration, The third power, Let p be the second sum; then consider p as the parameter p in the Bernoulli distribution Ber(p).
[0377] In these alternative embodiments, converting the debiased playback duration into a first probability in Bernoulli mapping maps continuous values to a probability range of 0 to 1, facilitating processing within a unified probabilistic framework. Converting the predicted playback duration into a second probability allows for comparison with the former on the same scale. The introduction of the Bernoulli distribution simplifies the playback duration prediction problem into a binary probability problem, which is beneficial for mathematical modeling and analysis. These two probabilities serve as the basis for subsequently calculating the first loss function, more accurately measuring the difference between the prediction and the actual situation, allowing the multi-task prediction model to better learn data features during training, thereby improving prediction accuracy and recommendation performance.
[0378] In one embodiment, the first loss function can be computed by calculating the cross-entropy between the probabilities of the two Bernoulli distributions (i.e., the first probability and the second probability). Therefore, as... Figure 18 As shown, step 1620, calculating the first loss function based on the first probability and the second probability, includes:
[0379] Step 1810: Calculate the first logarithm of the reciprocal of the second probability;
[0380] Step 1820: Calculate the third product based on the first probability and the first logarithm;
[0381] Step 1830: Calculate the second difference between 1 and the first probability, and the third difference between 1 and the second probability;
[0382] Step 1840: Calculate the second logarithm of the reciprocal of the third difference;
[0383] Step 1850: Calculate the fourth product based on the second difference and the second logarithm;
[0384] Step 1860: Calculate the first loss function based on the third product and the fourth product.
[0385] In this embodiment, the core objective of training the multi-task prediction model is to make the predicted value (i.e., the predicted playback duration) as close as possible to the actual value (i.e., the debiased playback duration). From the perspective of probability distribution, this means that the Bernoulli distribution Ber(p) (where p is the second probability) derived from the predicted playback duration should be as close as possible to the Bernoulli distribution Ber(q) (where q is the first probability) derived from the debiased playback duration. To accurately measure the degree of difference between these two Bernoulli distributions Ber(p) and Ber(q), a first loss function needs to be designed to determine the degree of difference between them. In one specific implementation of this embodiment, cross-entropy can be used as the first loss function. Let C be the cross-entropy between the Bernoulli distributions Ber(p) and Ber(q), and its expression is:
[0386]
[0387] Based on the properties of cross-entropy, the closer the probability distributions Ber(p) and Ber(q) are, the smaller the value of cross-entropy C; conversely, the greater the difference between the two probability distributions, the larger the value of C. Therefore, when modeling the task of predicting playback duration in a multi-task prediction model, the key is to minimize the value of cross-entropy C. Consequently, the first loss function in this embodiment is carefully designed based on this principle of cross-entropy, thereby helping the multi-task prediction model to continuously optimize during training and improve the approximation between the predicted playback duration and the debiased playback duration.
[0388] Specifically, let q be the probability converted from the debiased playback duration of the i-th sample. i The predicted duration of the model target, after being converted into a probability, is p. i (θ), where θ is the model parameter. The second probability p for each sample. i (θ), calculate the first logarithm of its reciprocal, i.e. This step prepares for the subsequent calculation of cross-entropy. Logarithmic operations can amplify the differences in probabilities, making it easier to measure the degree of difference between different probabilities.
[0389] The first probability q i With the first logarithm Multiplying them together gives the third product. This reflects the contribution of the first probability to the cross-entropy calculation.
[0390] Calculate (1-q) respectively i ) and (1-p i (θ)) yields the second and third differences. These two differences are used to subsequently calculate another component of the cross-entropy, to comprehensively measure the difference between the two probability distributions.
[0391] For the third difference (1-p) i Calculate the second logarithm after taking the reciprocal of (θ), that is... This step is also to amplify the probability difference, making subsequent calculations easier.
[0392] The second difference (1-q) i ) and the second logarithm Multiplying them together, we get the fourth product. This term, together with the third product, constitutes the cross-entropy of a single sample.
[0393] For each sample, the third and fourth products are summed to obtain the cross-entropy of a single sample:
[0394]
[0395] Then, the average of the cross-entropy of all samples is calculated to obtain the first loss function:
[0396]
[0397] Further simplification of the logarithm in Formula 11 yields:
[0398]
[0399] Where N represents the total number of sample media resources. The training process for the playback duration prediction task in the multi-task prediction model is essentially the process of minimizing the first loss function L(θ). By continuously adjusting the model parameters θ, L(θ) is minimized, thereby learning the optimal parameters θ of the model. * ,Right now:
[0400] θ * =argmin θ L(θ)(Formula 13)
[0401] This allows the Bernoulli distribution Ber(p) to approximate the Bernoulli distribution Ber(q) as closely as possible, improving the accuracy of the multi-task prediction model in predicting playback duration.
[0402] In these alternative embodiments, calculating the first loss function using cross-entropy can effectively measure the degree of difference between the two Bernoulli distributions (i.e., the distributions represented by the first and second probabilities). The closer the second probability distribution corresponding to the predicted playback duration is to the first probability distribution corresponding to the debiased playback duration, the smaller the cross-entropy, i.e., the smaller the value of the first loss function. This can intuitively reflect the closeness between the model's prediction and reality, helping to optimize the training of multi-task prediction models and improve prediction accuracy.
[0403] In one embodiment, such as Figure 19 As shown, training the multi-task prediction model based on the first loss function includes:
[0404] Step 1910: Obtain the loss function for each of the other tasks besides the playback duration task.
[0405] Step 1920: Calculate the multi-task loss function based on the first loss function and the respective other task loss functions of each other task;
[0406] Step 1930: Train the multi-task prediction model based on the multi-task loss function.
[0407] Playback duration prediction is a crucial task in multi-task prediction models, with its core objective being to predict the actual playback duration of media resources. Other tasks refer to prediction tasks within the multi-task prediction model besides playback duration prediction. Taking video recommendation as an example, in addition to accurate prediction of playback duration, it encompasses many other equally critical tasks. These tasks reflect the interaction behavior and potential needs of users with videos from different dimensions, playing an indispensable role in improving the accuracy of video recommendations and the user experience. Examples include predicting whether a user will like, share, favorite, or rate a video.
[0408] Other task loss functions measure the difference between the predicted and actual values for each other task. Different other tasks can employ different loss function forms. Taking the task of predicting whether an object will "like" a video as an example, the result exhibits typical binary classification characteristics, meaning the object's behavior exists in only two mutually exclusive states: liking or not liking. Based on this, the binary cross-entropy loss function can be used. The core principle of the binary cross-entropy loss function is to quantify the deviation between the model's predicted probability of liking and the actual probability of liking. Another example is the task of predicting an object's rating of a video. Since object ratings are usually expressed as continuous numerical values (e.g., 1-5 stars), the mean squared error loss function can be used. The mean squared error loss function measures the prediction error by calculating the squared mean of the difference between the model's predicted rating and the object's actual rating.
[0409] The multi-task loss function is an overall loss function that comprehensively considers the losses of the playback duration task and other tasks. Specifically, it can be a weighted sum of the loss functions of each task. For example, suppose the first loss function for the playback duration task is L1, the loss function for the predicted object's "like" task is L2, the loss function for the predicted object's "share" task is L3, and the loss function for the predicted object's "favorite" task is L4, and these tasks are assigned weights w1, w2, w3, and w4 respectively. Then the multi-task loss function L can be expressed as L = w1*L1 + w2*L2 + w3*L3 + w4*L4. By minimizing this multi-task loss function, the multi-task prediction model can simultaneously optimize the prediction performance of each task, achieving collaborative learning among multiple tasks, thereby providing more accurate prediction results in multiple aspects.
[0410] In one specific embodiment, it is assumed that in a multi-task prediction model of a video recommendation system, there are tasks for predicting playback duration, predicting object likes, predicting object shares, and predicting object favorites.
[0411] For step 1910, obtain the loss function for each task. The first loss function for the playback duration prediction task is calculated using cross-entropy, based on the previously described conversion of the debiased playback duration and predicted playback duration into probabilities. For the object like prediction task, since it is a binary classification problem, a binary cross-entropy loss function can be chosen. The multi-task prediction model predicts the object like probability based on the first feature information, second feature information, etc., and calculates the loss by comparing it with the actual like situation (1 for like, 0 for no like). For the object share prediction task, considering the sparsity of the data and class imbalance, a weighted binary cross-entropy loss function can be used, calculating the loss by setting weights for different categories based on the ratio of shared to unshared samples. For the object favorite prediction task, given the characteristics of favorite behavior data, a focal loss function can be used. Focal loss can focus on hard-to-classify samples, improving the accuracy of the multi-task prediction model in predicting favorite behavior.
[0412] In step 1920, a weighted summation method can be used to calculate the multi-task loss function. When using this method, the determination of the weights is crucial, as they determine the performance of the multi-task prediction model on each task. In scenarios like video recommendation systems, an initial weight can be determined based on experience and business requirements. Subsequently, the task difficulty can be assessed by observing metrics such as the rate of decrease in the loss function and the improvement in the accuracy of the multi-task prediction model on each task. If the loss function for the "like" task decreases slowly, it indicates that the model is struggling with this task, and its weight can be appropriately increased to encourage the multi-task prediction model to focus more on this task, accelerating convergence. This weight can then be dynamically adjusted in subsequent training based on task progress.
[0413] In step 1930, during the training of the multi-task prediction model based on the multi-task loss function, sample media resources can be continuously input into the model. The multi-task prediction model performs forward propagation calculations based on the input sample media resources, outputting prediction results for each task, such as playback duration, likes, shares, and favorites. Next, based on the multi-task loss function, the difference between the predicted results and the actual values for each task is quantitatively evaluated, and the corresponding gradients are calculated. Subsequently, using the backpropagation algorithm, the calculated gradients are propagated backward along the hierarchical structure of the deep neural network of the multi-task prediction model, thereby updating the model parameters. In this iterative process, the multi-task prediction model continuously learns the features and patterns in the sample media resources, gradually optimizing its prediction performance on each task, thereby achieving accurate predictions of multiple tasks such as playback duration and object behavior to meet the needs of real-world business scenarios.
[0414] In these optional embodiments, obtaining the loss functions for each other task allows for precise measurement of prediction errors based on the characteristics of different tasks, enabling the multi-task prediction model to focus on the unique needs of each task. Calculating the multi-task loss function comprehensively considers the playback duration task and other tasks, preventing the multi-task prediction model from focusing solely on a single task and balancing the importance of each task. Training the model based on the multi-task loss function allows the multi-task prediction model to learn collaboratively and optimize across multiple tasks, improving overall performance and generalization ability. This results in greater accuracy in predicting playback duration and other tasks, meeting the diverse prediction needs of complex business scenarios.
[0415] In one embodiment, such as Figure 20 As shown, step 1930, training the multi-task prediction model based on the multi-task loss function, includes:
[0416] Step 2010: Calculate the multi-sample loss function based on the multi-task loss function of each of the sample media resources;
[0417] Step 2020: Train the multi-task prediction model based on the multi-sample loss function.
[0418] The multi-sample loss function is the result of comprehensively calculating the multi-task loss functions of multiple sample media resources. In the training scenario of the multi-task prediction model, each sample media resource has a corresponding multi-task loss function, which comprehensively considers the losses of the playback duration task and other tasks. The multi-sample loss function is the summation calculation of the multi-task loss functions of all sample media resources. In step 2010, the multi-sample loss function can be calculated by averaging the multi-task loss functions of each sample media resource. For example, assuming there are N sample media resources, the multi-task loss function of the i-th sample media resource is... So many sample loss functions It can be represented as By calculating the multi-sample loss function, the performance of the multi-task prediction model on the entire sample dataset can be more comprehensively reflected.
[0419] In a video recommendation scenario, assuming there are N sample videos, the multi-task loss function of each of these N sample videos is summed and divided by N to obtain the multi-sample loss function. For example, if there are 100 sample videos, the multi-task loss functions of these 100 videos are summed and divided by 100 to obtain the multi-sample loss function value for the current sample set. This value reflects the overall prediction bias of the multi-task prediction model on this batch of samples. Subsequently, using the multi-sample loss function value as a feedback signal, the multi-task prediction model calculates the gradient of the network parameters in each multi-task prediction model through the backpropagation algorithm. Since the multi-sample loss function integrates the loss information of multiple samples and multiple tasks, the calculated gradient can comprehensively reflect the bias of the multi-task prediction model on different tasks and different samples. The multi-task prediction model adjusts the weights and other parameters in the network based on these gradients. For example, if the playback duration prediction bias is large on some samples, the gradient will prompt the multi-task prediction model to adjust the parameters related to the playback duration prediction; if the object like prediction is inaccurate on some samples, the gradient will also guide the multi-task prediction model to optimize the corresponding parameters. Through multiple rounds of iterative training and continuous adjustment of parameters based on the new multi-sample loss function, the multi-task prediction model can gradually improve its prediction performance on a large number of samples across multiple tasks, ultimately achieving accurate prediction of video playback duration and object behavior, providing strong support for video recommendation.
[0420] In one embodiment, such as Figure 21 As shown, step 460, training the multi-task prediction model based on the first loss function, includes:
[0421] Step 2110: Calculate the duration difference between the debiased playback duration and the predicted playback duration;
[0422] Step 2120: Calculate the second loss function based on the time difference;
[0423] Step 2130: Train the multi-task prediction model based on the first loss function and the second loss function.
[0424] In some implementations, the first loss function is calculated based on the difference in probability distributions, thereby guiding the multi-task prediction model to optimize the prediction results in the probability dimension, making the probability distribution of the predicted playback duration output by the model as close as possible to the actual probability distribution of the playback duration after debiasing. The second loss function similarly reflects the degree of difference between the predicted playback duration and the actual playback duration after debiasing in the playback duration prediction task. However, the second loss function focuses on a numerical perspective, directly quantifying the difference between the two to push the predicted playback duration to more closely approximate the actual value after debiasing, thereby improving the accuracy of the multi-task prediction model in playback duration prediction.
[0425] In one specific implementation of this disclosure, the time difference between the debiased playback duration of a large number of sample media resources and the playback duration predicted by the multi-task prediction model is first calculated. Then, based on the calculated time difference, a second loss function (MSE) is constructed using the mean squared error (MSE). The squared duration differences corresponding to numerous sample media resources are summed and then divided by the total number of samples to obtain the mean squared error. This MSE value is the calculation result of the second loss function, which comprehensively reflects the overall deviation of the multi-task prediction model in playback duration prediction; the larger the value, the greater the difference between the model's predicted value and the debiased actual value. Subsequently, the first and second loss functions are weighted and summed to obtain the total loss function. The multi-task prediction model aims to minimize the total loss function, continuously adjusting the parameters in the multi-task prediction model to gradually improve its performance in the playback duration prediction task, ultimately achieving more accurate playback duration prediction.
[0426] In these alternative embodiments, a second loss function is calculated based on the duration difference to quantify this deviation numerically, allowing the multi-task prediction model to be optimized in a targeted manner. By combining the first and second loss functions to train the multi-task prediction model, it comprehensively considers probability distribution differences and numerical deviations, learning and optimizing from multiple dimensions. This not only improves the accuracy and reliability of the multi-task prediction model in predicting playback duration but also enhances its generalization ability, enabling it to perform better in complex and ever-changing real-world scenarios and better serve multi-task prediction needs.
[0427] In one embodiment, the multi-task prediction model includes multiple expert networks and multiple prediction networks corresponding to each of the multiple prediction tasks; the multiple prediction networks include a duration prediction network; the duration prediction network includes a first gating network and a first task tower network;
[0428] like Figure 22 As shown, step 450, the step of predicting the predicted playback duration based on the sample media resources using the multi-task prediction model, includes:
[0429] Step 2210: Input the first feature information and the second feature information of the sample media resources into the multiple expert networks;
[0430] Step 2220: The outputs of the multiple expert networks are weighted and calculated through the first gating network to obtain the first vector corresponding to the duration prediction network;
[0431] Step 2230: Input the first vector into the first task tower network to obtain the predicted playback duration.
[0432] In one implementation, the multi-task prediction model can also be a multi-gate mixture-of-experts (MMoE) network. An MMoE consists of a feature embedding layer, multiple expert networks, multiple gating networks, and multiple task tower networks. One prediction task in the multi-task prediction model includes one gating network and one task tower network. Expert networks are shared components across multiple prediction tasks. Multiple expert networks process the input feature information in parallel, generating different feature representations. The gating network then weights and combines the outputs of the expert networks according to the characteristics of each prediction task, obtaining a feature vector suitable for the corresponding prediction task, which is then input into the corresponding task tower network for further processing and prediction. For example, in a recommendation scenario that includes multiple prediction tasks such as playback duration prediction and click-through rate prediction, all prediction tasks use the same multiple expert networks to perform preliminary processing on the feature information of the sample media resources. Then, they use their respective independent gating networks to select and combine the outputs of the expert networks. Finally, their respective task tower networks complete the specific prediction tasks. For example, the playback duration prediction task outputs the predicted playback duration through its corresponding gating network and task tower network, and the click-through rate prediction task outputs the predicted click-through rate through its corresponding gating network and task tower network.
[0433] The feature embedding layer is the starting point for MMoE to process input data. In recommendation scenarios, the input data often contains a large amount of feature information of different types. This raw feature information is usually high-dimensional and sparse, and it is difficult for MMoE to process it effectively if directly input. The role of the feature embedding layer is to transform this high-dimensional and sparse raw feature information into a low-dimensional and dense vector representation through a specific embedding function. For example, for the category feature information of an object (such as job), it may originally be represented by discrete category labels. After passing through the feature embedding layer, it will be transformed into a fixed-length real number vector. This vector can better capture the potential relationship between this feature information and other feature information, providing a more efficient data form for subsequent model processing and improving the model's ability to learn features.
[0434] An expert network can be viewed as an "expert" that focuses on learning specific patterns or feature combinations from sample media resources. Different expert networks have different structures and parameters, each excelling at processing different types of information. When the first and second feature information of the sample media resources are input, each expert network processes this information in parallel, outputting its own unique results. These results reflect the characteristics of the input data from different perspectives, providing rich and diverse foundational information for subsequent prediction tasks and enhancing the ability of multi-task prediction models to handle complex data.
[0435] The primary responsibility of the gating network is to integrate and regulate the outputs of multiple expert networks. The gating network assigns different weights to the outputs of each expert network. For different prediction tasks (such as the playback duration prediction task in this embodiment), the gating network dynamically adjusts the weights of each expert network's output based on the characteristics of the input data. Taking the first gating network in the duration prediction network as an example, the first gating network determines the importance of each expert network's output to duration prediction based on the input feature information, assigning higher weights to the outputs of expert networks with higher importance, and vice versa. Then, through weighted calculation, the outputs of multiple expert networks are integrated into a first vector corresponding to the duration prediction network. In this way, the first vector can integrate information provided by multiple expert networks from different perspectives, and the dynamic allocation of weights allows the multi-task prediction model to flexibly utilize the advantages of expert networks based on different data.
[0436] The first vector is calculated by weighting the outputs of multiple expert networks through the first gating network, and it carries multi-dimensional feature information closely related to the predicted playback duration. Each element in the first vector corresponds to the weighted result of the output of a certain expert network. These elements together constitute a vector that reflects various features of the sample object and sample media resources, providing a key basis for the subsequent first task tower network to accurately predict the playback duration.
[0437] Each task tower network corresponds to a specific prediction task. In this embodiment, there are multiple prediction networks corresponding to multiple prediction tasks, and the first task tower network in the duration prediction network is one of them. The task tower network receives the integrated vector (such as the first vector) output by the gating network and performs further deep processing and transformation on the vector according to the target and characteristics of the specific prediction task. In the playback duration prediction task, the first task tower network transforms the information in the first vector into the final predicted playback duration through a series of network layer operations, thus completing the prediction of the specific task of playback duration. Different task tower network structures and parameters are designed and trained according to the characteristics of their respective prediction tasks to achieve accurate prediction for different tasks.
[0438] In a specific example of this application, in step 2210, the first and second feature information of the sample media resources are input into multiple expert networks. These expert networks operate in parallel, each focusing on mining specific patterns or feature combinations within the feature information. For example, some expert networks excel at processing time-related feature information, extracting the timeliness information of the media resources from their release time; others are more sensitive to the interactive features of objects, discovering the correlation between play counts and popularity. In this way, multiple expert networks perform preliminary processing of the input feature information, providing multi-dimensional feature representations for subsequent predictions.
[0439] In step 2220, the first gating network performs a weighted calculation on the outputs of multiple expert networks. The first gating network dynamically assigns different weights to the output of each expert network based on the input feature information. For duration prediction, the first gating network evaluates the importance of the information output by each expert network to the playback duration prediction. If an expert network performs well in processing feature information related to content length, then its output will be given a higher weight in duration prediction. Through weighted calculation, the first gating network integrates the outputs of multiple expert networks into a first vector corresponding to the duration prediction network. This first vector integrates feature information extracted from multiple expert networks from different perspectives, providing a comprehensive and targeted feature representation for subsequent playback duration prediction.
[0440] In step 2230, the first vector is input into the first task tower network. The first task tower network performs further in-depth processing and transformation on the first vector for the specific task of playback duration prediction. The first task tower network may include multiple neural network layers, which map the feature information in the first vector to the predicted playback duration value through a series of nonlinear transformations. For example, the first task tower network learns a complex functional relationship between certain feature combinations and playback duration, thereby outputting an accurate predicted playback duration. This predicted playback duration is the result of comprehensively considering various feature information of the sample media resource and being processed collaboratively by multiple network components, and can accurately reflect the actual playback duration of the sample media resource.
[0441] In other embodiments of this disclosure, the multi-task prediction model in the related art can be extended by adding a first task tower network and a first gating network for the duration prediction task, while sharing the original multiple expert networks in the model. Therefore, when outputting the recommendation score, for each candidate media resource, the output value of the playback duration prediction task can be incorporated into the fusion score of the original multi-task prediction model (i.e., the multi-task prediction model without the added first task tower network and first gating network) in a power-multiplied manner. Specifically, the original fusion score can be denoted as s0, the new fusion score as s1, and the output value of the playback duration prediction task as z. The new fusion formula can then be calculated using the following formula:
[0442] s1=s0·z α (Formula 14)
[0443] Here, α represents the weight of the output value of the playback duration prediction task. The larger the value, the greater the impact on the fusion score, and the closer the ranking result is to the output value of the playback duration prediction task. A new fusion score is obtained through this process. All candidate media resources are then sorted in descending order, and the top-k candidate media resources are selected as the recommendation results presented to the user.
[0444] To determine α, we can first set a range of values for α, and then conduct experiments with different values within this range. In each experiment, a new fusion score is calculated using different α values, and the candidate media resources are ranked according to the new fusion scores to obtain the recommendation results. Next, the recommendation accuracy under different α values is measured by evaluation metrics such as object click-through rate, playback completion rate, and object dwell time. By continuously adjusting the value of α, until the optimal α value is found that makes the evaluation metrics reach their optimal level, this optimal α value is the optimal weight for the output value of the playback duration prediction task in this scenario.
[0445] In these alternative embodiments, inputting the feature information of the sample media resources into multiple expert networks can comprehensively mine data features and provide rich information for subsequent predictions. A first gating network weights the outputs of the expert networks to obtain a first vector, which can dynamically adjust the contributions of each expert network to accurately focus on duration prediction. A first task tower network deeply processes the first vector to output a predicted playback duration, capturing complex relationships between features, thereby improving the accuracy and reliability of the playback duration prediction task, optimizing recommendation performance, and enhancing the user experience.
[0446] In this embodiment of the disclosure, such as Figure 23 and Figure 24 As shown, in a video recommendation scenario, an A / B test was conducted on a multi-task prediction model that includes a playback duration prediction task. The control group (A) used a multi-task prediction model that did not include a playback duration prediction task, while the experimental group (B) used a multi-task prediction model that did. Specifically, multiple subjects were randomly divided into two groups: one group used the control group A multi-task prediction model (without a playback duration prediction task), and the other group used the experimental group B multi-task prediction model (with a playback duration prediction task). Both groups were allowed to browse videos in a video recommendation scenario simultaneously. Data differences in total video clicks, total playback duration, and other relevant metrics were collected and analyzed to determine whether the multi-task prediction model including the playback duration prediction task could optimize video recommendation performance, such as whether it could make recommendations more aligned with the subjects' interests and increase the subjects' video consumption time.
[0447] like Figure 23 and Figure 24 As shown, compared with the control group (A), the present invention (experimental group B) significantly improved the total number of video clicks and total playback time by using the embodiments of the present invention (experimental group B). Compared with control group A, experimental group B saw an average increase of 1.67% in the total number of clicks, indicating that the recommendations of the present invention are more in line with the interests of the target audience. Compared with control group A, experimental group B saw an increase of 1.66% in the total playback time, indicating that the present invention can recommend content that is liked by the target audience. By leveraging clicks to drive the increase in playback time, it strongly proves that the present invention can optimize the recommendation effect and improve the recommendation accuracy.
[0448] Training method of multi-task prediction model according to embodiments of this disclosure
[0449] In one embodiment, such as Figure 25 As shown, a training method for a multi-task prediction model is provided, which is then applied to... Figure 1 Taking a server as an example, it can be understood that this method can also be applied to servers, and also to systems including terminals and servers, and implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0450] Step 2510: Obtain multiple sample media resources, wherein the sample media resources have actual playback duration;
[0451] Step 2520: Based on the actual playback duration of each of the multiple sample media resources, determine the target distribution pattern; the target distribution pattern indicates the change of the actual playback duration with the media resource duration of the sample media resources;
[0452] Step 2530: Based on the target distribution pattern, determine the debiasing parameters corresponding to the sample media resources;
[0453] Step 2540: Calculate the playback duration after offsetting based on the actual playback duration of the sample media resources and the offsetting parameters;
[0454] Step 2550: Based on the sample media resources, the predicted playback duration is obtained by using the multi-task prediction model.
[0455] Step 2560: Calculate a first loss function based on the debiased playback duration and the predicted playback duration, and train the multi-task prediction model based on the first loss function.
[0456] The implementation methods of steps 2510-2560 are basically similar to those of steps 410-460, so they will not be described in detail here.
[0457] The training method for the multi-task prediction model determines the target distribution pattern and debiasing parameters by acquiring sample media resources, then calculates the debiased playback duration, and combines the predicted playback duration to calculate the first loss function to train the multi-task prediction model. This can effectively improve the accuracy of the multi-task prediction model in predicting playback duration and optimize the multi-task prediction performance.
[0458] Implementation details of the training method in this disclosure embodiment
[0459] The following reference Figure 26A and Figure 26B The following provides a detailed and exemplary description of the implementation details of the training method for the multi-task prediction model according to embodiments of the present disclosure.
[0460] In step 2601, multiple sample media resources are acquired, and the sample media resources have the actual playback duration.
[0461] In step 2602, the multiple sample media resources are grouped, wherein sample media resources with the same media resource duration are grouped into the same group.
[0462] In step 2603, for each group, the average playback duration of the group is determined based on the media resource duration of the group and the first curve; and the standard deviation of the playback duration of the group is determined based on the media resource duration of the group and the second curve.
[0463] In step 2604, a first curve is generated based on the average playback duration of each group, the first curve indicating the change of the average playback duration with the duration of the media resources in each group; a second curve is generated based on the standard deviation of the playback duration of each group, the second curve indicating the change of the standard deviation of the playback duration with the duration of the media resources in each group.
[0464] In step 2605, a first function formula for fitting the first curve is determined. The first function formula has first function parameters, which include a first constant, a first coefficient, a first exponent, and a second exponent.
[0465] In step 2606, for each group, the average playback duration is determined based on the media resource duration and the first curve. The media resource duration is substituted into the general formula of the first function to obtain the first result. The first fitting error is obtained by calculating the difference between the average playback duration of each group and the first result. The first fitting error is minimized to determine the parameters of the first function, thereby generating the first function with the first distribution law.
[0466] In step 2607, a second function formula for fitting the second curve is determined, the second function formula having second function parameters, the second function parameters including the second coefficient and the second constant;
[0467] In step 2608, for each group, the standard deviation of the playback duration is determined based on the media resource duration and the second curve. The media resource duration is substituted into the general formula of the second function to obtain the second result. The second fitting error is obtained by calculating the difference between the standard deviation of the playback duration of each group and the second result. The second fitting error is minimized to determine the parameters of the second function, thereby generating the second function with the second distribution law.
[0468] In step 2609, based on the media resource duration and the first distribution pattern, the average playback duration is determined; based on the media resource duration and the second distribution pattern, the standard deviation of the playback duration is determined, and the average playback duration and the standard deviation of the playback duration constitute the debiasing parameter.
[0469] In step 2610, the playback duration after offset correction is calculated based on the actual playback duration and the average playback duration.
[0470] In step 2611, the first feature information and the second feature information of the sample media resources are input into the multiple expert networks of the multi-task prediction model;
[0471] In step 2612, the outputs of the multiple expert networks are weighted and calculated through the first gating network of the multi-task prediction model to obtain the first vector corresponding to the duration prediction network of the multi-task prediction model;
[0472] In step 2613, the first vector is input into the first task tower network to obtain the predicted playback duration;
[0473] In step 2614, the debiased playback duration is converted into a first probability, and the predicted playback duration is converted into a second probability. The first probability and the second probability are probabilities that satisfy a Bernoulli distribution.
[0474] In step 2615, the first loss function is calculated based on the first probability and the second probability;
[0475] In step 2616, obtain the loss function for each of the other tasks besides the playback duration task;
[0476] In step 2617, a multi-task loss function is calculated based on the first loss function and the respective other task loss functions of each other task;
[0477] In step 2618, the multi-task prediction model is trained based on the multi-task loss function.
[0478] Description of apparatus and devices according to embodiments of this disclosure
[0479] It is understood that although the steps in the above flowcharts are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in this embodiment, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the above flowcharts may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.
[0480] It should be noted that in various specific embodiments of this application, when processing is required based on data related to the characteristics of the target content, such as target content attribute information or attribute information sets, permission or consent from the target content provider will be obtained first. Furthermore, the collection, use, and processing of this data will comply with relevant laws, regulations, and standards of the relevant countries and regions. In addition, when embodiments of this application require obtaining target content attribute information, separate permission or consent from the target content provider will be obtained through pop-up windows or redirection to a confirmation page. Only after obtaining the separate permission or consent from the target content provider will the necessary target content-related data for the normal operation of the embodiments of this application be obtained.
[0481] Figure 27 A schematic diagram of the structure of a media resource recommendation device 2700 provided in an embodiment of this disclosure. The training device 2700 includes:
[0482] The feature acquisition module 2710 is used to acquire the first feature information of the object and the second feature information of each of the multiple candidate media resources;
[0483] The prediction module 2720 is used to make predictions based on the first feature information and the second feature information through a multi-task prediction model to obtain the recommendation score of each candidate media resource.
[0484] Recommendation module 2730 is used to determine a target media resource among the multiple candidate media resources based on the recommendation scores of each candidate media resource, and recommend the target media resource to the object;
[0485] The multi-task prediction model is trained using a first loss function, which is calculated based on the debiased playback duration of the sample media resources and the predicted playback duration of the multi-task prediction model for the sample media resources. The debiased playback duration is determined based on the actual playback duration of the sample media resources and the target distribution pattern, where the target distribution pattern indicates the change in the actual playback duration as the media resource duration of the sample media resources changes.
[0486] Optionally, the media resource recommendation device 2700 further includes a training module;
[0487] The training module is specifically used for:
[0488] The multi-task prediction model is pre-trained in the following manner:
[0489] Acquire multiple sample media resources, each sample media resource having the actual playback duration;
[0490] The target distribution pattern is determined based on the actual playback duration of each of the multiple sample media resources.
[0491] Based on the target distribution pattern, determine the debiasing parameters corresponding to the sample media resources;
[0492] Based on the actual playback duration of the sample media resources and the anti-biasing parameters, calculate the playback duration after anti-biasing.
[0493] Based on the sample media resources, the predicted playback duration is obtained by using the multi-task prediction model.
[0494] Based on the debiased playback duration and the predicted playback duration, the first loss function is calculated, and the multi-task prediction model is trained based on the first loss function.
[0495] Optionally, the debiasing parameters include the average playback duration and the standard deviation of playback duration; the target distribution pattern includes a first distribution pattern and a second distribution pattern, wherein the first distribution pattern indicates the change of the average playback duration with the duration of the media resource, and the second distribution pattern indicates the change of the standard deviation of playback duration with the duration of the media resource;
[0496] The training module is specifically used for:
[0497] Based on the duration of the media resources and the first distribution pattern, the average playback duration is determined;
[0498] Based on the duration of the media resources and the second distribution pattern, the standard deviation of the playback duration is determined.
[0499] Optionally, the training module is specifically used for:
[0500] Based on the actual playback duration and the average playback duration, calculate the deviation value of the actual playback duration;
[0501] The playback duration after debiasing is calculated based on the ratio of the deviation value to the standard deviation of the playback duration.
[0502] Optionally, the training module is specifically used for:
[0503] The sample media resources are grouped together, wherein sample media resources with the same duration are grouped together.
[0504] Calculate the average of the actual playback duration of the sample media resources within the same group, and use it as the average playback duration of the group;
[0505] Calculate the standard deviation of the actual playback duration of the sample media resources within the same group, and use it as the standard deviation of the playback duration of the group;
[0506] Based on the average playback duration of each group, a first curve is generated, which indicates the change of the average playback duration as the media resource duration of each group changes.
[0507] Based on the standard deviation of playback duration for each group, a second curve is generated, which indicates the change of the standard deviation of playback duration with the duration of the media resources for each group.
[0508] Generate a first function that fits the first curve as the first distribution law, and generate a second function that fits the second curve as the second distribution law.
[0509] Optionally, the first function has a first general function formula, the first general function formula has a first function parameter, and the second function has a second general function formula, the second general function formula has a second function parameter;
[0510] The training module is specifically used for:
[0511] For each group, the average playback duration of the group is determined based on the media resource duration of the group and the first curve;
[0512] Substituting the duration of the media resources in the group into the general formula of the first function, we obtain the first result;
[0513] The first function is generated based on the average playback duration of each group and the first result;
[0514] For each group, the standard deviation of the playback duration of the group is determined based on the duration of the media resources in the group and the second curve;
[0515] Substituting the duration of the media resources in the group into the general formula of the second function, we obtain the second result;
[0516] The second function is generated based on the standard deviation of the playback duration for each group and the second result.
[0517] Optionally, the training module is specifically used for:
[0518] The first fitting error is calculated based on the difference between the average playback duration of each group and the first result.
[0519] The first function is generated by minimizing the first fitting error to determine the parameters of the first function.
[0520] The second function is generated based on the standard deviation of the playback duration of each group and the second result, including:
[0521] The second fitting error is calculated based on the difference between the standard deviation of the playback duration of each group and the second result.
[0522] The second function is generated by minimizing the second fitting error to determine the parameters of the second function.
[0523] Optionally, the first function is a monotonically increasing function, and when the duration of the media resource approaches positive infinity, the value of the first function approaches a first constant, the first constant is positive, and the parameters of the first function include the first constant, the first coefficient, the first exponent and the second exponent.
[0524] The first function formula is generated in the following way:
[0525] Calculate the first product based on the first exponent power of the media resource duration and the first coefficient;
[0526] Calculate the first power of the product;
[0527] Calculate the first difference between 1 and the first power.
[0528] The first function general formula is generated based on the second exponent of the first difference and the first constant.
[0529] Optionally, the second function is a monotonically increasing linear function, and the parameters of the second function include a second coefficient and a second constant;
[0530] The second function's general formula is generated in the following way:
[0531] Calculate the second product based on the media resource duration and the second coefficient;
[0532] Based on the second product and the second constant, the general formula of the second function is generated.
[0533] Optionally, the training module is specifically used for:
[0534] The debiased playback duration is converted into a first probability, and the predicted playback duration is converted into a second probability. The first probability and the second probability are probabilities that satisfy a Bernoulli distribution.
[0535] The first loss function is calculated based on the first probability and the second probability.
[0536] Optionally, the training module is specifically used for:
[0537] Calculate the duration difference between the debiased playback duration and the predicted playback duration;
[0538] Based on the time difference, calculate the second loss function;
[0539] The multi-task prediction model is trained based on the first loss function and the second loss function.
[0540] Optionally, the training module is specifically used for:
[0541] Calculate the second power of the negative of the playback duration after debiasing;
[0542] Calculate the first sum of 1 and the second power;
[0543] The first probability is calculated based on the reciprocal of the first sum.
[0544] Optionally, the training module is specifically used for:
[0545] Calculate the third power of the predicted playback duration;
[0546] Calculate the second sum of 1 and the third power;
[0547] The second probability is calculated based on the reciprocal of the second sum.
[0548] Optionally, the training module is specifically used for:
[0549] Calculate the first logarithm of the reciprocal of the second probability;
[0550] Calculate the third product based on the first probability and the first logarithm;
[0551] Calculate the second difference between 1 and the first probability, and the third difference between 1 and the second probability;
[0552] Calculate the second logarithm of the reciprocal of the third difference;
[0553] Calculate the fourth product based on the second difference and the second logarithm;
[0554] The first loss function is calculated based on the third product and the fourth product.
[0555] Optionally, the training module is specifically used for:
[0556] Obtain the loss function for each of the other tasks besides the playback duration task;
[0557] Based on the first loss function and the respective other task loss functions of each other task, calculate the multi-task loss function;
[0558] The multi-task prediction model is trained based on the multi-task loss function.
[0559] Optionally, the training module is specifically used for:
[0560] Calculate the multi-sample loss function based on the multi-task loss function of each of the sample media resources;
[0561] The multi-task prediction model is trained based on the multi-sample loss function.
[0562] Optionally, the multi-task prediction model includes multiple expert networks and multiple prediction networks corresponding to each of the multiple prediction tasks; the multiple prediction networks include a duration prediction network corresponding to the playback duration task; the duration prediction network includes a first gating network and a first task tower network;
[0563] The training module is specifically used for:
[0564] The first feature information and the second feature information of the sample media resources are input into the multiple expert networks;
[0565] The outputs of the multiple expert networks are weighted and calculated by the first gating network to obtain a first vector corresponding to the duration prediction network.
[0566] The first vector is input into the first task tower network to obtain the predicted playback duration.
[0567] Figure 28 A schematic diagram of the structure of a training device 2400 for a multi-task prediction model provided in an embodiment of this disclosure. The training device 2800 includes:
[0568] The sample acquisition module 2810 is used to acquire multiple sample media resources, wherein the sample media resources have actual playback duration.
[0569] The pattern determination module 2820 is used to determine a target distribution pattern based on the actual playback duration of each of the multiple sample media resources; the target distribution pattern indicates the change of the actual playback duration with the media resource duration of the sample media resources;
[0570] The first debiasing determination module 2830 is used to determine the debiasing parameters corresponding to the sample media resources based on the target distribution pattern.
[0571] The second anti-bias determination module 2840 is used to calculate the playback duration after anti-biasing based on the actual playback duration of the sample media resources and the anti-biasing parameters.
[0572] The duration prediction module 2850 is used to predict the playback duration based on the sample media resources and through the multi-task prediction model.
[0573] The model training module 2860 is used to calculate a first loss function based on the debiased playback duration and the predicted playback duration, and to train the multi-task prediction model based on the first loss function.
[0574] Reference Figure 29 , Figure 29 The structural block diagram of the terminal 140 portion for implementing the media resource recommendation method and multi-task prediction model training method of this disclosure embodiment is shown below. The terminal 140 includes: a radio frequency (RF) circuit 2910, a memory 2915, an input unit 2930, a display unit 2940, a sensor 2950, an audio circuit 2960, a wireless fidelity (WiFi) module 2970, a processor 2980, and a power supply 2990, among other components. Those skilled in the art will understand that... Figure 29 The terminal 140 structure shown does not constitute a limitation on a mobile phone or computer, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0575] The RF circuit 2910 can be used to receive and transmit signals during information transmission or calls. In particular, it receives downlink information from the base station and processes it with the processor 2980; in addition, it transmits uplink data to the base station.
[0576] The memory 2915 can be used to store software programs and modules. The processor 2980 executes various functional applications and data processing of the content terminal 140 by running the software programs and modules stored in the memory 2915.
[0577] The input unit 2930 can be used to receive input numeric or character information, and to generate key signal inputs related to the settings and function control of the content terminal 140. Specifically, the input unit 2930 may include a touch panel 2931 and other input devices 2932.
[0578] The display unit 2940 can be used to display input or provided information, as well as various menus of the content terminal 140. The display unit 2940 may include a display panel 2941.
[0579] Audio circuitry 2960, speaker 2961, and microphone 2962 provide an audio interface.
[0580] In this embodiment, the processor 2980 included in the terminal 140 can execute the media resource recommendation method and the multi-task prediction model training method of the previous embodiment.
[0581] The terminal 140 in this disclosure includes, but is not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, and aircraft. This invention can be applied to various scenarios, including but not limited to big data and artificial intelligence.
[0582] Figure 30 This is a partial structural block diagram of a server 110 for implementing the methods of this disclosure embodiment. The server 110 can vary significantly due to different configurations or performance characteristics, and may include one or more central processing units (CPUs) 3022 (e.g., one or more processors) and memory 3032, and one or more storage media 3030 (e.g., one or more mass storage devices) for storing application programs 3042 or data 3044. The memory 3032 and storage media 3030 may be temporary or persistent storage. The program stored in the storage media 3030 may include one or more modules (not shown in the figure), each module including a series of instruction operations on the server 110. Furthermore, the CPU 3022 may be configured to communicate with the storage media 3030 and execute the series of instruction operations in the storage media 3030 on the server 110.
[0583] Server 110 may also include one or more power supplies 3030, one or more wired or wireless network interfaces 3050, one or more input / output interfaces 3058, and / or one or more operating systems 3041, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0584] The central processing unit 3022 in server 110 can be used to execute the methods of embodiments of this disclosure.
[0585] This disclosure also provides a computer-readable storage medium for storing program code for performing the methods of the foregoing embodiments.
[0586] This disclosure also provides a computer program product comprising a computer program. A processor of a computer device reads and executes the computer program, causing the computer device to perform the method described above.
[0587] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in this disclosure and the foregoing drawings are used to distinguish similar terms and are not necessarily used to describe a particular order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this disclosure described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “including,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatuses.
[0588] It should be understood that in this disclosure, "at least one item" refers to one or more items, and "more than one item" refers to two or more items. "And / or" is used to describe the relationship between related content, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related content are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0589] It should be understood that in the description of the embodiments disclosed herein, "multiple" means two or more, "greater than", "less than", "exceeding" etc. are understood to exclude the number itself, and "above", "below", "within" etc. are understood to include the number itself.
[0590] In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0591] 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.
[0592] Furthermore, the functional units in the various embodiments of this disclosure 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. The integrated unit can be implemented in hardware or as a software functional unit.
[0593] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or all or part 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 of the various embodiments of this disclosure. 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.
[0594] It should also be understood that the various implementation methods provided in this disclosure can be combined arbitrarily to achieve different technical effects.
[0595] The above is a detailed description of the embodiments of this disclosure. However, this disclosure is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this disclosure. All such equivalent modifications or substitutions are included within the scope defined by the claims of this disclosure.
Claims
1. A media resource recommendation method, characterized in that, include: Obtain the first feature information of the object, and the second feature information of each of the multiple candidate media resources; Based on the first feature information and the second feature information, a multi-task prediction model is used to make predictions and obtain the recommendation scores of each candidate media resource. Based on the recommendation scores of each candidate media resource, a target media resource is determined from the plurality of candidate media resources, and the target media resource is recommended to the object; The multi-task prediction model is trained using a first loss function, which is calculated based on the debiased playback duration of the sample media resources and the predicted playback duration of the multi-task prediction model for the sample media resources. The debiased playback duration is determined based on the actual playback duration of the sample media resources and the target distribution pattern, where the target distribution pattern indicates the change in the actual playback duration as the media resource duration of the sample media resources changes.
2. The method according to claim 1, characterized in that, The multi-task prediction model is pre-trained in the following manner: Acquire multiple sample media resources, each sample media resource having the actual playback duration; The target distribution pattern is determined based on the actual playback duration of each of the multiple sample media resources. Based on the target distribution pattern, determine the debiasing parameters corresponding to the sample media resources; Based on the actual playback duration of the sample media resources and the anti-biasing parameters, calculate the playback duration after anti-biasing. Based on the sample media resources, the predicted playback duration is obtained by using the multi-task prediction model. Based on the debiased playback duration and the predicted playback duration, the first loss function is calculated, and the multi-task prediction model is trained based on the first loss function.
3. The method according to claim 2, characterized in that, The debiasing parameters include the average playback duration and the standard deviation of playback duration; the target distribution pattern includes a first distribution pattern and a second distribution pattern, wherein the first distribution pattern indicates the change of the average playback duration with the duration of the media resource, and the second distribution pattern indicates the change of the standard deviation of playback duration with the duration of the media resource; The step of determining the debiasing parameters corresponding to the sample media resources based on the target distribution pattern includes: Based on the duration of the media resources and the first distribution pattern, the average playback duration is determined; Based on the duration of the media resources and the second distribution pattern, the standard deviation of the playback duration is determined.
4. The method according to claim 3, characterized in that, The calculation of the post-biased playback duration based on the actual playback duration of the sample media resources and the bias reduction parameters includes: Based on the actual playback duration and the average playback duration, calculate the deviation value of the actual playback duration; The playback duration after debiasing is calculated based on the ratio of the deviation value to the standard deviation of the playback duration.
5. The method according to claim 3, characterized in that, Determining the target distribution pattern based on the actual playback duration of each of the multiple sample media resources includes: The sample media resources are grouped together, wherein sample media resources with the same duration are grouped together. Calculate the average of the actual playback duration of the sample media resources within the same group, and use it as the average playback duration of the group; Calculate the standard deviation of the actual playback duration of the sample media resources within the same group, and use it as the standard deviation of the playback duration of the group; Based on the average playback duration of each group, a first curve is generated, which indicates the change of the average playback duration as the media resource duration of each group changes. Based on the standard deviation of playback duration for each group, a second curve is generated, which indicates the change of the standard deviation of playback duration with the duration of the media resources for each group. Generate a first function that fits the first curve as the first distribution law, and generate a second function that fits the second curve as the second distribution law.
6. The method according to claim 5, characterized in that, The first function has a first function general form, and the first function general form has a first function parameter; the second function has a second function general form, and the second function general form has a second function parameter. The process of generating a first function to fit the first curve, as the first distribution law, and generating a second function to fit the second curve, as the second distribution law, includes: For each group, the average playback duration of the group is determined based on the media resource duration of the group and the first curve; Substituting the duration of the media resources in the group into the general formula of the first function, we obtain the first result; The first function is generated based on the average playback duration of each group and the first result; For each group, the standard deviation of the playback duration of the group is determined based on the duration of the media resources in the group and the second curve; Substituting the duration of the media resources in the group into the general formula of the second function, we obtain the second result; The second function is generated based on the standard deviation of the playback duration for each group and the second result.
7. The method according to claim 6, characterized in that, The first function is generated based on the average playback duration of each group and the first result, including: The first fitting error is calculated based on the difference between the average playback duration of each group and the first result. The first function is generated by minimizing the first fitting error to determine the parameters of the first function. The second function is generated based on the standard deviation of the playback duration of each group and the second result, including: The second fitting error is calculated based on the difference between the standard deviation of the playback duration of each group and the second result. The second function is generated by minimizing the second fitting error to determine the parameters of the second function.
8. The method according to claim 6, characterized in that, The first function is a monotonically increasing function, and when the duration of the media resource approaches positive infinity, the value of the first function approaches a first constant, which is positive. The parameters of the first function include the first constant, the first coefficient, the first exponent, and the second exponent. The first function formula is generated in the following way: Calculate the first product based on the first exponent power of the media resource duration and the first coefficient; Calculate the first power of the product; Calculate the first difference between 1 and the first power. The first function general formula is generated based on the second exponent of the first difference and the first constant.
9. The method according to claim 6, characterized in that, The second function is a monotonically increasing linear function, and the parameters of the second function include a second coefficient and a second constant; The second function's general formula is generated in the following way: Calculate the second product based on the media resource duration and the second coefficient; Based on the second product and the second constant, the general formula of the second function is generated.
10. The method according to claim 2, characterized in that, The step of calculating the first loss function based on the debiased playback duration and the predicted playback duration includes: The debiased playback duration is converted into a first probability, and the predicted playback duration is converted into a second probability. The first probability and the second probability are probabilities that satisfy a Bernoulli distribution. The first loss function is calculated based on the first probability and the second probability.
11. The method according to claim 10, characterized in that, Training the multi-task prediction model based on the first loss function includes: Calculate the duration difference between the debiased playback duration and the predicted playback duration; Based on the time difference, calculate the second loss function; The multi-task prediction model is trained based on the first loss function and the second loss function.
12. The method according to claim 10, characterized in that, The calculation of the first loss function based on the first probability and the second probability includes: Calculate the first logarithm of the reciprocal of the second probability; Calculate the third product based on the first probability and the first logarithm; Calculate the second difference between 1 and the first probability, and the third difference between 1 and the second probability; Calculate the second logarithm of the reciprocal of the third difference; Calculate the fourth product based on the second difference and the second logarithm; The first loss function is calculated based on the third product and the fourth product.
13. The method according to claim 2, characterized in that, Training the multi-task prediction model based on the first loss function includes: Obtain the loss function for each of the other tasks besides the playback duration task; Based on the first loss function and the respective other task loss functions of each other task, calculate the multi-task loss function; The multi-task prediction model is trained based on the multi-task loss function.
14. The method according to claim 13, characterized in that, Training the multi-task prediction model based on the multi-task loss function includes: Calculate the multi-sample loss function based on the multi-task loss function of each of the sample media resources; The multi-task prediction model is trained based on the multi-sample loss function.
15. The method according to claim 2, characterized in that, The multi-task prediction model includes multiple expert networks and multiple prediction networks corresponding to each of the multiple prediction tasks; the multiple prediction networks include a duration prediction network corresponding to the playback duration task; the duration prediction network includes a first gating network and a first task tower network; The step of predicting the playback duration based on the sample media resources using the multi-task prediction model includes: The first feature information and the second feature information of the sample media resources are input into the multiple expert networks; The outputs of the multiple expert networks are weighted and calculated by the first gating network to obtain a first vector corresponding to the duration prediction network. The first vector is input into the first task tower network to obtain the predicted playback duration.
16. A training method for a multi-task prediction model, characterized in that, include: Acquire multiple sample media resources, wherein the sample media resources have actual playback duration; Based on the actual playback duration of each of the multiple sample media resources, the target distribution pattern is determined; The target distribution pattern indicates the change in the actual playback duration as the media resource duration of the sample media resources changes; Based on the target distribution pattern, determine the debiasing parameters corresponding to the sample media resources; Based on the actual playback duration of the sample media resources and the anti-biasing parameters, calculate the playback duration after anti-biasing. Based on the sample media resources, the predicted playback duration is obtained by using the multi-task prediction model. Based on the debiased playback duration and the predicted playback duration, a first loss function is calculated, and the multi-task prediction model is trained based on the first loss function.
17. A media resource recommendation device, characterized in that, include: The feature acquisition module is used to acquire the first feature information of the object and the second feature information of each of the multiple candidate media resources; The prediction module is used to make predictions based on the first feature information and the second feature information through a multi-task prediction model to obtain the recommendation score of each candidate media resource. The recommendation module is used to determine the target media resource from the multiple candidate media resources based on the recommendation scores of each candidate media resource, and recommend the target media resource to the object; The multi-task prediction model is trained using a first loss function, which is calculated based on the debiased playback duration of the sample media resources and the predicted playback duration of the multi-task prediction model for the sample media resources. The debiased playback duration is determined based on the actual playback duration of the sample media resources and the target distribution pattern, where the target distribution pattern indicates the change in the actual playback duration as the media resource duration of the sample media resources changes.
18. A training device for a multi-task prediction model, characterized in that, include: The sample acquisition module is used to acquire multiple sample media resources, wherein the sample media resources have actual playback duration; The pattern determination module is used to determine the target distribution pattern based on the actual playback duration of each of the multiple sample media resources. The target distribution pattern indicates the change in the actual playback duration as the media resource duration of the sample media resources changes; The first debiasing determination module is used to determine the debiasing parameters corresponding to the sample media resources based on the target distribution pattern. The second anti-bias determination module is used to calculate the playback duration after anti-biasing based on the actual playback duration of the sample media resources and the anti-biasing parameters. The duration prediction module is used to predict the playback duration based on the sample media resources and through the multi-task prediction model. The model training module is used to calculate a first loss function based on the debiased playback duration and the predicted playback duration, and to train the multi-task prediction model based on the first loss function.
19. An electronic device comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 16.
20. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 16.