Model training method and device, user portrait generation method and device, and equipment

By constructing decision subtrees and training decision tree models, the problem of selecting the main portrait from massive user portraits was solved, the efficiency and accuracy of model training were improved, and accurate identification of target users was achieved.

CN115099344BActive Publication Date: 2025-09-23CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210739784.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-28
Publication Date
2025-09-23
Estimated Expiration
2042-06-28

AI Technical Summary

Technical Problem

In the context of big data, how to select the main portrait that best represents the customer's characteristics from massive user portrait tags? The existing technology has problems such as the inability to personalize and adapt and the inability to accurately portray the intersection of multiple user characteristics.

Method used

By obtaining the sample portrait data of the sample object, performing feature extraction and constructing a decision subtree, parsing the knowledge items of the decision subtree, using the classification model training to obtain the knowledge item weights of the decision tree, generating the target decision tree model, and identifying the required portrait features.

Benefits of technology

It improves the efficiency and accuracy of model training, and can identify the required features from massive portrait data to achieve accurate identification of target users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115099344B_ABST
    Figure CN115099344B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a model training method and apparatus, a user portrait generation method and apparatus, and equipment, which belong to the field of artificial intelligence technology. The model training method includes: obtaining sample portrait data of a sample object; performing feature extraction on the sample portrait data to obtain sample portrait features; constructing a decision subtree based on the sample portrait features; the decision subtree includes leaf nodes, each leaf node is one of the sample portrait features; parsing the decision subtree to obtain sample knowledge items of each decision subtree; wherein each sample knowledge item includes one of the leaf nodes; inputting the sample knowledge items into a preset classification model for training to obtain the knowledge item weight of each decision subtree; obtaining the target decision tree model based on the knowledge item weights of K decision subtrees. The target decision tree model of the embodiment of the present application can identify the required portrait features from massive portrait data, thereby improving the training efficiency and accuracy of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a model training method and device, a user portrait generation method and device, and equipment. Background Art

