A model training method, user portrait generation method, device and equipment
By training the label prediction model and optimizing, the problem of missing tags in user portrait generation is solved, and the accurate completion of user labels and improvement of user portraits is achieved.
Patent Information
- Application Number
- CN202110862719.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-29
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2041-07-29
AI Technical Summary
The prior art cannot adapt to data changes during the user portrait generation process, resulting in some users missing tags, which in turn interferes with the generation and utilization of user portraits in the subsequent process.
By obtaining sample feature data and sample label data of sample users, complete and missing label data are selected, the label prediction model is trained, the label prediction is used to make label prediction using perturbation feature data, and the model is optimized based on the loss function to complete the missing labels.
It realizes accurate completion of user tags, improves the accuracy of user portraits, and reduces the time and resource consumption of manual judgment.
Smart Images

Figure CN113569955B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of artificial intelligence technology, and in particular to a model training method, a user portrait generation method, a device and equipment. Background Art
[0002] With the development of artificial intelligence technology in recent years, more and more functions can be realized based on the corresponding artificial intelligence models, thereby helping users to process business, improve work processing results, and enhance business processing efficiency. Among them, the corresponding information of the user can be obtained and the user profile can be realized based on this information. Specifically, the user profile can contain various user tags, so that these user tags can be used for identification and classification, and in the subsequent business processing stage, the user profile can be used to realize business recommendations, business auxiliary processing and other operations.
[0003] At present, when creating user portraits, different user labels are generally generated based on the user's characteristic data through the corresponding model. However, as the complexity of user data increases, the model cannot adapt to the changes in data, so when determining user labels based on the current model, some users will have missing labels, that is, the model cannot determine the user's compliance with all preset labels based on the current data and judgment rules, which in turn interferes with the generation and use of user portraits in the subsequent process.
[0004] In the case of missing labels, when the current model cannot determine the corresponding labels based on the data, the missing data can only be fed back to the management staff for manual judgment. In the case of large amounts of data, it will consume a lot of time and resources, seriously affecting the development of the corresponding business. Therefore, there is an urgent need for a method that can accurately and effectively complete user labels. Summary of the invention
[0005] The purpose of the embodiments of this specification is to provide a model training method, a user portrait generation method, an apparatus and a device to solve the problem of how to supplement missing user labels to improve the accuracy of user portraits.
[0006] To solve the above technical problems, an embodiment of the present specification provides a model training method, including: obtaining sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the features of the sample user; the sample label data is used to label at least one preset label type; screening complete label data corresponding to a first sample user and missing label data corresponding to a second sample user from the sample label data; the complete label data includes data labeled for all preset label types; training a label prediction model using the complete label data and sample feature data of the first sample user; perturbing the sample feature data to obtain first perturbed feature data corresponding to the first sample user and second perturbed feature data corresponding to the second sample user; using the label prediction model to respectively determine a first predicted label corresponding to the first perturbed feature data and a second predicted label corresponding to the second perturbated feature data; constructing a loss function based on the first predicted label, the second predicted label and the sample label data; and optimizing the label prediction model based on the loss function.
[0007] The embodiment of the present specification also proposes a model training device, including: a data acquisition module, used to acquire sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the features of the sample user; the sample label data is used to label at least one preset label type; a data screening module, used to screen the complete label data corresponding to the first sample user and the missing label data corresponding to the second sample user from the sample label data; the complete label data includes data labeled for all preset label types; a label prediction model training module, used to train the label prediction model using the complete label data and sample feature data of the first sample user; a data perturbation module, used to perturb the sample feature data to obtain first perturbation feature data corresponding to the first sample user and second perturbation feature data corresponding to the second sample user; a label determination module, used to use the label prediction model to respectively determine a first predicted label corresponding to the first perturbation feature data and a second predicted label corresponding to the second perturbation feature data; a loss function construction module, used to construct a loss function based on the first predicted label, the second predicted label and the sample label data; a label prediction model optimization module, used to optimize the label prediction model based on the loss function.
[0008] The embodiment of this specification also proposes a model training device, including a memory and a processor; the memory is used to store computer program instructions; the processor is used to execute the computer program instructions to implement the following steps: obtaining sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the features of the sample user; the sample label data is used to label at least one preset label type; screening complete label data corresponding to the first sample user and missing label data corresponding to the second sample user from the sample label data; the complete label data includes data labeled for all preset label types; training a label prediction model using the complete label data and sample feature data of the first sample user; perturbing the sample feature data to obtain first perturbation feature data corresponding to the first sample user and second perturbation feature data corresponding to the second sample user; using the label prediction model to respectively determine a first predicted label corresponding to the first perturbation feature data and a second predicted label corresponding to the second perturbation feature data; constructing a loss function based on the first predicted label, the second predicted label and the sample label data; and optimizing the label prediction model based on the loss function.
[0009] In order to solve the above technical problems, the embodiments of this specification also propose a user portrait generation method, including: obtaining target feature data and target label data of the target user; the target label data corresponds to at least one target label type; determining the missing label type based on the target label data; the missing label type includes the type that the target label type lacks compared to the preset label type; inputting the target feature data and the target label data into a label prediction model to obtain a predicted label; the predicted label includes a label corresponding to the missing label type; the label prediction model is obtained in the following manner: obtaining sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the characteristics of the sample user; the sample label data is used to annotate at least one preset label type; screening the sample label data corresponding to the first Complete label data of a sample user and missing label data corresponding to a second sample user; the complete label data includes data annotated for all preset label types; a label prediction model is trained using the complete label data and sample feature data of the first sample user; the sample feature data is perturbed to obtain first perturbation feature data corresponding to the first sample user and second perturbation feature data corresponding to the second sample user; a first predicted label corresponding to the first perturbation feature data and a second predicted label corresponding to the second perturbation feature data are respectively determined using the label prediction model; a loss function is constructed based on the first predicted label, the second predicted label and the sample label data; the label prediction model is optimized based on the loss function; a target user portrait is constructed based on the predicted label; the target user portrait is used to describe the type of the target user.
[0010] The embodiment of the present specification also proposes a user portrait generation device, including: a data acquisition module, used to acquire target feature data and target label data of a target user; the target label data corresponds to at least one target label type; a missing label type determination module, used to determine the missing label type based on the target label data; the missing label type includes the type that the target label type lacks compared to the preset label type; a predicted label acquisition module, used to input the target feature data and the target label data into a label prediction model to obtain a predicted label; the predicted label includes a label corresponding to the missing label type; the label prediction model is obtained in the following manner: acquiring sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the characteristics of the sample user; the sample label data is used to annotate at least one preset label type; screening from the sample label data Select complete label data corresponding to the first sample user and missing label data corresponding to the second sample user; the complete label data includes data annotated for all preset label types; use the complete label data and sample feature data of the first sample user to train a label prediction model; perturb the sample feature data to obtain first perturbation feature data corresponding to the first sample user and second perturbation feature data corresponding to the second sample user; use the label prediction model to respectively determine a first predicted label corresponding to the first perturbation feature data and a second predicted label corresponding to the second perturbation feature data; construct a loss function based on the first predicted label, the second predicted label and the sample label data; optimize the label prediction model based on the loss function; a target user portrait construction module is used to construct a target user portrait based on the predicted label; the target user portrait is used to describe the type of the target user.
[0011] The embodiment of this specification also proposes a user portrait generation device, including a memory and a processor; the memory is used to store computer program instructions; the processor is used to execute the computer program instructions to implement the following steps: obtaining target feature data and target label data of a target user; the target label data corresponds to at least one target label type; determining a missing label type based on the target label data; the missing label type includes a type that the target label type lacks compared to a preset label type; inputting the target feature data and the target label data into a label prediction model to obtain a predicted label; the predicted label includes a label corresponding to the missing label type; the label prediction model is obtained in the following manner: obtaining sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the characteristics of the sample user; the sample label data is used to predict at least one preset label type Labeling; screening complete label data corresponding to the first sample user and missing label data corresponding to the second sample user from the sample label data; the complete label data includes data labeled for all preset label types; training a label prediction model using the complete label data and sample feature data of the first sample user; perturbing the sample feature data to obtain first perturbed feature data corresponding to the first sample user and second perturbed feature data corresponding to the second sample user; using the label prediction model to respectively determine a first predicted label corresponding to the first perturbed feature data and a second predicted label corresponding to the second perturbated feature data; constructing a loss function based on the first predicted label, the second predicted label and the sample label data; optimizing the label prediction model based on the loss function; constructing a target user portrait based on the predicted label; the target user portrait is used to describe the type of the target user.
[0012] It can be seen from the technical solutions provided by the above embodiments of this specification that the embodiments of this specification obtain sample feature data and sample label data of sample users, and train the label prediction model after filtering out the complete label data, and then perturb the feature data, use the label prediction model to predict the labels of the perturbed feature data, and after building a loss function based on the predicted labels and the original sample label data, optimize the label prediction model based on the loss function, and then use the label prediction model to complete the missing labels, so as to use the completed label data to create user portraits. Through the above method, the training and optimization of the corresponding model are realized for the case of missing user label data, which ensures the completion of user labels and improves the accuracy of user portraits. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0014] Figure 1 This is a flow chart of a model training method according to an embodiment of this specification;
[0015] Figure 2 A schematic diagram of a semi-supervised learning process according to an embodiment of this specification;
[0016] Figure 3 A schematic diagram of a model application scenario of an embodiment of this specification;
[0017] Figure 4 This is a flow chart of a method for generating a user portrait according to an embodiment of this specification;
[0018] Figure 5 This is a module diagram of a model training device according to an embodiment of this specification;
[0019] Figure 6 This is a module diagram of a user portrait generation device according to an embodiment of this specification;
[0020] Figure 7 This is a structural diagram of a model training device according to an embodiment of this specification;
[0021] Figure 8 This is a structural diagram of a user portrait generation device according to an embodiment of this specification. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0023] In order to solve the above technical problems, a model training method is introduced in the embodiment of this specification. The execution subject of the model training method is a model training device, which includes but is not limited to a server, an industrial computer, a PC, etc. Figure 1 As shown, the model training method may include the following specific implementation steps.
[0024] S110: Acquire sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the features of the sample user; the sample label data is used to mark at least one preset label type.
[0025] The sample user may be a user who has certain sample data to train the model. For example, the sample user may be a user who has a record in the corresponding data system, so that the corresponding data of the user can be called to implement the training of the model in the subsequent steps.
[0026] The sample characteristic data may be data used to describe the characteristics of a user, such as user identity information, business processing records, user evaluation information, and other characteristic data. In actual applications, other types of data may also be set as the sample characteristic data.
[0027] In some implementations, in order to facilitate the use of the sample feature data, the sample feature data may be converted into a feature vector, that is, each feature vector is constructed for different feature data to obtain a corresponding feature vector. Specifically, suppose the feature vector x of each customer is i =[x i,1 ,…,x i,N ], i = 1, ..., M, the total customer feature matrix X∈R M*N .
[0028] The sample label data is data used to label the type of user in the form of a label. In the embodiment of the present specification, at least one preset label type may be pre-set, and the preset label type is used to determine different labels. Accordingly, the sample label data can be used to identify whether these preset label types are all met. For example, in the case where the preset label types include A label and B label, the sample label data can be marked as "yes" for A label and "no" for B label to achieve labeling of the user.
[0029] In some real-time methods, the sample label data may also be in the form of a vector. Specifically, each customer label vector y i ={y i,1 ,…,y i,D}. All customer label matrix Y∈R M*D When a customer has a tag d, y i,d =1, otherwise y i,d = 0, if the label is missing, then y i,d = null. The null label is the label that needs to be generated later.
[0030] Preferably, in order to facilitate calculations in subsequent processes, the lengths of the feature vector and the label vector may be fixed values.
[0031] S120: Filtering complete label data corresponding to the first sample user and missing label data corresponding to the second sample user from the sample label data; the complete label data includes data annotated with respect to all preset label types.
[0032] Since the technical purpose of the embodiments of this specification is to supplement the missing labels, there are some missing labels in the sample label data of some sample users, that is, not all preset label types are marked.
[0033] Therefore, in this step, complete label data and missing label data can be screened out from the sample label data by the integrity of the label data. Complete label data can be data that is labeled for all preset label types, and missing label data is data that is labeled for only some preset label types, and other preset label types are missing.
[0034] In some implementations, while screening the first sample users and the second sample users, the sample users may also be clustered to obtain at least one user cluster. The data of the users in the user cluster may be relatively similar, that is, these users belong to the same type of users.
[0035] The specific clustering method can be implemented through a corresponding clustering model, and the clustering model can be set based on the needs of actual applications, which will not be described in detail here.
[0036] After determining the user clusters, the mean and standard deviation of the sample feature data of each user cluster can be calculated respectively, and the Bernoulli distribution of the sample label data of each user cluster can also be calculated. The purpose of Bernoulli distribution is to obtain the probability distribution of customer labels in different clusters. The specific calculation process is set according to the actual application and will not be repeated here.
[0037] Based on the above implementation, preferably, before clustering to obtain user clustering clusters, the user information of the sample users can also be sent to the administrator terminal, and the administrator classifies these sample users based on certain classification rules to obtain corresponding user groups. These user groups are used to describe the approximate classification of sample users. Accordingly, in subsequent steps, clustering is performed for each user group to obtain at least one user clustering cluster. Through the pre-classification of the administrator, clustering can be performed faster, more conveniently and effectively in this step, reducing the consumption of time and computing resources, which is conducive to the implementation of the program.
[0038] S130: Train a label prediction model using the complete label data and sample feature data of the first sample user.
[0039] After the first sample user is screened, the complete label data and sample feature data of the first sample user can be used to train the label prediction model. The label prediction model is used to predict the corresponding label based on the user's feature data and label data to complete the label completion, or directly realize the user's judgment result for all preset label types. The specific structure and parameters of the label prediction model can be set based on the needs of the actual application, which will not be repeated here.
[0040] Specifically, the data input to the model can be set as customer feature X l ∈R M*N , the target variable for training is Y l ∈R M *D , the model is P supervised .
[0041] S140: perturbing the sample feature data to obtain first perturbed feature data corresponding to the first sample user and second perturbed feature data corresponding to the second sample user.
[0042] Since only the data of the first sample user is used in step S130, and the proportion of the first sample user to all users may not be large, the amount of complete label data and sample feature data corresponding to the first sample user is small, and the model trained based on these data may lack a certain degree of accuracy. Therefore, the data corresponding to the second sample user needs to be used in model training.
[0043] Specifically, in order to utilize the data of the second sample user, the sample feature data of the first sample user and the second sample user may be disturbed respectively to obtain first disturbed feature data and second disturbed feature data.
[0044] In some embodiments, the perturbation may be to randomly perturb each feature data using a normal distribution. After determining the user clusters and the mean and standard deviation of the sample feature data in each user cluster, the sample feature data is perturbed based on the mean and standard deviation of the sample feature data of each user cluster.
[0045] Specifically, the perturbation value is constructed as In the formula, is the disturbance value, i is the identifier of the sample user, j is the identifier of a single feature in the feature data, is the mean of sample feature data j, is the standard deviation of sample feature data j. Then use the formula Obtain the first disturbance characteristic data and the second disturbance characteristic data, where, is the first disturbance characteristic data or the second disturbance characteristic data, is the feature data j of sample user i, j=1,…,N.
[0046] In practical applications, other suitable methods may be used to achieve disturbance of feature data, which are not limited to the above examples and will not be described in detail here.
[0047] S150: Determine a first predicted label corresponding to the first disturbance feature data and a second predicted label corresponding to the second disturbance feature data by using a label prediction model.
[0048] Since the label prediction model is trained using the data of the first sample user, the label prediction model can already use the feature data to predict the corresponding label without considering the accuracy, therefore, the first disturbance feature data and the second disturbance feature data can be input into the label prediction model to obtain the corresponding first predicted label and the second predicted label respectively. The specific calculation process is not repeated here.
[0049] S160: Constructing a loss function based on the first predicted label, the second predicted label and the sample label data.
[0050] After obtaining the first prediction label and the second prediction label, the loss function can be constructed in combination with the original sample label data. The loss function is used to evaluate the error of the label prediction model, so as to correct and optimize the label prediction model and thus improve the accuracy of the model.
[0051] In some embodiments, due to the presence of missing label data in the sample label data, in order to prevent the missing labels from affecting the construction of the loss function in this step, when the Bernoulli distribution of the missing label data is calculated in the aforementioned step, the Bernoulli distribution of the missing label data can be used to fill in the missing preset label types of the second sample user, and then a loss function is constructed based on the filled sample label data and the first predicted label and the second predicted label to improve the accuracy of the calculation results.
[0052] In some implementations, before constructing the loss function, the label prediction model may be subjected to dropout processing to obtain an adjusted prediction model. The dropout processing is mainly aimed at the generalization ability of the model to increase the robustness of the model. Afterwards, the sample feature data of the second sample user may be input into the adjusted prediction model to obtain an adjusted prediction label, and then a weighted average is calculated for the sample label data and the prediction label to obtain a comprehensive prediction label, and finally the loss function is constructed by combining the comprehensive prediction label and the second prediction label.
[0053] Based on the above implementation, when constructing a loss function, the comprehensive prediction label and the second prediction label can be combined to construct a label loss function, and then a feature loss function can be constructed based on the sample feature data and the perturbation feature data, and finally a loss function can be constructed based on the label loss function and the feature loss function.
[0054] Combined with Figure 2 , using a specific example to illustrate. Let the dropout strategy be dropout_1. Let the neural network structure of the model be dnn_1, and the output prediction result be Loss l Using cross entropy, we can l and Find the cross entropy. For the customer data set with incomplete labels, X u ∈R M*N , Y u ∈R M*D , and similarly for each corresponding i=1,…,M u , use normal distribution to randomly perturb each of its feature variables. The μ of normal distribution is the mean of each feature variable in each cluster, and σ is the standard deviation of each feature variable in each cluster. Let the perturbation value be j=1,…,N. That is, we get Likewise, for each corresponding i=1,…,M u ,if If there is a value, that is, the label is not missing, then keep the original value; if If is null, the Bernoulli distribution calculated in the previous step is used to randomly generate its value, and we get
[0055] After the disturbance As input data, based on P supervised Input data for retraining. Here P supervised During the retraining process, the neural network structure is subjected to dropout processing, and the dropout strategy is set to dropout_2. The neural network structure of the model is set to dnn_2, and the output prediction result is Will and Taking the weighted average, we get α is a hyperparameter. As input data, it is input into the dnn_1 structure in the previous step, and the output prediction result is Loss u Using MSE, and Find MSE. The loss function of the final goal solution is is a hyperparameter.
[0056] S170: Optimizing the label prediction model based on the loss function.
[0057] After obtaining the loss function, since the loss function realizes the evaluation of the prediction effect of the label prediction model, the prediction of the label prediction model can be realized in combination with the loss function. Specifically, the model optimization can be realized by combining methods such as gradient descent method. In practical applications, the specific optimization process can be set according to the corresponding needs, which will not be repeated here.
[0058] The following is combined with Figure 3 Let’s use a specific scenario example to illustrate. Figure 3 As shown, it is divided into a customer portrait model training device and a customer portrait generation device. In the customer portrait model training device, after clustering customer labels, supervised learning is performed using customer portrait labels, and then unsupervised learning is performed in combination with missing label data. Afterwards, after the existing customer portrait is generated by the original model, the trained customer portrait model is used to complete the portrait and complete the online customer portrait generation, thereby accurately and effectively realizing customer portraits, which is conducive to combining customer portraits in subsequent steps to realize business recommendations, business processing, etc.
[0059] Based on the introduction of the above embodiments and scenario examples, it can be seen that the above method obtains sample feature data and sample label data of sample users, and trains the label prediction model after filtering out the complete label data, and then perturbs the feature data, uses the label prediction model to predict labels for the perturbed feature data, and after building a loss function based on the predicted labels and the original sample label data, optimizes the label prediction model based on the loss function, and then can use the label prediction model to complete the missing labels, so as to use the completed label data to create user portraits. Through the above method, the training and optimization of the corresponding model are realized for the case of missing user label data, which ensures the completion of user labels, thereby improving the accuracy of user portraits.
[0060] based on Figure 1 The corresponding model training method introduces a user portrait generation method in the embodiment of this specification. The execution subject of the user portrait generation method is a user portrait generation device, and the user portrait generation device includes but is not limited to a server, an industrial computer, a PC, etc. The user portrait generation device can be the same device as the model training device, or it can be a different device. Figure 4 As shown, the model user portrait generation method may include the following specific implementation steps.
[0061] S410: Acquire target feature data and target tag data of a target user; the target tag data corresponds to at least one target tag type.
[0062] The target user may be a user who needs to complete the tag. Before executing step S410, the target tag data may be output based on other methods, such as a pre-set tag judgment model, combined with the target feature data of the target user. There are missing types in the target tag data corresponding to all the preset tag types, which need to be completed in subsequent steps.
[0063] In some embodiments, the sample data including the target feature data and the target label data may also be used to train the label prediction model, thereby further improving the accuracy of the label prediction model through repeated training of these data.
[0064] S420: Determine a missing tag type based on the target tag data; the missing tag type includes a type that is missing from the target tag type compared to a preset tag type.
[0065] After obtaining the target tag data, the target tag data can be compared with the preset tag type to determine the type that the target tag type lacks compared to the preset tag type as the missing tag type. In subsequent steps, the tag prediction model can be used to predict the tag corresponding to the missing tag type.
[0066] S430: Input the target feature data and the target label data into the label prediction model to obtain a predicted label; the predicted label includes a label corresponding to the missing label type; the label prediction model is obtained in the following manner: obtain sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the features of the sample user; the sample label data is used to label at least one preset label type; screen the complete label data corresponding to the first sample user and the missing label data corresponding to the second sample user from the sample label data; the complete label data includes data labeled for all preset label types; train the label prediction model using the complete label data and sample feature data of the first sample user; perturb the sample feature data to obtain first perturbation feature data corresponding to the first sample user and second perturbation feature data corresponding to the second sample user; use the label prediction model to respectively determine a first predicted label corresponding to the first perturbation feature data and a second predicted label corresponding to the second perturbation feature data; construct a loss function based on the first predicted label, the second predicted label and the sample label data; optimize the label prediction model based on the loss function.
[0067] After the target feature data and the target label data are input into the label prediction model, the model can determine the predicted label of the corresponding real label type based on the target feature data and the target label data. The specific training process of the above label prediction model can refer to Figure 1 The introduction in the corresponding embodiments will not be repeated here.
[0068] S440: Construct a target user portrait based on the predicted label; the target user portrait is used to describe the type of the target user.
[0069] After obtaining the predicted tag, the predicted tag can be combined with the original target tag data to complete the construction of the target user portrait of the target user. Since the target user portrait is used to describe the type of the target user, the user portrait can be constructed in combination with the obtained tag, thereby accurately describing the type of the target user. The specific process of using tags to build a portrait can be set based on the actual application situation, which will not be repeated here.
[0070] In some embodiments, when constructing a target user portrait, the target feature data may be compared with each preset user cluster, which is often a user of the same type. Based on the comparison result, the cluster closest to the target user may be determined as the target user cluster. Since the target user is relatively similar to the users in the cluster, the target user portrait may be constructed in combination with the corresponding tags and features of the users in the target cluster, thereby further improving the accuracy of the target user portrait.
[0071] based on Figure 1 The corresponding model training method introduces a model training device in the embodiment of this specification. The model training device is set in the model training equipment. Figure 5 As shown, the model training device includes the following modules.
[0072] The data acquisition module 510 is used to acquire sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the features of the sample user; and the sample label data is used to mark at least one preset label type.
[0073] The data screening module 520 is used to screen the complete label data corresponding to the first sample user and the missing label data corresponding to the second sample user from the sample label data; the complete label data includes data annotated for all preset label types.
[0074] The label prediction model training module 530 is used to train the label prediction model using the complete label data and sample feature data of the first sample user.
[0075] The data perturbation module 540 is used to perturb the sample feature data to obtain first perturbed feature data corresponding to the first sample user and second perturbed feature data corresponding to the second sample user.
[0076] The label determination module 550 is used to determine a first predicted label corresponding to the first disturbance feature data and a second predicted label corresponding to the second disturbance feature data by using a label prediction model.
[0077] The loss function construction module 560 is used to construct a loss function based on the first predicted label, the second predicted label and the sample label data.
[0078] The label prediction model optimization module 570 is used to optimize the label prediction model based on the loss function.
[0079] based on Figure 4 The corresponding user portrait generation method introduces a user portrait generation device in the embodiment of this specification. The user portrait generation device is set in the user portrait generation device. Figure 6 As shown, the user portrait generating device includes the following modules.
[0080] The data acquisition module 610 is used to acquire target feature data and target tag data of a target user; the target tag data corresponds to at least one target tag type.
[0081] The missing tag type determination module 620 is used to determine the missing tag type based on the target tag data; the missing tag type includes the type that the target tag type lacks compared to the preset tag type.
[0082] The predicted label acquisition module 630 is used to input the target feature data and the target label data into the label prediction model to obtain the predicted label; the predicted label includes the label corresponding to the missing label type; the label prediction model is obtained in the following manner: obtaining sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the characteristics of the sample user; the sample label data is used to label at least one preset label type; the complete label data corresponding to the first sample user and the missing label data corresponding to the second sample user are screened from the sample label data; the complete label data includes data labeled for all preset label types; the label prediction model is trained using the complete label data and sample feature data of the first sample user; the sample feature data is perturbed to obtain the first perturbation feature data corresponding to the first sample user and the second perturbation feature data corresponding to the second sample user; the first predicted label corresponding to the first perturbation feature data and the second predicted label corresponding to the second perturbation feature data are respectively determined using the label prediction model; a loss function is constructed based on the first predicted label, the second predicted label and the sample label data; and the label prediction model is optimized based on the loss function.
[0083] The target user portrait construction module 640 is used to construct a target user portrait based on the predicted label; the target user portrait is used to describe the type of the target user.
[0084] based on Figure 1 Corresponding to the model training method, this specification embodiment provides a model training device. Figure 7 As shown, the model training device may include a memory and a processor.
[0085] In this embodiment, the memory may be implemented in any appropriate manner. For example, the memory may be a read-only memory, a mechanical hard disk, a solid-state hard disk, or a USB flash drive, etc. The memory may be used to store computer program instructions.
[0086] In this embodiment, the processor may be implemented in any suitable manner. For example, the processor may take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, etc. The processor can execute the computer program instructions to implement the following steps: obtaining sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the features of the sample user; the sample label data is used to label at least one preset label type; screening complete label data corresponding to the first sample user and missing label data corresponding to the second sample user from the sample label data; the complete label data includes data labeled for all preset label types; training a label prediction model using the complete label data and sample feature data of the first sample user; perturbing the sample feature data to obtain first perturbation feature data corresponding to the first sample user and second perturbation feature data corresponding to the second sample user; using the label prediction model to respectively determine a first predicted label corresponding to the first perturbation feature data and a second predicted label corresponding to the second perturbation feature data; constructing a loss function based on the first predicted label, the second predicted label and the sample label data; and optimizing the label prediction model based on the loss function.
[0087] based on Figure 4 Corresponding to the user portrait generation method, this specification embodiment provides a user portrait generation device. Figure 8 As shown, the user portrait generating device may include a memory and a processor.
[0088] In this embodiment, the memory may be implemented in any appropriate manner. For example, the memory may be a read-only memory, a mechanical hard disk, a solid-state hard disk, or a USB flash drive, etc. The memory may be used to store computer program instructions.
[0089] In this embodiment, the processor can be implemented in any appropriate manner. For example, the processor can take the form of a computer-readable medium, such as a microprocessor or a processor and a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, etc. The processor can execute the computer program instructions to implement the following steps: obtain the target feature data and target label data of the target user; the target label data corresponds to at least one target label type; determine the missing label type based on the target label data; the missing label type includes the type that the target label type lacks compared to the preset label type; input the target feature data and the target label data into the label prediction model to obtain a predicted label; the predicted label includes a label corresponding to the missing label type; the label prediction model is obtained in the following manner: obtain sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the characteristics of the sample user; the sample label data is used to mark at least one preset label type; filter the sample label data corresponding to the first sample user complete label data corresponding to the first sample user and missing label data corresponding to the second sample user; the complete label data includes data annotated for all preset label types; a label prediction model is trained using the complete label data and sample feature data of the first sample user; the sample feature data is perturbed to obtain first perturbation feature data corresponding to the first sample user and second perturbation feature data corresponding to the second sample user; a first predicted label corresponding to the first perturbation feature data and a second predicted label corresponding to the second perturbation feature data are respectively determined using the label prediction model; a loss function is constructed based on the first predicted label, the second predicted label and the sample label data; the label prediction model is optimized based on the loss function; a target user portrait is constructed based on the predicted label; the target user portrait is used to describe the type of the target user.
[0090] It should be noted that the above-mentioned model training method, user portrait generation method, device and equipment can be applied to the field of artificial intelligence technology, and can also be applied to other technical fields except the field of artificial intelligence technology, without any limitation.
[0091] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0092] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0093] It can be known from the above description of the implementation mode that the technicians in this field can clearly understand that the present specification can be implemented by means of software plus the necessary first hardware platform. Based on such an understanding, the technical solution of the present specification can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present specification or some parts of the embodiments.
[0094] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0095] This specification can be used in many first or special computer system environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.
[0096] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0097] Although the present specification is described through embodiments, those skilled in the art will appreciate that there are many modifications and changes to the present specification without departing from the spirit of the present specification, and it is intended that the appended claims include these modifications and changes without departing from the spirit of the present specification.
Claims
1. A model training method, characterized in that: include: Acquire sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the features of the sample user; the sample label data is used to mark at least one preset label type, and the sample label data is used to identify whether the type of the user conforms to the at least one preset label type; Filtering complete label data corresponding to the first sample user and missing label data corresponding to the second sample user from the sample label data; the complete label data includes data annotated for all preset label types; Training a label prediction model using the complete label data and sample feature data of the first sample user; Perturbing the sample feature data to obtain first perturbed feature data corresponding to the first sample user and second perturbed feature data corresponding to the second sample user; Determine a first predicted label corresponding to the first disturbance feature data and a second predicted label corresponding to the second disturbance feature data respectively by using a label prediction model; Constructing a loss function based on the first predicted label, the second predicted label and the sample label data; Optimizing the label prediction model based on the loss function Before using the complete label data and sample feature data of the first sample user to train the label prediction model, the method also includes: clustering the sample users to obtain at least one user clustering cluster, and calculating the mean and standard deviation of the sample feature data of each user clustering cluster respectively; perturbing the sample feature data to obtain first perturbed feature data corresponding to the first sample user and second perturbed feature data corresponding to the second sample user, including: perturbing the sample feature data based on the mean and standard deviation of the sample feature data of each user clustering cluster, to obtain first perturbed feature data corresponding to the first sample user and second perturbed feature data corresponding to the second sample user.
2. The method according to claim 1, characterized in that The perturbing the sample feature data based on the mean and standard deviation of the sample feature data of each user cluster to obtain first perturbed feature data corresponding to the first sample user and second perturbed feature data corresponding to the second sample user includes: Construct the perturbation value as In the formula, is the disturbance value, i is the identifier of the sample user, j is the identifier of a single feature in the feature data, is the mean of sample feature data j, is the standard deviation of sample feature data j; Using the formula Obtain the first disturbance characteristic data and the second disturbance characteristic data, where, is the first disturbance characteristic data or the second disturbance characteristic data, is the feature data j of sample user i, j=1,Λ,N.
3. The method according to claim 1, characterized in that Before clustering the sample users to obtain at least one user cluster, the method further includes: Sending the user information of the sample user to the administrator terminal; Receive user groups fed back by management terminal; the user groups are used to describe the classification of sample users; Accordingly, clustering the sample users to obtain at least one user cluster includes: Clustering is performed on each user group to obtain at least one user cluster.
4. The method according to claim 1, characterized in that The constructing a loss function based on the first predicted label, the second predicted label and the sample label data includes: Calculate the Bernoulli distribution of the missing label data; Completing the missing preset label types of the second sample user by using the Bernoulli distribution of the missing label data; A loss function is constructed based on the padded sample label data, the first predicted label, and the second predicted label.
5. The method according to claim 1, characterized in that The constructing a loss function based on the first predicted label, the second predicted label and the sample label data includes: Perform dropout processing on the label prediction model to obtain an adjusted prediction model; Inputting the sample feature data of the second sample user into the adjustment prediction model to obtain an adjustment prediction label; Calculate a weighted average of the sample label data and the predicted label to obtain a comprehensive predicted label; A loss function is constructed by combining the comprehensive prediction label and the second prediction label.
6. The method according to claim 5, characterized in that The step of constructing a loss function by combining the comprehensive prediction label and the second prediction label includes: Constructing a label loss function by combining the comprehensive prediction label and the second prediction label; Construct a feature loss function based on sample feature data and perturbation feature data; A loss function is constructed based on the label loss function and the feature loss function.
7. A model training device, characterized in that: include: A data acquisition module, used to acquire sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the features of the sample user; the sample label data is used to mark at least one preset label type, and the sample label data is used to identify whether the type of the user conforms to the at least one preset label type; A clustering module, used to cluster the sample users to obtain at least one user clustering cluster, and calculate the mean and standard deviation of the sample feature data of each user clustering cluster; A data screening module, used to screen the complete label data corresponding to the first sample user and the missing label data corresponding to the second sample user from the sample label data; the complete label data includes data annotated for all preset label types; A label prediction model training module, used to train a label prediction model using the complete label data and sample feature data of the first sample user; A data perturbation module, used for perturbing the sample feature data to obtain first perturbation feature data corresponding to the first sample user and second perturbation feature data corresponding to the second sample user; the perturbation of the sample feature data to obtain the first perturbation feature data corresponding to the first sample user and the second perturbation feature data corresponding to the second sample user comprises: perturbing the sample feature data based on the mean and standard deviation of the sample feature data of each user clustering cluster to obtain the first perturbation feature data corresponding to the first sample user and the second perturbation feature data corresponding to the second sample user; A label determination module, used to determine a first predicted label corresponding to the first disturbance feature data and a second predicted label corresponding to the second disturbance feature data respectively by using a label prediction model; A loss function construction module, used to construct a loss function based on the first predicted label, the second predicted label and the sample label data; The label prediction model optimization module is used to optimize the label prediction model based on the loss function.
8. A model training device comprising a memory and a processor; The memory is used to store computer program instructions; The processor is used to execute the computer program instructions to implement the following steps: obtaining sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the features of the sample user; the sample label data is used to label at least one preset label type, and the sample label data is used to identify whether the type of the user conforms to the at least one preset label type; screening the complete label data corresponding to the first sample user and the missing label data corresponding to the second sample user from the sample label data; the complete label data includes data labeled for all preset label types; training the label prediction model using the complete label data and sample feature data of the first sample user; perturbing the sample feature data to obtain first perturbation feature data corresponding to the first sample user and second perturbation feature data corresponding to the second sample user; using the label prediction model to respectively determine a first predicted label corresponding to the first perturbation feature data and a second predicted label corresponding to the second perturbation feature data; constructing a loss function based on the first predicted label, the second predicted label and the sample label data; optimizing the label prediction model based on the loss function; Before the complete label data and sample feature data of the first sample user are used to train the label prediction model, the processor further clusters the sample users to obtain at least one user clustering cluster, and respectively calculates the mean and standard deviation of the sample feature data of each user clustering cluster; the perturbing the sample feature data to obtain first perturbed feature data corresponding to the first sample user and second perturbed feature data corresponding to the second sample user includes: The sample feature data is perturbed based on the mean and standard deviation of the sample feature data of each user cluster, to obtain first perturbed feature data corresponding to the first sample user and second perturbed feature data corresponding to the second sample user.
9. A method for generating a user portrait, characterized in that: include: Obtain target feature data and target label data of target users; The target tag data corresponds to at least one target tag type; Determine the missing label type based on the target label data; The missing tag type includes the type that the target tag type lacks compared to the preset tag type; Input the target feature data and the target label data into the label prediction model to obtain the predicted label; the predicted label includes the label corresponding to the missing label type; the label prediction model is obtained in the following manner: obtain sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the features of the sample user; the sample label data is used to mark at least one preset label type, and the sample label data is used to identify whether the user type conforms to the at least one preset label type; cluster the sample users to obtain at least one user clustering cluster, and calculate the mean and standard deviation of the sample feature data of each user clustering cluster respectively; filter the complete label data corresponding to the first sample user and the missing label data corresponding to the second sample user from the sample label data; the complete label data includes data marked for all preset label types; use the first sample The label prediction model is trained with the user's complete label data and sample feature data; the sample feature data is perturbed to obtain first perturbed feature data corresponding to the first sample user and second perturbed feature data corresponding to the second sample user; the perturbed sample feature data is perturbed to obtain first perturbed feature data corresponding to the first sample user and second perturbed feature data corresponding to the second sample user, including: the sample feature data is perturbed based on the mean and standard deviation of the sample feature data of each user clustering cluster to obtain first perturbed feature data corresponding to the first sample user and second perturbed feature data corresponding to the second sample user; the label prediction model is used to respectively determine a first predicted label corresponding to the first perturbed feature data and a second predicted label corresponding to the second perturbed feature data; a loss function is constructed based on the first predicted label, the second predicted label and the sample label data; and the label prediction model is optimized based on the loss function; Building a target user profile based on the predicted label; The target user portrait is used to describe the type of the target user.
10. The method according to claim 9, characterized in that Before inputting the target feature data and the target label data into the label prediction model to obtain the predicted label, the method further includes: The label prediction model is trained using sample data including the target feature data and the target label data.
11. The method according to claim 9, characterized in that The constructing a target user portrait based on the predicted label includes: Comparing the target feature data with each preset user cluster respectively; Determine a target user cluster corresponding to the target user according to the comparison result; In combination with the target user clustering cluster, a target user portrait is constructed based on the predicted label.
12. A user portrait generation device, characterized in that: include: A data acquisition module is used to acquire target feature data and target label data of a target user; The target tag data corresponds to at least one target tag type; A missing tag type determination module, used to determine the missing tag type based on the target tag data; The missing tag type includes the type that the target tag type lacks compared to the preset tag type; A prediction label acquisition module is used to input target feature data and target label data into a label prediction model to obtain a prediction label; the prediction label includes a label corresponding to the missing label type; the label prediction model is acquired in the following manner: obtaining sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the features of the sample user; the sample label data is used to annotate at least one preset label type, and the sample label data is used to identify whether the user type conforms to the at least one preset label type; clustering the sample users to obtain at least one user clustering cluster, and calculating the mean and standard deviation of the sample feature data of each user clustering cluster respectively; screening the complete label data corresponding to the first sample user and the missing label data corresponding to the second sample user from the sample label data; the complete label data includes data annotated for all preset label types; using the The complete label data and sample feature data of the first sample user are used to train the label prediction model; the sample feature data are perturbed to obtain first perturbed feature data corresponding to the first sample user and second perturbed feature data corresponding to the second sample user; the perturbed sample feature data are perturbed to obtain first perturbed feature data corresponding to the first sample user and second perturbed feature data corresponding to the second sample user, including: the sample feature data are perturbed based on the mean and standard deviation of the sample feature data of each user clustering cluster to obtain first perturbed feature data corresponding to the first sample user and second perturbed feature data corresponding to the second sample user; the label prediction model is used to respectively determine a first predicted label corresponding to the first perturbed feature data and a second predicted label corresponding to the second perturbed feature data; a loss function is constructed based on the first predicted label, the second predicted label and the sample label data; and the label prediction model is optimized based on the loss function; The target user portrait construction module is used to construct a target user portrait based on the predicted label; the target user portrait is used to describe the type of the target user.
13. A user portrait generation device, comprising a memory and a processor; The memory is used to store computer program instructions; The processor is used to execute the computer program instructions to implement the following steps: obtaining target feature data and target label data of a target user; the target label data corresponds to at least one target label type; and determining the missing label type based on the target label data; The missing tag type includes the type that the target tag type lacks compared to the preset tag type; Input the target feature data and the target label data into the label prediction model to obtain the predicted label; the predicted label includes the label corresponding to the missing label type; the label prediction model is obtained in the following manner: obtain sample feature data and sample label data of at least one sample user; the sample feature data is used to describe the characteristics of the sample user; the sample label data is used to annotate at least one preset label type, and the sample label data is used to identify whether the user type conforms to the at least one preset label type; cluster the sample users to obtain at least one user clustering cluster, and calculate the mean and standard deviation of the sample feature data of each user clustering cluster respectively; filter the complete label data corresponding to the first sample user and the missing label data corresponding to the second sample user from the sample label data; the complete label data includes data annotated for all preset label types; use the complete label data of the first sample user and sample feature data to train a label prediction model; perturb the sample feature data to obtain first perturbation feature data corresponding to a first sample user and second perturbation feature data corresponding to a second sample user; the perturbation of the sample feature data to obtain first perturbation feature data corresponding to the first sample user and second perturbation feature data corresponding to the second sample user includes: perturbing the sample feature data based on the mean and standard deviation of the sample feature data of each user clustering cluster to obtain first perturbation feature data corresponding to the first sample user and second perturbation feature data corresponding to the second sample user; using the label prediction model to respectively determine a first prediction label corresponding to the first perturbation feature data and a second prediction label corresponding to the second perturbation feature data; constructing a loss function based on the first prediction label, the second prediction label and the sample label data; optimizing the label prediction model based on the loss function; and constructing a target user portrait based on the prediction label; The target user portrait is used to describe the type of the target user.
Citation Information
Patent Citations
User behavior analysis system for garment industry
CN109377260A
Traffic speed prediction method based on hierarchical clustering and hierarchical attention mechanism
CN111598325A