Method, apparatus, electronic device, and readable storage medium for training a model
By stratifying the interactive frequency of user samples and using high-frequency user samples to assist in low-frequency user samples learning, the problem of insufficient learning of low-frequency user samples in the existing technology is solved, and the overall accuracy of the click-through rate estimate model is improved.
Patent Information
- Application Number
- CN202110342815.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-30
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2041-03-30
AI Technical Summary
The existing click-through rate estimate model is inadequately learning when processing user samples with fewer interactions, resulting in low accuracy.
By performing interactive frequency stratification of user samples, high-frequency user samples are used to assist low-frequency user samples learning, iteratively optimize the model parameters of the click-through rate estimate model, and improve the accuracy of low-frequency user samples.
Without losing high-frequency user sample accuracy, improve the accuracy of low-frequency user sample and improve the overall accuracy of the click-through rate estimate model.
Smart Images

Figure CN115146773B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of Internet technologies, and in particular, to a method, an apparatus, an electronic device, and a readable storage medium for training a model. Background Art
[0002] The click-through rate (CTR) generally refers to the ratio of the number of times a piece of content on a website page is clicked to the number of times it is displayed. The click-through rate is expressed as a percentage and can be used to reflect the degree of attention received by a piece of content on a web page.
[0003] To predict the degree of attention received by a piece of content, a click-through rate prediction model can be used for prediction. Currently, for large-scale online content (such as advertisements, news, etc.) recommendation systems, most of the click-through rate prediction models are trained based on Logistic Regression (LR). After inputting the relevant data to be predicted into the model, corresponding prediction results can be output.
[0004] However, for user samples with less interaction, due to the lack of rich user behavior, the model learning is insufficient, which in turn affects the accuracy of the click-through rate prediction model. Summary of the Invention
[0005] Embodiments of the present disclosure provide a method, an apparatus, an electronic device, and a readable storage medium for training a model to improve the accuracy of predicting the click-through rate of a click-through rate prediction model.
[0006] According to a first aspect of the embodiments of the present disclosure, a method for training a model is provided. The method includes:
[0007] Obtain sample data, where the sample data includes low-frequency user samples and high-frequency user samples;
[0008] Label sample tags for each sample data, where the sample tags include click tags and hierarchical tags;
[0009] Input the input features of the sample data into an initial click-through rate prediction model, map the input features of the low-frequency user samples to the input feature space of the high-frequency user samples through the click-through rate prediction model, and output the predicted click-through rate and the predicted hierarchical type of each sample data;
[0010] Iteratively optimize the model parameters of the click-through rate prediction model according to the difference between the click tag and the predicted click-through rate, and the difference between the hierarchical tag and the predicted hierarchical type, to obtain a trained click-through rate prediction model.
[0011] According to a second aspect of the embodiments of the present disclosure, a method for predicting a click-through rate is provided. The method includes:
[0012] Obtain the input features of the target user;
[0013] Input the input features of the target user into the trained click-through rate prediction model, and output the click probability of the target user through the click-through rate prediction model. The click-through rate prediction model is trained according to the method of the aforementioned training model.
[0014] According to the third aspect of the embodiments of the present disclosure, there is provided an apparatus for training a model, the apparatus including:
[0015] A sample acquisition module, configured to acquire sample data, where the sample data includes low-frequency user samples and high-frequency user samples;
[0016] A sample annotation module, configured to annotate sample labels for each sample data, where the sample labels include click labels and stratification labels;
[0017] A feature mapping module, configured to input the input features of the sample data into an initial click-through rate prediction model, map the input features of the low-frequency user samples to the input feature space of the high-frequency user samples through the click-through rate prediction model, and output the predicted click-through rate and predicted stratification type of each sample data;
[0018] An iterative optimization module, configured to iteratively optimize the model parameters of the click-through rate prediction model according to the difference between the click label and the predicted click-through rate, and the difference between the stratification label and the predicted stratification type, to obtain a trained click-through rate prediction model.
[0019] According to the fourth aspect of the embodiments of the present disclosure, there is provided a click-through rate prediction apparatus, the apparatus including:
[0020] A feature acquisition module, configured to acquire the input features of the target user;
[0021] A click-through rate prediction module, configured to input the input features of the target user into the trained click-through rate prediction model, and output the click probability of the target user through the click-through rate prediction model. The click-through rate prediction model is trained according to the method of the aforementioned training model.
[0022] According to the fifth aspect of the embodiments of the present disclosure, there is provided an electronic device, including:
[0023] A processor, a memory, and a computer program stored on the memory and executable on the processor, characterized in that when the processor executes the program, the method for training the model described above is implemented.
[0024] According to a sixth aspect of the embodiments of the present disclosure, there is provided a readable storage medium, which enables an electronic device to execute the foregoing method for training a model when instructions in the storage medium are executed by a processor of the electronic device.
[0025] Embodiments of the present disclosure provide a method, apparatus, electronic device, and readable storage medium for training a model. The method includes: obtaining sample data, where the sample data includes low-frequency user samples and high-frequency user samples; labeling sample tags for each sample data, where the sample tags include click tags and stratification tags; inputting input features of the sample data into an initial click-through rate prediction model, mapping the input features of the low-frequency user samples to the input feature space of the high-frequency user samples through the click-through rate prediction model, and outputting the predicted click-through rate and predicted stratification type of each sample data; and iteratively optimizing the model parameters of the click-through rate prediction model according to the difference between the click tag and the predicted click-through rate, and the difference between the stratification tag and the predicted stratification type, to obtain a trained click-through rate prediction model. Embodiments of the present disclosure stratify user samples according to the interaction frequency, adopt a domain adaptation method, and use high-frequency user samples to assist low-frequency user samples in learning, improving the accuracy of low-frequency user samples without sacrificing the accuracy of high-frequency user samples, thereby improving the overall accuracy of the predicted click-through rate of the click-through rate prediction model. Description of the Drawings
[0026] To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following will briefly introduce the drawings required for the description of the embodiments of the present disclosure. Obviously, the following drawings are only some embodiments of the embodiments of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0027] Figure 1 Shows a flowchart of the steps of the method for training a model in an embodiment of the present disclosure;
[0028] Figure 2 Shows a schematic diagram of the framework of the click-through rate prediction model in an embodiment of the present disclosure;
[0029] Figure 3 Shows a flowchart of the steps of the click-through rate prediction method in an embodiment of the present disclosure;
[0030] Figure 4 Shows a structural diagram of the apparatus for training a model in an embodiment of the present disclosure;
[0031] Figure 5 Shows a structural diagram of the click-through rate prediction apparatus in an embodiment of the present disclosure;
[0032] Figure 6 The structural diagram of an electronic device provided by an embodiment of the present disclosure is shown. Detailed implementation manners
[0033] Next, the technical solutions in the embodiments of the present disclosure will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the embodiments of the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the embodiments of the present disclosure.
[0034] Referring to Figure 1 , which shows the step flow chart of a method for training a model in an embodiment of the present disclosure. The method includes:
[0035] Step 101, obtaining sample data, where the sample data includes low-frequency user samples and high-frequency user samples;
[0036] Step 102, labeling sample labels for each sample data, where the sample labels include click labels and hierarchical labels;
[0037] Step 103, inputting the input features of the sample data into an initial click-through rate prediction model, mapping the input features of the low-frequency user samples to the input feature space of the high-frequency user samples through the click-through rate prediction model, and outputting the predicted click-through rate and predicted hierarchical type of each sample data;
[0038] Step 104, iteratively optimizing the model parameters of the click-through rate prediction model according to the difference between the click label and the predicted click-through rate, and the difference between the hierarchical label and the predicted hierarchical type, to obtain a trained click-through rate prediction model.
[0039] In the click-through rate prediction scenario, for user samples with less interaction, due to the lack of rich user behavior, the model learning is insufficient or prone to overfitting. If the user samples are stratified according to the interaction frequency and different models are trained for user samples in different layers, for the samples in the low-frequency user layer, due to the small number of samples, there is a risk of underfitting caused by insufficient learning. If the weights of the samples in the low-frequency user layer are adjusted, there is a risk of artificially changing the sample distribution.
[0040] The present disclosure proposes a method for training a model, stratifying user samples according to the interaction frequency, and adopting a domain adaptation method to use high-frequency user samples to assist the learning of low-frequency user samples, improving the accuracy of low-frequency user samples without loss of the accuracy of high-frequency user samples, thereby improving the overall accuracy of the model.
[0041] In the disclosed embodiment, the click-through rate prediction model can be obtained by supervised training of an existing neural network based on a large amount of sample data and machine learning methods. It should be noted that the disclosed embodiment does not limit the model structure and training method of the click-through rate prediction model. The click-through rate prediction model can be a deep neural network model that integrates multiple neural networks. The neural network includes but is not limited to a combination, superposition, and nesting of at least one or at least two of the following: CNN (Convolutional Neural Network), LSTM (Long Short-Term Memory) network, RNN (Simple Recurrent Neural Network), attention neural network, etc.
[0042] Specifically, first, sample data is obtained, and the sample data includes low-frequency user samples and high-frequency user samples. After collecting the sample data, the embodiment of the present disclosure stratifies the sample data according to the user's interaction frequency, and divides the sample data into high-frequency user samples and low-frequency user samples.
[0043] In an optional embodiment of the present disclosure, obtaining sample data may specifically include:
[0044] Step S11, obtaining sample data and the click result of the user corresponding to the sample data;
[0045] Step S12: stratify the sample data according to the user interaction frequency within a preset time period into high-frequency user samples and low-frequency user samples.
[0046] Sample data refers to data related to click scenarios, where click results do not refer to the probability of clicks, but to existing results of clicks or non-clicks. Depending on the actual application scenarios, sample data and click results can be obtained in a targeted manner. For example, if you want to determine the click effect after a certain content is placed on a certain page, you can obtain sample data and corresponding click results generated when different users browse the page; if you want to determine the content that a certain user is interested in, you can obtain sample data and corresponding click results generated when the user uses a client (such as using an advertising client).
[0047] Furthermore, the sample data may include two aspects: user and content. Therefore, in the embodiment of the present disclosure, obtaining the sample data may be obtaining sample content data and sample user data, and performing feature extraction on the sample content data and sample user data to obtain input features of the sample data. The sample content data may be data related to the content to be clicked, and the sample user data may be data related to user attributes.
[0048] Optionally, the extracted input features can be preset, and the input features include at least one of the following: user features, merchant features, and environmental features. Among them, the user features include at least one of the following: the gender, age, and historical preferences of the user, the merchant features include at least one of the following: the category, sales volume, and sales ranking of the merchant, and the environmental features include at least one of the following: time, geographical location, and weather.
[0049] In addition, the embodiments of the present disclosure do not limit the data sources of the sample data and the click results. For example, when the user uses a news client, an advertising client, or a browser, the database can be used to store the sample data and the click results corresponding to the user. When the training of the click-through rate prediction model is required, the sample data and the click results can be obtained from the database for offline learning; or the sample data and the click results can be directly obtained from the online data stream to achieve online learning.
[0050] Then, sample labels are marked for each sample data, and the sample labels include click labels and stratification labels. Among them, the click label is used to mark whether there is a click behavior in the sample data. Specifically, the click label of the sample data can be marked according to the click results corresponding to the obtained sample data. For example, if the click result is a click, the click label can be marked as 1; if the click result is no click, the click label can be marked as 0. The stratification label is used to mark whether the sample data belongs to high-frequency user samples or low-frequency user samples. For example, according to a three-month time period, the sample data with a click count greater than N (a preset value) is defined as high-frequency user samples, and the sample data with a click count less than N is defined as low-frequency user samples.
[0051] Next, the input features of the sample data are input into the initial click-through rate prediction model. Through the click-through rate prediction model, the input features of the low-frequency user samples are mapped to the input feature space of the high-frequency user samples, and the predicted click-through rate and the predicted stratification type of each sample data are output.
[0052] Generally, the interaction behaviors of high-frequency user samples are relatively rich, and the training will be relatively sufficient, and the accuracy can be guaranteed. Due to the lack of rich interaction behaviors of low-frequency user samples, the learning is insufficient and the accuracy is difficult to guarantee. Therefore, the embodiments of the present disclosure map the input features of the low-frequency user samples to the input feature space of the high-frequency user samples, jointly train the high-frequency user samples and the low-frequency user samples, and perform CTR learning. Thus, the richness of the high-frequency user samples can be utilized to make the training of the low-frequency user samples more sufficient, and after sufficient learning, the accuracy of the high-frequency user samples will not be affected, thereby improving the overall accuracy of the model.
[0053] Finally, based on the differences between the clicked tags and the predicted click-through rates, and the differences between the hierarchical tags and the predicted hierarchical types, the initial model is iteratively optimized through the gradient descent algorithm to adjust the model parameters. When the optimized model reaches the preset convergence condition, the iterative optimization is stopped, and the model obtained from the last optimization is used as the click-through rate prediction model that has completed training.
[0054] Among them, the preset convergence condition can be that the loss value satisfies a preset range. The loss value can represent the deviation degree between the click probability predicted by the initial model and the actually statistically click probability. When the loss value is outside the preset range, it is considered that the deviation between the click probability predicted by the initial model and the actually statistically click probability is large. At this time, the model parameters of the initial model can be adjusted, and the initial model can be continuously iteratively trained to make the finally obtained loss value within the preset range.
[0055] In an alternative embodiment of the present disclosure, the click-through rate prediction model may include an identification mapping network, a domain adaptation network, and a click-through rate prediction network. Inputting the input features of the sample data into the initial click-through rate prediction model, and mapping the input features of the low-frequency user samples to the input feature space of the high-frequency user samples through the click-through rate prediction model, and outputting the predicted click-through rate and predicted hierarchical type of each sample data may specifically include:
[0056] Step S21: Input the input features of the sample data into the identification mapping network, and identify the hierarchical type corresponding to the input features through the identification mapping network;
[0057] Step S22: If the identified hierarchical type of the input features is a high-frequency user sample, keep the input features of the high-frequency user sample unchanged. If the identified hierarchical type of the input features is a low-frequency user sample, map the input features of the low-frequency user sample to the input feature space of the high-frequency user sample to obtain the mapped input features;
[0058] Step S23: Input the sample features output by the identification mapping network into the domain adaptation network and the click-through rate prediction network respectively. The sample features output by the identification mapping network include the input features of the high-frequency user samples and the mapped input features of the low-frequency user samples;
[0059] Step S24: Estimate the hierarchical type corresponding to the sample features output by the identification mapping network through the domain adaptation network, and estimate the click-through rate corresponding to the sample features output by the identification mapping network through the click-through rate prediction network.
[0060] Referring to Figure 2 , shows a framework schematic diagram of a click-through rate prediction model of the present disclosure. As Figure 2As shown, first, the input features of the sample data are input into the recognition mapping network, and the hierarchical type corresponding to the input features is recognized through the recognition mapping network.
[0061] Furthermore, the recognition mapping network includes a gating switch and a mapping network. The gating switch is used to recognize the hierarchical type corresponding to the input features, and the hierarchical type is used to represent whether the sample data is a low-frequency user sample or a high-frequency user sample. The mapping network is used to keep the input features of the high-frequency user samples unchanged and map the input features of the low-frequency user samples to the input feature space of the high-frequency user samples to obtain the mapped input features.
[0062] Furthermore, in the embodiment of the present disclosure, after dividing the high-frequency user samples and the low-frequency user samples and extracting the input features, an additional field can be used to label whether the input features belong to the high-frequency user samples or the low-frequency user samples. The gating switch can recognize the hierarchical type corresponding to the input features by parsing this field.
[0063] It should be noted that the embodiment of the present disclosure does not limit the specific manner of mapping the input features of the low-frequency user samples to the input feature space of the high-frequency user samples.
[0064] In an alternative embodiment of the present disclosure, the mapping of the input features of the low-frequency user samples to the input feature space of the high-frequency user samples to obtain the mapped input features may specifically include: multiplying the input features of the low-frequency user samples by a preset matrix to obtain the mapped input features.
[0065] For example, when it is recognized that the hierarchical type of the input features is a low-frequency user sample, the input features can be multiplied by a preset matrix to convert the input features into a new matrix.
[0066] In an alternative embodiment of the present disclosure, the mapping of the input features of the low-frequency user samples to the input feature space of the high-frequency user samples to obtain the mapped input features may specifically include: inputting the input features of the low-frequency user samples into a fully connected layer, and outputting the mapped input features through the fully connected layer. The dimension of the output of the fully connected layer is the same as the dimension of the input.
[0067] One function of the fully connected layer is dimension transformation, which is equivalent to a feature space transformation. It can extract and integrate useful information, and the feature space transformation of the input features of the low-frequency user samples can be achieved through the fully connected layer.
[0068] After the input features of the sample data are input into the recognition mapping network in the embodiments of the present disclosure, the recognition mapping network keeps the input features of the high-frequency user samples unchanged, and performs a feature mapping on the input features of the low-frequency user samples. Furthermore, through the negative gradient backpropagation of the domain adaptation network, the similarity between the high-frequency user sample space and the space after the mapping of the low-frequency user samples can be minimized, making the two feature spaces more similar, which can be regarded as being in the same feature space.
[0069] The sample features output by the recognition mapping network include the input features of the high-frequency user samples and the input features after the mapping of the low-frequency user samples. As Figure 2 shown, the sample features output by the recognition mapping network are respectively input into the domain adaptation network and the click-through rate prediction network.
[0070] Among them, the domain adaptation network is used to predict the hierarchical type for the sample features output by the recognition mapping network and output the predicted hierarchical type (D); the click-through rate prediction network is used to predict the click-through rate for the sample features output by the recognition mapping network and output the predicted click-through rate (CTR).
[0071] Specifically, the domain adaptation network sequentially performs feature mapping and forward calculation according to the input features (the sample features output by the recognition mapping network), and calculates the probability that each feature belongs to the high-frequency user samples and the probability that it belongs to the low-frequency user samples. Through the negative gradient backpropagation of the domain adaptation network, the similarity between the high-frequency user sample space and the space after the mapping of the low-frequency user samples can be minimized, making the two spaces more similar, that is, it can be considered that the input features of the low-frequency user samples are mapped to the same feature space as the high-frequency user samples.
[0072] The domain adaptation problem can be defined as follows: the source domain and the target domain share the same features and categories, but the feature distributions are different. How to use the information-rich source domain samples to improve the performance of the target domain model. The source domain and the target domain often belong to the same type of task, but the distributions are different.
[0073] In the embodiments of the present disclosure, domain adaptation is performed at the feature level, mapping the input features of the low-frequency user samples and the input features of the high-frequency user samples to the common feature space, calculating the empirical error of the high-frequency user samples, approximating the empirical error of the low-frequency user samples to have the same distribution, and then improving the model accuracy of the low-frequency user samples through the high-frequency user samples with rich interaction information.
[0074] In summary, the embodiment of the present disclosure stratifies user samples according to the user's interaction frequency. For high-frequency user samples, their input features are kept unchanged. For low-frequency user samples, the input features are mapped to the feature space of high-frequency user samples through domain adaptation. Then, with the help of the richness of high-frequency user samples, the low-frequency user samples can be trained more fully, thereby improving the training accuracy; and the accuracy of high-frequency user samples will not be affected after sufficient learning. Therefore, the accuracy of the click-through rate prediction model is improved as a whole. In addition, the embodiment of the present disclosure does not need to split the samples of stratified users and train the models separately, and the learning effect of low-frequency user samples is better. Furthermore, the embodiment of the present disclosure does not adjust the weights of the samples to avoid artificial changes in the sample distribution, further improving the model training effect.
[0075] Reference Figure 3 , which shows a flow chart of the steps of a click rate prediction method in an embodiment of the present disclosure, the method comprising:
[0076] Step 301: Obtain input features of a target user;
[0077] Step 302: Input the input features of the target user into a trained click rate prediction model, and output the click probability of the target user through the click rate prediction model, wherein the click rate prediction model is trained according to the aforementioned model training method.
[0078] The click rate prediction method provided by the present invention can be applied to electronic devices, including but not limited to: smart phones, tablet computers, e-book readers, MP3 (Moving Picture Experts Group Audio Layer III) players, MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, car computers, desktop computers, set-top boxes, smart TVs, wearable devices, etc.
[0079] The electronic device may be installed with a client, which may be an APP (Application, APP for short) or a web browser used on the World Wide Web, etc. The client may be used for shopping, ordering takeout, booking a hotel, etc. The client may display an interface on the electronic device. The electronic device may provide a human-computer interaction interface to the user, which may be implemented in the form of a web page, an application page, or a window, etc.
[0080] Further, the input features of the target user obtained can be preset, and the input features include at least one of the following: user features, merchant features, and environmental features. Among them, the user features include at least one of the following: the gender, age, and historical preferences of the user, the merchant features include at least one of the following: the category, sales volume, and sales ranking of the merchant, and the environmental features include at least one of the following: time, geographical location, and weather.
[0081] In the process of training the click-through rate prediction model in the embodiments of the present disclosure, user samples are stratified according to the interaction frequency of users. For high-frequency user samples, their input features remain unchanged. For low-frequency user samples, the input features are mapped to the feature space of high-frequency user samples through domain adaptation. Furthermore, by leveraging the richness of high-frequency user samples, the training of low-frequency user samples can be made more sufficient, thereby improving the training accuracy; while for high-frequency user samples, after sufficient learning, the accuracy will not be affected. Therefore, the accuracy of the click-through rate prediction model is improved as a whole. By using the trained click-through rate prediction model for click-through rate prediction, the prediction accuracy can be improved.
[0082] It should be noted that for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of the present disclosure are not limited by the described action sequence, because according to the embodiments of the present disclosure, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present disclosure.
[0083] Refer to Figure 4 , which shows the structural diagram of the device for training a model in an embodiment of the present disclosure, specifically as follows.
[0084] A sample acquisition module 401, configured to acquire sample data, where the sample data includes low-frequency user samples and high-frequency user samples;
[0085] A sample annotation module 402, configured to annotate sample labels for each sample data, where the sample labels include click labels and stratification labels;
[0086] A feature mapping module 403, configured to input the input features of the sample data into an initial click-through rate prediction model, map the input features of low-frequency user samples to the input feature space of high-frequency user samples through the click-through rate prediction model, and output the predicted click-through rate and predicted stratification type of each sample data;
[0087] The iterative optimization module 404 is used to iteratively optimize the model parameters of the click-through rate prediction model according to the difference between the click label and the predicted click-through rate, and the difference between the hierarchical label and the predicted hierarchical type, so as to obtain a trained click-through rate prediction model.
[0088] Optionally, the click-through rate prediction model includes an identification mapping network, a domain adaptation network, and a click-through rate prediction network. The feature mapping module includes:
[0089] The hierarchical identification sub-module is used to input the input features of the sample data into the identification mapping network, and identify the hierarchical type corresponding to the input features through the identification mapping network;
[0090] The feature mapping sub-module is used to keep the input features of the high-frequency user samples unchanged if the identified hierarchical type of the input features is high-frequency user samples, and map the input features of the low-frequency user samples to the input feature space of the high-frequency user samples if the identified hierarchical type of the input features is low-frequency user samples, so as to obtain the mapped input features;
[0091] The feature input sub-module is used to input the sample features output by the identification mapping network into the domain adaptation network and the click-through rate prediction network respectively. The sample features output by the identification mapping network include the input features of the high-frequency user samples and the mapped input features of the low-frequency user samples;
[0092] The probability prediction sub-module is used to predict the hierarchical type corresponding to the sample features output by the identification mapping network through the domain adaptation network, and predict the click-through rate corresponding to the sample features output by the identification mapping network through the click-through rate prediction network.
[0093] Optionally, the feature mapping module is specifically used to multiply the input features of the low-frequency user samples by a preset matrix to obtain the mapped input features.
[0094] Optionally, the feature mapping module is specifically used to input the input features of the low-frequency user samples into a fully connected layer, and output the mapped input features through the fully connected layer. The dimension of the output of the fully connected layer is the same as the dimension of the input.
[0095] Optionally, the sample acquisition module includes:
[0096] The sample collection sub-module is used to obtain sample data and the click results corresponding to the sample data for users;
[0097] The sample stratification sub-module is used to stratify the sample data according to the interaction frequency of users within a preset time period, into high-frequency user samples and low-frequency user samples.
[0098] Optionally, the input features of the sample data include at least one of the following: user features, merchant features, and environmental features. Among them, the user features include at least one of the following: the gender, age, and historical preferences of the user. The merchant features include at least one of the following: the category, sales volume, and sales ranking of the merchant. The environmental features include at least one of the following: time, geographical location, and weather.
[0099] In an embodiment of the present disclosure, user samples are stratified according to the interaction frequency of users. For high-frequency user samples, their input features remain unchanged. For low-frequency user samples, the input features are mapped to the feature space of high-frequency user samples through domain adaptation. Furthermore, by leveraging the richness of high-frequency user samples, the training of low-frequency user samples can be made more sufficient, thereby improving the training accuracy. For high-frequency user samples, after sufficient learning, the accuracy will not be affected. Therefore, the accuracy of the click-through rate prediction model is improved as a whole. In addition, in the embodiment of the present disclosure, it is not necessary to split the stratified users into samples and train the model separately, and the learning effect of low-frequency user samples is better. Moreover, in the embodiment of the present disclosure, the weights of the samples are not adjusted, avoiding the situation of artificially changing the sample distribution and further improving the model training effect.
[0100] Refer to Figure 5 , which shows the structural diagram of a click-through rate prediction device in an embodiment of the present disclosure, as follows.
[0101] A feature acquisition module 501, configured to acquire the input features of a target user;
[0102] A click-through rate prediction module 502, configured to input the input features of the target user into a trained click-through rate prediction model, and output the click probability of the target user through the click-through rate prediction model. The click-through rate prediction model is trained according to the method of the foregoing training model.
[0103] Further, the acquired input features of the target user include at least one of the following: user features, merchant features, and environmental features. Among them, the user features include at least one of the following: the gender, age, and historical preferences of the user. The merchant features include at least one of the following: the category, sales volume, and sales ranking of the merchant. The environmental features include at least one of the following: time, geographical location, and weather.
[0104] In the process of training the click-through rate prediction model according to the embodiments of the present disclosure, user samples are stratified according to the interaction frequency of users. For high-frequency user samples, their input features remain unchanged. For low-frequency user samples, the input features are mapped to the feature space of high-frequency user samples through domain adaptation. Furthermore, by leveraging the richness of high-frequency user samples, the training of low-frequency user samples can be made more sufficient, thereby improving the training accuracy. For high-frequency user samples, after sufficient learning, the accuracy will not be affected. Therefore, the accuracy of the click-through rate prediction model is improved as a whole. By performing click-through rate prediction using the trained click-through rate prediction model, the accuracy of the prediction can be improved.
[0105] For the apparatus embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For related parts, refer to the corresponding descriptions in the method embodiments.
[0106] The embodiments in this specification are all described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other.
[0107] Regarding the apparatus in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.
[0108] Embodiments of the present disclosure also provide an electronic device, see Figure 6 , including: a processor 601, a memory 602, and a computer program 6021 stored on the memory and executable on the processor. When the processor executes the program, it implements the method for training the model in the foregoing embodiments.
[0109] Embodiments of the present disclosure also provide a readable storage medium. When the instructions in the storage medium are executed by the processor of an electronic device, the electronic device can execute the method for training the model in the foregoing embodiments.
[0110] For the apparatus embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For related parts, refer to the corresponding descriptions in the method embodiments.
[0111] The algorithms and displays provided herein are not inherently related to any specific computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. Based on the above description, the structure required to construct such systems is obvious. In addition, the embodiments of the present disclosure are not directed to any specific programming language. It should be understood that the content of the embodiments of the present disclosure described herein can be implemented using various programming languages, and the description of the specific language above is for disclosing the best implementation manner of the embodiments of the present disclosure.
[0112] In the specification provided herein, numerous specific details are set forth. However, it will be understood that embodiments of the present disclosure may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0113] Similarly, it should be understood that, in order to streamline the present disclosure and assist in understanding one or more of the various inventive aspects, in the foregoing description of exemplary embodiments of the present disclosure, various features of the embodiments of the present disclosure are sometimes grouped together in a single embodiment, figure, or description thereof. However, the disclosed method should not be construed as reflecting an intention that the claimed embodiments of the present disclosure require more features than are expressly recited in each claim. Rather, as reflected in the following claims, the inventive aspects lie in less than all the features of the single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of the present disclosure.
[0114] Those skilled in the art will appreciate that the modules in the devices in the embodiments can be adaptively changed and disposed in one or more devices different from the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and in addition, they can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all the features disclosed in this specification (including the accompanying claims, abstract and drawings) and all the processes or units of any method or device so disclosed. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstract and drawings) can be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0115] The various component embodiments of the embodiments of the present disclosure can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the embodiments of the present disclosure. The embodiments of the present disclosure can also be implemented as a device or apparatus program for performing part or all of the methods described herein. Such a program implementing the embodiments of the present disclosure can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or in any other form.
[0116] It should be noted that the above embodiments are illustrative of the embodiments of the present disclosure rather than limiting the embodiments of the present disclosure, and those skilled in the art can design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in the claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. Embodiments of the present disclosure can be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a unit claim listing several devices, several of these devices may be embodied by the same item of hardware. The use of the words first, second, and third, etc. does not denote any order. These words may be interpreted as names.
[0117] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.
[0118] The above are only the preferred embodiments of the embodiments of the present disclosure, and are not intended to limit the embodiments of the present disclosure. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the embodiments of the present disclosure shall be included in the protection scope of the embodiments of the present disclosure.
[0119] The above is only the specific implementation manner of the embodiments of the present disclosure, but the protection scope of the embodiments of the present disclosure is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the embodiments of the present disclosure, and all of them should be covered by the protection scope of the embodiments of the present disclosure. Therefore, the protection scope of the embodiments of the present disclosure shall be subject to the protection scope of the claims.
Claims
1. A method for training a model, characterized in that, The method includes: Obtaining sample data, where the sample data includes low-frequency user samples and high-frequency user samples; Annotating sample labels for each sample data, where the sample labels include click labels and stratification labels; Inputting the input features of the sample data into an initial click-through rate prediction model, and mapping the input features of the low-frequency user samples to the input feature space of the high-frequency user samples through the click-through rate prediction model, and outputting the predicted click-through rate and predicted stratification type of each sample data; Iteratively optimizing the model parameters of the click-through rate prediction model according to the difference between the click label and the predicted click-through rate, and the difference between the stratification label and the predicted stratification type, to obtain a trained click-through rate prediction model; The click-through rate prediction model includes an identification mapping network, a domain adaptation network, and a click-through rate prediction network. The step of inputting the input features of the sample data into the initial click-through rate prediction model, and mapping the input features of the low-frequency user samples to the input feature space of the high-frequency user samples through the click-through rate prediction model, and outputting the predicted click-through rate and predicted stratification type of each sample data includes: Inputting the input features of the sample data into the identification mapping network, and identifying the stratification type corresponding to the input features through the identification mapping network; If the identified stratification type of the input features is a high-frequency user sample, keep the input features of the high-frequency user sample unchanged. If the identified stratification type of the input features is a low-frequency user sample, map the input features of the low-frequency user sample to the input feature space of the high-frequency user sample to obtain the mapped input features; Inputting the sample features output by the identification mapping network into the domain adaptation network and the click-through rate prediction network respectively. The sample features output by the identification mapping network include the input features of the high-frequency user samples and the mapped input features of the low-frequency user samples; Predicting the stratification type corresponding to the sample features output by the identification mapping network through the domain adaptation network, and predicting the click-through rate corresponding to the sample features output by the identification mapping network through the click-through rate prediction network.
2. The method according to claim 1, wherein The step of mapping the input features of the low-frequency user sample to the input feature space of the high-frequency user sample to obtain the mapped input features includes: Multiplying the input features of the low-frequency user sample by a preset matrix to obtain the mapped input features.
3. The method according to claim 1, characterized in that, The step of mapping the input features of the low-frequency user sample to the input feature space of the high-frequency user sample to obtain the mapped input features includes: Inputting the input features of the low-frequency user sample into a fully connected layer, and outputting the mapped input features through the fully connected layer. The dimension of the output of the fully connected layer is the same as the input dimension.
4. The method according to claim 1, wherein The step of obtaining the sample data includes: Obtaining sample data and the click results corresponding to the users of the sample data; Stratifying the sample data according to the interaction frequency of the users within a preset time period, into high-frequency user samples and low-frequency user samples.
5. The method according to any one of claims 1 to 4, characterized in that, The input features of the sample data include at least one of the following: user features, merchant features, and environmental features. Among them, the user features include at least one of the following: the gender, age, and historical preferences of the user; the merchant features include at least one of the following: the category, sales volume, and sales ranking of the merchant; and the environmental features include at least one of the following: time, geographical location, and weather.
6. A click-through rate prediction method, characterized in that, The method includes: Obtaining the input features of the target user; Inputting the input features of the target user into the trained click-through rate prediction model, and outputting the click probability of the target user through the click-through rate prediction model. The click-through rate prediction model is trained by the method of the training model described in any one of the above claims 1-5.
7. An apparatus for training a model, characterized in that, The device includes: A sample acquisition module, configured to acquire sample data, where the sample data includes low-frequency user samples and high-frequency user samples; A sample annotation module, configured to annotate sample labels for each sample data, where the sample labels include click labels and stratification labels; A feature mapping module, configured to input the input features of the sample data into an initial click-through rate prediction model, map the input features of the low-frequency user samples to the input feature space of the high-frequency user samples through the click-through rate prediction model, and output the predicted click-through rate and predicted stratification type of each sample data; An iterative optimization module, configured to iteratively optimize the model parameters of the click-through rate prediction model according to the difference between the click label and the predicted click-through rate, and the difference between the stratification label and the predicted stratification type, to obtain the trained click-through rate prediction model; The click-through rate prediction model includes an identification mapping network, a domain adaptation network, and a click-through rate prediction network. The feature mapping module includes: A stratification identification sub-module, configured to input the input features of the sample data into the identification mapping network, and identify the stratification type corresponding to the input features through the identification mapping network; A feature mapping sub-module, configured to keep the input features of the high-frequency user samples unchanged if the identified stratification type of the input features is a high-frequency user sample, and map the input features of the low-frequency user samples to the input feature space of the high-frequency user samples if the identified stratification type of the input features is a low-frequency user sample, to obtain the mapped input features; A feature input sub-module, configured to input the sample features output by the identification mapping network into the domain adaptation network and the click-through rate prediction network respectively. The sample features output by the identification mapping network include the input features of the high-frequency user samples and the mapped input features of the low-frequency user samples; A probability prediction sub-module, configured to predict the stratification type corresponding to the sample features output by the identification mapping network through the domain adaptation network, and predict the click-through rate corresponding to the sample features output by the identification mapping network through the click-through rate prediction network.
8. The device according to claim 7, characterized in that, The feature mapping module is specifically configured to multiply the input features of the low-frequency user samples by a preset matrix to obtain the mapped input features.
9. The device according to claim 7, characterized in that, The feature mapping module is specifically configured to input the input features of low-frequency user samples into a fully-connected layer, and output the mapped input features through the fully-connected layer. The dimension of the output of the fully-connected layer is the same as the dimension of the input.
10. The device according to claim 7, characterized in that, The sample acquisition module includes: A sample collection sub-module, configured to obtain sample data and the click results corresponding to the users of the sample data; A sample stratification sub-module, configured to stratify the sample data according to the interaction frequency of users within a preset time period, into high-frequency user samples and low-frequency user samples.
11. The device according to any one of claims 7 to 10, characterized in that, The input features of the sample data include at least one of the following: user features, merchant features, and environmental features. Among them, the user features include at least one of the following: the gender, age, and historical preferences of the user. The merchant features include at least one of the following: the category, sales volume, and sales volume ranking of the merchant. The environmental features include at least one of the following: time, geographical location, and weather.
12. A click-through rate prediction device, characterized in that The device includes: A feature acquisition module, configured to acquire the input features of a target user; A click-through rate prediction module, configured to input the input features of the target user into a trained click-through rate prediction model, and output the click probability of the target user through the click-through rate prediction model. The click-through rate prediction model is trained according to the method of the training model described in any one of claims 1-5 above.
13. An electronic device, characterized in that, It includes: A processor, a memory, and a computer program stored on the memory and executable on the processor. It is characterized in that when the processor executes the program, it implements the method of the training model described in any one of claims 1-5.
14. A readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is enabled to execute the method of the training model described in any one of method claims 1-5.
Citation Information
Patent Citations
Image analysis and prediction based visual search
CN109844767A
Advertisement click rate estimation method and device
CN110415006A