[0002] User profiling technology in artificial intelligence typically generates a virtual representation of a user based on user data, such as their attributes, preferences, habits, and behaviors. This is often referred to as an abstract, labeled user model. A user profile is typically represented by a combination of data tags, such as [Gender: Male, Age: 25-30, Education: Bachelor's Degree]. With the development of big data technologies like data warehouses, user profiling technology has been widely applied. However, selecting the right user tags from the vast amount of profile tags has become a pressing technical challenge. Summary of the Invention

[0003] The main purpose of the embodiments of the present application is to propose a model training method and device, a user portrait generation method and device, and equipment. The target decision tree model obtained by the model training method can identify the required portrait features from massive portrait data.

[0004] To achieve the above objectives, a first aspect of an embodiment of the present application proposes a model training method, which includes:

[0005] Obtain sample portrait data of the sample object;

[0006] Performing feature extraction on the sample portrait data to obtain sample portrait features;

[0007] Construct a decision subtree based on the sample portrait features; the decision subtree includes leaf nodes, each of which is one of the sample portrait features;

[0008] Parsing the decision subtree to obtain a sample knowledge item of each decision subtree; wherein each sample knowledge item includes one of the leaf nodes;

[0009] Inputting the sample knowledge items into a preset classification model for training to obtain the knowledge item weight of each decision subtree;

[0010] A target decision tree model is obtained according to the knowledge item weights of the K decision subtrees; wherein the target decision tree model includes the K decision subtrees.

[0011] In some embodiments, constructing a decision subtree based on the sample portrait features includes:

[0012] Filtering parent features from the sample portrait features;

[0013] Performing feature division on at least one of the parent features to obtain at least one child feature; wherein each of the parent features includes at least one child feature;

[0014] The decision subtree is obtained according to the at least one parent feature and the at least one child feature; wherein the parent feature is a branch node of the decision subtree, and each leaf node is one of the child features.

[0015] In some embodiments, filtering out parent features from the sample portrait features includes:

[0016] Calculating the information gain of the sample portrait feature;

[0017] Obtaining the maximum information gain from the information gains as the target gain;

[0018] The parent feature is filtered out from the sample portrait features according to the target gain.

[0019] In some embodiments, obtaining a target decision tree model according to the weights of the knowledge items of the K decision subtrees includes:

[0020] Obtain K decision subtrees;

[0021] Obtaining a knowledge item weight of each of the K decision subtrees;

[0022] The target decision tree model is obtained according to the classification model and the knowledge item weight of each decision subtree.

[0023] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes a method for generating a user portrait, the method comprising:

[0024] Obtain target profile data of a target user; input the target profile data into a target decision tree model for decision making to obtain a set of predicted knowledge items; wherein the set of predicted knowledge items includes at least two knowledge items hit by the target user, and the target decision tree model is trained according to the model training method described in the first aspect above;

[0025] Inputting the predicted knowledge item set into the classification model for prediction to obtain a target weight;

[0026] The predicted knowledge item set is traversed according to the target weight to obtain a target knowledge item; wherein the target knowledge item is a user portrait of the target user.

[0027] In some embodiments, traversing the set of predicted knowledge items according to the weights to obtain target knowledge items includes:

[0028] Obtaining the absolute value of each target weight;

[0029] Sort the target weights from large to small according to the absolute values ​​to obtain a weight ranking;

[0030] The target weights are sequentially traversed according to the weight sorting to obtain the target knowledge items.

[0031] To achieve the above objectives, a third aspect of the embodiments of the present application provides a model training device, comprising:

[0032] A sample data acquisition module is used to obtain sample portrait data of a sample object;

[0033] A sample feature extraction module is used to extract features from the sample portrait data to obtain sample portrait features;

[0034] A decision tree construction module is used to construct a decision subtree according to the sample portrait feature; the decision subtree includes leaf nodes, and each leaf node is one of the sample portrait features;

[0035] A parsing module, configured to parse the decision subtree to obtain a sample knowledge item of each decision subtree; wherein each sample knowledge item includes one of the leaf nodes;

[0036] A model training module is used to input the sample knowledge items into a preset classification model for training to obtain the knowledge item weight of each decision subtree;

[0037] A model generation module is used to obtain a target decision tree model according to the knowledge item weights of the K decision subtrees; wherein the target decision tree model includes the K decision subtrees.

[0038] To achieve the above-mentioned purpose, a fourth aspect of the embodiments of the present application provides a user portrait generation device, the user portrait generation device comprising:

[0039] A target data acquisition module is used to obtain target profile data of a target user; a decision module is used to input the target profile data into a target decision tree model for decision making to obtain a set of predicted knowledge items; wherein the set of predicted knowledge items includes at least two knowledge items hit by the target user, and the target decision tree model is trained according to the model training method described in the first aspect;

[0040] A prediction module, configured to input the prediction knowledge set into the classification model for prediction to obtain a target weight;

[0041] A traversal module is used to traverse the set of predicted knowledge items according to the target weight to obtain a target knowledge item; wherein the target knowledge item is a user portrait of the target user.

[0042] To achieve the above-mentioned purpose, the fifth aspect of an embodiment of the present application proposes an electronic device, which includes a memory, a processor, a program stored on the memory and runnable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, it realizes the model training method described in the first aspect or the user portrait generation method described in the second aspect.

[0043] To achieve the above-mentioned purpose, the sixth aspect of an embodiment of the present application proposes a storage medium, which is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the model training method described in the first aspect or the user portrait generation method described in the second aspect.

[0044] The model training method and device, user portrait generation method and device, electronic device and storage medium proposed in the present application obtain sample portrait data of a sample object, perform feature extraction on the sample portrait data, and obtain sample portrait features; and construct a decision subtree based on the sample portrait features, wherein the decision subtree includes leaf nodes, and each leaf node is one of the sample portrait features; and parse the decision subtree to obtain sample knowledge items of each decision subtree; and then input the sample knowledge items into a preset classification model for training to obtain the knowledge item weights of each decision subtree; thereby, a target decision tree model can be obtained based on the knowledge item weights of K decision subtrees, and the target decision tree model obtained in this way includes K decision subtrees. Through this target decision tree model, the required portrait features can be identified from massive portrait data, and the efficiency and accuracy of model training are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 This is a flow chart of the model training method provided in the embodiment of the present application;

[0046] Figure 2 yes Figure 1 Flowchart of step 103 in FIG.

[0047] Figure 3 is a schematic diagram of the structure of a decision subtree in one embodiment;

[0048] Figure 4 is a schematic diagram of the structure of a decision subtree in another embodiment;

[0049] Figure 5 yes Figure 2 Flowchart of step 201 in FIG.

[0050] Figure 6 yes Figure 1 Flowchart of step 106 in FIG.

[0051] Figure 7 This is a flowchart of a method for generating a user portrait according to an embodiment of the present application;

[0052] Figure 8 yes Figure 7 Flowchart of step 704 in FIG.

[0053] Figure 9 Schematic diagram of the structure of the model training device provided in the embodiment of the present application;

[0054] Figure 10 This is a schematic diagram of the structure of the user portrait generation device provided in an embodiment of the present application;

[0055] Figure 11 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0057] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.

[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0059] First, let’s analyze some of the terms used in this application:

[0060] Artificial intelligence (AI) is a new technical discipline that studies and develops theories, methods, technologies, and application systems for simulating, extending, and expanding human intelligence. A branch of computer science, AI seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. AI can simulate the information processes of human consciousness and thinking. It also encompasses the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.

[0061] Natural language processing (NLP): NLP uses computers to process, understand, and apply human languages ​​(such as Chinese and English). A branch of artificial intelligence, NLP is an interdisciplinary field between computer science and linguistics, often referred to as computational linguistics. Natural language processing encompasses grammatical analysis, semantic analysis, and discourse comprehension. Natural language processing is commonly used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis, and opinion mining. It encompasses data mining, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research related to language processing, and linguistics research related to language computing.

[0062] Logistic Regression (LR), also known as logistic regression analysis, is a classification learning method commonly used in two scenarios: prediction and identifying factors influencing the dependent variable. Its general principle is to predict the probability of future outcomes based on historical data.

[0063] Gradient Boosting Decision Tree (GBDT): It is a commonly used model in machine learning. It is an iterative decision tree algorithm. Its main idea is to use weak classifiers (decision trees) for iterative training to obtain the optimal model. This model has the advantages of good training effect and low overfitting.

[0064] XGboost: XGboost uses a pre-sorted algorithm, which can find data separation points more accurately.

[0065] Light Gradient Boosting Machine (LightGBM): LightGBM is an advanced version of the GBDT model. It is an upgraded version of XGboost. Unlike XGboost, LightGBM uses a histogram algorithm. LightGBM employs a leaf-wise growth strategy, finding the leaf with the largest split gain (usually the largest amount of data) from all current leaves, then splitting it, and repeating the cycle.

[0066] User profiling technology in artificial intelligence typically generates a virtual representation of a user based on user data, such as their attributes, preferences, habits, and behaviors. This is often referred to as an abstract, labeled user model. A user profile is typically represented comprehensively by data tags, such as [Gender: Male, Age: 25-30, Education: Bachelor's Degree]. With the development of big data technologies like data warehouses, user profiling technology has expanded significantly, leading to the question of how to select the primary profile that best represents a customer's characteristics from the vast number of profile tags. The purpose of a primary profile is to identify a user's primary profile within a specific context (e.g., user purchases, user retention, user complaints), thereby identifying the majority of a user's characteristics (e.g., the risk of a user complaining at least 70%) based on a small number of profile (primary profile) tags (e.g., profile tags representing less than 1%). Current methods for mining primary profiles often suffer from issues such as a lack of personalized adaptation and an inability to accurately capture the intersection of multiple user characteristics. Among them, the application scenario of user multi-feature intersection is: in the scenario of insurance agent retention, users whose income exceeds the social average and whose previous occupation is sales usually have a higher retention probability.

[0067] Based on this, the embodiments of the present application provide a model training method and device, a user portrait generation method and device, an electronic device and a storage medium. The target decision tree model obtained by the model training method can identify the required portrait features from massive portrait data and improve the training efficiency and accuracy of the model.

[0068] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results.

[0069] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0070] The model training method or user portrait generation method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The model training method or user portrait generation method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server side, and can also be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, or can be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the model training method or the user portrait generation method, etc., but is not limited to the above forms.

[0071] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can 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, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0072] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user portrait data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of such data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0073] The model training method and device, user portrait generation method and device, electronic device and storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the model training method in the embodiments of the present application is described.

[0074] Figure 1 This is an optional flowchart of the model training method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps 101 to 106.

[0075] Step 101, obtaining sample portrait data of a sample object;

[0076] Step 102: extract features from the sample portrait data to obtain sample portrait features;

[0077] Step 103: construct a decision subtree based on the sample portrait features; wherein the decision subtree includes leaf nodes, and each leaf node is one of the sample portrait features;

[0078] Step 104: Parse the decision subtree to obtain sample knowledge items for each decision subtree; wherein each sample knowledge item includes a leaf node;

[0079] Step 105: Input the sample knowledge items into a preset classification model for training to obtain the knowledge item weights of each decision subtree;

[0080] Step 106: Obtain a target decision tree model based on the knowledge item weights of the K decision subtrees; wherein the target decision tree model includes the K decision subtrees.

[0081] In steps 101 to 106 of the embodiment of the present application, sample portrait data of the sample object is obtained, and feature extraction is performed on the sample portrait data to obtain sample portrait features; a decision subtree is constructed based on the sample portrait features, and the decision subtree includes leaf nodes, each leaf node is one of the sample portrait features; the decision subtree is parsed to obtain sample knowledge items of each decision subtree; the sample knowledge items are then input into a preset classification model for training to obtain the knowledge item weights of each decision subtree; thereby, a target decision tree model can be obtained based on the knowledge item weights of K decision subtrees, and the target decision tree model can be used to identify the required portrait features from massive portrait data, and the training efficiency and accuracy of the model can be improved.

[0082] In step 101 of some embodiments, the sample subject may be a buyer on a shopping platform, a user of a related application, such as a user of a music player, or a policyholder in the insurance field; the sample profile data of the sample subject may include the sample subject's basic user information, purchase data, complaint data, etc.; the sample subject's basic user information may include the sample subject's name, gender, age, etc., as well as the sample subject's educational background and occupation information. The sample profile data in step 101 may include a large amount of profile data and can be applied in a variety of scenarios, such as shopping platforms, dating platforms, etc., as well as in the insurance field, housing rental field, electricity bill payment field, etc.

[0083] In step 102 of some embodiments, the method for extracting features from the sample portrait data may be an existing feature extraction method, which is not limited in this embodiment. The sample portrait features may be educational background features, which may include elementary school, junior high school, high school, college, bachelor's degree, master's degree, and above; the sample portrait features may also be basic user information features, such as gender, age, and place of origin.

[0084] See also Figure 2 In some embodiments, step 103 may include but is not limited to steps 201 to 203:

[0085] Step 201, filtering out parent features from sample portrait features;

[0086] Step 202: performing feature division on at least one parent feature to obtain at least one child feature; wherein each parent feature includes at least one child feature;

[0087] Step 203: Obtain a decision subtree based on the at least one parent feature and the at least one child feature; wherein the parent feature is a branch node of the decision subtree, and each leaf node is one of the child features.

[0088] In step 201 of some embodiments, the sample portrait feature includes educational background, and the "education background" in the sample portrait feature is used as the parent feature; in step 202, the parent feature "education background" is divided to obtain two sub-features, one of which is "primary school, junior high school, high school" and the other is "college, undergraduate, master's degree and above". Please refer to Figure 3 As shown, through step 203, a decision subtree is constructed. Figure 3 The diagram shows a two-layer decision subtree, where the parent feature is the first layer, also the parent node "education level"; the two child features are the second layer, and the two child features are two child nodes. In this embodiment of the application, all features can be greedily enumerated to perform feature partitioning and obtain at least one child feature.

[0089] In some application scenarios, the decision subtree is a binary tree; in this application embodiment, a binary tree is used as an example for illustration. Figure 4 , Figure 4 It shows a four-layer decision subtree. By repeatedly executing 202, feature division is continuously performed. After feature division, one of the sub-features "primary school, junior high school, and senior high school" obtains two sub-features of the next layer: "primary school, junior high school" and "senior high school". At this time, the sub-feature "primary school, junior high school, and senior high school" becomes the parent feature; after feature division, another sub-feature "junior college, undergraduate, master's degree and above" obtains two sub-features of the next layer: "bachelor's degree, master's degree and above" and "junior college". At this time, the sub-feature "junior college, undergraduate, master's degree and above" becomes the parent feature. Similarly, the sub-feature "primary school and junior high school" is divided into two sub-features of the next layer: "primary school" and "junior high school"; similarly, the sub-feature "bachelor's degree, master's degree and above" is divided into two sub-features of the next layer: "bachelor's degree" and "master's degree and above". In this decision subtree, the parent feature is also the parent node, the child feature is also the branch node, and the child feature at the end is the leaf node. Figure 4 The leaf nodes include: the third-level sub-feature "high school", the fourth-level sub-feature "primary school", the fourth-level sub-feature "junior high school", the third-level sub-feature "college", the fourth-level sub-feature "master's degree and above", and the fourth-level sub-feature "undergraduate degree".

[0090] See also Figure 5 In some embodiments, step 201 may include but is not limited to steps 501 to 503:

[0091] Step 501, calculating the information gain of the sample portrait feature;

[0092] Step 502: Obtain the maximum information gain from the information gains as the target gain;

[0093] Step 503: Filter out parent features from the sample portrait features according to the target gain.

[0094] Information gain is used to measure the degree to which data becomes more ordered and purer; the greater the information gain, the purer the data. Therefore, when performing feature selection, the feature with the largest information gain is selected. In steps 501 to 503 of this embodiment, the maximum information gain is obtained from the information gain as the target gain, and the sample profile feature corresponding to the target gain is then used as the parent feature.

[0095] In step 202 of some embodiments, each time feature division is performed, only the division of one node in the decision subtree is determined, and multiple recursive feature divisions are required to finally generate a decision subtree; when the preset stopping condition is reached, the feature division is stopped; wherein, the preset stopping condition can be achieved by setting a hyperparameter, or by setting a node level threshold, or by setting a decision subtree depth threshold that exceeds the value of the hyperparameter, or exceeds the node level threshold, or exceeds the decision subtree depth threshold, then the feature division is stopped.

[0096] In some embodiments, each decision subtree includes a root node. In some embodiments, step 104 may include, but is not limited to:

[0097] Traverse the decision subtree from the root node to obtain the leaf nodes;

[0098] Parse the leaf nodes to obtain sample knowledge items.

[0099] In some embodiments, taking the decision subtree as a binary tree as an example, the method of traversing the decision subtree may include: pre-order traversal; wherein, pre-order traversal refers to traversing from the root node, then traversing the left node, and finally traversing the right node; in some application scenarios, traversal can be performed in accordance with the conventional pre-order traversal method, which is not limited in this embodiment. In other embodiments, the method of traversing the decision subtree may also include in-order traversal or subsequent traversal, and may also include hierarchical traversal, which is not limited in this embodiment; the traversal process of in-order traversal, subsequent traversal, or hierarchical traversal is not limited in this embodiment, and can refer to the conventional traversal principle.

[0100] As can be seen from the above step 103, each leaf node is one of the sample portrait features, so by parsing the leaf node in step 104, the corresponding sample portrait feature can be obtained, and the obtained sample portrait feature is the sample knowledge item. Figure 4 In the example, the leaf node may be the sub-feature "high school" of the third layer, which is also one of the sample knowledge items.

[0101] In step 105 of some embodiments, the preset classification model may be a logistic regression model. In other embodiments, the preset classification model may also be other models, which is not limited in this embodiment. This embodiment takes the logistic regression model as an example for explanation. The sample knowledge items are input into the logistic regression model for training, and the weight of each knowledge item in the decision subtree can be obtained. In some application scenarios, the weight of the i-th knowledge item can be expressed as wx i , the model parameter of the logistic regression model can be expressed as w. In step 105, the logistic regression model is trained based on the input sample knowledge items. First, the weighted probabilities of the sample knowledge items are obtained. Then, the weighted probabilities are analyzed to obtain the knowledge item weight corresponding to each sample knowledge item. The weighted probabilities and the corresponding knowledge item weights are in one-to-one correspondence.

[0102] In some embodiments, the preset classification model can be trained using a gradient descent method. This embodiment does not limit the training method of the classification model.

[0103] See also Figure 6 In some embodiments, step 106 may include but is not limited to steps 601 to 602:

[0104] Step 601, obtaining K decision subtrees;

[0105] Step 602: Obtain the knowledge item weight of each of the K decision subtrees;

[0106] Step 603: Obtain a target decision tree model based on the classification model and the weight of each decision subtree's knowledge items.

[0107] In some application scenarios, taking a total of K decision subtrees and each decision subtree including n sample knowledge items as an example, the K decision subtrees have a total of K*n sample knowledge items, that is, a total of K*n knowledge item weights.

[0108] In step 603 of some embodiments, the model parameter w of the classification model is obtained, and the i-th sample knowledge item x is obtained. i , then multiply the model parameter w and the i-th sample knowledge item to obtain the weight wx of each knowledge item i , and then sum up the weights of the n knowledge items of each decision subtree to obtain the logistic regression model, as shown in the following formula (1):

[0109] ∑(wx1+wx2+wx i +...wxn) formula (1)

[0110] In formula (1), for each decision subtree: multiply the model parameter w and the i-th sample knowledge item to obtain the weight wx of each knowledge item i, the weights of n pieces of knowledge in each decision subtree are summed up to obtain the logistic regression model.

[0111] In some embodiments, the target decision tree model may be a LightGBM model; in other embodiments, the target decision tree model may be an XGboost model. In addition, the target decision tree model may also be other decision tree models, which is not limited in this embodiment. In this embodiment, the target decision tree model is described as a LightGBM model. A decision tree is a model generated by a greedy strategy. The target decision tree model of this embodiment is a binary tree structure. At each decision node, the target decision tree model calculates the feature partitioning that maximizes the current information gain. For example, the educational background feature is divided into two sets ([primary school, junior high school, high school], [college, undergraduate, master and above]). In the target decision tree model of this embodiment, a new decision subtree is learned based on the loss of the previous step to obtain multiple decision subtrees. In addition, each decision subtree that constitutes the target decision tree model of this embodiment is a binary tree structure.

[0112] In some embodiments, the model training method may also include, but is not limited to, optimizing the target decision tree model, specifically including:

[0113] Calculate the optimal parameters of the decision subtree through the second-order Taylor expansion;

[0114] Optimize the target decision tree model according to the optimal parameters.

[0115] In other embodiments, the optimal parameters of the decision subtree can be calculated by other methods, which are not limited in the present embodiment. Since the target decision tree model obtained in this embodiment is a combination of a decision tree model and a logistic regression model, the target decision tree model can be optimized by calculating the optimal parameters of the decision subtree.

[0116] In addition, the convergence condition of the target decision tree model can be achieved by setting a loss function, which can be a cross-entropy loss function. The cross-entropy loss function represents the distribution difference between the predicted probability of the current model and the true target value of the sample. The closer the model prediction is to the actual situation, the smaller the loss is. When the loss is minimized, the model converges.

[0117] The target decision tree model obtained above can be used to perform feature segmentation based on user portraits. Specifically, this will be explained in detail later and will not be repeated here.

[0118] Figure 7 This is an optional flowchart of the user portrait generation method provided in the embodiment of the present application. Figure 7 The method may include but is not limited to steps 701 to 704.

[0119] Step 701: Obtain target profile data of the target user;

[0120] Step 702: Input the target profile data into a target decision tree model for decision making to obtain a set of predicted knowledge items; wherein the set of predicted knowledge items includes at least two knowledge items that the target user hits, and the target decision tree model is trained according to the model training method of the above embodiment;

[0121] Step 703: Input the predicted knowledge item set into the classification model for prediction to obtain the target weight;

[0122] Step 704: traverse the predicted knowledge item set according to the target weight to obtain the target knowledge item; wherein the target knowledge item is the user portrait of the target user.

[0123] In steps 701 to 704 of the embodiment of the present application, target portrait data of the target user is obtained; the target portrait data is input into the target decision tree model for decision making to obtain a set of predicted knowledge items; the predicted knowledge item set is then input into the classification model for prediction to obtain a target weight; the predicted knowledge item set is traversed according to the target weight to obtain a target knowledge item, which is a user portrait of the target user and also the main portrait of the target user; thereby, accurate identification of the target user can be achieved.

