CN115146773A - Method and device for training model, electronic equipment and readable storage medium - Google Patents
Method and device for training model, electronic equipment and readable storage medium Download PDFInfo
- Publication number
- CN115146773A CN115146773A CN202110342815.8A CN202110342815A CN115146773A CN 115146773 A CN115146773 A CN 115146773A CN 202110342815 A CN202110342815 A CN 202110342815A CN 115146773 A CN115146773 A CN 115146773A
- Authority
- CN
- China
- Prior art keywords
- sample
- input
- click rate
- user
- frequency user
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The embodiment of the disclosure provides a method, a device, an electronic device and a readable storage medium for training a model, wherein the method comprises the following steps: acquiring sample data, wherein the sample data comprises a low-frequency user sample and a high-frequency user sample; labeling a sample label for each sample data, wherein the sample label comprises a click label and a layering label; inputting the input characteristics of the sample data into an initial click rate estimation model, mapping the input characteristics of the low-frequency user sample to an input characteristic space of the high-frequency user sample through the click rate estimation model, and outputting the estimated click rate and the estimated hierarchical type of each sample data; and iteratively optimizing model parameters of the click rate estimation model according to the difference between the click label and the estimated click rate and the difference between the layered label and the estimated layered type to obtain the trained click rate estimation model. The click rate estimation method and the click rate estimation device can improve the accuracy of the click rate estimation model in estimating the click rate.
Description
Technical Field
The embodiment of the disclosure relates to the technical field of internet, in particular to a method and a device for training a model, an electronic device and a readable storage medium.
Background
Click-Through-Rate (CTR) generally refers to the ratio of the number of times a certain content on a web page is clicked to the number of times the content is displayed, and the Click-Through Rate is expressed as a percentage and can be used to reflect the attention degree of a certain content on a web page.
In order to predict the attention degree of a certain content, a click rate prediction model can be used for prediction. At present, for a large-scale online content (such as advertisement, news, etc.) recommendation system, most click rate estimation models are obtained based on Logistic Regression (LR) training, and after relevant data to be predicted is input into the models, corresponding prediction results can be output.
However, for a user sample with less interaction, due to the fact that the user behaviors are not rich enough, model learning is not sufficient, and therefore accuracy of the click rate estimation model is affected.
Disclosure of Invention
Embodiments of the present disclosure provide a method and an apparatus for training a model, an electronic device, and a readable storage medium, so as to improve accuracy of a click rate estimation model for estimating a click rate.
According to a first aspect of embodiments of the present disclosure, there is provided a method of training a model, the method comprising:
acquiring sample data, wherein the sample data comprises a low-frequency user sample and a high-frequency user sample;
labeling a sample label for each sample data, wherein the sample label comprises a click label and a layered label;
inputting the input characteristics of the sample data into an initial click rate estimation model, mapping the input characteristics of the low-frequency user sample to an input characteristic space of the high-frequency user sample through the click rate estimation model, and outputting the estimated click rate and the estimated hierarchical type of each sample data;
and iteratively optimizing model parameters of the click rate estimation model according to the difference between the click label and the estimated click rate and the difference between the layered label and the estimated layered type to obtain the trained click rate estimation model.
According to a second aspect of embodiments of the present disclosure, A click rate pre-estimation method is provided, and the method comprises the following steps:
acquiring input characteristics of a target user;
inputting the input characteristics of the target user into a trained click rate estimation model, outputting the click probability of the target user through the click rate estimation model, and training the click rate estimation model according to the method of the training model to obtain the click rate estimation model.
According to a third aspect of embodiments of the present disclosure, there is provided an apparatus for training a model, the apparatus comprising:
the system comprises a sample acquisition module, a data processing module and a data processing module, wherein the sample acquisition module is used for acquiring sample data, and the sample data comprises a low-frequency user sample and a high-frequency user sample;
the sample labeling module is used for labeling a sample label for each sample data, wherein the sample label comprises a click label and a layered label;
the characteristic mapping module is used for inputting the input characteristics of the sample data into an initial click rate estimation model, mapping the input characteristics of the low-frequency user sample to an input characteristic space of the high-frequency user sample through the click rate estimation model, and outputting the estimated click rate and the estimated hierarchical type of each sample data;
and the iterative optimization module is used for iteratively optimizing the model parameters of the click rate estimation model according to the difference between the click label and the estimated click rate and the difference between the layered label and the estimated layered type to obtain the trained click rate estimation model.
According to a fourth aspect of embodiments of the present disclosure, there is provided a click rate predicting apparatus, including:
the characteristic acquisition module is used for acquiring the input characteristics of a target user;
and the click rate estimation module is used for inputting the input characteristics of the target user into a trained click rate estimation model, outputting the click probability of the target user through the click rate estimation model, and training the click rate estimation model according to the method of the training model to obtain the click rate estimation model.
According to a fifth aspect of an embodiment of the present disclosure, there is provided an electronic apparatus including:
a processor, a memory, and a computer program stored on the memory and executable on the processor, wherein the processor implements the aforementioned method of training a model when executing the program.
According to a sixth aspect of embodiments of the present disclosure, there is provided a readable storage medium, wherein instructions, when executed by a processor of an electronic device, enable the electronic device to perform the aforementioned method of training a model.
The embodiment of the disclosure provides a method, a device, an electronic device and a readable storage medium for training a model, wherein the method comprises the following steps: obtaining sample data, wherein the sample data comprises a low-frequency user sample and a high-frequency user sample; labeling a sample label for each sample data, wherein the sample label comprises a click label and a layered label; inputting the input characteristics of the sample data into an initial click rate estimation model, mapping the input characteristics of the low-frequency user sample to an input characteristic space of the high-frequency user sample through the click rate estimation model, and outputting the estimated click rate and the estimated hierarchical type of each sample data; and iteratively optimizing model parameters of the click rate estimation model according to the difference between the click label and the estimated click rate and the difference between the layered label and the estimated layered type to obtain the trained click rate estimation model. According to the method and the device, the user samples are layered according to the interactive frequency, the high-frequency user samples are used for assisting the learning of the low-frequency user samples by adopting a field self-adaptive method, the precision of the low-frequency user samples is improved on the premise that the precision of the high-frequency user samples is not lost, and therefore the overall precision of the estimated click rate of the click rate estimation model is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings needed to be used in the description of the embodiments of the present disclosure will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 illustrates a flow chart of steps of a method of training a model in one embodiment of the present disclosure;
FIG. 2 illustrates a frame diagram of a click rate prediction model in one embodiment of the present disclosure;
FIG. 3 is a flow chart illustrating steps of a click-through rate estimation method in one embodiment of the present disclosure;
FIG. 4 shows a block diagram of an apparatus for training a model in one embodiment of the present disclosure;
FIG. 5 is a block diagram of a click rate predictor in one embodiment of the present disclosure;
fig. 6 shows a block diagram of an electronic device provided by an embodiment of the present disclosure.
Detailed Description
Technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments, which can be obtained by a person skilled in the art without making creative efforts based on the embodiments of the present disclosure, belong to the protection scope of the embodiments of the present disclosure.
Referring to fig. 1, a flow diagram illustrating the steps of a method of training a model in one embodiment of the present disclosure is shown, the method comprising:
102, labeling a sample label for each sample data, wherein the sample label comprises a click label and a layered label;
103, inputting the input characteristics of the sample data into an initial click rate estimation model, mapping the input characteristics of the low-frequency user sample to an input characteristic space of the high-frequency user sample through the click rate estimation model, and outputting the estimated click rate and the estimated hierarchical type of each sample data;
and 104, iteratively optimizing model parameters of the click rate estimation model according to the difference between the click label and the estimated click rate and the difference between the layered label and the estimated layered type to obtain the trained click rate estimation model.
In a click rate estimation scene, for a user sample with less interaction, due to the fact that user behaviors are not rich enough, model learning is not sufficient or overfitting is easy to happen. If the user samples are layered according to the interaction frequency, different models are trained for the user samples of different layers, and for the samples of the low-frequency user layer, because the samples are fewer, the risk of under-fitting caused by insufficient learning exists. If the samples of the low frequency user layer are weighted, there is a risk of artificially changing the distribution of the samples.
The utility model provides a method for training a model, which is used for layering user samples according to interactive frequency, adopts a field self-adaptive method, utilizes high-frequency user samples to assist learning of low-frequency user samples, and improves the precision of the low-frequency user samples on the premise of not losing the precision of the high-frequency user samples, thereby improving the overall precision of the model.
In the embodiment of the disclosure, the click rate estimation model may be obtained by performing supervised training on an existing neural network according to a large amount of sample data and a machine learning method. It should be noted that, the embodiment of the present disclosure does not limit the model structure and the training method of the click rate estimation model. The click rate estimation model can be a deep neural network model fusing multiple neural networks. The neural network includes, but is not limited to, at least one or a combination, superposition, nesting of at least two of the following: CNN (Convolutional Neural Network), LSTM (Long Short-Term Memory) Network, RNN (Simple Recurrent Neural Network), attention Neural Network, and the like.
Specifically, first, sample data is obtained, where the sample data includes a low frequency user sample and a high frequency user sample. After the sample data is collected, the sample data is layered according to the interaction frequency of the user and divided into a high-frequency user sample and a low-frequency user sample.
In an optional embodiment of the present disclosure, the obtaining sample data may specifically include:
s11, acquiring sample data and a click result of the sample data corresponding to a user;
and S12, layering the sample data according to the interaction frequency of the user in a preset time period, and dividing the sample data into a high-frequency user sample and a low-frequency user sample.
The sample data refers to data related to a click scene, wherein the click result does not refer to the probability of clicking but refers to the existing result of clicking or not clicking. According to different actual application scenes, sample data and click results can be acquired in a targeted manner, for example, if the click effect after a certain content is released to a certain page is determined, the sample data and the corresponding click results generated when different users browse the page can be acquired; if the content of interest of a user is to be determined, sample data and corresponding click results generated when the user uses a client (e.g., an advertisement client) can be obtained.
Further, the sample data may include two aspects of a user and content, and therefore, in the embodiment of the present disclosure, obtaining the sample data may be to obtain sample content data and sample user data, perform feature extraction on the sample content data and the sample user data, and obtain an input feature of the sample data. Wherein, the sample content data may be data related to the content to be clicked, and the sample user data may be data related to the user attribute.
Optionally, the extracted input features may be preset, where the input features include at least one of the following: user characteristics, merchant characteristics, and environmental characteristics, wherein the user characteristics include at least one of: gender, age, historical preferences of the user, the merchant characteristics including at least one of: the category, sales and sales ranking of the merchant, and the environmental characteristics comprise at least one of the following: time, geographic location, weather.
In addition, the data sources of the sample data and the click result are not limited in the embodiment of the disclosure, for example, when a user uses a news client, an advertisement client or a browser, the sample data and the click result of the user corresponding to the sample data can be stored in the database, and when training of the click rate prediction model is required, the sample data and the click result can be obtained from the database for off-line learning; and sample data and a click result can be directly obtained from the online data stream, so that online learning is realized.
Then, labeling a sample label for each sample data, wherein the sample label comprises a click label and a hierarchical label. The click label is used for marking whether the sample data has click behavior, and specifically, the click label of the sample data can be marked according to the obtained sample data corresponding to the click result of the user. For example, if the click result is a click, the click label may be marked as 1; if the click result is not clicked, the click label can be marked as 0. And the hierarchical label is used for marking whether the sample data belongs to the high-frequency user sample or the low-frequency user sample. For example, according to a time period of three months, sample data with a click number greater than N (a preset numerical value) is defined as a high-frequency user sample, and sample data with a click number less than N is defined as a low-frequency user sample.
And then, inputting the input characteristics of the sample data into an initial click rate estimation model, mapping the input characteristics of the low-frequency user sample to an input characteristic space of the high-frequency user sample through the click rate estimation model, and outputting the estimated click rate and the estimated hierarchical type of each sample data.
Generally, the interaction behavior of the high-frequency user sample is rich, the training is sufficient, and the precision can be guaranteed. Due to the fact that interaction behaviors of low-frequency user samples are not rich enough, learning is not sufficient, and precision is difficult to guarantee. Therefore, the embodiment of the present disclosure maps the input features of the low-frequency user samples to the input feature space of the high-frequency user samples, and performs the CTR learning by performing the joint training on the high-frequency user samples and the low-frequency user samples. Therefore, the training of the low-frequency user sample can be more sufficient by means of the richness of the high-frequency user sample, and after the high-frequency user sample is sufficiently and sufficiently learned, the precision is not influenced, so that the overall precision of the model can be improved.
And finally, according to the difference between the click label and the estimated click rate and the difference between the layered label and the estimated layered type, performing iterative optimization on the initial model through a gradient descent algorithm, adjusting model parameters, stopping iterative optimization until the optimized model reaches a preset convergence condition, and taking the model obtained by the last optimization as a click rate estimation model after training.
Wherein the preset convergence condition may be that the loss value satisfies a preset range, the penalty value may represent the degree of deviation between the initial model predicted click probability and the actual statistical click probability. If the loss value is out of the preset range, the deviation between the click probability predicted by the initial model and the actually counted click probability is considered to be large, at the moment, the model parameters of the initial model can be adjusted, and the iterative training of the initial model is continued, so that the finally obtained loss value is in the preset range.
In an optional embodiment of the present disclosure, the click rate prediction model may include an identification mapping network, a domain adaptive network, and a click rate prediction network, where the input feature of the sample data is input into an initial click rate prediction model, the input feature of the low-frequency user sample is mapped to an input feature space of the high-frequency user sample through the click rate prediction model, and a predicted click rate and a predicted hierarchical type of each sample data are output, which specifically includes:
s21, inputting the input features of the sample data into the identification mapping network, and identifying the hierarchical type corresponding to the input features through the identification mapping network;
step S22, if the hierarchical type of the input features is recognized as a high-frequency user sample, keeping the input features of the high-frequency user sample unchanged, and if the hierarchical type of the input features is recognized as a low-frequency user sample, mapping the input features of the low-frequency user sample to an input feature space of the high-frequency user sample to obtain the mapped input features;
step S23, respectively inputting the sample characteristics output by the identification mapping network into the field adaptive network and the click rate estimation network, wherein the sample characteristics output by the identification mapping network comprise input characteristics of a high-frequency user sample and input characteristics of a low-frequency user sample after mapping;
and S24, estimating the hierarchical type corresponding to the sample characteristics output by the identification mapping network through the domain adaptive network, and estimating the click rate corresponding to the sample characteristics output by the identification mapping network through the click rate estimation network.
Referring to fig. 2, a frame diagram of a click rate prediction model of the present disclosure is shown. As shown in fig. 2, first, input features of sample data are input into the recognition mapping network, and a hierarchical type corresponding to the input features is recognized through the recognition mapping network.
Further, the identifying a mapping network includes a switch and a mapping network that may be gated. The gating switch is used for identifying a hierarchical type corresponding to the input feature, and the hierarchical type is used for representing whether the sample data is a low-frequency user sample or a high-frequency user sample. The mapping network is used for keeping the input characteristics of the high-frequency user sample unchanged, and mapping the input characteristics of the low-frequency user sample to the input characteristic space of the high-frequency user sample to obtain the mapped input characteristics.
Further, after the high-frequency user sample and the low-frequency user sample are obtained through division and the input features are extracted, an additional field can be used for marking whether the input features belong to the high-frequency user sample or the low-frequency user sample. The gating switch can identify the hierarchical type corresponding to the input feature by parsing the field.
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.
In an optional embodiment of the present disclosure, the 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 may specifically include: and multiplying the input characteristics of the low-frequency user sample by a preset matrix to obtain the mapped input characteristics.
For example, when the hierarchical type of the input feature is identified as a low-frequency user sample, the input feature may be multiplied by a preset matrix, and the input feature may be converted into a new matrix.
In an optional embodiment of the present disclosure, the 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 may specifically include: inputting the input features of the low-frequency user sample into a full connection layer, outputting the mapped input features through the full connection layer, wherein the output dimension and the input dimension of the full connection layer are the same.
One function of the full connection layer is dimension transformation, which is equivalent to feature space transformation, and can extract and integrate useful information, and the feature space transformation can be performed on the input features of the low-frequency user sample through the full connection layer.
After the input characteristics of the sample data are input into the identification mapping network, the identification mapping network keeps unchanged the input characteristics of the high-frequency user sample, and performs characteristic mapping on the input characteristics of the low-frequency user sample once, so that the similarity between the high-frequency user sample space and the space after the low-frequency user sample mapping can be minimized through negative gradient back propagation of the domain adaptive network, and the two characteristic spaces are more similar and can be regarded as the same characteristic space.
The sample characteristics output by the identification mapping network comprise input characteristics of a high-frequency user sample and input characteristics of a low-frequency user sample after mapping, and as shown in fig. 2, the sample characteristics output by the identification mapping network are respectively input into a domain adaptive network and a click rate estimation network.
The domain self-adaptive network is used for estimating the hierarchical type of the sample characteristics output by the identification mapping network and outputting an estimated hierarchical type (D); and the click rate prediction network is used for predicting the click rate of the sample characteristics output by the identification mapping network and outputting the predicted click rate (CTR).
Specifically, the domain adaptive network performs feature mapping and forward calculation in sequence according to the input features (sample features output by the recognition mapping network), and calculates the probability that each feature belongs to the high-frequency user sample and the probability that each feature belongs to the low-frequency user sample. The similarity between the high-frequency user sample space and the space after the low-frequency user sample is mapped can be minimized through the negative gradient back propagation of the domain adaptive network, so that the two spaces are more similar, namely, the input features of the low-frequency user sample are mapped to the same feature space of the high-frequency user sample.
The domain adaptation problem can be defined as: the source domain and the target domain share the same characteristics and categories, but the characteristics are distributed differently, so how to improve the performance of the target domain model by using the source domain sample with rich information. The source domain and the target domain tend to belong to the same class of tasks, but are distributed differently.
The method and the device for the field self-adaptation are used for carrying out field self-adaptation on a characteristic level, the input characteristics of the low-frequency user sample and the input characteristics of the high-frequency user sample are mapped to a public characteristic space, the empirical errors of the high-frequency user sample are calculated, the distribution of the empirical errors of the low-frequency user sample is approximated, and then the model precision of the low-frequency user sample is improved through the high-frequency user sample with rich interactive information.
In summary, the embodiments of the present disclosure perform layering on user samples according to the interaction frequency of the user. For a high-frequency user sample, the input characteristics of the high-frequency user sample are kept unchanged, for a low-frequency user sample, the input characteristics are mapped to the characteristic space of the high-frequency user sample through field self-adaption, and further, the training of the low-frequency user sample is more sufficient by means of the richness of the high-frequency user sample, so that the training precision is improved; and after the high-frequency user sample is sufficiently and sufficiently learned, the precision cannot be influenced. Therefore, the accuracy of the click rate estimation model is improved on the whole. In addition, the embodiment of the disclosure does not need to perform sample splitting on the layered users and respectively train the models, so that the learning effect on the low-frequency user samples is better. Moreover, the weight adjustment is not carried out on the samples in the embodiment of the disclosure, the condition that the distribution of the samples is changed artificially is avoided, and the model training effect is further improved.
Referring to FIG. 3, a flow chart illustrating steps of a click-through rate estimation method in one embodiment of the present disclosure is shown, the method comprising:
301, acquiring input characteristics of a target user;
The click rate estimation method provided by the present disclosure 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 portable computers, car-mounted computers, desktop computers, set-top boxes, smart televisions, wearable devices, and the like.
The electronic device may be installed with a client, and the client may be an APP (Application, APP for short) or a web browser used by the world wide web, and the like. The client can be used for shopping, point taking out, hotel booking and the like, and the client can display an interface on the electronic equipment. The electronic equipment can provide a human-computer interaction interface for a user, and the implementation form of the human-computer interaction interface can be a webpage, an application page, a window and the like.
Further, the acquired input characteristics of the target user may be preset, and the input characteristics include at least one of the following: user characteristics, merchant characteristics, and environmental characteristics, wherein the user characteristics include at least one of: gender, age, historical preference of the user, the merchant characteristics including at least one of: the category, sales volume and sales volume ranking of the merchant, and the environmental characteristics comprise at least one of the following: time, geographic location, weather.
According to the embodiment of the disclosure, in the process of training the click rate estimation model, the user samples are layered according to the interaction frequency of the user. For a high-frequency user sample, the input characteristics of the high-frequency user sample are kept unchanged, for a low-frequency user sample, the input characteristics are mapped to the characteristic space of the high-frequency user sample through field self-adaption, and further, the training of the low-frequency user sample is more sufficient by means of the richness of the high-frequency user sample, so that the training precision is improved; and after the high-frequency user sample is sufficiently and sufficiently learned, the precision cannot be influenced. Therefore, the accuracy of the click rate estimation model is improved on the whole. The click rate prediction is carried out through the trained click rate prediction model, and the prediction accuracy can be improved.
It is noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the disclosed embodiments are not limited by the described order of acts, as some steps may occur in other orders or concurrently with other steps in accordance with the disclosed embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required of the disclosed embodiments.
Referring to FIG. 4, a block diagram of an apparatus for training a model in one embodiment of the present disclosure is shown, as follows.
A sample obtaining module 401, configured to obtain sample data, where the sample data includes a low-frequency user sample and a high-frequency user sample;
a sample labeling module 402, configured to label a sample label for each sample data, where the sample label includes a click label and a hierarchical label;
the feature mapping module 403 is configured to input the input features of the sample data into an initial click rate prediction model, map the input features of the low-frequency user sample to an input feature space of the high-frequency user sample through the click rate prediction model, and output a predicted click rate and a predicted hierarchical type of each sample data;
an iterative optimization module 404, configured to iteratively optimize a model parameter of the click rate estimation model according to a difference between the click label and the estimated click rate and a difference between the layered label and the estimated layered type, so as to obtain a trained click rate estimation model.
Optionally, the click rate pre-estimation model includes an identification mapping network, a domain adaptive network, and a click rate pre-estimation network, and the feature mapping module includes:
the hierarchical identification submodule is used for inputting the input characteristics of the sample data into the identification mapping network and identifying the hierarchical type corresponding to the input characteristics through the identification mapping network;
the characteristic mapping submodule is used for keeping the input characteristics of the high-frequency user sample unchanged if the hierarchical type of the input characteristics is identified as the high-frequency user sample, and mapping the input characteristics of the low-frequency user sample to the input characteristic space of the high-frequency user sample to obtain the mapped input characteristics if the hierarchical type of the input characteristics is identified as the low-frequency user sample;
the characteristic input submodule is used for respectively inputting the sample characteristics output by the identification mapping network into the field adaptive network and the click rate estimation network, and the sample characteristics output by the identification mapping network comprise input characteristics of a high-frequency user sample and input characteristics of a low-frequency user sample after mapping;
and the probability estimation submodule is used for estimating the hierarchical type corresponding to the sample characteristics output by the identification mapping network through the field adaptive network and estimating the click rate corresponding to the sample characteristics output by the identification mapping network through the click rate estimation network.
Optionally, the feature mapping module is specifically configured to multiply the input features of the low-frequency user sample by a preset matrix to obtain mapped input features.
Optionally, the feature mapping module is specifically configured to input the input features of the low-frequency user sample into a full connection layer, and output the mapped input features through the full connection layer, where the output dimension and the input dimension of the full connection layer are the same.
Optionally, the sample acquiring module includes:
the sample collection submodule is used for acquiring sample data and a click result of the sample data corresponding to a user;
and the sample layering submodule is used for layering the sample data according to the interaction frequency of the user in a preset time period and dividing the sample data into a high-frequency user sample and a low-frequency user sample.
Optionally, the input features of the sample data comprise at least one of: user characteristics, merchant characteristics, and environmental characteristics, wherein the user characteristics include at least one of: gender, age, historical preferences of the user, the merchant characteristics including at least one of: the category, sales volume and sales volume ranking of the merchant, and the environmental characteristics comprise at least one of the following: time, geographic location, weather.
According to the embodiment of the disclosure, the user samples are layered according to the interaction frequency of the user. For a high-frequency user sample, the input characteristics of the high-frequency user sample are kept unchanged, for a low-frequency user sample, the input characteristics are mapped to the characteristic space of the high-frequency user sample through field self-adaption, and further, the training of the low-frequency user sample is more sufficient by means of the richness of the high-frequency user sample, so that the training precision is improved; and after the high-frequency user sample is sufficiently and sufficiently learned, the precision cannot be influenced. Therefore, the accuracy of the click rate estimation model is improved on the whole. In addition, the embodiment of the disclosure does not need to perform sample splitting on the layered users and respectively train the models, so that the learning effect on the low-frequency user samples is better. Moreover, the weight adjustment is not carried out on the samples in the embodiment of the disclosure, the condition that the distribution of the samples is changed artificially is avoided, and the model training effect is further improved.
Referring to fig. 5, a block diagram of a click rate estimation device in an embodiment of the disclosure is shown, which is described in detail as follows.
A feature obtaining module 501, configured to obtain an input feature of a target user;
the click rate estimation module 502 is configured to input the input characteristics of the target user into a trained click rate estimation model, and output the click probability of the target user through the click rate estimation model, where the click rate estimation model is obtained by training according to the method of the training model.
Further, the acquired input features of the target user include at least one of: user characteristics, merchant characteristics, and environmental characteristics, wherein the user characteristics include at least one of: the gender, age, historical preferences of the user, the merchant characteristics include at least one of: the category, sales and sales ranking of the merchant, and the environmental characteristics comprise at least one of the following: time, geographic location, weather.
According to the embodiment of the disclosure, in the process of training the click rate estimation model, the user samples are layered according to the interaction frequency of the user. For a high-frequency user sample, the input characteristics of the high-frequency user sample are kept unchanged, for a low-frequency user sample, the input characteristics are mapped to the characteristic space of the high-frequency user sample through field self-adaption, and further, the training of the low-frequency user sample is more sufficient by means of the richness of the high-frequency user sample, so that the training precision is improved; and after the high-frequency user sample is sufficiently and sufficiently learned, the precision cannot be influenced. Therefore, the accuracy of the click rate estimation model is improved on the whole. The click rate prediction is carried out through the trained click rate prediction model, and the prediction accuracy can be improved.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
An embodiment of the present disclosure also provides an electronic device, referring to fig. 6, including: a processor 601, a memory 602, and a computer program 6021 stored on the memory and executable on the processor, which when executed by the processor implements the method of training a model of the foregoing embodiments.
Embodiments of the present disclosure also provide a readable storage medium, in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform the method of training a model of the foregoing embodiments.
For the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. In addition, embodiments of the present disclosure are not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the embodiments of the present disclosure as described herein, and any descriptions of specific languages are provided above to disclose the best modes of the embodiments of the present disclosure.
In the description provided herein, numerous specific details are set forth. However, it is 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 in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the disclosure, various features of the embodiments of the disclosure are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that is, claimed embodiments of the disclosure require more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a 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 an embodiment of this disclosure.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
The various component embodiments of the disclosure may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It will be appreciated by those skilled in the art that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in a sequencing device according to embodiments of the present disclosure. Embodiments of the present disclosure may also be implemented as an apparatus or device program for performing a portion or all of the methods described herein. Such programs implementing embodiments of the present disclosure may be stored on a computer readable medium or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit embodiments of the disclosure, and that those skilled in the art will be able to 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 a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. Embodiments of the disclosure may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
It can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The above description is intended only to serve as a preferred embodiment of the disclosure, and should not be taken as limiting the disclosure, and any modifications, equivalents, improvements and the like that are made within the spirit and principle of the disclosed embodiments are intended to be included within the scope of the embodiments of the disclosure.
The above description is only a specific implementation of the embodiments of the present disclosure, but the scope of the embodiments of the present disclosure is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the embodiments of the present disclosure, and all the changes or substitutions should be covered by the 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 (16)
1. A method of training a model, the method comprising:
acquiring sample data, wherein the sample data comprises a low-frequency user sample and a high-frequency user sample;
labeling a sample label for each sample data, wherein the sample label comprises a click label and a layered label;
inputting the input characteristics of the sample data into an initial click rate estimation model, mapping the input characteristics of the low-frequency user sample to an input characteristic space of the high-frequency user sample through the click rate estimation model, and outputting the estimated click rate and the estimated hierarchical type of each sample data;
and iteratively optimizing model parameters of the click rate estimation model according to the difference between the click label and the estimated click rate and the difference between the layered label and the estimated layered type to obtain the trained click rate estimation model.
2. The method of claim 1, wherein the click rate prediction model comprises an identification mapping network, a domain adaptive network, and a click rate prediction network, the inputting the input features of the sample data into an initial click rate prediction model, mapping the input features of the low frequency user sample to an input feature space of the high frequency user sample through the click rate prediction model, and outputting a predicted click rate and a predicted hierarchical type of each sample data, comprises:
inputting the input features of the sample data into the identification mapping network, and identifying the hierarchical type corresponding to the input features through the identification mapping network;
if the hierarchical type of the input features is identified as a high-frequency user sample, keeping the input features of the high-frequency user sample unchanged, and if the hierarchical type of the input features is identified as a low-frequency user sample, mapping the input features of the low-frequency user sample to an input feature space of the high-frequency user sample to obtain the mapped input features;
respectively inputting the sample characteristics output by the identification mapping network into the field adaptive network and the click rate estimation network, wherein the sample characteristics output by the identification mapping network comprise the input characteristics of a high-frequency user sample and the input characteristics of a low-frequency user sample after mapping;
and predicting the hierarchical type corresponding to the sample characteristics output by the identification mapping network through the field adaptive network, and predicting the click rate corresponding to the sample characteristics output by the identification mapping network through the click rate prediction network.
3. The method of claim 1, wherein the mapping the input features of the low-frequency user samples to the input feature space of the high-frequency user samples to obtain mapped input features comprises:
and multiplying the input features of the low-frequency user sample by a preset matrix to obtain the mapped input features.
4. The method of claim 1, wherein the mapping the input features of the low-frequency user samples to the input feature space of the high-frequency user samples to obtain mapped input features comprises:
inputting the input features of the low-frequency user sample into a full connection layer, outputting the mapped input features through the full connection layer, wherein the output dimension and the input dimension of the full connection layer are the same.
5. The method of claim 1, wherein said obtaining sample data comprises:
acquiring sample data and a click result of the sample data corresponding to a user;
and layering the sample data according to the interaction frequency of the user in a preset time period, and dividing the sample data into a high-frequency user sample and a low-frequency user sample.
6. The method of any of claims 1 to 5, wherein the input features of the sample data comprise at least one of: user characteristics, merchant characteristics, and environmental characteristics, wherein the user characteristics include at least one of: gender, age, historical preferences of the user, the merchant characteristics including at least one of: the category, sales and sales ranking of the merchant, and the environmental characteristics comprise at least one of the following: time, geographic location, weather.
7. A click rate pre-estimation method is characterized by comprising the following steps:
acquiring input characteristics of a target user;
inputting the input characteristics of the target user into a trained click rate estimation model, and outputting the click probability of the target user through the click rate estimation model, wherein the click rate estimation model is obtained by training according to the method for training the model in any one of claims 1-6.
8. An apparatus for training a model, the apparatus comprising:
the system comprises a sample acquisition module, a data processing module and a data processing module, wherein the sample acquisition module is used for acquiring sample data, and the sample data comprises a low-frequency user sample and a high-frequency user sample;
the sample labeling module is used for labeling a sample label for each sample data, wherein the sample label comprises a click label and a layered label;
the characteristic mapping module is used for inputting the input characteristics of the sample data into an initial click rate estimation model, mapping the input characteristics of the low-frequency user sample to an input characteristic space of the high-frequency user sample through the click rate estimation model, and outputting the estimated click rate and the estimated hierarchical type of each sample data;
and the iterative optimization module is used for iteratively optimizing the model parameters of the click rate estimation model according to the difference between the click label and the estimated click rate and the difference between the layered label and the estimated layered type to obtain the trained click rate estimation model.
9. The apparatus of claim 8, wherein the click-through rate prediction model comprises an identification mapping network, a domain adaptive network, and a click-through rate prediction network, and the feature mapping module comprises:
the hierarchical identification submodule is used for inputting the input characteristics of the sample data into the identification mapping network and identifying the hierarchical type corresponding to the input characteristics through the identification mapping network;
the characteristic mapping submodule is used for keeping the input characteristics of the high-frequency user sample unchanged if the hierarchical type of the input characteristics is identified as the high-frequency user sample, and mapping the input characteristics of the low-frequency user sample to the input characteristic space of the high-frequency user sample to obtain the mapped input characteristics if the hierarchical type of the input characteristics is identified as the low-frequency user sample;
the characteristic input submodule is used for respectively inputting the sample characteristics output by the identification mapping network into the field adaptive network and the click rate estimation network, and the sample characteristics output by the identification mapping network comprise input characteristics of a high-frequency user sample and input characteristics of a low-frequency user sample after mapping;
and the probability estimation submodule is used for estimating the hierarchical type corresponding to the sample characteristics output by the identification mapping network through the field self-adaptive network and estimating the click rate corresponding to the sample characteristics output by the identification mapping network through the click rate estimation network.
10. The apparatus of claim 8, wherein the feature mapping module is specifically configured to multiply the input features of the low-frequency user sample by a preset matrix to obtain the mapped input features.
11. The apparatus of claim 8, wherein the feature mapping module is specifically configured 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, wherein the output dimension of the fully-connected layer is the same as the input dimension.
12. The apparatus of claim 8, wherein the sample acquisition module comprises:
the sample collection submodule is used for acquiring sample data and a click result of the sample data corresponding to a user;
and the sample layering submodule is used for layering the sample data according to the interaction frequency of the user in a preset time period and dividing the sample data into a high-frequency user sample and a low-frequency user sample.
13. The apparatus according to any of claims 8 to 12, wherein the input features of the sample data comprise at least one of: user characteristics, merchant characteristics, and environmental characteristics, wherein the user characteristics include at least one of: gender, age, historical preference of the user, the merchant characteristics including at least one of: the category, sales volume and sales volume ranking of the merchant, and the environmental characteristics comprise at least one of the following: time, geographic location, weather.
14. A click through rate estimation apparatus, comprising:
the characteristic acquisition module is used for acquiring the input characteristics of a target user;
the click rate estimation module is used for inputting the input characteristics of the target user into a trained click rate estimation model, outputting the click probability of the target user through the click rate estimation model, and the click rate estimation model is obtained by training according to the method of the training model in any one of claims 1-6.
15. An electronic device, comprising:
processor, memory and a computer program stored on the memory and executable on the processor, characterized in that the processor, when executing the program, implements a method of training a model according to any of claims 1-6.
16. A readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method of training a model of any of method claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110342815.8A CN115146773A (en) | 2021-03-30 | 2021-03-30 | Method and device for training model, electronic equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110342815.8A CN115146773A (en) | 2021-03-30 | 2021-03-30 | Method and device for training model, electronic equipment and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115146773A true CN115146773A (en) | 2022-10-04 |
Family
ID=83404557
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110342815.8A Pending CN115146773A (en) | 2021-03-30 | 2021-03-30 | Method and device for training model, electronic equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115146773A (en) |
-
2021
- 2021-03-30 CN CN202110342815.8A patent/CN115146773A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20220198289A1 (en) | Recommendation model training method, selection probability prediction method, and apparatus | |
CA2944652C (en) | Inference model for traveler classification | |
CN111723292B (en) | Recommendation method, system, electronic equipment and storage medium based on graph neural network | |
US20190303980A1 (en) | Training and utilizing multi-phase learning models to provide digital content to client devices in a real-time digital bidding environment | |
CN111859149A (en) | Information recommendation method and device, electronic equipment and storage medium | |
US20220284067A1 (en) | Method for pushing information, electronic device | |
US20170076299A1 (en) | Extracting relevant features from electronic marketing data for training analytical models | |
WO2024041483A1 (en) | Recommendation method and related device | |
CN113469752A (en) | Content recommendation method and device, storage medium and electronic equipment | |
CN111814050A (en) | Tourism scene reinforcement learning simulation environment construction method, system, equipment and medium | |
CN111445280A (en) | Model generation method, restaurant ranking method, system, device and medium | |
CN112989174A (en) | Information recommendation method and device, medium and equipment | |
CN112269943B (en) | Information recommendation system and method | |
CN111507471B (en) | Model training method, device, equipment and storage medium | |
CN116910357A (en) | Data processing method and related device | |
CN117057855A (en) | Data processing method and related device | |
CN116975426A (en) | Service data processing method, device, equipment and medium | |
JP5588938B2 (en) | Item recommendation apparatus, method and program | |
CN114298118B (en) | Data processing method based on deep learning, related equipment and storage medium | |
CN115146773A (en) | Method and device for training model, electronic equipment and readable storage medium | |
CN111191142B (en) | Electronic resource recommendation method and device and readable medium | |
CN114912009A (en) | User portrait generation method, device, electronic equipment and computer program medium | |
CN113641900A (en) | Information recommendation method and device | |
CN111767497B (en) | Method and device for processing information | |
CN114417944B (en) | Recognition model training method and device, and user abnormal behavior recognition method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |