Decision-making method, device and equipment based on user tag portrait
By analyzing the semantic features of user tag portraits and inputting word embedding vectors into the encoder-decoder model for decision analysis, the problem that user tag portraits cannot accurately describe the characteristics of user groups is solved, and more accurate and reliable decision results are achieved.
Patent Information
- Application Number
- CN202411405373.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-02-14
AI Technical Summary
The existing user tag portrait generation method lacks the ability to capture users' personalized needs and preferences, which leads to the inability to accurately describe the characteristics of different user groups, which leads to the inaccurate decision-making methods based on user tag portraits and are relatively robust. Difference.
By obtaining the user tag portrait of the target user, analyzing its semantic features to obtain word embedding vectors, and inputting these word embedding vectors into the encoder-decoder model for decision analysis, in order to accurately capture the target user's personalized needs and preferences.
It improves the relevance and satisfaction of decisions, enhances the system's intelligent decision-making ability, and makes the decision results more accurate and reliable.
Smart Images

Figure CN119444268A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and specifically to a decision-making method, apparatus, device and storage medium based on user tag profiling. Background Art
[0002] User tag portraits refer to one or more personas representing typical user groups in the target market, which are constructed by collecting and analyzing various attribute data and behavior data of users. User tag portraits can help companies better understand the characteristics of each user group, thereby formulating more accurate marketing strategies, product designs, and service optimization measures, and thus providing more personalized products and services, and enhancing user satisfaction and loyalty.
[0003] For example, user tag portraits can be used in product recommendation business scenarios. By analyzing the user tag portraits of target users and based on information such as the purchase history, preferences, behavior patterns, and market trends of the user group to which the target users belong, products that meet the user needs of the target users can be determined, and these products can then be pushed to the target users.
[0004] However, the current user label portrait generation method still needs to be improved in its ability to capture users' personalized needs and preferences, resulting in the inability of user label portraits to accurately describe the characteristics of different user groups, which in turn leads to the decision-making method based on user label portraits being inaccurate and having poor robustness. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a decision-making method, apparatus, device and storage medium based on user label portraits, which can solve the problem that the current user label portraits cannot accurately describe the characteristics of different user groups, which in turn leads to the problem that the decision-making method based on user label portraits is not accurate enough and has poor robustness.
[0006] In a first aspect, an embodiment of the present application provides a decision-making method based on a user tag portrait, the method comprising:
[0007] Obtaining a user tag portrait of a target user; the user tag portrait is text information used to indicate attribute information and / or behavioral characteristics of the target user;
[0008] Analyze the semantic features of the user tag portrait to obtain a word embedding vector corresponding to each word in the user tag portrait;
[0009] The word embedding vector is input into a decision analysis model for decision analysis to obtain a decision result corresponding to the target user; the decision analysis model is obtained based on the training of an encoder-decoder model.
[0010] Optionally, analyzing the semantic features of the user tag portrait to obtain a word embedding vector corresponding to each word in the user tag portrait includes:
[0011] Preprocessing the user tag portrait to obtain a target text sequence;
[0012] A context prediction analysis is performed on each word in the target text sequence to obtain a word embedding matrix; each row in the word embedding matrix is a word embedding vector of each word in the target text sequence.
[0013] Optionally, performing context prediction analysis on each word in the target text sequence to obtain a word embedding matrix includes:
[0014] Traversing the target text sequence according to a preset window, taking the word located at the center of the preset window as the target word, and taking other words in the preset window except the target word as predicted words;
[0015] Encode each word in the target text sequence and initialize the word vector of each word;
[0016] Taking the value of the word vector of the target word as a first variable, constructing a prediction probability that the context of the target word is the predicted word according to the first variable and the word vector of the predicted word, and constructing a first loss function based on the prediction probability;
[0017] The first loss function is minimized using a gradient descent algorithm, and when the first loss function takes a minimum value, the word embedding vector of the target word is determined according to the value of the first variable.
[0018] Optionally, the decision analysis model is trained by adopting the following steps:
[0019] Acquire a training sample; the training sample includes sample portrait data of a sample user and a real decision sequence corresponding to the sample user;
[0020] Analyze the semantic features of the sample portrait data to obtain an input vector corresponding to each word in the sample portrait data;
[0021] Inputting the input vector into an encoder-decoder model for decision analysis to obtain a predicted decision sequence corresponding to the sample user;
[0022] Calculating a loss value between the predicted decision sequence and the actual decision sequence;
[0023] When the loss value does not meet the preset threshold, the model parameters of the encoder-decoder model are iteratively adjusted until the loss value meets the preset threshold, and the adjusted encoder-decoder model is used as the decision analysis model.
[0024] Optionally, inputting the word embedding vector into a decision analysis model for decision analysis to obtain a decision result corresponding to the target user includes:
[0025] Inputting the word embedding vector into a decision analysis model for decision analysis to obtain a decision result sequence corresponding to the target user; the decision result sequence includes a plurality of decision results sorted in order of priority;
[0026] Determining a target decision result based on the priority order of each decision result in the decision result sequence;
[0027] The target decision result is pushed to the target user.
[0028] Optionally, after pushing the target decision result to the target user, the method further includes:
[0029] Acquiring feedback information from the target user; the feedback information indicating whether the target user accepts or rejects the target decision result;
[0030] Taking the value of the model parameter of the decision analysis model as the second variable, and constructing a second loss function according to the user label portrait, the second variable and the feedback information;
[0031] The second loss function is minimized using the gradient descent algorithm, and when the second loss function takes a minimum value, the model parameters of the decision analysis model are iteratively adjusted according to the value of the first variable.
[0032] Optionally, the decision analysis model includes an input layer, a position encoding layer, an encoder, a decoder, a fully connected layer and an output layer;
[0033] The encoder comprises three layers, each layer comprising a first multi-head self-attention network and a first feedforward neural network;
[0034] The decoder includes three layers, each layer including a masked multi-head self-attention network, a second multi-head self-attention network, and a second feedforward neural network.
[0035] In a second aspect, an embodiment of the present application provides a decision-making device based on a user tag portrait, the device comprising:
[0036] An acquisition module, used to acquire a user tag portrait of a target user; the user tag portrait is text information used to indicate attribute information and / or behavioral characteristics of the target user;
[0037] A feature analysis module, used to analyze the semantic features of the user tag portrait to obtain a word embedding vector corresponding to each word in the user tag portrait;
[0038] A decision module is used to input the word embedding vector into a decision analysis model for decision analysis to obtain a decision result corresponding to the target user; the decision analysis model is obtained based on the training of the encoder-decoder model.
[0039] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0040] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0041] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0042] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0043] In the solution provided in the embodiment of the present application, a user label portrait of the target user is obtained; the user label portrait is text information used to indicate the attribute information and / or behavioral characteristics of the target user; the semantic features of the user label portrait are analyzed to obtain a word embedding vector corresponding to each word in the user label portrait; the word embedding vector is input into a decision analysis model for decision analysis to obtain a decision result corresponding to the target user; the decision analysis model is obtained based on the training of the encoder-decoder model.
[0044] From the above, it can be seen that in this application, after obtaining the user label portrait of the target user, a word embedding vector can be obtained by analyzing the semantic features of the user label portrait. The word embedding vector can more accurately understand the semantics of the user label portrait, and then, the word embedding vector is input into the decision analysis model for decision-making, so that the decision analysis model can accurately capture the personalized needs and preferences of the target user, thereby improving the relevance and satisfaction of the decision. Moreover, the decision analysis model is obtained based on the training of the encoder-decoder model, and the encoder-decoder model has the ability to efficiently process complex input data, thereby enhancing the intelligent decision-making ability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is a flow chart showing a decision method based on user tag portrait according to an exemplary embodiment;
[0046] Figure 2 is an architectural diagram of a decision analysis model according to an exemplary embodiment;
[0047] Figure 3 is a block diagram of a decision-making device based on user tag portrait according to an exemplary embodiment;
[0048] Figure 4 is a block diagram of an electronic device according to an exemplary embodiment;
[0049] Figure 5 The figure is a schematic diagram showing the hardware structure of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0051] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0052] The following is a detailed description of the decision-making method based on user tag portraits provided by the embodiment of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0053] Figure 1 It is a flowchart of a decision method based on user tag portrait according to an exemplary embodiment. The decision method based on user tag portrait includes the following steps.
[0054] In step S11, a user tag portrait of the target user is obtained; the user tag portrait is text information used to indicate attribute information and / or behavioral characteristics of the target user.
[0055] User tag portraits refer to one or more personas representing typical user groups in the target market, which are constructed by collecting and analyzing various attribute data and behavior data of users. User tag portraits can help companies better understand the characteristics of each user group, thereby formulating more accurate marketing strategies, product designs, and service optimization measures, and thus providing more personalized products and services, and enhancing user satisfaction and loyalty.
[0056] For example, user tag portraits can be used in product recommendation business scenarios. By analyzing the user tag portraits of target users and based on information such as the purchase history, preferences, behavior patterns, and market trends of the user group to which the target users belong, products that meet the user needs of the target users can be determined, and these products can then be pushed to the target users.
[0057] However, the current user label portrait generation method still needs to be improved in its ability to capture users' personalized needs and preferences, resulting in the inability of user label portraits to accurately describe the characteristics of different user groups, which in turn leads to the decision-making method based on user label portraits being inaccurate and having poor robustness.
[0058] Based on this, this application proposes a decision-making method based on user label portrait to solve the above problems.
[0059] In this step, you first need to obtain the user tag portrait of the target user. The user tag portrait is generated by collecting and analyzing various attribute data and behavioral data of the user. These attribute data may include but are not limited to the target user's age, gender, occupation, income level, purchasing habits, interests and hobbies, etc., and the behavioral data includes but is not limited to the target user's behavior patterns, preferences and needs.
[0060] Among them, the user tag portrait can be text information from the tag system, can be a combination of various tags accumulated by business personnel on a daily basis, or can be obtained by analyzing attribute data and behavior data.
[0061] For example, the data format of the obtained user tag portrait can be in json format, expressed as:
[0062]
[0063] That is, the target user's user ID is "xxxxxxxxxxxx45", age is 30, gender is male, interests include travel, food, movies, the most recent purchases are XX yuan traffic packages purchased on September 1, 2023 and September 15, 2023, the user device used is iPhone 13, the user behavior pattern is high traffic, low talk time, etc. All of this information can be used as a user tag portrait, and part of it can also be filtered as a user tag portrait, without specific limitation.
[0064] In step S12, the semantic features of the user tag portrait are analyzed to obtain a word embedding vector corresponding to each word in the user tag portrait.
[0065] In this step, it is necessary to analyze the semantic features of the user tag portrait, further understand the deep meaning and logical structure of the text information included in the user tag portrait, and obtain the word embedding vector corresponding to each word in the user tag portrait.
[0066] Among them, the Skip-gram model can be used to perform semantic analysis on each word in the user tag portrait to obtain the word embedding vector of each word. The Skip-gram model is a shallow neural network model that does not focus on grammatical structure, but instead obtains the word embedding vector of each word by learning the statistical relationship between words.
[0067] Specifically, the core idea of the Skip-gram model is to start from a given target word and predict the context within a certain preset window size around the target word, so that the Skip-gram model can learn the semantic relationship between words and encode these relationships into the word embedding vector of each word.
[0068] In step S13, the word embedding vector is input into a decision analysis model for decision analysis to obtain a decision result corresponding to the target user; the decision analysis model is obtained based on the training of the encoder-decoder model.
[0069] In this step, the word embedding vector is input into the pre-trained decision analysis model for decision analysis, and the decision analysis model outputs the decision result corresponding to the target user. The decision analysis model is based on the training of the Encoder-Decoder model, which is a model structure widely used in the field of deep learning, especially in the fields of natural language processing, computer vision and speech recognition. It can be used to solve sequence-to-sequence (seq2seq) problems, such as machine translation, text summarization, speech recognition and image description generation.
[0070] The Encoder-Decoder model is a typical neural network architecture, which includes an encoder and a decoder. The encoder is responsible for converting the input data into a fixed-length vector, called a context vector or hidden state; the decoder receives this vector and generates an output sequence based on it.
[0071] For example, in a scenario where a decision analysis model is used to recommend resources to a target user, the Encoder-Decoder model can be used to model the preferences of the target user. Specifically, the encoder can extract meaningful features from the word embedding vector corresponding to each word in the user tag portrait, which can reflect the interests and needs of the target user; the decoder generates a personalized recommendation list based on these features. In addition, by introducing the attention mechanism, the Encoder-Decoder model can further improve the accuracy of the recommendation because it allows the model to focus on the key parts of the input sequence that are more relevant to the output sequence.
[0072] In the present application, the embedded representation vector of the decision result can be realized by labelEncoder (label encoding) or feature discretization. Then, these embedded representations included in the decision result output by the decision analysis model can correspond to the specific decision.
[0073] The working principle of LabelEncoder is very simple: it traverses the list of categories and assigns a unique integer to each different category. For each category, it replaces the text representation of the category with the corresponding integer. For example, for a sales product type, suppose it has three different values: A, B, and C, then LabelEncoder will assign integers 0, 1, 2 (or any order) to these three categories respectively.
[0074] For example, in a scenario where the decision analysis model is used to recommend resources to target users, the specification information of the sales products recorded in the operator's sales product management system can be directly labelEncoder or feature discretized to obtain the corresponding embedded representation vector of the sales products.
[0075] For example, the specification information of a sales product may include but is not limited to: sales product type, price, validity period, included traffic, included voice, and rights. Among them, continuous values such as price, included traffic, included voice, etc. will be feature discretized, and discrete variables such as sales product type will be processed by LabelEncoder. Ultimately, each sales product will get a unique corresponding embedding representation vector.
[0076] Special note: To ensure the subsequent training of the Encoder-Decoder model, the embedding representation vector of the decision result will generally have the same dimension as the word embedding vector corresponding to each word in the user label portrait.
[0077] In one implementation, the semantic features of the user tag portrait are analyzed to obtain a word embedding vector corresponding to each word in the user tag portrait, including:
[0078] Preprocess the user label portrait to obtain the target text sequence;
[0079] Perform context prediction analysis on each word in the target text sequence to obtain a word embedding matrix; each row in the word embedding matrix is the word embedding vector of each word in the target text sequence.
[0080] Specifically, in this embodiment, the user label portrait text needs to be preprocessed first to make these text information meet the requirements of subsequent training. For example, some meaningless fields such as user_id can be removed from the user label portrait; unnecessary characters such as "{}" double quotes, single quotes and other characters in the user label portrait can be removed; ":" in the user label portrait can be replaced with a space, etc. In the actual application process, preprocessing needs to be performed in combination with its own scenarios and requirements, and this application does not specifically limit this.
[0081] In this way, the text information in the user tag portrait can be converted into a text sequence at the word level. Then, a unique ID can be assigned to each word, and a vocabulary can be used to store all unique words and their corresponding IDs, thereby converting unstructured text data into structured digital data for subsequent model processing.
[0082] For example, assuming that the user tag profile of the target user is simply "travel", then the text information can be split into word-level text sequences: "travel", "travel", where the ID of "travel" may be 1001, and the ID of "travel" may be 1002, thereby encoding each word.
[0083] In one implementation, context prediction analysis is performed on each word in the target text sequence to obtain a word embedding matrix, including:
[0084] Traverse the target text sequence according to the preset window, take the word located at the center of the preset window as the target word, and take the other words in the preset window except the target word as the predicted words;
[0085] Encode each word in the target text sequence and initialize the word vector of each word;
[0086] Taking the value of the word vector of the target word as the first variable, constructing the prediction probability that the context of the target word is the predicted word according to the first variable and the word vector of the predicted word, and constructing a first loss function based on the prediction probability;
[0087] The first loss function is minimized using a gradient descent algorithm, and when the first loss function takes a minimum value, a word embedding vector of the target word is determined according to the value of the first variable.
[0088] That is, the Skip-gram model is used to perform semantic analysis on each word in the user tag portrait to obtain the word embedding vector of each word. Specifically, assuming that the vocabulary size is V, the dimension of each word vector is d, and the word vector matrix is W, which is a V×d matrix, and each row corresponds to the vector representation of a word. Let the context vector matrix be W′, which is also a V×d matrix, but is usually different from W.
[0089] Then, traverse the target text sequence, for any target word w t , select a preset window, then the context word set C(w t ) is the first c words and the last c words centered on , and the words in the context word set are the predicted words. For a given target word w i and predicted word w j , then, the predicted probability of the context of the target word being the predicted word is P(w i |w j ), expressed as:
[0090]
[0091] Among them, u j is the context vector matrix W′ corresponding to w j A line, that is, the predicted word w jThe word vector of Indicates u j The transpose of v i is the word vector matrix W corresponding to w i A line, u k is the context vector matrix W′ corresponding to w k A line, that is, a word w k The word vector of Indicates u k exp is the transpose of the natural logarithm base e.
[0092] The first loss function constructed based on the predicted probability is expressed as:
[0093]
[0094] Among them, logP(C|W, W′) is the likelihood probability of traversing the target text sequence and taking each word as the target word. In order to maximize the likelihood probability, a negative sign is added in front of the likelihood probability function as the final loss function J(W, W′) to implement the gradient descent algorithm.
[0095] In this way, by minimizing J(W, W′) through the gradient descent algorithm, the parameters of W and W′ can be updated and optimized during the training process of each batch, and the skip-gram model training based on the user label portrait can be realized. The W matrix obtained by minimizing J(W, W′) is the final word embedding matrix. The dimension of each row vector in the word embedding matrix is d, which corresponds to the word embedding vector of a character.
[0096] In one implementation, the following steps may be used in this application to train a decision analysis model:
[0097] Obtain training samples; the training samples include sample portrait data of sample users and real decision sequences corresponding to the sample users;
[0098] Analyze the semantic features of the sample portrait data to obtain the input vector corresponding to each word in the sample portrait data;
[0099] Input the input vector into the encoder-decoder model for decision analysis to obtain the predicted decision sequence corresponding to the sample user;
[0100] Calculate the loss value between the predicted decision sequence and the actual decision sequence;
[0101] When the loss value does not meet the preset threshold, the model parameters of the encoder-decoder model are iteratively adjusted until the loss value meets the preset threshold, and the adjusted encoder-decoder model is used as the decision analysis model.
[0102] That is to say, first, a training sample is obtained, which includes sample portrait data of the sample user and the real decision sequence corresponding to the sample user. The real decision sequence is used to indicate the decision actually adopted by the sample user.
[0103] For example, in a scenario where a decision analysis model is used to recommend resources to target users, the actual decision sequence originates from sales product ordering data in a real business system, while the sample portrait data can be manually annotated by business experts.
[0104] Then, by analyzing the semantic features of the sample portrait data, the word embedding vector corresponding to each character in the sample portrait data is obtained. In order to distinguish it from the word embedding vector corresponding to each character in the user portrait data of the target user, the word embedding vector corresponding to each character in the sample portrait data is called the input vector.
[0105] Furthermore, the input vector is used as the input of the encoder-decoder model, and the encoder-decoder model performs decision analysis to obtain the predicted decision sequence corresponding to the sample user.
[0106] For example, in a scenario where the decision analysis model is used to recommend resources to target users, the prediction decision sequence can be a sales product recommendation sequence for the target user. Among them, there is a business priority ranking for the recommended sales product combination mainly to make the sales product packaging recommendation more in line with the business. The sales product ranking rule is: product>package>contract>agreement>...(key business ranking is omitted here)>others.
[0107] Furthermore, the gap between the predicted decision sequence and the actual decision sequence can be measured by calculating the loss value, so that the predicted decision sequence and the actual decision sequence are most similar in probability. When the loss value does not meet the preset threshold, the model parameters of the encoder-decoder model are iteratively adjusted until the loss value meets the preset threshold, and the adjusted encoder-decoder model is used as the decision analysis model. The preset threshold can be a preset smaller value or the minimum value of the loss value.
[0108] For example, the loss value J can be calculated using the following formula:
[0109] J = -∑logP(y i |x i )
[0110] Among them, x i is the input vector, y i is the real decision sequence, P(y i |x i ) indicates the model predicts x i The corresponding label is y iThe probability of the maximum likelihood can be determined by minimizing the loss value J, and then the model weight update can be completed through optimization algorithms such as gradient descent.
[0111] During the training process of the decision analysis model, the optimizer can select the Adam optimizer, the learning rate can be set to r=0.001, the batch_size (batch size) of the training can be 16, and the epoch (era) can be set to 314, where epoch refers to the number of times the entire training sample is forward propagated and backpropagated in the encoder-decoder model. In other words, one epoch represents the number of complete traversals of the training sample in the encoder-decoder model training.
[0112] In one implementation, the word embedding vector is input into a decision analysis model for decision analysis to obtain a decision result corresponding to the target user, including:
[0113] The word embedding vector is input into the decision analysis model for decision analysis to obtain a decision result sequence corresponding to the target user; the decision result sequence includes multiple decision results sorted in order of priority;
[0114] Determine the target decision result based on the priority order of each decision result in the decision result sequence;
[0115] Push target decision results to target users.
[0116] That is to say, the decision results output by the decision analysis model can be a sequence, which includes multiple decision results sorted in order of priority. Then, one or more target decision results can be determined according to the priority order, and then the target decision results can be pushed to the target users.
[0117] For example, in a scenario where the decision analysis model is used to recommend resources to target users, the decision result sequence may include multiple sales items sorted by priority. In this case, the sales item with the highest priority can be pushed to the target user, or further reference can be made to information such as the recommendation strength of each sales item to determine one or more of them and recommend them to the target user. This application does not limit this.
[0118] In one implementation, after the target decision result is pushed to the target user, the method further includes:
[0119] Obtaining feedback information from the target user; the feedback information indicates whether the target user accepts or rejects the target decision result;
[0120] The value of the model parameter of the decision analysis model is used as the second variable, and the second loss function is constructed according to the user label portrait, the second variable and the feedback information;
[0121] The second loss function is minimized using a gradient descent algorithm. When the second loss function takes a minimum value, the model parameters of the decision analysis model are iteratively adjusted according to the value of the first variable.
[0122] In other words, the decision analysis model can be further optimized by using DPO (Direct Preference Optimization). The DPO algorithm is an alignment algorithm that does not require reinforcement learning and can achieve model alignment with a complexity similar to that of supervised fine-tuning.
[0123] For example, in a scenario where the decision analysis model is used to recommend resources to target users, the above-mentioned supervised training can make the second loss function of the sales product sequence recommended based on the user label portrait take the lowest value. However, whether the sales product sequence complies with business rules and whether it can avoid business risks still needs to be trained through business alignment.
[0124] Therefore, a series of optimized sample sets with business preferences can be defined according to business needs. The optimized sample set consists of three parts:
[0125] x: user tag portrait;
[0126] y + :The target user accepts the target decision result;
[0127] y - : The target user rejects the target decision result.
[0128] Then, business rules are added as additional constraints during the training process to ensure that the target decision results are consistent with actual business operations. The optimization goal of the model is to minimize the second loss function L, and the expression of L is:
[0129]
[0130] in, express When the input is x, the probability distribution of the target user accepting the target decision result is, express When the input is x, the probability distribution of the target user rejecting the target decision result, π θ (y + |x) represents π θ When the input is x, the probability distribution of the target user accepting the target decision result, π θ (y - |x) represents π θWhen the input is x, the probability distribution of the target user rejecting the target decision result, α represents the first hyperparameter, β represents the second hyperparameter, σ represents the third hyperparameter, and the first hyperparameter, the second hyperparameter and the third hyperparameter are respectively used to adjust the weights of different parts in the second loss function.
[0131] is a decision analysis model generated through supervised training in the above steps, π θ It is also a decision analysis model in essence. Before optimizing based on the second loss function, and π θ It is actually the same model. The parameters of π are not updated, but θ The parameters of the model need to be updated.
[0132] Then, the DPO-based preference alignment algorithm fine-tunes the decision analysis model and outputs π θ The model is the model output that has finally completed business alignment, that is, the optimized decision analysis model. The optimized decision analysis model can not only better complete the decision based on user tag portraits, but also effectively improve the accuracy of the decision.
[0133] In one implementation, the decision analysis model includes an input layer, a position encoding layer, an encoder, a decoder, a fully connected layer, and an output layer;
[0134] The encoder consists of three layers, each of which includes a first multi-head self-attention network and a first feedforward neural network;
[0135] The decoder consists of three layers, each of which includes a masked multi-head self-attention network, a second multi-head self-attention network, and a second feedforward neural network.
[0136] Among them, the input layer is used to receive the input sequence and map it to the dimensional space of the decision analysis model; the position encoding layer is used to add position information so that the decision analysis model can distinguish different positions in the input sequence.
[0137] The encoder consists of three layers, each of which includes a first multi-head self-attention network and a first feedforward neural network. The first multi-head self-attention network is used to calculate the relationship between each position and all other positions to capture long-distance dependencies, and the first feedforward neural network is used to further extract features.
[0138] The decoder consists of three layers, each of which includes a masked multi-head self-attention network, a second multi-head self-attention network, and a second feedforward neural network. The masked multi-head self-attention network is used to prevent the decision analysis model from seeing future information in advance during the decoding stage, and uses a mask to block out the ungenerated parts; the second multi-head self-attention network enables the decoder to pay attention not only to the position of its own sequence, but also to the output of the encoder, which is achieved through encoder-decoder attention. The second feedforward neural network is similar to the first feedforward neural network in the encoder and is used for feature extraction.
[0139] In this application, a three-layer encoder and a three-layer decoder are combined, and the model architecture of the decision analysis model is as follows: Figure 2 In addition, in the decision analysis model, the previous output of the decoder can be shifted right by one bit as the current input, thereby realizing the autoregressive prediction process.
[0140] From the above, it can be seen that the technical solution provided by the embodiment of the present application, after obtaining the user label portrait of the target user, can obtain a word embedding vector by analyzing the semantic features of the user label portrait. The word embedding vector can more accurately understand the semantics of the user label portrait, and then, input the word embedding vector into the decision analysis model for decision-making, so that the decision analysis model can accurately capture the personalized needs and preferences of the target user, thereby improving the relevance and satisfaction of the decision. Moreover, the decision analysis model is obtained based on the training of the encoder-decoder model, and the encoder-decoder model has the ability to efficiently process complex input data, thereby enhancing the intelligent decision-making ability of the system.
[0141] The decision method based on user tag portrait provided in the embodiment of the present application can be executed by a decision device based on user tag portrait. In the embodiment of the present application, the method of executing terminal access by a decision device based on user tag portrait is taken as an example to illustrate the device of the decision method based on user tag portrait provided in the embodiment of the present application.
[0142] Figure 3 The present invention is a block diagram of a decision-making device based on a user tag portrait according to an exemplary embodiment, which is applied to a server in a distributed system. The distributed system also includes multiple computing nodes, including:
[0143] The acquisition module 201 is used to acquire a user tag portrait of a target user; the user tag portrait is text information indicating attribute information and / or behavior characteristics of the target user;
[0144] A feature analysis module 202 is used to analyze the semantic features of the user tag portrait to obtain a word embedding vector corresponding to each word in the user tag portrait;
[0145] The decision module 203 is used to input the word embedding vector into a decision analysis model for decision analysis to obtain a decision result corresponding to the target user; the decision analysis model is obtained based on the training of the encoder-decoder model.
[0146] In one implementation, the feature analysis module 202 is specifically configured to:
[0147] Preprocessing the user tag portrait to obtain a target text sequence;
[0148] A context prediction analysis is performed on each word in the target text sequence to obtain a word embedding matrix; each row in the word embedding matrix is a word embedding vector of each word in the target text sequence.
[0149] In one implementation, the feature analysis module 202 is specifically configured to:
[0150] Traversing the target text sequence according to a preset window, taking the word located at the center of the preset window as the target word, and taking other words in the preset window except the target word as predicted words;
[0151] Encode each word in the target text sequence and initialize the word vector of each word;
[0152] Taking the value of the word vector of the target word as a first variable, constructing a prediction probability that the context of the target word is the predicted word according to the first variable and the word vector of the predicted word, and constructing a first loss function based on the prediction probability;
[0153] The first loss function is minimized using a gradient descent algorithm, and when the first loss function takes a minimum value, the word embedding vector of the target word is determined according to the value of the first variable.
[0154] In one implementation, the device further includes a training module, which is used to train the decision analysis model by using the following steps:
[0155] Acquire a training sample; the training sample includes sample portrait data of a sample user and a real decision sequence corresponding to the sample user;
[0156] Analyze the semantic features of the sample portrait data to obtain an input vector corresponding to each word in the sample portrait data;
[0157] Inputting the input vector into an encoder-decoder model for decision analysis to obtain a predicted decision sequence corresponding to the sample user;
[0158] Calculating a loss value between the predicted decision sequence and the actual decision sequence;
[0159] When the loss value does not meet the preset threshold, the model parameters of the encoder-decoder model are iteratively adjusted until the loss value meets the preset threshold, and the adjusted encoder-decoder model is used as the decision analysis model.
[0160] In one implementation, the decision module 203 is specifically configured to:
[0161] Inputting the word embedding vector into a decision analysis model for decision analysis to obtain a decision result sequence corresponding to the target user; the decision result sequence includes a plurality of decision results sorted in order of priority;
[0162] Determining a target decision result based on the priority order of each decision result in the decision result sequence;
[0163] The target decision result is pushed to the target user.
[0164] In one implementation, the device further includes an optimization module, which is used to:
[0165] Acquiring feedback information from the target user; the feedback information indicating whether the target user accepts or rejects the target decision result;
[0166] Taking the value of the model parameter of the decision analysis model as the second variable, and constructing a second loss function according to the user label portrait, the second variable and the feedback information;
[0167] The second loss function is minimized using the gradient descent algorithm, and when the second loss function takes a minimum value, the model parameters of the decision analysis model are iteratively adjusted according to the value of the first variable.
[0168] In one implementation, the decision analysis model includes an input layer, a position encoding layer, an encoder, a decoder, a fully connected layer, and an output layer;
[0169] The encoder comprises three layers, each layer comprising a first multi-head self-attention network and a first feedforward neural network;
[0170] The decoder includes three layers, each layer including a masked multi-head self-attention network, a second multi-head self-attention network, and a second feedforward neural network.
[0171] From the above, it can be seen that the technical solution provided by the embodiment of the present application, after obtaining the user label portrait of the target user, can obtain a word embedding vector by analyzing the semantic features of the user label portrait. The word embedding vector can more accurately understand the semantics of the user label portrait, and then, input the word embedding vector into the decision analysis model for decision-making, so that the decision analysis model can accurately capture the personalized needs and preferences of the target user, thereby improving the relevance and satisfaction of the decision. Moreover, the decision analysis model is obtained based on the training of the encoder-decoder model, and the encoder-decoder model has the ability to efficiently process complex input data, thereby enhancing the intelligent decision-making ability of the system.
[0172] The decision method based on user tag portrait provided in the embodiment of the present application can be executed by a terminal access terminal. In the embodiment of the present application, the method of executing terminal access by a terminal access terminal is taken as an example to illustrate the device of the decision method based on user tag portrait provided in the embodiment of the present application.
[0173] The decision-making device based on user tag portrait in the embodiment of the present application can be an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a car electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0174] The decision-making device based on user tag portrait provided in the embodiment of the present application can achieve Figure 1 to Figure 2 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0175] Alternatively, if Figure 4As shown, an embodiment of the present application also provides an electronic device 700, including a processor 701 and a memory 702, wherein the memory 702 stores programs or instructions that can be executed on the processor 701, and when the program or instructions are executed by the processor 701, the various steps of the above-mentioned decision-making method embodiment based on user tag portraits are implemented, and the same technical effect can be achieved. To avoid repetition, they will not be repeated here.
[0176] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0177] Figure 5 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0178] The electronic device 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010 and other components.
[0179] Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 5 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0180] From the above, it can be seen that the technical solution provided by the embodiment of the present application, after obtaining the user label portrait of the target user, can obtain a word embedding vector by analyzing the semantic features of the user label portrait. The word embedding vector can more accurately understand the semantics of the user label portrait, and then, input the word embedding vector into the decision analysis model for decision-making, so that the decision analysis model can accurately capture the personalized needs and preferences of the target user, thereby improving the relevance and satisfaction of the decision. Moreover, the decision analysis model is obtained based on the training of the encoder-decoder model, and the encoder-decoder model has the ability to efficiently process complex input data, thereby enhancing the intelligent decision-making ability of the system.
[0181] It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0182] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0183] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1010.
[0184] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned decision-making method embodiment based on user tag portrait is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0185] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0186] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned decision-making method embodiment based on user tag portraits, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0187] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0188] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned decision-making method embodiment based on user tag portraits, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0189] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0190] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0191] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A decision-making method based on user tag portrait, characterized in that: The method comprises: Obtaining a user tag portrait of a target user; the user tag portrait is text information used to indicate attribute information and / or behavioral characteristics of the target user; Analyze the semantic features of the user tag portrait to obtain a word embedding vector corresponding to each word in the user tag portrait; The word embedding vector is input into a decision analysis model for decision analysis to obtain a decision result corresponding to the target user; the decision analysis model is obtained based on the training of an encoder-decoder model.
2. The decision-making method based on user tag portrait according to claim 1 is characterized in that: The step of analyzing the semantic features of the user tag portrait to obtain a word embedding vector corresponding to each word in the user tag portrait includes: Preprocessing the user tag portrait to obtain a target text sequence; A context prediction analysis is performed on each word in the target text sequence to obtain a word embedding matrix; each row in the word embedding matrix is a word embedding vector of each word in the target text sequence.
3. The decision-making method based on user tag portrait according to claim 2 is characterized in that: The process of performing context prediction analysis on each word in the target text sequence to obtain a word embedding matrix includes: Traversing the target text sequence according to a preset window, taking the word located at the center of the preset window as the target word, and taking other words in the preset window except the target word as predicted words; Encode each word in the target text sequence and initialize the word vector of each word; Taking the value of the word vector of the target word as a first variable, constructing a prediction probability that the context of the target word is the predicted word according to the first variable and the word vector of the predicted word, and constructing a first loss function based on the prediction probability; The first loss function is minimized using a gradient descent algorithm, and when the first loss function takes a minimum value, the word embedding vector of the target word is determined according to the value of the first variable.
4. The decision-making method based on user tag portrait according to claim 1 is characterized in that: The decision analysis model is trained using the following steps: Acquire a training sample; the training sample includes sample portrait data of a sample user and a real decision sequence corresponding to the sample user; Analyze the semantic features of the sample portrait data to obtain an input vector corresponding to each word in the sample portrait data; Inputting the input vector into an encoder-decoder model for decision analysis to obtain a predicted decision sequence corresponding to the sample user; Calculating a loss value between the predicted decision sequence and the actual decision sequence; When the loss value does not meet the preset threshold, the model parameters of the encoder-decoder model are iteratively adjusted until the loss value meets the preset threshold, and the adjusted encoder-decoder model is used as the decision analysis model.
5. The decision-making method based on user tag portrait according to claim 1 is characterized in that: The step of inputting the word embedding vector into a decision analysis model for decision analysis to obtain a decision result corresponding to the target user includes: Inputting the word embedding vector into a decision analysis model for decision analysis to obtain a decision result sequence corresponding to the target user; the decision result sequence includes a plurality of decision results sorted in order of priority; Determining a target decision result based on the priority order of each decision result in the decision result sequence; The target decision result is pushed to the target user.
6. The decision-making method based on user tag portrait according to claim 5 is characterized in that: After pushing the target decision result to the target user, the method further includes: Acquiring feedback information from the target user; the feedback information indicating whether the target user accepts or rejects the target decision result; Taking the value of the model parameter of the decision analysis model as the second variable, and constructing a second loss function according to the user label portrait, the second variable and the feedback information; The second loss function is minimized using the gradient descent algorithm, and when the second loss function takes a minimum value, the model parameters of the decision analysis model are iteratively adjusted according to the value of the first variable.
7. The decision-making method based on user tag portrait according to claim 1 is characterized in that: The decision analysis model includes an input layer, a position encoding layer, an encoder, a decoder, a fully connected layer and an output layer; The encoder comprises three layers, each layer comprising a first multi-head self-attention network and a first feedforward neural network; The decoder includes three layers, each layer including a masked multi-head self-attention network, a second multi-head self-attention network, and a second feedforward neural network.
8. A decision-making device based on user tag portrait, characterized in that: The device comprises: An acquisition module, used to acquire a user tag portrait of a target user; the user tag portrait is text information used to indicate attribute information and / or behavioral characteristics of the target user; A feature analysis module, used to analyze the semantic features of the user tag portrait to obtain a word embedding vector corresponding to each word in the user tag portrait; A decision module is used to input the word embedding vector into a decision analysis model for decision analysis to obtain a decision result corresponding to the target user; the decision analysis model is obtained based on the training of the encoder-decoder model.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the decision-making method based on user tag portrait as described in any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium stores programs or instructions, and when the programs or instructions are executed by the processor, the steps of the decision-making method based on user tag portraits as described in any one of claims 1-7 are implemented.