[0124] Currently, methods for mining user primary profiles generally suffer from issues such as a lack of personalized adaptation and an inability to accurately portray the intersection of multiple user features. The user profile generation method provided in this embodiment is suitable for accurately identifying user primary profiles in complex user profile systems. The target knowledge item obtained in step 704 is the target user's primary profile. This primary profile allows for accurate identification of the target user, using a minimal number of features. Even in complex systems, the user profile generation method of this embodiment can accurately identify the target user.

[0125] In some implementations, the target user in step 701 is similar to the sample object in step 101. The target user may be a buyer on a shopping platform, a user of a related application, such as a user of a music player, or a policyholder in the insurance field, etc. The target profile data of the target user may include the target user's basic user information, and may also include the target user's purchase data, and may also include the target user's complaint data, etc. The target user's basic user information may include the target user's name, gender, age, etc., and may also include the target user's educational background information, occupation information, etc. The target profile data in step 101 may include a large amount of profile data and can be applied in various scenarios, such as shopping platforms, dating platforms, etc., and may also be applied in the insurance field, housing rental field, electricity bill payment field, etc.

[0126] In some implementations of step 702, the target decision tree model is trained according to the model training method of the above embodiment. The target decision tree model includes K decision subtrees, each of which is a binary tree. The target profile data is input into the target decision tree model, and the target decision tree is used to make a decision to obtain the predicted knowledge item set UKB. s , the predicted knowledge set UKB s is the set of knowledge items that the target user hits, and the predicted knowledge item set UKB s Include at least two pieces of knowledge that target users will find appealing.

[0127] In some implementations, step 703, the classification model is a logistic regression model, which predicts the knowledge item set UKB s Input into the logistic regression model for prediction and obtain the target weight.

[0128] See also Figure 8 In some implementations, step 704 may include, but is not limited to, steps 801 to 803:

[0129] Step 801, obtaining the absolute value of each target weight;

[0130] Step 802: sort the target weights from largest to smallest according to their absolute values ​​to obtain a weight ranking;

[0131] Step 803: traverse the target weights in order according to the weight sorting to obtain the target knowledge item.

[0132] In some implementations, at step 801 , for each target weight, its absolute value is calculated.

[0133] In some implementations of step 802, the target weights are sorted from large to small according to the absolute value of each target weight to obtain a sorted weight sort, which is sorted from large to small.

[0134] In some implementations, step 803 may include, but is not limited to:

[0135] All target weights are summed to obtain a weight sum; in some embodiments, the weight sum is expressed as while_logits;

[0136] The predicted knowledge item set is sequentially traversed according to the weight sorting to obtain the traversed knowledge items; in some embodiments, the traversal weight sum is expressed as sum_logits j , where j is the number of traversed knowledge items that have been traversed;

[0137] Sum up all traversed knowledge items to get the traversal weight sum;

[0138] Compare the traversal weight with the target weight and the sum of the weights;

[0139] If the sum of the traversal weights is greater than the total weight, the traversal is stopped and the target knowledge item is obtained.

[0140] In a specific application scenario, if there are 100 knowledge items, the target user will be hit by 10 of them. Sort them from large to small according to the absolute value of the weight of the 10 knowledge items hit by the target user. Accumulate the weights of the 10 sorted knowledge items to get the sum of the weights as while_logits. Then traverse the 10 sorted knowledge items sequentially. Each time a knowledge item is traversed, sum all the traversed knowledge items to get the traversal weight and sum_logits. j ,If the traversal of the 6th knowledge item has been completed, the sum of the traversal weights at this time is sum_logits6.

[0141] Compare the traversal weight to the target weight and the sum of the weights, including:

[0142] Get the current weight of the currently traversed knowledge item;

[0143] Compare the current weight with the weight threshold; the weight threshold is used to represent the coverage of the portrait feature;

[0144] If the current weight is greater than the weight threshold, compare the traversal weight and the sum of the weights;

[0145] If the current weight is less than or equal to the weight threshold, the traversed weight and the sum of the weights greater than the weight will be inverted and compared.

[0146] In a specific application scenario, the traversal weight and the sum of the weights are inverted and compared, which can be expressed as shown in formula (2):

[0147] sign*sum_logits i >sign*while_logits*thre Formula (2)

