Prediction method and device, training method and device, and electronic device
By processing video data and user behavior data through the embedding layer, intermediate layer, and output layer of the neural network model, the predicted values of the second playback parameters are generated and guided, which solves the accuracy problem of multi-objective learning models in video playback parameter prediction and improves the prediction effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-28
- Publication Date
- 2026-03-03
AI Technical Summary
Existing multi-objective learning models have low accuracy in predicting targets, especially in predicting video playback parameters.
Input features are generated based on video data features and user behavior data features of the target video. The embedding layer, intermediate layer and tower layer of the neural network model are used to convert them into embedding vectors and fused feature vectors. Combined with the predicted value of the output layer, the predicted values of the first and second playback parameters are generated respectively. Finally, the predicted value of the second playback parameter is guided by the output layer to avoid its influence on the first playback parameter.
It improves the prediction accuracy of video playback parameters, especially the accuracy of the second playback parameter, which is significantly improved compared to traditional multi-objective learning models.
Smart Images

Figure CN115171010B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of artificial intelligence, specifically relating to a prediction method and apparatus, a training method and apparatus, and an electronic device. Background Technology
[0002] Artificial intelligence (AI) is a branch of computer science that attempts to understand the nature of intelligence and produce new intelligent machines that can react in a way similar to human intelligence. Simply put, a major goal of AI research is to enable machines to perform complex tasks that typically require human intelligence. With the continuous development of various neural network models, AI is being applied more and more widely in our lives.
[0003] Currently, multi-objective learning models (also known as multi-task learning models), as neural network models capable of simultaneously completing multiple tasks or objectives, have been widely used in many scenarios. In particular, the MMOE (Multi-gate Mixture-of-Experts) model is a very popular multi-objective learning model.
[0004] However, precisely because this general multi-objective learning model can be applied to a variety of application scenarios, its prediction of the target is not very accurate in most application scenarios. Summary of the Invention
[0005] The purpose of this application is to provide a prediction method and apparatus, a training method and apparatus, and an electronic device that can solve the problem of low accuracy in predicting targets using multi-objective learning models in related technologies.
[0006] In a first aspect, embodiments of this application provide a method for predicting video playback parameters, the method comprising:
[0007] Input features are generated based on the video data features of the target video and the behavioral data features of users watching the video within a preset time period;
[0008] The input features are input into the embedding layer of the neural network model, and the embedding layer converts the input features into embedding vectors, wherein the embedding vectors are representations of the input features;
[0009] The embedding vector is input into the intermediate layer of the neural network model, and the intermediate layer obtains N fused feature vectors based on the embedding vector, wherein each fused feature vector corresponds to a playback parameter;
[0010] The N fused feature vectors are input into the tower floor of the neural network model. The tower floor obtains a first predicted value and a second predicted value of the first playback parameter based on the first fused feature vector, and obtains a third predicted value of the second playback parameter based on the second fused feature vector. The first fused feature vector and the second fused feature vector are different fused feature vectors among the N fused feature vectors. The first playback parameter is the playback parameter corresponding to the first fused feature vector, and the second playback parameter is the playback parameter corresponding to the second fused feature vector.
[0011] The first predicted value, the second predicted value, and the third predicted value are input to the output layer of the neural network model. The output layer determines the predicted value of the first playback parameter based on the first predicted value, and determines the predicted value of the second playback parameter based on the second predicted value and the third predicted value.
[0012] Secondly, embodiments of this application provide a method for training a neural network model, used to train the neural network model as described above, the training method comprising:
[0013] Obtain the sample set for training;
[0014] The samples in the sample set are used as input features and input to the embedding layer of the neural network model. The embedding layer converts the input features into embedding vectors, where the embedding vectors are representations of the input features.
[0015] The embedding vector is input into the intermediate layer of the neural network model, and the intermediate layer obtains N fused feature vectors based on the embedding vector, wherein each fused feature vector corresponds to a target of the neural network model;
[0016] The N fused feature vectors are input into the tower floors of the neural network model. The tower floors obtain a first predicted value and a second predicted value of the first target based on the first fused feature vector, and obtain a third predicted value of the second target based on the second fused feature vector. The first fused feature vector and the second fused feature vector are different fused feature vectors among the N fused feature vectors. The first target is the target corresponding to the first fused feature vector, and the second target is the target corresponding to the second fused feature vector.
[0017] The first predicted value, the second predicted value, and the third predicted value are input to the output layer of the neural network model. The output layer determines the predicted value of the first target based on the first predicted value, and determines the predicted value of the second target based on the second predicted value and the third predicted value.
[0018] The model loss is calculated based on the predicted and actual values of the first target and the predicted and actual values of the second target.
[0019] If the model loss obtained during training is greater than the target threshold, the gradient of the model loss is calculated based on the backpropagation algorithm, and the model parameters of the neural network model are updated based on the gradient until the model loss obtained during training is less than or equal to the target threshold.
[0020] Thirdly, embodiments of this application provide a device for predicting video playback parameters, the device comprising:
[0021] The input module is used to generate input features based on the video data features of the target video and the behavioral data features of the user watching the video within a preset time period.
[0022] A conversion module is used to input the input features into the embedding layer of a neural network model, and convert the input features into embedding vectors via the embedding layer, wherein the embedding vectors are representations of the input features;
[0023] The feature module is used to input the embedding vector into the intermediate layer of the neural network model, and obtain N fused feature vectors based on the embedding vector through the intermediate layer, wherein each fused feature vector corresponds to a playback parameter;
[0024] The prediction module is used to input the N fused feature vectors into the tower floor of the neural network model, and through the tower floor, obtain a first predicted value and a second predicted value of the first playback parameter based on the first fused feature vector, and obtain a third predicted value of the second playback parameter based on the second fused feature vector. The first fused feature vector and the second fused feature vector are different fused feature vectors among the N fused feature vectors, the first playback parameter is the playback parameter corresponding to the first fused feature vector, and the second playback parameter is the playback parameter corresponding to the second fused feature vector.
[0025] An output module is used to input the first predicted value, the second predicted value, and the third predicted value to the output layer of the neural network model, and through the output layer, determine the predicted value of the first playback parameter based on the first predicted value, and determine the predicted value of the second playback parameter based on the second predicted value and the third predicted value.
[0026] Fourthly, embodiments of this application provide a training apparatus for a neural network model, used to train the neural network model as described above, the training apparatus comprising:
[0027] The sample module is used to obtain the sample set for training.
[0028] The first training module is used to input the samples in the sample set as input features into the embedding layer of the neural network model, and convert the input features into embedding vectors through the embedding layer, wherein the embedding vectors are representations of the input features;
[0029] The second training module is used to input the embedding vector into the intermediate layer of the neural network model, and obtain N fused feature vectors based on the embedding vector through the intermediate layer, wherein each fused feature vector corresponds to a target of the neural network model;
[0030] The third training module is used to input the N fused feature vectors into the tower floors of the neural network model, and through the tower floors, obtain a first predicted value and a second predicted value of the first target based on the first fused feature vector, and obtain a third predicted value of the second target based on the second fused feature vector. The first fused feature vector and the second fused feature vector are different fused feature vectors among the N fused feature vectors, the first target is the target corresponding to the first fused feature vector, and the second target is the target corresponding to the second fused feature vector.
[0031] The fourth training module is used to input the first predicted value, the second predicted value, and the third predicted value into the output layer of the neural network model, and through the output layer, determine the predicted value of the first target based on the first predicted value, and determine the predicted value of the second target based on the second predicted value and the third predicted value;
[0032] The loss module is used to calculate the model loss from the predicted and true values of the first target and the predicted and true values of the second target.
[0033] The update module is used to calculate the gradient of the model loss based on the backpropagation algorithm when the model loss obtained from training is greater than the target threshold, and update the model parameters of the neural network model based on the gradient until the model loss obtained from training is less than or equal to the target threshold.
[0034] Fifthly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing programs or instructions executable on the processor, the programs or instructions, when executed by the processor, implementing the steps of the method described in the first or second aspect.
[0035] In a sixth aspect, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first or second aspect.
[0036] In a seventh aspect, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the methods described in the first or second aspect.
[0037] Eighthly, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method as described in the first or second aspect.
[0038] In this embodiment, after obtaining input features based on the video data features of the target video and the user's video viewing behavior data features within a preset time period, the input features are converted into embedding vectors by the embedding layer of the neural network model, facilitating subsequent processing. Then, the intermediate layer of the neural network model obtains a fused feature vector based on the embedding vector, which is used as the data required to predict playback parameters. The tower layer of the neural network model uses the fused feature vector to obtain a first predicted value, a second predicted value, and a third predicted value for the second playback parameter. Finally, the output layer of the neural network model guides the second playback parameter based on the first playback parameter, combining the second and third predicted values to obtain the predicted value of the second playback parameter, thus improving the accuracy of the second playback parameter. Simultaneously, it avoids the influence of the second playback parameter on the first playback parameter. Compared to using traditional multi-objective learning models to predict targets, this application improves the accuracy of target prediction. Attached Figure Description
[0039] Figure 1 This is a schematic diagram of the steps in the video playback parameter prediction method provided in the embodiments of this application;
[0040] Figure 2 This is a diagram illustrating the actual application architecture of the neural network model provided in the embodiments of this application;
[0041] Figure 3 This is a schematic diagram of the training method steps for the neural network model provided in the embodiments of this application;
[0042] Figure 4 This is a schematic diagram showing the distribution of video playback completion rates in an embodiment of this application;
[0043] Figure 5 This is one of the schematic diagrams of the neural network model provided in the embodiments of this application;
[0044] Figure 6 This is the second schematic diagram of the architecture of the neural network model provided in the embodiments of this application;
[0045] Figure 7 This is the third schematic diagram of the architecture of the neural network model provided in the embodiments of this application;
[0046] Figure 8 This is a structural block diagram of the video playback parameter prediction device provided in the embodiments of this application;
[0047] Figure 9 This is a structural block diagram of the training device for the neural network model provided in the embodiments of this application;
[0048] Figure 10 This is one of the hardware structure diagrams of the electronic device provided in the embodiments of this application;
[0049] Figure 11 This is the second schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0050] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0051] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0052] The method for predicting video playback parameters provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0053] like Figure 1 The image shows a method for predicting video playback parameters provided in an embodiment of this application. The method includes:
[0054] Step 101: Generate input features based on the video data features of the target video and the behavioral data features of the user watching the video within a preset time period.
[0055] In this step, the target video is any video from the preset video library. Video understanding technology can be used to obtain the video features of the target video. For example, video features can include video clarity, primary and secondary video categories, video tags, video author, etc., but are not limited to these. Behavioral data features of watching videos include: the number of videos watched, likes received, primary and secondary video categories, etc., but are not limited to these. The preset time period can be any number of historical time periods, such as the past three days, the past thirty days, etc. Alternatively, behavioral data features of the user watching the most recent target number of videos can be selected to replace the user's behavioral data features of watching videos within the preset time period. It is understood that the behavioral data features are obtained with the user's authorization. For example, an authorization interface can be displayed; when the user triggers the authorization option, the user's behavioral data features of watching videos within the preset time period will be obtained.
[0056] Step 102: Input the input features into the embedding layer of the neural network model, and convert the input features into embedding vectors through the embedding layer, where the embedding vectors are representations of the input features.
[0057] In this step, the input features are typically sparse. To facilitate subsequent processing, the input features can be transformed into a different representation, which can characterize the input features in another dimension. For example, the input features can be mapped to a low-dimensional vector space to obtain their representation in that low-dimensional vector space, i.e., the embedding vector, but this is not limited to this. The neural network model here is a pre-trained neural network model, such as the neural network model in the above-mentioned embodiments. The embedding layer is used to transform the input features into embedding vectors in the neural network model. It is understood that the neural network models mentioned below can all be the neural network models in the above-mentioned embodiments, and will not be described again hereafter to avoid repetition.
[0058] Step 103: Input the embedding vector into the intermediate layer of the neural network model. The intermediate layer obtains N fused feature vectors based on the embedding vector, where each fused feature vector corresponds to a playback parameter.
[0059] In this step, the embedding vector is merely a simple transformation of the input feature representation, and it is clearly unsuitable as data for directly predicting playback parameters. Therefore, the embedding vector can be processed to obtain data suitable for directly predicting playback parameters, i.e., a fused feature vector. Here, the playback parameters corresponding to the fused feature vector are the playback parameters suitable for prediction using this fused feature vector.
[0060] Step 104: Input N fused feature vectors into the tower floor of the neural network model. The tower floor obtains the first predicted value and the second predicted value of the first playback parameter based on the first fused feature vector, and obtains the third predicted value of the second playback parameter based on the second fused feature vector.
[0061] In this step, the first fusion feature vector and the second fusion feature vector are different fusion feature vectors among N fusion feature vectors, the first playback parameter is the playback parameter corresponding to the first fusion feature vector, and the second playback parameter is the playback parameter corresponding to the second fusion feature vector.
[0062] Step 105: Input the first predicted value, the second predicted value, and the third predicted value into the output layer of the neural network model. The output layer determines the predicted value of the first playback parameter based on the first predicted value, and determines the predicted value of the second playback parameter based on the second and third predicted values.
[0063] It should be noted that the first playback parameter can influence the second playback parameter to some extent, but the second playback parameter cannot influence the first playback parameter. Therefore, we will first obtain two predicted values for the first playback parameter, namely the first predicted value and the second predicted value. The first predicted value will be used as the final predicted value for the first playback parameter. The second predicted value will be combined with the third predicted value for the second playback parameter to obtain the final predicted value for the second playback parameter.
[0064] It is understood that, in addition to the first and second playback parameters, any number of other playback parameters can be included, without limitation here. These arbitrary number of other playback parameters can include playback parameters of the first type and / or playback parameters of the second type, wherein the first playback parameter can influence the playback parameters of the first type to a certain extent, but the playback parameters of the first type cannot influence the first playback parameter. The first playback parameter and the playback parameters of the second type do not affect each other. When the arbitrary number of other playback parameters includes a third playback parameter of the first type, the method further includes: obtaining a fourth predicted value of the third playback parameter based on the third fusion feature vector, wherein the third playback parameter is the playback parameter corresponding to the third fusion feature vector; and determining the predicted value of the third playback parameter based on the second and fourth predicted values. When the arbitrary number of other playback parameters includes a fourth playback parameter of the second type, the method further includes: obtaining a fifth predicted value of the fourth playback parameter based on the fourth fusion feature vector, wherein the fourth playback parameter is the playback parameter corresponding to the fourth fusion feature vector; and determining the predicted value of the fourth playback parameter based on the fifth predicted value.
[0065] In this embodiment, after obtaining input features based on the video data features of the target video and the user's video viewing behavior data features within a preset time period, the input features are converted into embedding vectors by the embedding layer of the neural network model, facilitating subsequent processing. Then, the intermediate layer of the neural network model obtains a fused feature vector based on the embedding vector, which is used as the data required to predict playback parameters. The tower layer of the neural network model uses the fused feature vector to obtain a first predicted value, a second predicted value, and a third predicted value for the second playback parameter. Finally, the output layer of the neural network model guides the second playback parameter based on the first playback parameter, combining the second and third predicted values to obtain the predicted value of the second playback parameter, thus improving the accuracy of the second playback parameter. Simultaneously, it avoids the influence of the second playback parameter on the first playback parameter. Compared to using traditional multi-objective learning models to predict targets, this application improves the accuracy of target prediction.
[0066] Optionally, the input features are converted into embedding vectors via an embedding layer, including:
[0067] The input features are transformed into M embedding vectors through M embedding networks in the embedding layer. The M embedding vectors represent the input features from M different dimensions, and M equals N plus 1.
[0068] Based on the embedding vector, N fused feature vectors are obtained through the intermediate layer, including:
[0069] Each gated network in the intermediate layer generates a set of weights based on the first embedding vector, wherein each set of weights includes N weight values and the first embedding vector is one of M embedding vectors;
[0070] N feature vectors are obtained from N expert networks in the intermediate layer based on N embedding vectors, where the N embedding vectors include the embedding vectors other than the first embedding vector from the M embedding vectors;
[0071] The N feature vectors are weighted and summed based on each set of weights to obtain N fused feature vectors.
[0072] It should be noted that each embedding vector is unique. The first embedding vector can be used to generate N sets of weights, and the remaining embedding vectors are subjected to feature processing to obtain feature vectors that are more suitable for predicting playback parameters. There is a one-to-one correspondence between the N embedding vectors and the N feature vectors.
[0073] Because there are differences between the playback parameters, and the fused feature vectors used to predict each playback parameter are all obtained by weighted summation of N feature vectors, different weight distributions can be used to generate different fused feature vectors when weighted summing of the N feature vectors, in order to predict different playback parameters respectively. Here, the first embedding vector will be used to generate different weight distributions for different playback parameters.
[0074] In this embodiment, the embedding vectors are not shared, making them more targeted and thus improving the final prediction results of the playback parameters.
[0075] Optionally, obtaining a first predicted value and a second predicted value of the first playback parameter based on the first fusion feature vector via the tower floor, and obtaining a third predicted value of the second playback parameter based on the second fusion feature vector, includes:
[0076] The first predicted value of the first target is obtained by the first multilayer perceptron among the M multilayer perceptrons in the tower floor based on the first fused feature vector;
[0077] The second predicted value of the first target is obtained by using the second multilayer perceptron among M multilayer perceptrons based on the first fused feature vector;
[0078] The third predicted value of the second target is obtained by the third multilayer perceptron among M multilayer perceptrons based on the second fused feature vector.
[0079] The process involves determining the predicted values of the first playback parameters based on the first predicted value via the output layer, and determining the predicted values of the second playback parameters based on the second and third predicted values, including:
[0080] Normalize the first predicted value to obtain the predicted value of the first playback parameter;
[0081] The second and third predicted values are normalized respectively, and the two normalized results are multiplied together to obtain the predicted value of the second playback parameter.
[0082] It should be noted that by normalizing the predicted value, its value can be limited to a value less than or equal to 1. Normalization can be performed using the sigmoid function, but is not limited to this. To ensure the accuracy of the first playback parameter, the result of normalizing the first predicted value is used as the predicted value of the first playback parameter. Correspondingly, the second playback parameter should be affected by the first playback parameter. Therefore, combining the second and third predicted values will yield a more accurate second playback parameter.
[0083] In this embodiment of the application, normalization processing can limit the final predicted value of the playback parameters to a small range of values, making it easier for users to understand.
[0084] Optionally, input features are generated based on the video data features of the target video and the user's video viewing behavior data features within a preset time period, including:
[0085] Determine the feature types of each video data feature and each behavioral data feature; the feature types include numerical and categorical.
[0086] Based on feature transformation strategies for each feature type, video data features and behavioral data features are transformed into input features.
[0087] It should be noted that user behavior such as clicks, views, and likes in video applications can be collected to establish long-term, short-term, and real-time user profiles. Specifically, long-term user profiles refer to a user's video preferences over the past 30 days; short-term user profiles refer to a user's video preferences over the past 3 days; and real-time user profiles refer to information from the 10 videos a user has watched in the past. See Table 1 for details.
[0088]
[0089] Table 1
[0090] The features in Table 1 are divided into two types: numerical features and categorical features. Numerical features refer to features that can be directly represented by numerical values, while categorical features refer to features that need to be encoded using discrete numerical values, as shown in Table 2.
[0091]
[0092] Table 2
[0093] The feature transformation strategies for each feature type are shown in Table 2. After determining the feature types of each video data feature and each behavioral data feature, the input features will be obtained based on the transformation strategies shown in Table 2.
[0094] In this embodiment, by utilizing feature transformation strategies corresponding to different feature types, input features can be quickly obtained based on video data features and behavioral data features.
[0095] Optionally, the number of target videos is at least two; after determining the predicted value of the first playback parameter based on the first predicted value via the output layer, and determining the predicted value of the second playback parameter based on the second and third predicted values, the method further includes:
[0096] For each target video, a recommendation score is calculated based on the first and second playback parameters of the target video.
[0097] The video information of at least two target videos is sorted and sent to the terminal device in descending order of recommendation score, so that the terminal device displays the video information of each target video in descending order of recommendation score.
[0098] It should be noted that in video recommendation scenarios, there are usually many target videos, requiring multiple target videos to be recommended to users in descending order of user preference. Here, the recommendation score is used as a quantification of user preference. The higher the recommendation score, the more the user likes the video. The first playback parameter includes the probability of playing the video, and the second playback parameter includes the video playback duration and / or video completion rate. For a given video, the video completion rate is equal to the quotient obtained by dividing the video playback duration by the total video duration. When calculating the recommendation score based on the first and second playback parameters, pre-assigned weights to different playback parameters can be used.
[0099] Optionally, when the playback parameters of the target video include the probability of playing the video, the video playback duration, and the video playback completion rate, the steps for calculating the recommendation score of the target video include:
[0100] Obtain the weight value corresponding to each playback parameter;
[0101] The intermediate score is obtained by weighted summation based on each playback parameter and its corresponding weight value.
[0102] In this step, the intermediate score score1 = W1 × CTR_SCORE + W2 × DU_SCORE + W3 × WR_SCORE; where CTR_SCORE represents the probability of playing the video, DU_SCORE represents the video playback duration, WR_SCORE represents the video playback completion rate, W1 represents the weight corresponding to the probability of playing the video, W2 represents the weight corresponding to the video playback duration, and W3 represents the weight corresponding to the video playback completion rate.
[0103] A recommendation score is derived based on the median score and the average duration of videos watched by the user.
[0104] It should be noted that users have different preferences for video lengths. When recommending videos to users, video length can be considered, prioritizing longer videos for users who prefer them and shorter videos for users who prefer them. Therefore, the median score should be adjusted based on user preferences for video length and the target video's length to arrive at the final recommendation score.
[0105] Here, we can pre-analyze users' past video viewing behavior to obtain the average raw video duration watched by users over the past 30 days. When calculating the recommendation score, we use Formula 1. Formula 1:
[0106]
[0107] Here, SCORE2 represents the recommended score, SCORE1 represents the median score, W4 is used to control the degree of adjustment, which is a predetermined fixed value, DURATION1 represents the average duration of the video watched by the user, and DURATION2 represents the duration of the target video.
[0108] In this embodiment, user preferences for long and short videos are taken into account, making the recommendation score more accurate in representing the user's liking for the target video.
[0109] Optionally, when the playback parameters of the target video include the probability of playing the video, the video playback duration, and the video playback completion rate, the steps for calculating the recommendation score of the target video include:
[0110] Obtain the weight value corresponding to each playback parameter;
[0111] A recommendation score is obtained based on each playback parameter and its corresponding weight value.
[0112] It should be noted that the recommended score can be calculated using Formula 2. Specifically, Formula 2:
[0113] SCORE = CTR_SCORE w5 +DU_SCORE w6 +WR_SCORE w7 Where, score represents the recommendation score, CTR_SCORE represents the probability of playing the video, DU_SCORE represents the video playback duration, WR_SCORE represents the video playback completion rate, W5 represents the weight corresponding to the probability of playing the video, W6 represents the weight corresponding to the video playback duration, and W7 represents the weight corresponding to the video playback completion rate.
[0114] In this embodiment, the recommended score of the target video is calculated using nonlinear transformation, which offers greater flexibility.
[0115] like Figure 2 As shown in the illustration, this application embodiment also provides a schematic diagram of the neural network model architecture in the video playback parameter prediction method. This neural network model can be used to obtain multiple video playback parameters, where the first playback parameter is the probability of playing the video, the second playback parameter is the video playback duration, and the third playback parameter is the video playback completion rate. After obtaining the input features through step 101, embedding vectors are obtained using embedding networks 0, 1, 2, and 3 respectively, and each embedding vector is input into expert networks 0, 1, 2, 0, 1, and 1 respectively.
[0116] Gated network 0, gated network 1, and gated network 2 each generate a set of weights based on an embedding vector; the outputs of each expert network are weighted and summed according to each set of weights to obtain three fusion feature vectors, wherein the first fusion feature vector is input to multilayer perceptron 0 and multilayer perceptron 1 respectively; the second fusion feature vector is input to multilayer perceptron 2; and the third fusion feature vector is input to multilayer perceptron 3.
[0117] Finally, the output of multilayer perceptron 0 is processed by the sigmoid function to obtain the probability of video playback; the output of multilayer perceptron 1 is processed by the sigmoid function to obtain the second predicted value; the output of multilayer perceptron 2 is multiplied by the second predicted value to obtain the video playback duration. The output of multilayer perceptron 3 is processed by the sigmoid function and then multiplied by the second predicted value to obtain the video playback completion rate, as shown in Formulas 3, 4, and 5 below:
[0118] Formula 3: CTR = sigmoid(O(MLP0));
[0119] Formula 4: CTR1 = sigmoid(O(MLP1));
[0120] Formula 5: DU = O(MLP2) × CTR1 = O(MLP2) × sigmoid(O(MLP1));
[0121] Formula 6: WR = sigmoid(O(MLP3)) × CTR1 = sigmoid(O(MLP3)) × sigmoid(O(MLP1));
[0122] Wherein, CTR represents the probability of playing the video, CTR1 represents the second predicted value, DU represents the video playback duration, WR represents the video playback completion rate; O(MLP0) represents the output of multilayer perceptron 0, O(MLP1) represents the output of multilayer perceptron 1, O(MLP2) represents the output of multilayer perceptron 2, and O(MLP3) represents the output of multilayer perceptron 3.
[0123] In this embodiment, compared to the MMOE model, the calculation of video playback duration and completion rate also utilizes information from the multilayer perceptron 1, thereby improving the accuracy of video playback duration and completion rate. Simultaneously, to reduce the impact of video playback duration and completion rate on the probability of playing the video, a second prediction value is added to guide the learning of video playback duration and completion rate, instead of directly using the probability of playing the video.
[0124] like Figure 3 The diagram illustrates a method for training a neural network model according to an embodiment of this application. This training method includes:
[0125] Step 301: Obtain the sample set for training.
[0126] In this step, the sample set is used to train the neural network model. For example, if the target of the neural network model is determined as the probability of playing a video, the video playback duration, and the video playback completion rate, a partial sample set can be obtained first by obtaining the input features in the above-mentioned embodiment. Then, this partial data is labeled to obtain the complete sample set. It can be understood that after a video is exposed to a user, the user has two behaviors: play or not play. If the user plays, the video playback duration and video playback completion rate can be obtained; if the user does not play, both the video playback duration and video playback completion rate are 0. Therefore, based on the user's behavior, samples are constructed for model training. The samples have three labels: whether the video was played (corresponding to the probability of playing the video, which is the true value of the probability of playing the video), the viewing duration (corresponding to the video playback duration, which is the true value of the video playback duration), and the completion rate (corresponding to the video playback completion rate, which is the true value of the video playback completion rate). The labeling method is shown in Table 3.
[0127] Label Annotation method Play or not? A score of 1 is assigned to the number of plays, and 0 is assigned to the number of exposures without plays. Video playback duration User's playback duration, in seconds Completion rate User playback duration divided by the original video duration
[0128] Table 3
[0129] Step 302: Input the samples in the sample set as input features into the embedding layer of the neural network model, and convert the input features into embedding vectors through the embedding layer.
[0130] In this step, the embedding vector represents the input features. It's understood that input features are typically sparse. To facilitate subsequent processing, the input features can be transformed in their representation, allowing the transformed representation to characterize the input features in another dimension. For example, the input features can be mapped to a low-dimensional vector space to obtain their representation in that low-dimensional vector space, i.e., the embedding vector, but this is not the only possibility.
[0131] Step 303: Input the embedding vector into the intermediate layer of the neural network model. The intermediate layer obtains N fused feature vectors based on the embedding vector, where each fused feature vector corresponds to a target of the neural network model.
[0132] In this step, the embedding vector is merely a simple transformation of the input feature representation, and it is clearly unsuitable as data for directly predicting the target. Therefore, the embedding vector can be processed to obtain data suitable for directly predicting the target, i.e., a fused feature vector. Here, the target corresponding to the fused feature vector is the target suitable for prediction using this fused feature vector.
[0133] Step 304: Input N fused feature vectors into the tower floor of the neural network model. The tower floor obtains the first predicted value and the second predicted value of the first target based on the first fused feature vector, and obtains the third predicted value of the second target based on the second fused feature vector.
[0134] In this step, the first fusion feature vector and the second fusion feature vector are different fusion feature vectors among N fusion feature vectors, the first target is the target corresponding to the first fusion feature vector, and the second target is the target corresponding to the second fusion feature vector.
[0135] Step 305: Input the first predicted value, the second predicted value, and the third predicted value into the output layer of the neural network model. The output layer determines the predicted value of the first target based on the first predicted value, and determines the predicted value of the second target based on the second and third predicted values.
[0136] It should be noted that each sample can complete one training iteration of the neural network model, and the training process is iterative. This explanation uses only one training iteration as an example. Inputting a sample into the neural network model will yield predicted values for the first target and the second target.
[0137] Step 306: Calculate the model loss based on the predicted and true values of the first target and the predicted and true values of the second target.
[0138] In this step, the neural network model has multiple objectives, each with its own loss. The model loss is the sum of the losses of all objectives. The true value of each objective can be determined based on the labels in the samples, which will not be elaborated here.
[0139] Step 307: If the model loss obtained from training is greater than the target threshold, calculate the gradient of the model loss based on the backpropagation algorithm, and update the model parameters of the neural network model based on the gradient until the model loss obtained from training is less than or equal to the target threshold.
[0140] It should be noted that if the model loss is less than or equal to the target threshold, it indicates that the model's current performance is good and its error rate is low, at which point training can be stopped. Conversely, if the loss is greater than or equal to the target threshold, it indicates that the model's current performance is poor and training needs to continue. Understandably, each training iteration updates the model parameters of the current neural network model, gradually improving its performance through multiple iterations until the model training is complete.
[0141] exist Figure 2In the specific application scenario shown, the probability of playing a video is used to guide the learning of video playback duration and completion rate. It's understandable that the video playback duration and completion rate are only obtained after the user plays the video. If the user does not play the video, both the playback duration and completion rate are 0. Therefore, there is a relationship between the probability of playing a video and the two objectives of video playback duration and completion rate. This application adds a second prediction value to guide the learning of video playback duration and completion rate, which can reduce the learning difficulty of these two parameters and make their predictions more accurate. Utilizing the probability of playing a video when learning video playback duration and completion rate increases the connection between the objectives and can also accelerate the convergence speed of each objective, reducing model training time.
[0142] exist Figure 2 In the neural network model shown, the parameters of embedded network 0 are updated through expert network 0 using the backpropagation algorithm, the parameters of embedded network 1 are updated through expert network 1 using the backpropagation algorithm, the parameters of embedded network 2 are updated through expert network 2 using the backpropagation algorithm, and the parameters of embedded network 2 are updated through a gating network using the backpropagation algorithm. Each embedded network is independent of the others and represents the input features from different dimensions, thereby increasing the model's fitting ability.
[0143] In this embodiment of the application, the first objective is used to guide the learning of the second objective during the training process. This not only reduces the learning difficulty of the second objective but also improves the learning speed of the second objective. As a result, the accuracy of the second objective of the neural network model is improved, while the training time of the model is also shortened.
[0144] Based on the above-mentioned application embodiments, in this application embodiment, when building user profile features based on past user behavior, only when a user plays a video and the playback duration exceeds the average playback duration of that video is considered a valid playback behavior. Only valid playback behaviors are used when building the profile. It is understood that a user clicking on a video does not necessarily mean the user likes the video; they may be attracted by the title and cover image, click on it, and then swipe away after a short playback time. A user clicking on a video and playing it for a long time indicates that the user is interested in the video. Using valid playback behaviors instead of regular playback behaviors when calculating user profile features makes the user profile more accurate and better reflects the user's true interest in the video. Specifically, when constructing the tags for whether a user played a video in the sample set, different methods are used depending on whether the video is automatically playing: if the video is not automatically playing, the tag 'l' is 1 as long as the user clicks on the video; if the video is automatically playing, the tag is 1 only if the playback duration exceeds a threshold K1, where the threshold K1 can be defined according to the video type.
[0145] In this embodiment of the application, when constructing the tag for whether a user plays a video, the automatic playback of the video is taken into account. This can distinguish whether the user actively clicks on the video, and the sample set used for model training can more accurately characterize user behavior and preferences.
[0146] Optionally, when the first objective is the probability of playing a video and the second objective is the video playback completion rate, the loss function for the second objective is the cross-entropy loss function.
[0147] It should be noted that video playback completion rate is a continuous value between 0 and 1. Neural network models often use the mean squared error as the loss function when fitting continuous values. Analysis of user video viewing logs reveals that the distribution of video playback completion rates is concentrated around the values of 0 and 1. Figure 4 This aligns with users' video viewing habits: users typically swipe away after watching a few seconds of videos they don't like, resulting in a near 0% completion rate; while they will watch videos they like to the end, resulting in a near 1% completion rate.
[0148] In this embodiment, since the video playback completion value is basically distributed between 0 and 1, the cross-entropy loss function is used instead of the commonly used mean squared error loss function as the calculation method for the loss of video playback completion, so as to improve the convergence speed and prediction accuracy of video playback completion.
[0149] like Figure 5 As shown, this is a neural network model provided in an embodiment of the present application for the prediction of N targets, where N is an integer greater than 1. The neural network model includes: an embedding layer 501, an intermediate layer 502, a tower layer 503, and an output layer 504.
[0150] Embedding layer 501 is used to convert input features into embedding vectors, where the embedding vectors are representations of the input features;
[0151] The intermediate layer 502 is used to obtain N fused feature vectors based on the embedding vectors, where each fused feature vector corresponds to a target;
[0152] Tower floor 503 is used to obtain a first predicted value and a second predicted value of the first target based on the first fusion feature vector, and to obtain a third predicted value of the second target based on the second fusion feature vector. The first fusion feature vector and the second fusion feature vector are different fusion feature vectors among N fusion feature vectors. The first target is the target corresponding to the first fusion feature vector, and the second target is the target corresponding to the second fusion feature vector.
[0153] The output layer 504 is used to determine the predicted value of the first target based on the first predicted value, and to determine the predicted value of the second target based on the second and third predicted values.
[0154] It should be noted that the embedding layer 501 is the input layer of the neural network model, and the input features are the input to the neural network model. The input of the neural network model is usually sparse features. To facilitate processing in the neural network model, the input features can be transformed in the embedding layer 501. The transformed representation can characterize the input features in another dimension. For example, the input features can be mapped to a low-dimensional vector space to obtain its representation in that low-dimensional vector space, i.e., the embedding vector, but it is not limited to this.
[0155] Embedded vectors are merely simple transformations of the input feature representation, and clearly cannot be used as data for directly predicting the target. Therefore, the neural network model is designed with an intermediate layer 502 to process the embedded vectors to obtain data suitable for directly predicting the target, i.e., a fused feature vector. Here, the target corresponding to the fused feature vector is the target suitable for prediction using this fused feature vector.
[0156] After obtaining the fused feature vector, the predicted values of each target can be obtained at tower floor 503. It is worth noting that the first target can influence the second target to some extent, but the second target cannot influence the first target. Therefore, two predicted values for the first target are first obtained, namely the first predicted value and the second predicted value. The first predicted value is used as the final predicted value for the first target, and the second predicted value is combined with the third predicted value for the second target to obtain the final predicted value for the second target. It is understood that the N targets can include any number of other targets besides the first and second targets; this is not limited here. These arbitrary number of other targets can include targets of type 1 and / or targets of type 2, wherein the first target can influence targets of type 1 to some extent, but targets of type 1 cannot influence the first target. The first target and targets of type 2 do not affect each other. In the case where these arbitrary number of other targets include a third target of type 1, tower floor 503 is also used to obtain a fourth predicted value for the third target based on the third fused feature vector, wherein the third target is the target corresponding to the third fused feature vector. Output layer 504 is also used to determine the predicted value of the third target based on the second and fourth predicted values. In the case that the arbitrary number of other targets includes a fourth target of the second type, tower layer 503 is further configured to obtain a fifth predicted value of the fourth target based on the fourth fusion feature vector, wherein the fourth target is the target corresponding to the fourth fusion feature vector. Output layer 504 is further configured to determine the predicted value of the fourth target based on the fifth predicted value.
[0157] In this embodiment, the neural network model includes an embedding layer 501, an intermediate layer 502, a tower layer 503, and an output layer 504. The embedding layer 501 converts input features into embedding vectors, facilitating processing within the neural network model. Then, the intermediate layer 502 obtains a fused feature vector based on the embedding vectors and uses it as the data required for predicting the target. In the tower layer 503, the fused feature vectors are used to obtain a first predicted value, a second predicted value, and a third predicted value for the second target. Finally, the second target is guided based on the first target, and the second and third predicted values are combined to obtain the predicted value for the second target. Simultaneously, to avoid the second target influencing the first target, the first predicted value is determined as the predicted value for the first target. This embodiment, by guiding the second target with the first target, accelerates the learning process of the second target, thereby shortening the model's learning time and solving the problem of excessively long model learning times. It also avoids the second target influencing the first target, ensuring the accuracy of the first target.
[0158] See Figure 6 The embedding layer 501 includes M embedding networks ( Figure 6 Only three embedded networks are shown in the diagram, but it is not limited to three. The intermediate layer 502 includes N expert networks. Figure 6 Only two expert networks are shown, but not limited to two) and N gated networks are shown. Figure 6 Only two gating networks are shown in the figure, but not limited to two, where M is equal to the sum of N and 1.
[0159] Embedding layer 501 is used to transform the input features into M embedding vectors through M embedding networks, where the M embedding vectors are representations of the input features from M different dimensions;
[0160] Each gated network generates a set of weights based on a first embedding vector. Each set of weights includes N weight values that characterize the weight distribution among N expert networks. The first embedding vector is one of M embedding vectors.
[0161] N expert networks obtain N feature vectors based on N embedding vectors. The N embedding vectors include the embedding vectors other than the first embedding vector from the M embedding vectors. Different expert networks use different embedding vectors.
[0162] The N feature vectors are weighted and summed based on each set of weights to obtain N fused feature vectors.
[0163] It should be noted that each embedding network is a sub-network in the neural network model, and the embedding networks are independent of each other. Each embedding network can convert input features into embedding vectors, but the embedding vectors converted by each embedding network are different. Each embedding network is similar to the embedding network in the MMOE model, and will not be elaborated further here.
[0164] Similarly, each expert network is analogous to the expert network in the MMOE model. Each expert network corresponds one-to-one with the target. For each expert network, it performs feature processing on the embedding vector, making the resulting feature vector more suitable for predicting the target corresponding to that expert network. Each expert network corresponds to an embedding network; therefore, each expert network uses the embedding vector output by its respective embedding network.
[0165] Because the targets differ, and the fusion feature vectors used to predict each target are obtained by weighted summation of the feature vectors output by N expert networks, different weight distributions can be used to generate different fusion feature vectors to predict different targets when weighted summation of the feature vectors output by N expert networks. Here, different gating networks will be used to generate different weight distributions for different targets. Similarly, each gating network is similar to the gate network in the MMOE model. Specifically, each gating network corresponds one-to-one with a target. For each gating network, it generates a set of weights based on its corresponding target. The fusion feature vector obtained by weighted summation of the feature vectors output by N expert networks according to these weights is more suitable for predicting that target.
[0166] In this embodiment, each expert network and gating network uses embedding vectors output by different embedding networks. Since the embedding vectors are no longer shared, the model's fitting ability is enhanced.
[0167] See Figure 7 Optionally, tower floor 503 includes M multilayer perceptrons (MLPs), and the output layer includes N target output networks; Figure 7 Only three multilayer perceptrons are shown in the original paper: a first multilayer perceptron, a second multilayer perceptron, and a third multilayer perceptron. The number of multilayer perceptrons in this application is not limited to this. Similarly, Figure 7 Only two target output networks are shown in the figure, namely the first target output network and the second target output network. The number of target output networks in this application is not limited to this.
[0168] The first multilayer perceptron in M multilayer perceptrons obtains the first predicted value of the first target based on the first fused feature vector.
[0169] The second multilayer perceptron in the M multilayer perceptrons obtains the second predicted value of the first target based on the first fused feature vector;
[0170] The third multilayer perceptron among M multilayer perceptrons obtains the third predicted value of the second target based on the second fused feature vector;
[0171] The first target output network in the N target output networks normalizes the first predicted value to obtain the predicted value of the first target;
[0172] The second target output network in the N target output networks normalizes the second and third predicted values respectively, and multiplies the two normalized results to obtain the predicted value of the second target.
[0173] It should be noted that both the first and second multilayer perceptrons input the first fused feature vector, therefore the first and second predicted values can both be considered as predicted values of the first target. However, the output of the second multilayer perceptron is connected to the input of the second target output network, so the second predicted value output by the second multilayer perceptron will be affected by the second target. Therefore, to ensure the accuracy of the first target, the result of normalizing the first predicted value is used as the predicted value of the first target. Correspondingly, the second target should be affected by the first target. Therefore, combining the second predicted value with the third predicted value of the second target output by the third multilayer perceptron will yield a more accurate second target. It is understood that the sigmoid function can be used for normalization, but it is not limited to this.
[0174] In this embodiment, the first multilayer perceptron and the second multilayer perceptron share only the input. The first multilayer perceptron is connected to the output network that outputs the first target, thereby preventing the second target from affecting the first target. Simultaneously, both the second and third perceptrons are connected to the output network that outputs the second target, thus incorporating the influence of the first target on the second target into the process of obtaining the second target, resulting in a more accurate second target.
[0175] It should be noted that the video playback parameter prediction method provided in this application embodiment can be executed by a video playback parameter prediction device, or a control module within that device for executing the video playback parameter prediction method. This application embodiment uses the execution of the video playback parameter prediction method by a video playback parameter prediction device as an example to illustrate the video playback parameter prediction device provided in this application embodiment.
[0176] like Figure 8As shown in the figure, this application embodiment also provides a video playback parameter prediction device, the device comprising:
[0177] Input module 81 is used to generate input features based on the video data features of the target video and the behavioral data features of the user watching the video within a preset time period;
[0178] The conversion module 82 is used to input the input features into the embedding layer of the neural network model and convert the input features into embedding vectors through the embedding layer, wherein the embedding vectors are representations of the input features;
[0179] Feature module 83 is used to input the embedding vector into the intermediate layer of the neural network model. The intermediate layer obtains N fused feature vectors based on the embedding vector, where each fused feature vector corresponds to a playback parameter.
[0180] The prediction module 84 is used to input N fused feature vectors into the tower floor of the neural network model, and obtain a first predicted value and a second predicted value of the first playback parameter based on the first fused feature vector through the tower floor, and obtain a third predicted value of the second playback parameter based on the second fused feature vector. The first fused feature vector and the second fused feature vector are different fused feature vectors among the N fused feature vectors, the first playback parameter is the playback parameter corresponding to the first fused feature vector, and the second playback parameter is the playback parameter corresponding to the second fused feature vector.
[0181] The output module 85 is used to input the first predicted value, the second predicted value, and the third predicted value to the output layer of the neural network model, and through the output layer, determine the predicted value of the first playback parameter based on the first predicted value, and determine the predicted value of the second playback parameter based on the second predicted value and the third predicted value.
[0182] Optionally, the conversion module 82 is specifically used to convert the input features into M embedding vectors through M embedding networks in the embedding layer, wherein the M embedding vectors are representations of the input features from M different dimensions, and M equals N plus 1;
[0183] Feature module 83 includes:
[0184] The weight unit is used to generate N sets of weights based on the first embedding vector through each gated network in the intermediate layer, wherein each set of weights includes N weight values and the first embedding vector is one of M embedding vectors;
[0185] The feature unit is used to obtain N feature vectors based on N embedding vectors via N expert networks in the intermediate layer, wherein the N embedding vectors include embedding vectors other than the first embedding vector from the M embedding vectors;
[0186] The fusion unit is used to perform weighted summation on N feature vectors based on each set of weights to obtain N fused feature vectors.
[0187] Optionally, the prediction module 84 includes:
[0188] The first prediction unit is used to obtain a first predicted value of the first target based on a first fused feature vector through the first multilayer perceptron among the M multilayer perceptrons in the tower floor.
[0189] The second prediction unit is used to obtain a second predicted value of the first target based on the first fused feature vector through the second multilayer perceptron among the M multilayer perceptrons;
[0190] The third prediction unit is used to obtain the third predicted value of the second target based on the second fused feature vector through the third multilayer perceptron among the M multilayer perceptrons.
[0191] Output module 85 includes:
[0192] The first output unit is used to normalize the first predicted value through the first target output network among the N target output networks in the output layer to obtain the predicted value of the first playback parameter.
[0193] The second output unit is used to normalize the second predicted value and the third predicted value through the second target output network in the N target output networks, and multiply the two normalized results to obtain the predicted value of the second playback parameter.
[0194] Optionally, the number of target videos is at least two; the device also includes:
[0195] The first recommendation module is used to calculate the recommendation score of each target video based on the first and second playback parameters of the target video.
[0196] The second recommendation module is used to sort the video information of at least two target videos in descending order of recommendation score and send it to the terminal device, so that the terminal device can display the video information of each target video in descending order of recommendation score.
[0197] In this embodiment, after obtaining input features based on the video data features of the target video and the user's video viewing behavior data features within a preset time period, the input features are converted into embedding vectors by the embedding layer of the neural network model, facilitating subsequent processing. Then, the intermediate layer of the neural network model obtains a fused feature vector based on the embedding vector, which is used as the data required to predict playback parameters. The tower layer of the neural network model uses the fused feature vector to obtain a first predicted value, a second predicted value, and a third predicted value for the second playback parameter. Finally, the output layer of the neural network model guides the second playback parameter based on the first playback parameter, combining the second and third predicted values to obtain the predicted value of the second playback parameter, thus improving the accuracy of the second playback parameter. Simultaneously, it avoids the influence of the second playback parameter on the first playback parameter. Compared to using traditional multi-objective learning models to predict targets, this application improves the accuracy of target prediction.
[0198] The video playback parameter prediction device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.
[0199] The video playback parameter prediction device in this embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this embodiment does not specifically limit the specific operating system.
[0200] The video playback parameter prediction device provided in this application embodiment can achieve... Figure 1 The various processes implemented in the method embodiments achieve the same technical effect, and will not be described again here to avoid repetition.
[0201] like Figure 9 As shown in the embodiments of this application, a training device for a neural network model is also provided, the training device comprising:
[0202] Sample module 91 is used to obtain a sample set for training;
[0203] The first training module 92 is used to input samples from the sample set as input features into the embedding layer of the neural network model, and convert the input features into embedding vectors through the embedding layer, wherein the embedding vectors are representations of the input features;
[0204] The second training module 93 is used to input the embedding vector into the intermediate layer of the neural network model, and obtain N fused feature vectors based on the embedding vector through the intermediate layer, wherein each fused feature vector corresponds to a target of the neural network model.
[0205] The third training module 94 is used to input N fused feature vectors into the tower floor of the neural network model. The tower floor obtains the first predicted value and the second predicted value of the first target based on the first fused feature vector, and obtains the third predicted value of the second target based on the second fused feature vector. The first fused feature vector and the second fused feature vector are different fused feature vectors among the N fused feature vectors. The first target is the target corresponding to the first fused feature vector, and the second target is the target corresponding to the second fused feature vector.
[0206] The fourth training module 95 is used to input the first predicted value, the second predicted value and the third predicted value into the output layer of the neural network model, and through the output layer, determine the predicted value of the first target based on the first predicted value, and determine the predicted value of the second target based on the second predicted value and the third predicted value.
[0207] Loss module 96 is used to calculate the model loss from the predicted and actual values of the first objective and the predicted and actual values of the second objective.
[0208] The update module 97 is used to calculate the gradient of the model loss based on the backpropagation algorithm when the model loss obtained from training is greater than the target threshold, and update the model parameters of the neural network model based on the gradient until the model loss obtained from training is less than or equal to the target threshold.
[0209] Optionally, when the first objective is the probability of playing a video and the second objective is the video playback completion rate, the loss function for the second objective is the cross-entropy loss function.
[0210] In this embodiment of the application, the first objective is used to guide the learning of the second objective during the training process. This not only reduces the learning difficulty of the second objective but also improves the learning speed of the second objective. As a result, the accuracy of the second objective of the neural network model is improved, while the training time of the model is also shortened.
[0211] The training device for the neural network model in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the scope of the device.
[0212] The training device for the neural network model in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.
[0213] The neural network model training device provided in this application embodiment can achieve Figure 3 The various processes implemented in the method embodiments achieve the same technical effect, and will not be described again here to avoid repetition.
[0214] Optionally, such as Figure 10 As shown, this application embodiment also provides an electronic device 1000, including a processor 1001 and a memory 1002. The memory 1002 stores a program or instructions that can run on the processor 1001. When the program or instructions are executed by the processor 1001, they implement the various steps of the above-mentioned video playback parameter prediction method or neural network model training method embodiment, and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0215] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0216] Figure 11 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.
[0217] The electronic device 1100 includes, but is not limited to, components such as: radio frequency unit 1101, network module 1102, audio output unit 1103, input unit 1104, sensor 1105, display unit 1106, user input unit 1107, interface unit 1108, memory 1109, and processor 1110.
[0218] Those skilled in the art will understand that the electronic device 1100 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1110 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 11 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0219] The processor 1110 is used to generate input features based on the video data features of the target video and the behavioral data features of the user watching the video within a preset time period.
[0220] The processor 1110 is also configured to input input features to the embedding layer of a neural network model, and convert the input features into embedding vectors via the embedding layer, wherein the embedding vectors are representations of the input features;
[0221] The processor 1110 is also used to input the embedding vector into the intermediate layer of the neural network model, and obtain N fused feature vectors based on the embedding vector through the intermediate layer, wherein each fused feature vector corresponds to a playback parameter;
[0222] The processor 1110 is further configured to input N fused feature vectors into the tower floor of the neural network model, and obtain a first predicted value and a second predicted value of the first playback parameter based on the first fused feature vector through the tower floor, and obtain a third predicted value of the second playback parameter based on the second fused feature vector, wherein the first fused feature vector and the second fused feature vector are different fused feature vectors among the N fused feature vectors, the first playback parameter is the playback parameter corresponding to the first fused feature vector, and the second playback parameter is the playback parameter corresponding to the second fused feature vector;
[0223] The processor 1110 is further configured to input the first predicted value, the second predicted value, and the third predicted value to the output layer of the neural network model, and determine the predicted value of the first playback parameter based on the first predicted value through the output layer, and determine the predicted value of the second playback parameter based on the second predicted value and the third predicted value.
[0224] In this embodiment, after obtaining input features based on the video data features of the target video and the user's video viewing behavior data features within a preset time period, the input features are converted into embedding vectors by the embedding layer of the neural network model, facilitating subsequent processing. Then, the intermediate layer of the neural network model obtains a fused feature vector based on the embedding vector, which is used as the data required to predict playback parameters. The top layer of the neural network model uses the fused feature vector to obtain a first predicted value, a second predicted value, and a third predicted value for the second playback parameter. Finally, the output layer of the neural network model guides the second playback parameter based on the first playback parameter, combining the second and third predicted values to obtain the predicted value of the second playback parameter, thus improving the accuracy of the second playback parameter. Simultaneously, it avoids the second playback parameter from influencing the first playback parameter.
[0225] or
[0226] Processor 1110 is used to acquire a sample set for training;
[0227] The processor 1110 is also used to input samples from the sample set as input features into the embedding layer of the neural network model, and convert the input features into embedding vectors via the embedding layer, wherein the embedding vectors are representations of the input features;
[0228] The processor 1110 is also used to input the embedding vector to the intermediate layer of the neural network model, and obtain N fused feature vectors based on the embedding vector through the intermediate layer, wherein each fused feature vector corresponds to a target of the neural network model;
[0229] The processor 1110 is also used to input N fused feature vectors into the tower floor of the neural network model, and obtain a first predicted value and a second predicted value of the first target based on the first fused feature vector through the tower floor, and obtain a third predicted value of the second target based on the second fused feature vector, wherein the first fused feature vector and the second fused feature vector are different fused feature vectors among the N fused feature vectors, the first target is the target corresponding to the first fused feature vector, and the second target is the target corresponding to the second fused feature vector;
[0230] The processor 1110 is also configured to input the first predicted value, the second predicted value, and the third predicted value to the output layer of the neural network model, and determine the predicted value of the first target based on the first predicted value and the predicted value of the second target based on the second predicted value and the third predicted value through the output layer;
[0231] The processor 1110 is also used to calculate the model loss based on the predicted and true values of the first objective and the predicted and true values of the second objective;
[0232] The processor 1110 is also used to calculate the gradient of the model loss based on the backpropagation algorithm when the model loss obtained from training is greater than the target threshold, and to update the model parameters of the neural network model based on the gradient until the model loss obtained from training is less than or equal to the target threshold.
[0233] In this embodiment of the application, the first objective is used to guide the learning of the second objective during the training process. This not only reduces the learning difficulty of the second objective but also improves the learning speed of the second objective. As a result, the accuracy of the second objective of the neural network model is improved, while the training time of the model is also shortened.
[0234] It should be understood that, in this embodiment, the input unit 1104 may include a graphics processing unit (GPU) 11041 and a microphone 11042. The GPU 11041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1106 may include a display panel 11061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1107 includes at least one of a touch panel 11071 and other input devices 11072. The touch panel 11071 is also called a touch screen. The touch panel 11071 may include a touch detection device and a touch controller. Other input devices 11072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0235] The memory 1109 can be used to store software programs and various data. The memory 1109 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1109 may include volatile memory or non-volatile memory, or it may include both volatile and non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1109 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0236] Processor 1110 may include one or more processing units; optionally, processor 1110 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 1110.
[0237] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described video playback parameter prediction method or neural network model training method embodiments, and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0238] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0239] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described video playback parameter prediction method or neural network model training method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0240] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0241] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement various processes as described in the above-described video playback parameter prediction method or neural network model training method embodiments, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0242] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0243] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0244] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for predicting video playback parameters, characterized in that, The method includes: Input features are generated based on the video data features of the target video and the behavioral data features of users watching the video within a preset time period; The input features are input into the embedding layer of the neural network model, and the embedding layer converts the input features into embedding vectors, wherein the embedding vectors are representations of the input features; The embedding vector is input into the intermediate layer of the neural network model, and the intermediate layer obtains N fused feature vectors based on the embedding vector, wherein each fused feature vector corresponds to a playback parameter; The N fused feature vectors are input into the tower floor of the neural network model. The tower floor obtains a first predicted value and a second predicted value of the first playback parameter based on the first fused feature vector, and obtains a third predicted value of the second playback parameter based on the second fused feature vector. The first fused feature vector and the second fused feature vector are different fused feature vectors among the N fused feature vectors. The first playback parameter is the playback parameter corresponding to the first fused feature vector, and the second playback parameter is the playback parameter corresponding to the second fused feature vector. The first predicted value, the second predicted value, and the third predicted value are input to the output layer of the neural network model. The output layer determines the predicted value of the first playback parameter based on the first predicted value, and determines the predicted value of the second playback parameter based on the second predicted value and the third predicted value.
2. The method according to claim 1, characterized in that, The process of converting the input features into an embedding vector via the embedding layer includes: The input features are converted into M embedding vectors through M embedding networks in the embedding layer, wherein the M embedding vectors represent the input features from M different dimensions, and M equals N plus 1; The process of obtaining N fused feature vectors based on the embedding vector via the intermediate layer includes: Each gated network in the intermediate layer generates a set of weights based on a first embedding vector, wherein each set of weights includes N weight values, and the first embedding vector is one of the M embedding vectors; N feature vectors are obtained based on N embedding vectors through N expert networks in the intermediate layer, wherein the N embedding vectors include the embedding vectors other than the first embedding vector among the M embedding vectors; The N feature vectors are weighted and summed based on each set of weights to obtain the N fused feature vectors.
3. The method according to claim 1, characterized in that, The process of obtaining a first predicted value and a second predicted value of the first playback parameter based on a first fusion feature vector via the tower floor, and obtaining a third predicted value of the second playback parameter based on a second fusion feature vector, includes: The first predicted value of the first target is obtained by the first multilayer perceptron among the M multilayer perceptrons in the tower floor based on the first fused feature vector; The second predicted value of the first target is obtained by the second multilayer perceptron among the M multilayer perceptrons based on the first fused feature vector; The third predicted value of the second target is obtained by the third multilayer perceptron among the M multilayer perceptrons based on the second fused feature vector; The step of determining the predicted value of the first playback parameter based on the first predicted value via the output layer, and determining the predicted value of the second playback parameter based on the second predicted value and the third predicted value, includes: The first predicted value is normalized by the first target output network among the N target output networks in the output layer to obtain the predicted value of the first playback parameter; The second predicted value and the third predicted value are normalized by the second target output network among the N target output networks, and the two normalized results are multiplied to obtain the predicted value of the second playback parameter.
4. The method according to claim 1, characterized in that, The number of target videos is at least two; After determining the predicted value of the first playback parameter based on the first predicted value via the output layer, and determining the predicted value of the second playback parameter based on the second predicted value and the third predicted value, the method further includes: For each target video, a recommendation score is calculated based on the first playback parameter and the second playback parameter of the target video; The video information of at least two of the target videos is sorted and sent to the terminal device in descending order of the recommendation score, so that the terminal device displays the video information of each target video in descending order of the recommendation score.
5. A method for training a neural network model, characterized in that, The training method includes: Obtain a sample set for training, wherein the samples in the sample set are video data features of the target video and behavioral data features of users watching the video within a preset time period; The samples in the sample set are used as input features and input to the embedding layer of the neural network model. The embedding layer converts the input features into embedding vectors, where the embedding vectors are representations of the input features. The embedding vector is input into the intermediate layer of the neural network model, and the intermediate layer obtains N fused feature vectors based on the embedding vector, wherein each fused feature vector corresponds to a target of the neural network model; The N fused feature vectors are input into the tower floors of the neural network model. The tower floors obtain a first predicted value and a second predicted value of the first target based on the first fused feature vector, and obtain a third predicted value of the second target based on the second fused feature vector. The first fused feature vector and the second fused feature vector are different fused feature vectors among the N fused feature vectors. The first target is the target corresponding to the first fused feature vector, and the second target is the target corresponding to the second fused feature vector. The first predicted value, the second predicted value, and the third predicted value are input to the output layer of the neural network model. The output layer determines the predicted value of the first target based on the first predicted value, and determines the predicted value of the second target based on the second predicted value and the third predicted value. The model loss is calculated based on the predicted and actual values of the first target and the predicted and actual values of the second target. If the model loss obtained during training is greater than the target threshold, the gradient of the model loss is calculated based on the backpropagation algorithm, and the model parameters of the neural network model are updated based on the gradient until the model loss obtained during training is less than or equal to the target threshold.
6. The training method according to claim 5, characterized in that, When the first objective is the probability of playing a video and the second objective is the video playback completion rate, the loss function for the second objective is the cross-entropy loss function.
7. A device for predicting video playback parameters, characterized in that, The device includes: The input module is used to generate input features based on the video data features of the target video and the behavioral data features of the user watching the video within a preset time period. A conversion module is used to input the input features into the embedding layer of a neural network model, and convert the input features into embedding vectors via the embedding layer, wherein the embedding vectors are representations of the input features; The feature module is used to input the embedding vector into the intermediate layer of the neural network model, and obtain N fused feature vectors based on the embedding vector through the intermediate layer, wherein each fused feature vector corresponds to a playback parameter; The prediction module is used to input the N fused feature vectors into the tower floor of the neural network model, and through the tower floor, obtain a first predicted value and a second predicted value of the first playback parameter based on the first fused feature vector, and obtain a third predicted value of the second playback parameter based on the second fused feature vector. The first fused feature vector and the second fused feature vector are different fused feature vectors among the N fused feature vectors, the first playback parameter is the playback parameter corresponding to the first fused feature vector, and the second playback parameter is the playback parameter corresponding to the second fused feature vector. An output module is used to input the first predicted value, the second predicted value, and the third predicted value to the output layer of the neural network model, and through the output layer, determine the predicted value of the first playback parameter based on the first predicted value, and determine the predicted value of the second playback parameter based on the second predicted value and the third predicted value.
8. The apparatus according to claim 7, characterized in that, The conversion module is specifically used to convert the input features into M embedding vectors through M embedding networks in the embedding layer, wherein the M embedding vectors are representations of the input features from M different dimensions, and M equals N plus 1; The feature module includes: A weighting unit is used to generate a set of weights based on a first embedding vector through each gated network in the intermediate layer, wherein each set of weights includes N weight values and the first embedding vector is one of the M embedding vectors; A feature unit is used to obtain N feature vectors based on N embedding vectors via N expert networks in the intermediate layer, wherein the N embedding vectors include the embedding vectors other than the first embedding vector among the M embedding vectors; The fusion unit is used to perform weighted summation on the N feature vectors based on each set of weights to obtain N fused feature vectors.
9. The apparatus according to claim 7, characterized in that, The prediction module includes: The first prediction unit is used to obtain a first predicted value of the first target based on a first fused feature vector through the first multilayer perceptron among the M multilayer perceptrons in the tower floor. The second prediction unit is used to obtain a second predicted value of the first target based on the first fused feature vector through the second multilayer perceptron among the M multilayer perceptrons; The third prediction unit is used to obtain a third predicted value of the second target based on the second fused feature vector through the third multilayer perceptron among the M multilayer perceptrons; The output module includes: The first output unit is used to normalize the first predicted value through the first target output network among the N target output networks in the output layer to obtain the predicted value of the first playback parameter. The second output unit is used to normalize the second predicted value and the third predicted value through the second target output network of the N target output networks, and multiply the two normalized results to obtain the predicted value of the second playback parameter.
10. The apparatus according to claim 7, characterized in that, The number of target videos is at least two; The device further includes: The first recommendation module is used to calculate a recommendation score for each target video based on the first playback parameters and the second playback parameters of the target video. The second recommendation module is used to sort the video information of at least two target videos in descending order of the recommendation score and send it to the terminal device, so that the terminal device displays the video information of each target video in descending order of the recommendation score.
11. A training device for a neural network model, characterized in that, The training device includes: The sample module is used to acquire a sample set for training, wherein the samples in the sample set are video data features of the target video and behavioral data features of users watching the video within a preset time period. The first training module is used to input the samples in the sample set as input features into the embedding layer of the neural network model, and convert the input features into embedding vectors through the embedding layer, wherein the embedding vectors are representations of the input features; The second training module is used to input the embedding vector into the intermediate layer of the neural network model, and obtain N fused feature vectors based on the embedding vector through the intermediate layer, wherein each fused feature vector corresponds to a target of the neural network model; The third training module is used to input the N fused feature vectors into the tower floors of the neural network model, and through the tower floors, obtain a first predicted value and a second predicted value of the first target based on the first fused feature vector, and obtain a third predicted value of the second target based on the second fused feature vector. The first fused feature vector and the second fused feature vector are different fused feature vectors among the N fused feature vectors, the first target is the target corresponding to the first fused feature vector, and the second target is the target corresponding to the second fused feature vector. The fourth training module is used to input the first predicted value, the second predicted value, and the third predicted value into the output layer of the neural network model, and through the output layer, determine the predicted value of the first target based on the first predicted value, and determine the predicted value of the second target based on the second predicted value and the third predicted value; The loss module is used to calculate the model loss from the predicted and true values of the first target and the predicted and true values of the second target. The update module is used to calculate the gradient of the model loss based on the backpropagation algorithm when the model loss obtained from training is greater than the target threshold, and update the model parameters of the neural network model based on the gradient until the model loss obtained from training is less than or equal to the target threshold.
12. An electronic device, characterized in that, It includes a processor and a memory, the memory storing programs or instructions that can run on the processor, the programs or instructions being executed by the processor to implement the steps of the video playback parameter prediction method as described in any one of claims 1-4 or the neural network model training method as described in any one of claims 5-6.
13. A computer-readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the video playback parameter prediction method as described in any one of claims 1-4 or the neural network model training method as described in any one of claims 5-6.
Citation Information
Patent Citations
Method for training recommendation probability prediction model and recommendation probability prediction method and device
CN113254792A
Video recommendation method and display equipment
CN114117126A