Content popularity prediction model training method, device, medium and program product
By dividing the content popularity data sequence into a support subset and a query subset, and training the prediction module and parameter update learning module, the problem of low content popularity prediction accuracy in existing technologies is solved, and higher prediction accuracy and adaptability are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIHANG UNIV
- Filing Date
- 2023-04-18
- Publication Date
- 2026-07-14
AI Technical Summary
Content popularity prediction based on time series has low accuracy, and existing technologies are difficult to apply to the entire time series, resulting in poor prediction performance.
By dividing the content popularity data sequence into a support subset and a query subset, the initial model is trained using a prediction module and a parameter update learning module to obtain a prediction model that is more suitable for the content popularity data sequence. The parameters of the prediction module are then updated to improve the prediction accuracy.
It improves the prediction accuracy of the content popularity prediction model on query subsets, adapts to changes in content popularity data sequences, and avoids the problem of insufficient model applicability in existing technologies.
Smart Images

Figure CN116432033B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, device, medium and program product for training a content popularity prediction model. Background Technology
[0002] In the era of social media, every user can become a content publisher, resulting in a wealth of content online. However, only a small portion of content becomes popular. Therefore, various types of content compete for user attention to achieve widespread popularity. Content popularity can be used to describe the relationship between content and user actions, serving as an indicator of content popularity. Predicting changes in content popularity can provide a basis for content recommendation, advertising, and other strategies.
[0003] Content popularity is based on time-varying changes, but currently the prediction accuracy of time-series-based content popularity is low. Summary of the Invention
[0004] This application provides a method, device, medium, and program product for training a content popularity prediction model, in order to solve the problem of low accuracy in time series-based content popularity prediction.
[0005] Firstly, this application provides a method for training a content popularity prediction model, including:
[0006] Obtain content popularity data sequences at n time points;
[0007] Based on the content popularity data sequence at the n time points, n task sets are generated; each task set includes: a support subset and a query subset;
[0008] The initial model is trained using m first task sets from n task sets for model training to obtain m candidate prediction models. The initial model includes a prediction module and a parameter update learning module. The parameter update learning module is used to update the parameters of the prediction module. The prediction module is used to obtain the prediction result based on the content popularity data sequence at time t. The prediction result is used to characterize the difference between the predicted content popularity data at time t+1 and the content popularity data at time t.
[0009] The target prediction model is determined from m candidate prediction models using q second task sets from n task sets, where the sum of m and q is less than or equal to n.
[0010] Optionally, the step of training the initial model using m first task sets from n task sets for model training to obtain m candidate prediction models includes:
[0011] For any first task set, the prediction module of the initial model is trained using the support subset of the first task set and the parameter update learning module of the initial model to obtain a trained prediction module.
[0012] Using the query subset of the first task set and the trained prediction module, the parameter update learning module of the initial model is trained to obtain the trained parameter update learning module.
[0013] The trained prediction module and parameter update learning module constitute the candidate prediction model corresponding to the first task set.
[0014] Optionally, training the prediction module of the initial model using the support subset of the first task set and the parameter update learning module of the initial model includes:
[0015] For the i-th training iteration, the parameter update learning module of the initial model is used to obtain the parameters used by the prediction module in the i-th training iteration based on the evaluation result of the prediction module of the initial model in the (i-1)-th training iteration, and the prediction module is updated using the parameters used in the i-th training iteration; the evaluation result includes: loss function value and / or gradient value, where i is greater than or equal to 2.
[0016] Using the updated prediction model, obtain the prediction result corresponding to the i-th support subset training data, and the evaluation result of the i-th training iteration of the prediction model;
[0017] Optionally, training the parameter update learning module of the initial model using the query subset of the first task set and the trained prediction module includes:
[0018] For the j-th training iteration, the parameters used by the parameter update learning module in the j-th training iteration are obtained using the evaluation results of the (j-1)-th training iteration of the trained prediction module, and the parameter update learning module is updated using the parameters used in the j-th training iteration, where j is greater than or equal to 2.
[0019] Optionally, determining the target prediction model from m candidate prediction models using q second task sets from n task sets includes:
[0020] Using q second task sets, the parameters of m candidate prediction models are tuned to obtain m candidate prediction models after parameter tuning.
[0021] The initial target prediction model is determined from the m candidate prediction models after parameter tuning.
[0022] Optionally, obtaining the content popularity data sequence at n time points includes:
[0023] Obtain content popularity data sequences for a target duration;
[0024] The content popularity data sequence for the target duration is split to obtain a content popularity data sequence for n time periods.
[0025] Secondly, this application provides a method for predicting content popularity, including:
[0026] Obtain the content popularity data sequence at time t;
[0027] Based on the content popularity data sequence at time t, a task set is generated, which includes a support subset and a query subset.
[0028] The prediction module of the target prediction model is trained using the parameter update learning module of the support subset and the target prediction model to obtain a trained prediction module. The target prediction model is trained using the method described in any of the first aspects.
[0029] Using a subset of queries and a trained prediction module, prediction results are obtained. These prediction results are used to characterize the difference between the predicted content popularity data at time t+1 and the content popularity data at time t.
[0030] Thirdly, this application provides a training device for a content popularity prediction model, comprising:
[0031] The acquisition module is used to acquire content popularity data sequences at n time points;
[0032] The generation module is used to generate n task sets based on the content popularity data sequence at the n time points; each task set includes a support subset and a query subset;
[0033] The training module is used to train the initial model using m first task sets from n task sets for model training, to obtain m candidate prediction models. The initial model includes a prediction module and a parameter update learning module. The parameter update learning module is used to update the parameters of the prediction module. The prediction module is used to obtain the prediction result based on the content popularity data sequence at time t. The prediction result is used to characterize the difference between the predicted content popularity data at time t+1 and the content popularity data at time t.
[0034] The determination module is used to determine the target prediction model from m candidate prediction models using q second task sets from n task sets, where the sum of m and q is less than or equal to n.
[0035] Fourthly, this application provides a content popularity prediction device, comprising:
[0036] The acquisition module is used to acquire the content popularity data sequence at time t;
[0037] The generation module is used to generate a task set based on the content popularity data sequence at time t. The task set includes a support subset and a query subset.
[0038] The training module is used to train the prediction module of the target prediction model using the parameter update learning module of the support subset and the target prediction model to obtain a trained prediction module, wherein the target prediction model is trained by the method described in any of the first aspects.
[0039] The prediction module is used to obtain prediction results using a subset of queries and a trained prediction module. The prediction results are used to characterize the difference between the predicted content popularity data at time t+1 and the content popularity data at time t.
[0040] Fifthly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0041] The memory stores computer-executed instructions;
[0042] The processor executes computer execution instructions stored in the memory to implement the method as described in any one of the first aspects, or the method as described in any one of the second aspects.
[0043] In a sixth aspect, this application provides a computer-readable storage medium, comprising: computer-executable instructions stored therein, which, when executed by a processor, are used to implement the method as described in any one of the first aspects, or the method as described in any one of the second aspects.
[0044] In a seventh aspect, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method as described in any one of the first aspects, or the method as described in any one of the second aspects.
[0045] Eighthly, this application provides a chip having a computer program stored thereon, which, when executed by the chip, implements the method as described in any one of the first aspects, or the method as described in any one of the second aspects.
[0046] The content popularity prediction model training method, device, medium, and program products provided in this application generate n task sets, including support subsets and query subsets, based on content popularity data sequences at n time points. Furthermore, an initial model, including a prediction module and a parameter update learning module, is trained using m of the first task sets. This allows the parameter update learning module to learn the changing patterns of the parameters used by the prediction module, thereby obtaining a prediction module more suitable for the content popularity data sequence. This improves the prediction accuracy when applied to the query subset, thus enhancing the prediction accuracy of the prediction model. Attached Figure Description
[0047] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0048] Figure 1 A flowchart illustrating a content popularity prediction model training method provided in an embodiment of this application;
[0049] Figure 2 This is a schematic diagram of the structure of an initial model provided in an embodiment of this application;
[0050] Figure 3 A flowchart illustrating another content popularity prediction model training method provided in this application embodiment;
[0051] Figure 4 A schematic diagram of the structure of another content popularity prediction model training method provided in an embodiment of this application;
[0052] Figure 5 A flowchart illustrating another content popularity prediction model training method provided in this application embodiment;
[0053] Figure 6 A schematic diagram of the structure of another content popularity prediction model training method provided in an embodiment of this application;
[0054] Figure 7 This is a schematic diagram of the structure of a parameter update learning module provided in an embodiment of this application;
[0055] Figure 8 This is a schematic diagram of the structure of a prediction module provided in an embodiment of this application;
[0056] Figure 9 A flowchart illustrating a content popularity prediction method provided in an embodiment of this application;
[0057] Figure 10 This is a schematic diagram of the structure of a content popularity prediction model training device provided in an embodiment of this application;
[0058] Figure 11 A schematic diagram of the structure of a content popularity prediction device provided in an embodiment of this application;
[0059] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0060] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0061] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0062] First, let me explain the terms used in this application:
[0063] Content popularity: This describes the relationship between content and user actions, and can be measured by various metrics, such as page views and play counts. The content referred to here can be online content such as videos and articles.
[0064] Time series: A set of observations of a variable measured at consecutive points in time or over a consecutive period. For example, the set of content popularity of a video at consecutive points in time or over a consecutive period.
[0065] Non-stationarity of time series: As time changes, the statistical properties of the observed values, such as the mean and variance, change.
[0066] The internet is flooded with a vast amount of diverse content, but only a small fraction becomes popular, attracting significant user attention. Therefore, every piece of content must compete for user attention to become popular. Content popularity can be used to evaluate its popularity, and predicting changes in content popularity can provide accurate data support for content recommendation and advertising.
[0067] Currently, there are two main methods for predicting the popularity of content based on time:
[0068] (1) Time-based content popularity sequences are predicted using deep learning network models, such as using convolutional neural networks (CNNs) to predict time-based content popularity sequences.
[0069] However, time-based content popularity sequences change continuously over time, exhibiting non-stationarity. For example, the training and test sets belong to different time periods, and the data distributions at these different times differ significantly. This non-stationarity leads to poor performance of models trained on the training set on the test set. In other words, models based on the training set cannot be applied to the entire time series, resulting in low accuracy in content popularity predictions when the entire time-based content popularity sequence is used as input to the prediction model.
[0070] (2) First, the time-based content popularity sequence is stabilized, such as mean normalization, difference processing, etc., and then the model is used for prediction, such as the Auto-Regressive Moving Average Model (ARMA model) and the Autoregressive Integrated Moving Average Model (ARIMA model).
[0071] While this approach addresses the differences in data distribution, it causes the data itself to lose some personalized information, resulting in lower prediction accuracy of the trained model.
[0072] In summary, the accuracy of content popularity prediction based on time series data is relatively low.
[0073] In view of this, this application proposes a training method for a content popularity prediction model. The prediction model is divided into a prediction module and a parameter update learning module. The parameter update learning module updates the parameters of the prediction module, training a prediction model suitable for the content popularity data sequence. This method updates the parameters of the prediction module based on the content popularity data sequence, making it more applicable to the current time-based content popularity data sequence. This avoids the problem in existing technologies where models obtained based on training sets cannot be applied to the entire time series, thus improving the prediction accuracy of the prediction model.
[0074] The execution subject of this method can be an electronic device such as a computer with processing capabilities, or a model training platform. The platform can be a cloud-based platform or a distributed platform (e.g., partially deployed in a cloud environment and partially deployed in an edge environment).
[0075] This application also proposes a content popularity prediction method, which divides the content popularity data sequence into a support subset and a query subset. Based on the support subset, the prediction module of the content popularity prediction model obtained by the content popularity prediction model training method is trained to obtain a prediction module that is more suitable for the content popularity data sequence. This module is then applied to the query subset to obtain the predicted data of content popularity, thereby improving the prediction accuracy of content popularity.
[0076] The subject executing this method can be an electronic device such as a computer with processing capabilities.
[0077] The following describes the content popularity prediction model training method proposed in this application in detail, taking electronic devices as the execution subject as an example, with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0078] Figure 1 This is a flowchart illustrating a content popularity prediction model training method provided in an embodiment of this application. Figure 1 As shown, the method includes:
[0079] S101. Obtain the content popularity data sequence at n time points.
[0080] The aforementioned content popularity data can be derived from a single metric such as the number of views or page views of a piece of content. For example, the number of views of a video or the number of page views of an article can be directly used as the content popularity data for that video or article. Alternatively, it can be data after processing the single metric, such as using the proportion of a video's views to the total number of video views within a certain time period as the video's content popularity data. Or, it can be a combination of multiple metrics for a piece of content, such as combining a video's views and likes as the video's content popularity data. This combination can be averaging, summing, etc., and this application does not limit the scope of the data.
[0081] It should be noted that this application does not limit the calculation method of content popularity data.
[0082] The aforementioned content popularity data can be obtained from the front-end interface of the corresponding online platform, the back-end database of the corresponding online platform, or from an external device that stores content popularity data, such as a USB flash drive.
[0083] The aforementioned content popularity data sequence at n time points includes n time points and content popularity data at a preset time interval preceding each of the n time points. This fixed time interval can be seconds, minutes, hours, etc., and is not limited herein. It should be noted that the preset time length of this content popularity data sequence is, for example, 1 hour. For example, the content popularity data sequence at time t can be {X... t-H+1 , ..., X t-1 X t}, where X t This represents the content popularity data at time t, with a preset time length of H, and the time interval between each data point is consistent.
[0084] The content popularity data sequence at the above n time points is described with n=2 and a preset time length of H.
[0085] One possible implementation is that the data in the n-time-time content popularity data sequence overlaps in time. For example, the content popularity data sequence {X} at time t1... t1-H+1 , ..., X t1-1 X t1}, the content popularity data sequence {X} at time t2 t1-H+2 , ..., X t1 X t2}
[0086] Another possible implementation is that the data in the n-time-time content popularity data sequence do not overlap. For example, the content popularity data sequence {X} at time t1... t1-H+1 , ..., X t1-1 X t1}, the content popularity data sequence {X} at time t2 t2-H+1 , ..., X t2-1 X t2}
[0087] Regarding the acquisition method of the content popularity data sequence at the aforementioned n time points, one possible implementation is to use a time sliding window to acquire content popularity data at fixed time intervals until a preset time window length is acquired. Then, all content popularity data acquired in that time window is considered as a content popularity data sequence for that moment. This process is repeated until a content popularity data sequence at n time points is acquired. For example, if the preset time window length is 1 hour, content popularity data for the current moment is acquired every 30 minutes until 1 hour's worth of data (3 data points) is acquired. These 3 data points acquired in that time window are then considered as a content popularity data sequence for that moment.
[0088] Another possible implementation is to first obtain a content popularity data sequence for the target duration, and then split this content popularity data sequence for the target duration into n time-period content popularity data sequences. For example, first obtain a 2-hour content popularity data sequence, and then split the content popularity data sequence at 1-hour time intervals to obtain 2 time-period content popularity data sequences.
[0089] The acquired content popularity data sequence for the target duration is a relatively long time series and exhibits non-stationarity. Therefore, it will be split into n relatively short sequences. These n relatively short sequences, due to their shorter duration, can be considered relatively stationary time series. In subsequent applications, a more accurate prediction model can be obtained based on each relatively stationary short sequence.
[0090] S102. Based on the content popularity data sequence at the above n time points, generate n task sets.
[0091] The task set described above can be used to train and / or test the initial model to obtain the content popularity prediction model described above. Each task set includes a support subset and a query subset.
[0092] The aforementioned support subset can be used to train the initial model; the aforementioned query subset can be used to test the trained model and update the model's parameters.
[0093] Optionally, the content popularity data sequence at the above n time points can be used as the above n task sets.
[0094] For each task set, regarding how to obtain the support subset and query subset, optionally, the task set can be divided into a support subset and a query subset according to a preset ratio in chronological order. For example, the data quantity ratio of the support subset to the query subset is 8:2. It should be noted that the above is merely an illustration of one ratio provided in this application embodiment, and is not intended to limit the specific implementation.
[0095] Taking a task set containing 10 content popularity data points as an example, specifically, the first four data points are used as the first supporting subset {X1, X2, X3, X4}, and the difference between data X4 and data X5 is used as the label of the first supporting subset; the second supporting subset is {X2, X3, X4, X5}, and the difference between data X5 and data X6 is used as the label of the second supporting subset, and so on, until the fifth supporting subset {X5, X6, X7, X8} is obtained, along with its label. These first to fifth supporting subsets together constitute the aforementioned supporting subsets.
[0096] The above query subset includes a first query subset {X6, X7, X8, X9}, which is labeled with data X9 and data X. 10The difference, and the second query subset {X7, X8, X9, X... 10 The label for this second query subset is data X. 10 With data X 11 The difference.
[0097] S103. Use m first task sets from n task sets for model training to train the initial model and obtain m candidate prediction models.
[0098] Optionally, the above n task sets can be divided into a first task set and a second task set according to a certain ratio. For example, a total of m first task sets can be divided, which are used to train the initial model.
[0099] Figure 2 This is a schematic diagram of the structure of an initial model provided in an embodiment of this application. Figure 2 As shown, the initial model includes a prediction module and a parameter update learning module.
[0100] The parameter update learning module is used to update the parameters of the prediction module. It can be a deep learning network model, such as a recurrent neural network (RNN) model, a long short-term memory (LSTM) neural network model, or other models that can update the parameters of the prediction module. This application does not limit the specific model.
[0101] The aforementioned prediction module is used to obtain prediction results based on the content popularity data sequence at time t. It can be a deep learning network model, such as a Convolutional Neural Network (CNN), or other models capable of predicting data; this application does not impose any limitations on this. The prediction result is used to characterize the difference between the predicted content popularity data at time t+1 and the content popularity data at time t.
[0102] For any first task set, one possible implementation is to use all supporting subsets of the first task set and the parameter update learning module of the initial model to train the prediction module of the initial model, thereby obtaining a trained prediction module; and use the query subset of the first task set and the trained prediction module to train the parameter update learning module of the initial model, thereby obtaining a trained parameter update learning module; wherein, the trained prediction module and the parameter update learning module constitute the candidate prediction model corresponding to the first task set.
[0103] For example, the parameters of the parameter update learning module are updated using all supporting subsets of the first task set and the parameters of the initial model, and the prediction module is trained to obtain the parameters used by the prediction module, i.e., the trained prediction module; then, the parameters used by the prediction module and the query subset of the first task set are used to train the parameters of the parameter update learning module to obtain the parameters used by the parameter update learning module, i.e., the trained parameter update learning module, and thus the candidate prediction model corresponding to the first task set is obtained.
[0104] Another possible implementation involves using a subset of the support set of the first task set and the parameter update learning module of the initial model to train the prediction module of the initial model. When the evaluation parameter of the prediction module reaches a preset threshold, training is stopped, and the prediction module obtained from this training is taken as the trained prediction module. Using a subset of the query set of the first task set and the trained prediction module, the parameter update learning module of the initial model is trained to obtain the trained parameter update learning module. Here, the evaluation parameter can be, for example, a loss function value. The trained prediction module and the parameter update learning module constitute the candidate prediction model corresponding to the first task set.
[0105] For example, when the evaluation parameters of the prediction module trained using the aforementioned third support subset are lower than a preset threshold, the prediction module trained in this training is taken as the trained prediction module, and then the trained parameter update learning module is obtained by using the query subset and the trained prediction module.
[0106] By updating the learning module using the aforementioned parameters, the parameters of the prediction module can be updated for each support subset of the first task set, resulting in a prediction module more suitable for that first task set, i.e., more suitable for that content popularity data sequence. Since the support subset and the query subset belong to the same first task set, the prediction module updated based on the support subset of the first task set exhibits higher generalization performance on the query subset of that first task set, meaning higher prediction accuracy for the content popularity data.
[0107] Using the method described above, the initial model is trained on each of the m first task sets to obtain m candidate prediction models.
[0108] S104. Use q second task sets from n task sets to determine the target prediction model from m candidate prediction models.
[0109] As mentioned above, optionally, the above n task sets can be divided into m first task sets and q second task sets, where the sum of m and q is less than or equal to n.
[0110] The second task set mentioned above is used to adjust the parameters of the candidate prediction models and / or determine the target prediction model. These parameters can be the number of network nodes, the learning rate, etc.
[0111] The aforementioned candidate prediction models refer to the prediction models trained based on each first task set.
[0112] The aforementioned determination of the target prediction model refers to determining the target prediction model based on the evaluation parameters obtained from training each candidate prediction model on the data of the second task set. These evaluation parameters can be loss function values, such as Mean Absolute Error (MAE) or Root Mean Squared Error (RMSE). Taking MAE as an example, the method for determining the target prediction model will be explained.
[0113] One possible implementation is to apply each of the above candidate prediction models to the second task set and obtain the MAE value of each candidate prediction model. The candidate prediction model with the smallest MAE value can be used as the target prediction model, or p (p>1) candidate prediction models with MAE values lower than a preset threshold can be obtained, and then other evaluation parameters can be used to determine the final target prediction model for the p candidate prediction models. For example, the model with the lowest RMSE value among the p candidate prediction models can be used as the final target prediction model.
[0114] Another possible implementation involves first using q second task sets to tune the parameters of m candidate prediction models, resulting in m tuned candidate prediction models; then determining the target prediction model from these m tuned candidate models. The method for determining the target prediction model from the m tuned candidate models can be found in the aforementioned possible implementation method and will not be elaborated upon here.
[0115] The content popularity prediction model training method provided in this application generates n task sets including support subsets and query subsets based on the content popularity data sequence at n time points. Furthermore, the initial model including a prediction module and a parameter update learning module is trained using m of the first task sets. This allows the parameter update learning module to learn the changing patterns of the parameters used by the prediction module, thereby obtaining a prediction module that is more suitable for the content popularity data sequence and improving the prediction accuracy when applied to the query subset.
[0116] The following example uses the support subsets of the first task set, including the first support subset {X1, X2, X3, X4}, the second support subset {X2, X3, X4, X5}, and the third support subset {X3, X4, X5, X6}, to illustrate how to use any support subset of the first task set and the parameters of the initial model to update the learning module and train the prediction module of the initial model in one training iteration.
[0117] Figure 3 This is a flowchart illustrating another content popularity prediction model training method provided in an embodiment of this application. Figure 3 As shown, for the i-th training iteration, the method includes:
[0118] S201. Update the learning module using the parameters of the initial model. Based on the evaluation results of the (i-1)th training iteration of the prediction module of the initial model, obtain the parameters used by the prediction module in the i-th training iteration, and update the prediction module using the parameters used in the i-th training iteration.
[0119] The i mentioned above is greater than or equal to 2. It should be noted that if the i mentioned above is less than 2, that is, in the first training iteration, the prediction module is trained based on the parameters used by the initial prediction module. The above initialization can be random initialization, for example, random initialization between 0 and 1, or it can be a fixed initialization value, which is not limited in this application.
[0120] The evaluation results include loss function values and / or gradient values. The loss function values describe the difference between the predicted values output by the prediction module and the true values. The gradient values represent the trend of the loss function. These evaluation results are obtained by the prediction module based on a preset function describing the relationship between the predicted and true values, and on the labels corresponding to the predicted values output by the prediction module and the input support subset.
[0121] The parameters used by the prediction module in the training iterations are updated by the parameter update learning module. The parameter update learning module can predict the parameters used by the prediction module in the i-th training iteration based on the evaluation result of the (i-1)th training iteration obtained by the prediction module and the parameters used by the prediction module in the (i-1)th training iteration.
[0122] For example, in the second training iteration, the prediction module is trained using data from the second support subset. The parameters used by the prediction module in this training are obtained by the parameter update learning module based on the evaluation results of the prediction module in the first training iteration, and the prediction module is updated using these parameters.
[0123] S202. Using the updated prediction module, obtain the prediction result corresponding to the i-th support subset training data, and the evaluation result of the i-th training iteration of the prediction module.
[0124] The updated prediction module uses the same parameters as those used in the i-th training iteration. Based on the training data of the i-th support subset, the updated prediction module obtains the prediction result corresponding to the training data of the i-th support subset. This prediction result is the difference between the last data point in the i-th support subset and the data at the next time interval corresponding to that data point.
[0125] Based on the above prediction results and the labels corresponding to the training data of the i-th supporting subset, the evaluation result of the i-th training iteration of the prediction module is obtained.
[0126] For example, using the updated prediction module, the prediction results corresponding to the training data in the second support subset are obtained, namely, the predicted value of the difference between X5 and X6. Based on the predicted value and the labels of the second support subset, the evaluation result of the second training iteration of the prediction module is obtained.
[0127] The following detailed explanation will be based on the example of the first support subset of the first task set, which includes the first support subset {X1, X2, X3, X4}, the second support subset {X2, X3, X4, X5}, and the third support subset {X3, X4, X5, X6}, and will be conducted after three training iterations.
[0128] Figure 4 This is a schematic diagram illustrating the structure of another content popularity prediction model training method provided in an embodiment of this application. It should be noted that... Figure 4 Therefore, the above evaluation results include the loss function value (L) and the gradient value. To illustrate.
[0129] The first set of data acquired is the first support subset {X1, X2, X3, X4}. For the first training iteration:
[0130] (1) Based on the parameters θ1 used by the initial prediction module, the above prediction module performs the first training iteration using the data obtained in the first iteration, and obtains the evaluation result L1 of the first training iteration of the prediction module. Figure 4 The diagram illustrates θ1 initialized with the parameters of the aforementioned prediction module.
[0131] (2) The above parameter update learning module is based on the parameters θ1 used by the prediction module, and the evaluation results L1 of the first training iteration of the prediction module. Obtain the parameter θ2 used by the prediction module in the second training iteration, and update the prediction module using the parameter θ2 used in the second training iteration.
[0132] It should be noted that the parameters used by the parameter update learning module mentioned above can be randomly initialized parameters; or they can be the parameters of the parameter update learning module obtained from the previous first task set training. Figure 4 The example illustrates how the parameters of the learning module are updated using the parameters mentioned above, with ψ0 as the initial value.
[0133] The second set of data obtained is the second support subset {X2, X3, X4, X5}. For the second training iteration:
[0134] (1) Based on the parameters θ2 used by the prediction module in the second training iteration, the prediction module performs a second training iteration using the data acquired in the second iteration, and obtains the evaluation result L2 of the prediction module in the second training iteration.
[0135] (2) The above parameter update learning module uses the parameter θ2 adopted by the prediction module of the initial model in the second training iteration, and the evaluation result L2 of the prediction module in the second training iteration. Obtain the parameter θ3 used by the prediction module in the third training iteration, and update the prediction module using the parameter θ3 used in the third training iteration.
[0136] The data obtained in the third iteration is the third support subset {X3, X4, X5, X6}. For the third training iteration:
[0137] (1) Based on the parameters θ3 used by the prediction module in the third training iteration, the prediction module performs the third training iteration using the data acquired in the third iteration, and obtains the evaluation result L3 of the prediction module in the third training iteration.
[0138] (2) The above parameter update learning module uses the parameter θ3 adopted by the prediction module in the third training iteration, and the evaluation result L3 of the prediction module in the third training iteration. Obtain the parameter θ4 used by the prediction module on the query subset corresponding to the support subset, and use the parameter θ4 to update the prediction module to obtain the trained prediction module.
[0139] The content popularity prediction model training method provided in this application, for each first task set, the parameter update module of the initial model uses the training data in the support subset of the first task set to update the parameters of the prediction module, so as to obtain the parameters of the prediction module that are more suitable for the query subset corresponding to the support subset. That is, a well-trained prediction module that is more suitable for the content popularity data sequence is obtained, so that the prediction module has higher prediction accuracy on the query subset.
[0140] The following example uses the query subsets mentioned above, including the first query subset {X4, X5, X6, X7} and the second query subset {X5, X6, X7, X8}, to illustrate how to use the query subsets of the first task set and the trained prediction module to train one of the training iterations of the parameter update learning module of the initial model.
[0141] Figure 5 This is a flowchart illustrating another content popularity prediction model training method provided in an embodiment of this application. Figure 5 As shown, for the j-th training iteration, the method includes:
[0142] S301. Using the evaluation results of the (j-1)th training iteration of the trained prediction module, obtain the parameters used by the parameter update learning module in the jth training iteration.
[0143] The above j is greater than or equal to 2. It should be noted that if the above j is less than 2, that is, during the first training iteration, the parameters used by the parameter update learning module are the initialized parameters. The above initialization can be random initialization, for example, random initialization between 0 and 1, or it can be a fixed initialization value; this application does not impose any limitations on this.
[0144] On the query subset, for the j-th training iteration, the parameter update learning module can obtain the parameter ψ′ of the parameter update learning module by using the backpropagation mechanism based on the evaluation result of the (j-1)-th training iteration of the trained prediction module and the parameters used in the (j-1)-th training iteration of the prediction module. The parameter ψ′ is the parameter used by the parameter update learning module in the j-th training iteration.
[0145] It should be noted that the above training iteration process is based on forward propagation of the parameters of the learning module updated from the initial parameters. That is, the parameters used by the prediction module in the i-th training iteration are obtained using the evaluation result of the prediction module in the (i-1)th training iteration. The parameters used by the prediction module in the i-th training iteration are obtained based on the evaluation result and the parameters of the learning module updated from the initial parameters. Intermediate computation results in this process can be retained. Therefore, based on the evaluation result of the trained prediction module in the (j-1)th training iteration and the parameters used by the prediction module in the (j-1)th training iteration, the parameters of the learning module can be updated using backpropagation.
[0146] S302. Update the parameter update learning module using the parameters adopted by the parameter update learning module in the j-th training iteration.
[0147] That is, in the j-th training iteration, the parameters used by the parameter update learning module are the same parameters used by the parameter update learning module in the j-th training iteration.
[0148] The following detailed explanation will be based on the example of the query subsets of the first task set mentioned above, including the first query subset {X4, X5, X6, X7} and the second query subset {X5, X6, X7, X8}, and the two training iterations.
[0149] Figure 6 This is a schematic diagram illustrating the structure of another content popularity prediction model training method provided in an embodiment of this application. It should be noted that... Figure 6 Therefore, the above evaluation results include the loss function value (L) and the gradient value. To illustrate.
[0150] The data obtained in the first iteration is the first query subset {X4, X5, X6, X7}. Referring to the previous embodiment, the parameter used by the trained prediction module is θ4. For the first training iteration:
[0151] (1) The trained prediction module uses parameter θ4 and obtains the evaluation result L1 of the first training iteration of the prediction module using the data acquired in the first iteration.
[0152] (2) The above parameter update learning module is based on the parameter θ4 used by the prediction module, and the evaluation result L1 of the first training iteration of the prediction module. Using the backpropagation mechanism, the parameters ψ′1 of the parameter update learning module in the second training iteration are obtained, and the parameters used in the second training iteration of the parameter update learning module are used to update the above parameter update learning module.
[0153] The data obtained in the second iteration is the second query subset {X5, X6, X7, X8}. For the second training iteration:
[0154] (1) The trained prediction module uses parameter θ4, and the evaluation result L2 of the second training iteration of the prediction module is obtained using the data obtained in the second iteration.
[0155] (2) The above parameter update learning module is based on the parameter θ4 used by the prediction module, and the evaluation result L2 of the second training iteration of the prediction module. Using the backpropagation mechanism, the parameters ψ′2 of the parameter update learning module are obtained, and the parameter update learning module is updated using the parameters ψ′2 adopted by the parameter update learning module to obtain the trained parameter update learning module.
[0156] It should be noted that the above training iterations are performed for each first task set. The parameters of the parameter update learning module for different first task sets can be updated serially, that is, the parameters of the parameter update learning module trained on the a-th first task set are used as the initial parameters of the parameter update learning module for the (a+1)-th first task set; or they can be updated in parallel, that is, the parameters of the parameter update learning module for each first task set are trained and iterated based on the initial parameters, and there is no relationship between them.
[0157] For example, using the method described in the above embodiments, a candidate prediction model is finally obtained, wherein the parameter update learning module of the candidate prediction model uses ψ′2 as the parameter; the parameters of the prediction module of the candidate prediction model need to be determined by the parameter update learning module based on the content popularity data sequence input to the candidate prediction model. The parameters used by the prediction module can initially be the initialized parameters, or the parameters θ4 determined by the training described above.
[0158] The content popularity prediction model training method provided in this application utilizes the prediction module trained on the support subset of the first task set, and updates the parameters of the parameter update learning module on the query subset of the first task set. This allows the parameter update learning module to learn the parameter update rules of the prediction module, and then the parameter update learning module can update the parameters of the prediction module based on the evaluation results of the prediction module on the support subset, thereby improving the prediction accuracy of the prediction module when applied to the query subset.
[0159] Taking the above parameter update learning module as an LSTM neural network model as an example, the architecture of the above parameter update learning module will be explained.
[0160] Figure 7This is a schematic diagram of the structure of a parameter update learning module provided in an embodiment of this application. Figure 7 As shown, the parameter update learning module mentioned above includes a two-layer LSTM neural network.
[0161] The first LSTM layer described above is used to extract features from the data input to the parameter update learning module. The data input to this module consists of the parameters used by the prediction module in the (i-1)th training iteration, and the evaluation result of the prediction module in the (i-1)th training iteration. The feature extraction process extracts features from the data input to the parameter update learning module, such as dependencies and contextual information, and encodes the extracted features.
[0162] The second LSTM layer mentioned above is used to update the parameters of the prediction module based on the data after feature extraction.
[0163] Taking the CNN model as an example, the architecture of the prediction module will be explained.
[0164] Figure 8 This is a schematic diagram of the structure of a prediction module provided in an embodiment of this application. Figure 8 As shown, the prediction module includes two convolutional layers, two pooling layers, one fully connected layer, and one output layer.
[0165] The following describes in detail, using electronic devices as the executing entity, a content popularity prediction method proposed in this application, with specific embodiments.
[0166] Figure 9 This is a flowchart illustrating a content popularity prediction method provided in an embodiment of this application. Figure 9 As shown, the method includes:
[0167] S501. Obtain the content popularity data sequence at time t.
[0168] For example, a time sliding window of length H can be used to obtain the content popularity data at time t, where the latest time is t. This content popularity data sequence could be, for example, {x} t-H+1 x t-H+2 , ..., x t}
[0169] S502. Generate a task set based on the content popularity data sequence at time t.
[0170] The aforementioned task set includes a support subset and a query subset. For example, the support subset may include {x} t-H+1 x t-H+2 , ..., x t-2} and {x t-H+2 xt-H+3 , ..., x t-1 The above query subset can be {x} t-H+3 , ..., x t-1 x t}
[0171] S503. Using the above-mentioned support subset and the parameter update learning module of the target prediction model, the prediction module of the above-mentioned target prediction model is trained to obtain the trained prediction module.
[0172] The target prediction model described above was trained using the method described in the foregoing embodiments.
[0173] S504. Use the query subset and the trained prediction module to obtain the prediction results.
[0174] The above prediction results are used to characterize the difference between the predicted content popularity data at time t+1 and the content popularity data at time t.
[0175] Table 1 compares the prediction errors of the target prediction model provided in this application with those of prediction models in the prior art. It should be noted that the prediction results in Table 1 are illustrated using MAE and RMSE.
[0176] Table 1
[0177]
[0178]
[0179] As shown in Table 1, both types of errors in content popularity prediction using the target prediction model of this application are low, indicating that the prediction accuracy of the target prediction model is high. Therefore, it can be concluded that the training method of the content popularity prediction model provided in this application can improve the prediction accuracy of the prediction model.
[0180] The content popularity prediction method provided in this application utilizes the parameter update learning module of the target prediction model to first obtain a trained prediction module based on the data of the support subset, and then uses the trained prediction module to make predictions based on the data of the query subset to obtain predicted data. By using the support subset to obtain the parameters of the prediction module that are more suitable for the content popularity data sequence, the prediction module can be applied to the query subset to obtain more accurate prediction data.
[0181] Figure 10 This is a schematic diagram of a content popularity prediction model training device provided in an embodiment of this application. Figure 10 As shown, the device includes: an acquisition module 11, a generation module 12, a training module 13, and a determination module 14.
[0182] Module 11 is used to acquire content popularity data sequences at n time points;
[0183] The generation module 12 is used to generate n task sets based on the content popularity data sequence at the n time points; each task set includes a support subset and a query subset;
[0184] Training module 13 is used to train the initial model using m first task sets from n task sets for model training, to obtain m candidate prediction models; the initial model includes: a prediction module and a parameter update learning module, the parameter update learning module is used to update the parameters of the prediction module, the prediction module is used to obtain the prediction result based on the content popularity data sequence at time t, and the prediction result is used to characterize the difference between the predicted content popularity data at time t+1 and the content popularity data at time t;
[0185] Module 14 is used to determine the target prediction model from m candidate prediction models using q second task sets from n task sets, where the sum of m and q is less than or equal to n.
[0186] One possible implementation is that the training module 13 is specifically used to train the prediction module of the initial model using the support subset of the first task set and the parameter update learning module of the initial model for any first task set, to obtain a trained prediction module; and to train the parameter update learning module of the initial model using the query subset of the first task set and the trained prediction module, to obtain a trained parameter update learning module; wherein the trained prediction module and the parameter update learning module constitute the candidate prediction model corresponding to the first task set.
[0187] In this implementation, the training module 13 is used to update the prediction module in the i-th training iteration by using the parameters of the initial model. Based on the evaluation result of the prediction module in the (i-1)-th training iteration of the initial model, the learning module obtains the parameters used by the prediction module in the i-th training iteration and updates the prediction module using the parameters used in the i-th training iteration. The evaluation result includes: loss function value and / or gradient value, where i is greater than or equal to 2. Using the updated prediction module, the prediction result corresponding to the i-th support subset training data is obtained, as well as the evaluation result of the prediction module in the i-th training iteration.
[0188] The training module 13 described above is used to obtain the parameters used by the parameter update learning module in the j-th training iteration by using the evaluation result of the (j-1)-th training iteration of the trained prediction module, and to update the parameter update learning module using the parameters used in the j-th training iteration, wherein j is greater than or equal to 2.
[0189] One possible implementation is that the aforementioned determining module 14 is specifically used to determine the target prediction model from m candidate prediction models using q second task sets in n task sets, including: using q second task sets to tune the parameters of the m candidate prediction models to obtain the tuned m candidate prediction models; and determining the initial target prediction model from the tuned m candidate prediction models.
[0190] One possible implementation is that the acquisition module 11 is specifically used to acquire a content popularity data sequence for a target duration; and to split the content popularity data sequence for the target duration to obtain a content popularity data sequence for n time periods.
[0191] The content popularity prediction model training device provided in this application can execute the content popularity prediction model training method in the above method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0192] Figure 11 This is a schematic diagram of a content popularity prediction device provided in an embodiment of this application. Figure 11 As shown, the device includes: an acquisition module 21, a generation module 22, a training module 23, and a prediction module 24.
[0193] Module 21 is used to acquire the content popularity data sequence at time t;
[0194] The generation module 22 is used to generate a task set based on the content popularity data sequence at time t. The task set includes a support subset and a query subset.
[0195] Training module 23 is used to train the prediction module of the target prediction model using the parameter update learning module of the support subset and the target prediction model to obtain a trained prediction module. The target prediction model is trained using the method described in the above embodiments.
[0196] The prediction module 24 is used to obtain prediction results using a query subset and a trained prediction module. The prediction results are used to characterize the difference between the predicted content popularity data at time t+1 and the content popularity data at time t.
[0197] The content popularity prediction device provided in this application can execute the content popularity prediction method in the above method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0198] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 12As shown, the electronic device 300 may include at least one processor 301 and a memory 302, such as a computer, tablet computer or other electronic device with processing capabilities.
[0199] Memory 302 is used to store programs. Specifically, the program may include program code, which includes computer operation instructions. Memory 302 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0200] The processor 301 is used to execute computer execution instructions stored in the memory 302 to implement the content popularity prediction model training method or the content popularity prediction method described in the foregoing method embodiments. The processor 301 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0201] The electronic device 300 may also include a communication interface 303, through which it can communicate and interact with external devices. These external devices may be, for example, computers, tablets, or other electronic devices.
[0202] In practical implementation, if the communication interface 303, memory 302, and processor 301 are implemented independently, they can be interconnected via a bus to complete communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not imply that there is only one bus or one type of bus.
[0203] Optionally, in a specific implementation, if the communication interface 303, memory 302 and processor 301 are integrated on a single chip, then the communication interface 303, memory 302 and processor 301 can communicate through an internal interface.
[0204] This application also provides a computer-readable storage medium, which may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a disk, or an optical disk. Specifically, the computer-readable storage medium stores program instructions, which are used for the content popularity prediction model training method or the content popularity prediction method in the above embodiments.
[0205] This application also provides a computer program product including executable instructions stored in a readable storage medium. At least one processor of an electronic device 300 can read the executable instructions from the readable storage medium, and the at least one processor executes the executable instructions to cause the electronic device 300 to implement the content popularity prediction model training method or the content popularity prediction method provided in the various embodiments described above.
[0206] This application also provides a chip on which a computer program is stored. When the computer program is executed by the chip, it implements a content popularity prediction model training method or a content popularity prediction method provided in various embodiments.
[0207] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0208] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for training a content popularity prediction model, characterized in that, The method includes: Obtain a content popularity data sequence at n time points; wherein the content popularity sequence changes continuously over time; Based on the content popularity data sequence at the n time points, n task sets are generated; each task set includes: a support subset and a query subset; The initial model is trained using m first task sets from n task sets for model training to obtain m candidate prediction models. The initial model includes a prediction module and a parameter update learning module. The parameter update learning module is used to update the parameters of the prediction module. The prediction module is used to obtain the prediction result based on the content popularity data sequence at time t. The prediction result is used to characterize the difference between the predicted content popularity data at time t+1 and the content popularity data at time t. The target prediction model is determined from m candidate prediction models using q second task sets from n task sets, where the sum of m and q is less than or equal to n. The initial model is trained using m first task sets from n task sets to obtain m candidate prediction models, including: For any first task set, the prediction module of the initial model is trained using the support subset of the first task set and the parameter update learning module of the initial model to obtain a trained prediction module. Using the query subset of the first task set and the trained prediction module, the parameter update learning module of the initial model is trained to obtain the trained parameter update learning module. Among them, the trained prediction module and the parameter update learning module constitute the candidate prediction model corresponding to the first task set; The step of training the prediction module of the initial model using the support subset of the first task set and the parameter update learning module of the initial model includes: For the i-th training iteration, the parameter update learning module of the initial model is used to obtain the parameters used by the prediction module in the i-th training iteration based on the evaluation result of the prediction module of the initial model in the (i-1)-th training iteration, and the prediction module is updated using the parameters used in the i-th training iteration; the evaluation result includes: loss function value and / or gradient value, where i is greater than or equal to 2. Using the updated prediction module, obtain the prediction result corresponding to the i-th support subset training data, and the evaluation result of the i-th training iteration of the prediction module; The step of using the query subset of the first task set and the trained prediction module to train the parameter update learning module of the initial model includes: For the j-th training iteration, the parameters used by the parameter update learning module in the j-th training iteration are obtained using the evaluation results of the (j-1)-th training iteration of the trained prediction module, and the parameter update learning module is updated using the parameters used in the j-th training iteration, where j is greater than or equal to 2.
2. The method according to claim 1, characterized in that, The step of determining the target prediction model from m candidate prediction models using q second task sets from n task sets includes: Using q second task sets, the parameters of m candidate prediction models are tuned to obtain m candidate prediction models after parameter tuning. The target prediction model is determined from the m candidate prediction models after parameter tuning.
3. The method according to claim 1, characterized in that, The acquisition of content popularity data sequences at n time points includes: Obtain content popularity data sequences for a target duration; The content popularity data sequence for the target duration is split to obtain a content popularity data sequence for n time periods.
4. A method for predicting content popularity, characterized in that, The method includes: Obtain the content popularity data sequence at time t; Based on the content popularity data sequence at time t, a task set is generated, which includes a support subset and a query subset. The prediction module of the target prediction model is trained using the parameter update learning module of the support subset and the target prediction model to obtain a trained prediction module. The target prediction model is trained using the method described in any one of claims 1-3. Using a subset of queries and a trained prediction module, prediction results are obtained. These prediction results are used to characterize the difference between the predicted content popularity data at time t+1 and the content popularity data at time t.
5. An electronic device, characterized in that, The electronic device includes: a processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-3.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-3.
7. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method as described in any one of claims 1-3.