[0148] Among them, thre is the weight threshold, and sign is a mark for whether the traversal weight sum and weight sum are negated. If the current weight is greater than the weight threshold, then sign = 1, indicating that the traversal weight sum and weight sum do not need to be negated; if the current weight is less than or equal to the weight threshold, then sign = -1, indicating that the traversal weight sum and weight sum need to be negated. For example, if the weight threshold thre is 0.5, it means that the coverage rate of the portrait feature is 50%, which also means that 50% of the user's features are covered; if the current weight is 0.6, the current weight 0.6> weight threshold 0.5, then sign = 1, and the size of the traversal weight sum greater than the weight sum is directly compared: sum_logits i >while_logits*thre; if the current weight is 0.4, and the current weight 0.4 < weight threshold 0.5, then sign = -1, then it is necessary to invert the traversal weight and the sum of the weights and then compare the sizes: -sum_logits i <-while_logits*thre. When the above traverses the weight sum_logits j When the sum is greater than the weighted sum while_logits, that is, when the inequality of formula (2) above holds, the traversal stops and the target knowledge item is obtained. The target knowledge item obtained in this way is the main profile feature of the target user, which can achieve accurate identification of the target user.

[0149] See also Figure 9 , an embodiment of the present application further provides a model training device, the model training device comprising:

[0150] A sample data acquisition module is used to obtain sample portrait data of a sample object;

[0151] The sample feature extraction module is used to extract features from the sample portrait data to obtain sample portrait features;

[0152] A decision tree construction module is used to construct a decision subtree based on the sample portrait features; the decision subtree includes leaf nodes, each leaf node is one of the sample portrait features;

[0153] A parsing module is used to parse the decision subtree to obtain a sample knowledge item of each decision subtree; wherein each sample knowledge item includes a leaf node;

[0154] The model training module is used to input sample knowledge items into the preset classification model for training and obtain the knowledge item weight of each decision subtree;

[0155] The model generation module is used to obtain a target decision tree model according to the knowledge item weights of the K decision subtrees; wherein the target decision tree model includes K decision subtrees.

[0156] The specific implementation of the model training device is basically the same as the specific embodiment of the above-mentioned model training method, and will not be repeated here.

[0157] See also Figure 10 The embodiment of the present application further provides a user portrait generation device that can implement the above-mentioned user portrait generation method, and the user portrait generation device includes:

[0158] Target data acquisition module, used to obtain target portrait data of target users;

[0159] A decision module, configured to input the target profile data into a target decision tree model for decision making, thereby obtaining a set of predicted knowledge items; wherein the set of predicted knowledge items includes at least two knowledge items hit by the target user, and the target decision tree model is trained according to the model training method of the first aspect;

[0160] The prediction module is used to input the prediction knowledge set into the classification model for prediction and obtain the target weight;

[0161] The traversal module is used to traverse the predicted knowledge item set according to the target weight to obtain the target knowledge item; wherein the target knowledge item is the user portrait of the target user.

[0162] The specific implementation of the user portrait generation device is basically the same as the specific embodiment of the above-mentioned user portrait generation method, and will not be repeated here.

[0163] The present application also provides an electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for enabling communication between the processor and the memory. When the program is executed by the processor, the aforementioned model training method or user profile generation method is implemented. The electronic device may be any intelligent terminal, such as a tablet computer or an in-vehicle computer.

[0164] See also Figure 11 , Figure 11 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:

[0165] The processor 110 may be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0166] The memory 112 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 112 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 112 and is called by the processor 110 to execute the model training method or user profile generation method of the embodiments of this application;

[0167] Input / output interface 114, used to implement information input and output;

[0168] Communication interface 116, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);

[0169] bus 118 , which transmits information between the various components of the device (e.g., processor 110 , memory 112 , input / output interface 114 , and communication interface 116 );

[0170] The processor 110 , the memory 112 , the input / output interface 114 , and the communication interface 116 are communicatively connected to each other within the device via a bus 118 .

[0171] An embodiment of the present application also provides a storage medium, which is a computer-readable storage medium used for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the above-mentioned model training method or user portrait generation method.

[0172] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0173] The model training method and device, user portrait generation method and device, electronic device and storage medium provided in the embodiments of the present application obtain sample portrait data of the sample object, perform feature extraction on the sample portrait data, and obtain sample portrait features; and construct a decision subtree based on the sample portrait features, the decision subtree includes leaf nodes, each leaf node is one of the sample portrait features; and parse the decision subtree to obtain sample knowledge items of each decision subtree; and then input the sample knowledge items into a preset classification model for training to obtain the knowledge item weights of each decision subtree; thus, a target decision tree model can be obtained based on the knowledge item weights of K decision subtrees, through which the required portrait features can be identified from massive portrait data, and the training efficiency and accuracy of the model can be improved. The target knowledge items obtained by the user portrait generation method are the main portrait features of the target user, thereby enabling accurate identification of the target user.

[0174] This embodiment combines a decision tree model and a logistic regression model to realize the identification of the target user, wherein the decision tree model is used to perform feature division to obtain knowledge items, and the knowledge items obtained by the decision tree model are input into the logistic regression model for prediction to obtain the target weight, and then the predicted knowledge item set is traversed according to the target weight to obtain the target knowledge item, which is the main portrait of the target user, thereby realizing accurate identification of the target user.

[0175] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0176] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0177] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0178] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.

[0179] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0180] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0181] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0182] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0183] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0184] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0185] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.

Claims

