A user tag determination method, an electronic device, and a storage medium
By combining Bayesian networks and large language models, and using cross-validation and genetic algorithms to calculate weights, the problem of inaccurate label matching in text classification is solved, achieving higher accuracy and reliability in text classification.
Patent Information
- Application Number
- CN202510088355.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-01-21
AI Technical Summary
In existing technologies, Bayesian network models cannot handle natural language input and have low recall rates, while large language models have insufficient accuracy in classification results, leading to inaccurate text classification label matching, which affects the classification of text libraries and search efficiency.
By combining a pre-defined Bayesian network model and a target large language model, and through cross-validation of the training and test sets, various matching degrees and error values are obtained. The weights are calculated using a genetic algorithm, and a weighted sum is performed to finally determine the target category label.
It improves the accuracy and reliability of text classification label filtering, and enhances the accuracy and robustness of text classification.
Smart Images

Figure CN119961455B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of text processing, and in particular to a user tag determination method, electronic device, and storage medium. Background Technology
[0002] In the existing text classification management process, in order to facilitate the unified storage and retrieval of texts, it is necessary to classify and manage texts. However, when processing text strings in certain fields, such as processing electronic medical record texts, feature selection is relatively troublesome, which may lead to inaccurate matching with classification labels. This results in a messy classification of texts in the text library, making subsequent text retrieval difficult and affecting the accuracy of reference after text retrieval.
[0003] Currently, text classification can be performed using Bayesian networks. Bayesian networks can perform basic modeling and optimize the basic model using a large amount of text data, and the model is interpretable. However, Bayesian network models rely on structured inputs and cannot handle natural language inputs. Furthermore, the number of nodes in the model is limited by modeling costs, making it impossible to cover a wide range of textual words and concepts, resulting in generally low recall rates. In contrast, large language models, which have emerged in recent years, can understand natural language and respond to all input scenarios. When used for text classification, they can overcome the limitations of Bayesian networks. However, the accuracy of their classification results cannot be guaranteed, and large language models themselves lack interpretability.
[0004] Therefore, how to utilize the above model and improve the accuracy and reliability of label selection during text classification has become an urgent problem to be solved. Summary of the Invention
[0005] To address the aforementioned technical problems, the technical solution adopted by this invention is as follows:
[0006] According to a first aspect of the present invention, a method for determining user tags is provided, the method comprising the following steps:
[0007] Based on a pre-defined Bayesian network model and a target large language model, the first and second matching degrees of the target user for each pre-defined category label are obtained according to the user description text input by the target user.
[0008] The sample set segmentation method in cross-validation is used to divide several historical descriptive text samples into training and test sets several times in proportion. Based on each segmentation result, a preset Bayesian network model is trained to obtain several model error values. Based on the target Bayesian network model obtained after each training, the third matching degree corresponding to the first matching degree and the fourth matching degree corresponding to the second matching degree are obtained.
[0009] Based on several model error values and the third and fourth matching degrees corresponding to each model error value, the first label weight corresponding to the first matching degree and the second label weight corresponding to the second matching degree are obtained.
[0010] The final matching degree of the preset category tag corresponding to the maximum first matching degree is calculated by weighted summing the first matching degree and the second matching degree of the preset category tag corresponding to the maximum first matching degree, as well as the first tag weight and the second tag weight; and the latest matching degree of the preset category tag corresponding to the maximum second matching degree is calculated by weighted summing the first matching degree and the second matching degree of the preset category tag corresponding to the maximum second matching degree.
[0011] When the final matching degree of the preset category label corresponding to the maximum first matching degree is different from the final matching degree of the preset category label corresponding to the maximum second matching degree, the preset category label corresponding to the maximum final matching degree is determined as the target category label of the target user; otherwise, the preset category label corresponding to the maximum first matching degree or the preset category label corresponding to the maximum second matching degree is determined as the target category label of the target user.
[0012] According to a second aspect of the present invention, a non-transitory computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or the at least one program being loaded and executed by a processor to implement the user tag determination method described above.
[0013] According to a third aspect of the present invention, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0014] The present invention has at least the following beneficial effects:
[0015] This invention provides a user tag determination method. First, based on the user description text input by the target user, the method obtains the first matching degree of each preset category tag for the target user under a preset Bayesian network model and the second matching degree under a target large language model. By obtaining the matching degree under the two implementation methods, a preliminary judgment basis for tag screening of the target user can be provided, which is beneficial to the reliability of tag screening. Then, after training the preset Bayesian network model several times, several model error values are obtained, and several third matching degrees and several fourth matching degrees are obtained based on the user description text. According to the influence relationship between the model error value and the third and fourth matching degrees, and considering that the influence of the third and fourth matching degrees on the model error value is different, several expressions are constructed and the optimal solution is obtained through a genetic algorithm to obtain the first tag weight and the second tag weight. Finally, a weighted sum is calculated to obtain the final matching degree of the preset category tag corresponding to the maximum first matching degree and the maximum second matching degree, respectively. Since the magnitude of the first tag weight and the magnitude of the second tag weight reflect the importance of the third and fourth matching degrees, respectively, assigning weights to the third and fourth matching degrees can make the final matching degree more accurate and reliable, thereby improving the accuracy of the selected target category tags. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart of a user tag determination method provided in an embodiment of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] This invention provides a method for determining user tags, such as... Figure 1 As shown, the method includes the following steps:
[0020] S100, based on a preset Bayesian network model and a target large language model, obtains the first and second matching degrees of each preset category label corresponding to the target user according to the user description text input by the target user.
[0021] In a specific embodiment, the first and second matching degrees of the target user for each preset category tag are obtained through the following steps:
[0022] S101, extract several first user keywords from the user description text, and input the several first user keywords into a preset Bayesian network model to obtain the first matching degree of each preset category label corresponding to the target user; this can be understood as: when the word vectors corresponding to the several first user keywords are used as input, the probability of each preset category label output by the preset Bayesian network model is used as the matching degree of each preset category label with the target user; in this embodiment, the preset category label can be a user type label pre-set when classifying users of any app, or it can be any disease name, etc.
[0023] Specifically, the user description text refers to text that describes the abnormal state characteristics of the target user; for example, text describing the user's operating habits of the app, or text describing electronic medical records.
[0024] Specifically, the first user keyword refers to a keyword that indicates any abnormal state characteristic of the target user; for example, headache, fever, cough, chest pain, palpitations, diarrhea, etc.
[0025] Specifically, the preset Bayesian network model refers to a model trained based on several preset category labels, several historical user keywords corresponding to each preset category label, and several historical user state information corresponding to each preset category label. Those skilled in the art are familiar with the specific training methods, which will not be elaborated here. The first matching degree of the target user for any preset category label meets the following condition:
[0026] P1 i =(P(S1,S1,…,S) n |D i )×P(D i )) / P(S1,S1,…,S n ), where P1 i D represents the first matching degree of the target user corresponding to the i-th preset category label. i For the i-th preset category label, S n Let n be the nth first user keyword, where n is the number of first user keywords extracted from the user description text.
[0027] S102, the user description text is input into the target large language model for processing to obtain several first user state information, and the several first user state information is input into a preset Bayesian network model to obtain the second matching degree of the target user for each preset category label; it can be understood that after the target large language model performs semantic analysis on the user description text, it extracts several key first user state information. For example, some users' user description text has problems with non-standard vocabulary or unclear descriptions. The target large language model can perform semantic analysis and standardize vocabulary processing on it. The first user state information can be keywords or short text, such as the target user's input of a fast heartbeat, number of diarrhea episodes, etc.
[0028] Specifically, the target large language model refers to the model obtained by training a preset large language model based on several historical user description texts and the historical user state information corresponding to each historical user description text. The training process is existing technology and will not be described again.
[0029] Specifically, the method for obtaining the second matching degree is the same as the method for obtaining the first matching degree.
[0030] The above-mentioned methods extract several first user keywords from user description text and extract several first user state information from user description text using a target large language model. Both methods determine the probability of the target user belonging to each preset category label based on a pre-trained preset Bayesian network model. This yields probabilities under two implementation methods. Combining the two probabilities achieves the integration of the preset Bayesian network model and the target large language model, which is beneficial to the accuracy of category label matching.
[0031] S200 uses the sample set segmentation method in cross-validation to divide several historical descriptive text samples into training and test sets several times in proportion. Based on each segmentation result, a preset Bayesian network model is trained to obtain several model error values. Based on the target Bayesian network model obtained after each training, the third matching degree corresponding to the first matching degree and the fourth matching degree corresponding to the second matching degree are obtained. It can be understood that after each training, the target Bayesian network model is obtained, and step S100 is executed to obtain the third matching degree and the fourth matching degree.
[0032] To facilitate understanding, the following explanation is provided: Using the idea of cross-validation, several historical descriptive text samples are divided into K parts. One part is used as the test set, and the other K-1 parts are integrated together as the training set. The trained model is then used on the test set to obtain model error values. Therefore, a total of K model error values can be obtained.
[0033] As described above, by dividing the sample set into training and test sets multiple times, the preset Bayesian network model can be trained multiple times. Using the model error value obtained during each training session is beneficial for adjusting the model parameters and increasing the prediction accuracy and robustness of the trained model.
[0034] S300: Based on several model error values and the third and fourth matching degrees corresponding to each model error value, obtain the first label weight corresponding to the first matching degree and the second label weight corresponding to the second matching degree.
[0035] In a specific embodiment, the first label weight and the second label weight are obtained through the following steps:
[0036] S301, for any model error value, substitute the model error value and the corresponding third and fourth matching degrees as c, x, and y respectively into the preset error value influence model c = ax + by to obtain the model to be processed error value influence model corresponding to the model error value, where a represents the probability coefficient of the third matching degree and b represents the probability coefficient of the fourth matching degree. It can be understood that: during each training, the preset Bayesian network model corresponds to an error value, and the target Bayesian network model obtained after each training corresponds to a new first matching degree and a new second matching degree, that is, a third matching degree and a fourth matching degree. Therefore, the three are related and have an influence relationship.
[0037] S302, based on the impact of the unprocessed error value corresponding to each model error value on the model, the optimal solution is obtained through a genetic algorithm to obtain the values of a and b.
[0038] S303, the value of a is used as the first label weight corresponding to the first matching degree, and the value of b is used as the second label weight corresponding to the second matching degree.
[0039] Preferably, a / (a+b) can be used as the first label weight corresponding to the first matching degree, and b / (a+b) can be used as the second label weight corresponding to the second matching degree.
[0040] As mentioned above, since the model error value, the third matching degree, and the fourth matching degree are mutually influential, and the influence of the third matching degree and the fourth matching degree on the model error value is different, a linear fit is performed on the three to obtain expressions. Each model error value corresponds to an expression. Based on the obtained expressions, a genetic algorithm is used to find the optimal solution, which can obtain the importance of the third matching degree and the fourth matching degree on the model error value. Therefore, the two coefficients corresponding to the optimal solution are used as the weight values of the third matching degree and the fourth matching degree, respectively, which can improve the accuracy and reliability of the final matching degree obtained.
[0041] S400: The final matching degree of the preset category label corresponding to the maximum first matching degree is calculated by weighted summing the first matching degree and the second matching degree of the preset category label corresponding to the maximum first matching degree, as well as the first label weight and the second label weight; and the latest matching degree of the preset category label corresponding to the maximum second matching degree is calculated by weighted summing the first matching degree and the second matching degree of the preset category label corresponding to the maximum second matching degree. This can be understood as: filtering out the preset category labels corresponding to the maximum first matching degree and the preset category labels corresponding to the maximum second matching degree, and only calculating the final matching degree of these two preset category labels.
[0042] Specifically, the final matching degree of the preset category tag corresponding to the maximum first matching degree meets the following conditions:
[0043] Q1 = α × R1 + β × R2, where α is the weight of the first label, β is the weight of the second label, R1 is the first matching degree of the preset category label corresponding to the maximum first matching degree, and R2 is the second matching degree of the preset category label corresponding to the maximum first matching degree.
[0044] Specifically, the final matching degree of the preset category tag corresponding to the maximum second matching degree meets the following conditions:
[0045] Q2 = α × R3 + β × R4, where R3 is the first matching degree of the preset category label corresponding to the maximum second matching degree, and R4 is the second matching degree of the preset category label corresponding to the maximum second matching degree.
[0046] S500, when the final matching degree of the preset category label corresponding to the maximum first matching degree is different from the final matching degree of the preset category label corresponding to the maximum second matching degree, the preset category label corresponding to the maximum final matching degree is determined as the target category label of the target user; otherwise, the preset category label corresponding to the maximum first matching degree or the preset category label corresponding to the maximum second matching degree is determined as the target category label of the target user; this can be understood as: randomly selecting any one of the two preset category labels as the target category label of the target user.
[0047] As mentioned above, since the weights of the first and second tags reflect the importance of the third and fourth matching degrees respectively, weights are assigned to the third and fourth matching degrees to make the final matching degree more accurate and reliable, thereby improving the accuracy of user tag filtering.
[0048] In a parallel embodiment, the method further determines the target category label for the target user by the following steps:
[0049] P100: Determine several first historical description texts corresponding to several first user keywords from the historical description text library, and obtain the first tag accuracy corresponding to each preset category tag based on the actual category tag corresponding to each first historical description text.
[0050] Specifically, the accuracy of the first label corresponding to the preset category label is obtained through the following steps:
[0051] P101, extract several second user keywords from each historical description text in the historical description text library, and determine the historical description text in the historical description text library that has the same number of second user keywords as several first user keywords as the first historical description text; it can be understood that: the number of second user keywords corresponding to the first historical description text corresponds one-to-one with the number of first user keywords, and the number is equal.
[0052] P102, for any preset category label, select several actual category labels that are the same as the preset category label from several actual category labels corresponding to several first historical description texts. For example: although several second user keywords corresponding to each first historical description text correspond one-to-one with several first user keywords, their actual classification results do not belong to the same category label. Therefore, the actual category labels that are the same as the preset category labels are selected.
[0053] P103, the proportion of the number of actual category labels selected from the actual category labels corresponding to the first historical description text to the total number of actual category labels corresponding to the first historical description text is used as the accuracy of the first label corresponding to the preset category label.
[0054] As mentioned above, since the same number of second user keywords can correspond to different classification results, the classification accuracy of each classification result can be known by the proportion of each historical classification result to all historical classification results corresponding to the number of second user keywords, and it can be predicted as the label accuracy of the corresponding label. The first label accuracy is obtained based on the number of first user keywords, so it can reflect the importance of the predicted probability results output by the preset Bayesian network model.
[0055] P200 uses a target large language model to process each historical description text in the historical description text library, obtains the second historical description text corresponding to several first user state information, and obtains the second label accuracy corresponding to each preset category label based on the actual category label corresponding to each second historical description text.
[0056] Specifically, the accuracy of the second label corresponding to the preset category label is obtained through the following steps:
[0057] On page 201, a target large language model is used to extract several second user state information from each historical description text in the historical description text library. Historical description texts in the library whose corresponding second user state information is semantically identical to several first user state information are identified as second historical description texts. This can be understood as a one-to-one semantic correspondence between the several second user state information and several first user state information corresponding to the second historical description text. For example, if the first user state information includes "high body temperature" and the second user state information includes "high temperature," they are considered to have the same semantic meaning.
[0058] P202, for any preset category label, select several actual category labels that are the same as the preset category label from several actual category labels corresponding to several second historical description texts. For example: although several second user status information corresponding to each second historical description text have the same semantics as several first user status information, their actual classification results do not belong to the same category label. Therefore, the actual category labels that are the same as the preset category label are selected.
[0059] P203, the proportion of the number of actual category labels selected from the actual category labels corresponding to the second historical description text to the total number of actual category labels corresponding to the second historical description text is used as the accuracy of the second label corresponding to the preset category label.
[0060] As mentioned above, since the same number of second user state information can correspond to different classification results, the classification accuracy corresponding to each classification result can be known by the proportion of each historical classification result to all historical classification results corresponding to the number of second user state information. This accuracy is then used to predict the label accuracy of the corresponding abnormal label. The second label accuracy is obtained based on the number of first user state information, which is extracted by the target large language model after semantic analysis. Therefore, it can reflect the importance of the predicted probability result obtained after processing by the target large language model.
[0061] P300 calculates the target matching degree of the target user for each preset category label by weighted summing of the first matching degree, second matching degree, first label accuracy and second label accuracy corresponding to each preset category label, and determines the preset category label with the maximum target matching degree as the target category label of the target user.
[0062] Specifically, the P300 procedure includes the following steps:
[0063] P301, for any preset category label, determine the model weights corresponding to the preset Bayesian network model and the target large language model based on the accuracy of the first label corresponding to the preset category label and the accuracy of the second label corresponding to the preset category label.
[0064] Specifically, the model weights W1 corresponding to the preset Bayesian network model meet the following conditions:
[0065] W1 = F1 / (F1+F2), where F1 is the accuracy of the first label and F2 is the accuracy of the second label.
[0066] Specifically, the model weights W2 corresponding to the target large language model meet the following conditions:
[0067] W2 = F2 / (F1 + F2).
[0068] P302, the target matching degree of the target user corresponding to the preset category label is obtained by weighted summation based on the first matching degree and the second matching degree of the preset category label, the model weights corresponding to the preset Bayesian network model and the model weights corresponding to the target large language model.
[0069] Specifically, the target matching degree G of the target user corresponding to the preset category tag meets the following conditions:
[0070] G = W1 × P1 + W2 × P2, where P1 is the first matching degree of the target user corresponding to the preset category label, and P2 is the second matching degree of the target user corresponding to the preset category label.
[0071] As mentioned above, the accuracy of the first label and the accuracy of the second label can reflect the difference in the accuracy of the matching degree output by the preset Bayesian network model after processing the user description text directly, and the accuracy of the matching degree output by the preset Bayesian network model after processing the user description text by the target large language model. Therefore, weights are assigned to the first matching degree and the second matching degree respectively, so that the target matching degree is more accurate and reliable, thereby improving the accuracy of user label selection.
[0072] Furthermore, the method also includes the following steps:
[0073] M100 determines both the preset category label corresponding to the maximum first matching degree and the preset category label corresponding to the maximum second matching degree as key category labels.
[0074] M200 acquires at least one current state feature information of the target user; for example, the current state feature information can be any one of body temperature, pulse, respiration and blood pressure.
[0075] The M300 determines the target value range corresponding to each current state feature based on several preset value ranges. For example, body temperature can be divided into six preset value ranges: below 36℃ is low temperature, 36-37.3℃ is normal body temperature, 37.3-38℃ is low fever, 38-39℃ is moderate fever, 39-41℃ is high fever, and above 41℃ is hyperpyrexia. Each preset value range may include a minimum value but not a maximum value. Blood pressure can also be divided into diastolic, normal, and systolic pressure, and the specific value ranges are set by those skilled in the art.
[0076] M400 inputs each target numerical range obtained into a given Bayesian network model to obtain the fifth matching degree of each key category label corresponding to the target user; it can be understood that: the given Bayesian network model refers to the model trained based on several preset category labels and the target numerical range corresponding to each current state feature information among several current state feature information information corresponding to each preset category label. Those skilled in the art know the specific training method, and the training process is not the innovation of this invention, so it will not be described in detail here.
[0077] M500 calculates the latest matching degree of the target user for each key category tag by performing a weighted sum based on the final matching degree, the fifth matching degree, and the preset tag weights corresponding to the final matching degree and the fifth matching degree, and determines the key category tag with the highest latest matching degree as the target category tag of the target user.
[0078] In addition to the user description text, several state feature information was also considered. The state feature information can also reflect the data information related to the category label to a large extent. Therefore, combining the target matching degree obtained from the user description text and the third matching degree obtained from the state feature information can further improve the accuracy and reliability of the final category label result.
[0079] Furthermore, the method further includes the following steps:
[0080] K100, based on a given set of weight optimization models, optimizes the first preset weight corresponding to the first matching degree and the second preset weight corresponding to the second matching degree, respectively, to obtain the first target weight and the second target weight corresponding to each weight optimization model; the set of weight optimization models includes grid search model, random search model and gradient descent model.
[0081] Specifically, the implementation methods of the grid search model, random search model, and gradient descent model during optimization are existing technologies. For example, the grid search model sets the weight parameters to a set of predefined values, and then selects the parameter combination that optimizes the model performance by traversing all possible parameter combinations. The random search model randomly selects weight parameter values within a certain range for testing. Compared to the grid search model, this method often finds better parameters with the same computing resources. The gradient descent model can directly optimize the weight parameters for differentiable loss functions by calculating the gradient of the loss function with respect to the weight parameters and gradually updating the weight parameter values until the loss function reaches its minimum. The specific optimization steps of the above three optimization models will not be elaborated here.
[0082] K200, for any weighted optimization model, calculates a weighted sum based on the first and second matching degrees of each historical user description text corresponding to each preset category label, as well as the first and second target weights of the weighted optimization model, to obtain the predicted category label for each historical user description text. This can be understood as follows: for a historical user description text, based on the weighted sum calculation result of each preset category label corresponding to the weighted optimization model, several calculation results can be obtained. The number of calculation results is consistent with the number of preset category labels. The preset category label corresponding to the largest calculation result among the several calculation results is taken as the predicted category label of the weighted optimization model for this historical user description text.
[0083] K300 obtains the prediction accuracy of each weighted optimization model based on the predicted category label and the actual category label corresponding to each historical user description text. This can be understood as: the ratio of the number of predicted category labels that are the same as the actual category labels to the total number of actual category labels is used as the prediction accuracy of the weighted optimization model.
[0084] K400 determines the target weight optimization model as the weight optimization model that corresponds to the highest prediction accuracy.
[0085] The above introduces multiple weight optimization methods and uses a voting mechanism to select the weight optimization model with the best optimization effect. Based on this weight optimization model, reasonable and reliable weight parameters are obtained, thereby improving the prediction accuracy of category labels.
[0086] Embodiments of the present invention also provide a non-transitory computer-readable storage medium that can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a method in the method embodiments, wherein the at least one instruction or the at least one program is loaded and executed by the processor to implement the user tag determination method provided in the above embodiments.
[0087] Embodiments of the present invention also provide an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0088] While specific embodiments of the invention have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of the invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the invention. The scope of this invention is defined by the appended claims.
Claims
1. A method for determining user tags, characterized in that, The method includes the following steps: Based on the preset Bayesian network model and the target large language model, the first and second matching degrees of the target user for each preset category label are obtained according to the user description text input by the target user. The sample set segmentation method in cross-validation is used to divide several historical descriptive text samples into training and test sets several times in proportion. Based on each segmentation result, a preset Bayesian network model is trained to obtain several model error values. Based on the target Bayesian network model obtained after each training, the third matching degree corresponding to the first matching degree and the fourth matching degree corresponding to the second matching degree are obtained. Based on several model error values and the third and fourth matching degrees corresponding to each model error value, the first label weight corresponding to the first matching degree and the second label weight corresponding to the second matching degree are obtained. The final matching degree of the preset category tag corresponding to the maximum first matching degree is obtained by weighted summing the first matching degree and the second matching degree of the preset category tag corresponding to the maximum first matching degree, as well as the first tag weight and the second tag weight. Furthermore, the latest matching degree of the preset category tag corresponding to the maximum second matching degree is obtained by weighted summing based on the first matching degree and the second matching degree of the preset category tag corresponding to the maximum second matching degree, as well as the first tag weight and the second tag weight; When the final matching degree of the preset category label corresponding to the maximum first matching degree is different from the final matching degree of the preset category label corresponding to the maximum second matching degree, the preset category label corresponding to the maximum final matching degree is determined as the target category label of the target user. Conversely, the preset category label corresponding to the highest first matching degree or the preset category label corresponding to the highest second matching degree will be determined as the target category label for the target user.
2. The user tag determination method according to claim 1, characterized in that, The first and second matching degrees for each preset category tag of the target user are obtained through the following steps: Several first user keywords are extracted from the user description text, and these first user keywords are input into a preset Bayesian network model to obtain the first matching degree of the target user for each preset category label; The user description text is input into the target large language model for processing to obtain several first user state information. The several first user state information is then input into a preset Bayesian network model to obtain the second matching degree of the target user for each preset category label.
3. The user tag determination method according to claim 1, characterized in that, The first tag weight and the second tag weight are obtained through the following steps: For any model error value, the model error value and its corresponding third and fourth matching degrees are substituted as c, x, and y, respectively, into the preset error value influence model c = ax + by to obtain the model of the error value to be processed, where a represents the probability coefficient of the third matching degree and b represents the probability coefficient of the fourth matching degree. Based on the impact of each model error value on the model, the optimal solution is obtained through a genetic algorithm to obtain the values of a and b. The value of 'a' is used as the first label weight corresponding to the first matching degree, and the value of 'b' is used as the second label weight corresponding to the second matching degree.
4. The user tag determination method according to claim 2, characterized in that, The method further includes the following steps: From the historical description text library, identify several first historical description texts corresponding to several first user keywords, and obtain the first tag accuracy corresponding to each preset category tag based on the actual category tag corresponding to each first historical description text. The target large language model is used to process each historical description text in the historical description text library to obtain the second historical description text corresponding to several first user state information, and the second label accuracy corresponding to each preset category label is obtained according to the actual category label corresponding to each second historical description text. The target matching degree of the target user for each preset category tag is calculated by weighted summing the first matching degree, second matching degree, first tag accuracy and second tag accuracy corresponding to each preset category tag, and the preset category tag with the maximum target matching degree is determined as the target category tag of the target user.
5. The user tag determination method according to claim 4, characterized in that, The accuracy of the first label corresponding to the preset category label is obtained through the following steps: Several second user keywords are extracted from each historical description text in the historical description text library. The historical description text in the historical description text library that corresponds to several second user keywords and several first user keywords is determined as the first historical description text. For any preset category label, select several actual category labels that are the same as the preset category label from several actual category labels corresponding to several first historical description texts; The proportion of the number of actual category tags selected from several actual category tags corresponding to several first historical description texts to the total number of actual category tags corresponding to several first historical description texts is used as the accuracy of the first tag corresponding to the preset category tag.
6. The user tag determination method according to claim 4, characterized in that, The accuracy of the second label corresponding to the preset category label is obtained through the following steps: The target large language model is used to obtain several second user state information from each historical description text in the historical description text library. The historical description texts in the historical description text library that have the same semantics as several first user state information are identified as second historical description texts. For any preset category label, select several actual category labels that are the same as the preset category label from several actual category labels corresponding to several second historical description texts; The proportion of the number of actual category tags selected from several actual category tags corresponding to several second historical description texts to the total number of actual category tags corresponding to several second historical description texts is used as the accuracy of the second tag corresponding to the preset category tag.
7. The user tag determination method according to claim 1, characterized in that, The method further includes the following steps: Both the preset category label corresponding to the maximum first matching degree and the preset category label corresponding to the maximum second matching degree are determined as key category labels; Obtain at least one current state feature of the target user; Based on several preset value ranges corresponding to each current state feature information, the target value range corresponding to each current state feature information is determined. Each target numerical range obtained is input into a given Bayesian network model to obtain the fifth matching degree of each key category label for the target user; The latest matching degree of the target user for each key category tag is calculated by weighting the final matching degree, the fifth matching degree, and the preset tag weights corresponding to the final matching degree and the fifth matching degree respectively, and the key category tag with the highest latest matching degree is determined as the target category tag of the target user.
8. The user tag determination method according to claim 1, characterized in that, The method further includes the following steps: Based on a given set of weight optimization models, the first preset weights corresponding to the first matching degree and the second preset weights corresponding to the second matching degree are optimized respectively to obtain the first target weight and the second target weight corresponding to each weight optimization model; the set of weight optimization models includes grid search model, random search model, and gradient descent model. For any weight optimization model, a weighted sum is calculated based on the first and second matching degrees of each historical user description text corresponding to each preset category label, as well as the first and second target weights of the weight optimization model, to obtain the predicted category label corresponding to each historical user description text. Based on the predicted category label and the actual category label corresponding to each historical user description text, obtain the prediction accuracy of each weighted optimization model; The weight optimization model corresponding to the highest prediction accuracy is determined as the target weight optimization model.
9. A non-transitory computer-readable storage medium, wherein the storage medium stores at least one instruction or at least one program segment, characterized in that, The at least one instruction or the at least one program segment is loaded and executed by the processor to implement the user tag determination method as described in any one of claims 1-8.
10. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 9.
Citation Information
Patent Citations
Text classification method, related equipment and readable storage medium
CN114756675A
Semantic matching model training method and text matching method
CN115511073A