1. Model training method, characterized in that, The model training method includes: Obtain sample portrait data of the sample object; Performing feature extraction on the sample portrait data to obtain sample portrait features; wherein the sample portrait features include educational background features or user basic information features, the educational background features include elementary school, junior high school, high school, junior college, undergraduate, master's degree and above, and the user basic information features include gender features, age features, and place of origin features; Construct a decision subtree based on the sample portrait features; the decision subtree includes leaf nodes, each of which is one of the sample portrait features; Parsing the decision subtree to obtain a sample knowledge item of each decision subtree; wherein each sample knowledge item includes one of the leaf nodes; Inputting the sample knowledge items into a preset classification model for training to obtain the knowledge item weight of each decision subtree; A target decision tree model is obtained according to the knowledge item weights of the K decision subtrees; wherein the target decision tree model includes the K decision subtrees, and the target decision tree model is used to generate a user portrait.

2. The model training method according to claim 1, characterized in that The step of constructing a decision subtree according to the sample portrait features includes: Filtering parent features from the sample portrait features; Performing feature division on at least one of the parent features to obtain at least one child feature; wherein each of the parent features includes at least one child feature; The decision subtree is obtained according to the at least one parent feature and the at least one child feature; wherein the parent feature is a branch node of the decision subtree, and each leaf node is one of the child features.

3. The model training method according to claim 2, characterized in that The step of filtering out the parent feature from the sample portrait feature includes: Calculating the information gain of the sample portrait feature; Obtaining the maximum information gain from the information gains as the target gain; The parent feature is filtered out from the sample portrait features according to the target gain.

4. The model training method according to any one of claims 1 to 3, characterized in that Obtaining a target decision tree model according to the knowledge item weights of the K decision subtrees includes: Obtain K decision subtrees; Obtaining a knowledge item weight of each of the K decision subtrees; The target decision tree model is obtained according to the classification model and the knowledge item weight of each decision subtree.

5. A user portrait generation method, characterized in that: The user portrait generation includes: Obtain target profile data of a target user; input the target profile data into a target decision tree model for decision making to obtain a set of predicted knowledge items; wherein the set of predicted knowledge items includes at least two knowledge items hit by the target user, and the target decision tree model is trained using the model training method according to any one of claims 1 to 4; Inputting the predicted knowledge item set into the classification model for prediction to obtain a target weight; The predicted knowledge item set is traversed according to the target weight to obtain a target knowledge item; wherein the target knowledge item is a user portrait of the target user.

6. The user portrait generation method according to claim 5, characterized in that: The step of traversing the set of predicted knowledge items according to the weights to obtain target knowledge items includes: Obtaining the absolute value of each target weight; Sort the target weights from large to small according to the absolute values ​​to obtain a weight ranking; The target weights are sequentially traversed according to the weight sorting to obtain the target knowledge items.

7. Model training device, characterized in that, The training device comprises: A sample data acquisition module is used to obtain sample portrait data of a sample object; A sample feature extraction module is used to extract features from the sample portrait data to obtain sample portrait features; wherein the sample portrait features include educational background features or user basic information features, the educational background features include elementary school, junior high school, high school, college, undergraduate, master's degree and above, and the user basic information features include gender features, age features, and place of origin features; A decision tree construction module is used to construct a decision subtree according to the sample portrait features; the decision subtree includes leaf nodes, each of which is one of the sample portrait features; A parsing module, configured to parse the decision subtree to obtain a sample knowledge item of each decision subtree; wherein each sample knowledge item includes one of the leaf nodes; A model training module is used to input the sample knowledge items into a preset classification model for training to obtain the knowledge item weight of each decision subtree; A model generation module is used to obtain a target decision tree model based on the knowledge item weights of the K decision subtrees; wherein the target decision tree model includes the K decision subtrees, and the target decision tree model is used to generate a user portrait.

8. A user portrait generating device, characterized in that: The user portrait generating device includes: A target data acquisition module is used to obtain target profile data of a target user; a decision module is used to input the target profile data into a target decision tree model for decision making to obtain a set of predicted knowledge items; wherein the set of predicted knowledge items includes at least two knowledge items hit by the target user, and the target decision tree model is trained using the model training method according to any one of claims 1 to 4; A prediction module, configured to input the prediction knowledge set into the classification model for prediction to obtain a target weight; A traversal module is used to traverse the set of predicted knowledge items according to the target weight to obtain a target knowledge item; wherein the target knowledge item is a user portrait of the target user.

9. An electronic device, characterized in that The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for implementing communication between the processor and the memory. When the program is executed by the processor, the following is implemented: The steps of the model training method according to any one of claims 1 to 4; or, The steps of the user portrait generation method according to any one of claims 5 to 6.

10. Storage medium, the storage medium is a computer-readable storage medium, used for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement: The steps of the model training method according to any one of claims 1 to 4; or, The steps of the user portrait generation method according to any one of claims 5 to 6.

Citation Information

Patent Citations

  • A power system online dynamic safety assessment method based on an integrated decision tree

    CN109726766A

  • Drug recommendation method and device based on decision tree, equipment and storage medium

    CN113722371A