A method and device for training a user tag generation model, and a storage medium

By employing a multi-step approach involving pre-training, first training, and second training phases, accurate user labels are generated, addressing the issue of existing models' inability to handle contextual information and improving the accuracy of user label generation and model performance.

CN116821336BActive Publication Date: 2026-04-28XIAMEN COBBLESTONE NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIAMEN COBBLESTONE NETWORK TECH CO LTD
Filing Date
2023-06-06
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing user tag generation models cannot accurately process contextual information, resulting in inaccurate user tag generation.

Method used

Predicted user labels are generated during the pre-training phase. Multiple text classification categories are generated in the first training phase, and the text classification categories are scored and ranked in the second training phase to update the model weights and improve the model's generation accuracy.

Benefits of technology

It enables accurate generation of user tags within a contextual session, avoiding keyword misidentification and improving the model's generation accuracy and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116821336B_ABST
    Figure CN116821336B_ABST
Patent Text Reader

Abstract

A kind of training method, device and storage medium of user label generation model, comprising: obtaining training data, setting user label generation task placeholder in training data, and as the first input of model;Randomly obtain training data and predict user label random combination, and set text classification task placeholder after as the second input of model;Obtain all second outputs, and score each second output according to preset scoring standard to obtain the corresponding score of each second output;According to the score of each second output, ranking is carried out, model weight is updated, and user label generation model is obtained.The user label generation model obtained by generating predicted user label in pre-training stage and then scoring text classification category in second training stage can accurately generate user label.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a training method for a user tag generation model, a training apparatus for using the method, and a computer-readable storage medium. Background Technology

[0002] User tags are identifying markers used to describe user characteristics and behaviors. They can be used to differentiate and classify users in order to better provide personalized services and products. During online interactions between operators and users, and in group chats, user attributes gradually emerge during the conversation.

[0003] For example:

[0004] User A: "How old are you? Did your doctor prescribe trazodone tablets?"

[0005] User B: "55, are there many side effects to letrozole tablets?"

[0006] In the above conversation, user A first asks a question (about age and medication), and user B then replies to user A's questions about age and medication. However, user B's user tag "age 55" can only be obtained in conjunction with user A's previous question. The existing user tag generation model training method can only process a single sentence sent by a user and cannot handle contextual information, which leads to inaccurate generation of user tags. For easier understanding, please refer to the following other conversation example:

[0007] User C: "I had low platelet and white blood cell counts a while ago."

[0008] User D: "I'm in the same situation as you."

[0009] Based on the above conversation, the existing user tag generation model training methods can only find the tags for user A: low platelet count and low white blood cell count, but have difficulty finding the tags for user B.

[0010] This results in the inability to accurately generate tags for each user.

[0011] In the conversation between users A and B, user B mentioned the drug keyword "letrozole tablets" in their response. However, user A only asked about the related side effects of this keyword and did not use the drug; therefore, it should not be attributed to user A's user tag. Thus, such cases should be considered during model training; otherwise, accurate user tag generation may fail.

[0012] It is evident that existing user tag generation models still suffer from the problem of failing to accurately generate user tags. Summary of the Invention

[0013] The main objective of the present invention is to provide a training method, device, and storage medium for a user label generation model, aiming to solve the technical problem that the existing user label generation models still cannot accurately generate user labels.

[0014] To achieve the above objective, the present invention provides a training method for a user label generation model, which includes the following steps: S1. Pre-training stage: Obtain training data, set a user label generation task placeholder in the training data, and use it as the first input of the model; the user label generation task placeholder is used to execute the user label generation task to generate predicted user labels; S2. First training stage: Randomly obtain training data and predicted user labels, perform random combination, and set a text classification task placeholder and then use it as the second input of the model; the text classification task placeholder is used to execute the text classification task to generate multiple text classification categories as the second output of the model; S3. Second training stage: Obtain all the second outputs, score each second output according to a preset scoring criterion to obtain the corresponding score of each second output; sort according to the scores of each second output and update the model weights to obtain the user label generation model.

[0015] Optionally, the training data is specifically: a text data set obtained by acquiring the text content in user chat data, which contains multiple text data.

[0016] Optionally, the specific steps of the pre-training stage are as follows: S10. Obtain the text data set and set corresponding preset label data for each text data in it; S11. Concatenate each text data and its corresponding preset label data into a string and set a user label generation task placeholder; S12. Use the result obtained in step S11 as the first input x1 of the model, and m1 < n < m2, where m1 is the text length of the text data, m2 is the text length of the first input x1, and n is a random number.

[0017] Optionally, the calculation formula of the loss function of the model in the pre-training stage is specifically as follows: loss_1 = classify_loss(one_hot(target1), y1); where loss_1 represents the first loss function, classify_loss is the classification loss function, target1 is the first expected output of the model, and the text length of target1 is x1 + a, a is the text length of the preset label data corresponding to the text data, one_hot represents one-hot encoding of target1 according to a preset dictionary, and y1 represents the first output of the model; y1 = GEN(x1), y1 is specifically a b * 1 vector, b represents the size of the preset dictionary, and the value of each element in the vector represents the probability of the corresponding word in the dictionary appearing, and GEN represents the user label generation task.

[0018] Optionally, the specific formula for calculating the loss function in the first training phase is as follows: loss_2 = classify_loss(target2, y2), where loss_2 represents the second loss function, classify_loss is the classification loss function, y2 represents the second output of the model, and target2 is the second expected output of the model; the second expected output is specifically: the predicted user label is completely unrelated to the training data, or the predicted user label is obtained based on the training data.

[0019] Optionally, the classification loss function may include at least one of the following: 0-1 loss or cross-entropy loss.

[0020] Optionally, the loss function calculation formula for the third training phase is as follows: loss_3 = rank_loss(y2_w); where loss_3 represents the third loss function, rank_loss represents the ranking loss, and y2_w represents multiple second outputs, and w∈N * N * It represents the set of positive integers.

[0021] Optionally, the ranking loss may include at least one of the following: single-point loss, pairing loss, or list loss.

[0022] Corresponding to the training method of the user tag generation model, the present invention provides a training device for a user tag generation model, comprising: a pre-training module for acquiring training data, setting a user tag generation task placeholder in the training data, and using it as the first input of the model; the user tag generation task placeholder is used to execute the user tag generation task to generate predicted user tags; a first training module for randomly acquiring training data and predicted user tags, randomly combining them, and setting a text classification task placeholder as the second input of the model; the text classification task placeholder is used to execute the text classification task to generate multiple text classification categories as the second output of the model; a second training module for acquiring all second outputs, scoring each second output according to a preset scoring standard, obtaining a corresponding score for each second output; sorting according to the score of each second output, and updating the model weights to obtain the user tag generation model.

[0023] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a training program for a user tag generation model, wherein when the training program for the user tag generation model is executed by a processor, the training program for the user tag generation model implements the steps of the training method for the user tag generation model as described above.

[0024] The beneficial effects of this invention are:

[0025] (1) Compared with the prior art, the present invention generates predicted user tags in the pre-training stage, generates multiple text classification categories in the first training stage, and scores the text classification categories in the second training stage. The resulting user tag generation model can accurately generate user tags.

[0026] (2) Compared with the prior art, the present invention calculates the first loss function by the first loss function calculation formula and sets the text length of the first expected output. The performance of the model is determined by comparing the first output of the model with the first expected output, and then the optimization direction is found to improve the model performance.

[0027] (3) Compared with the prior art, the present invention uses the value of each element in the first output vector to represent the probability of the corresponding word in the dictionary. Therefore, the probability value can be used as a weight to perform weighted random sampling to obtain training data and predict user tags for random combination. A text classification task placeholder is set to generate multiple different second outputs from a single text. The second outputs are then sorted by the scoring operation in the second training stage, and the model weights are updated. This avoids the situation where the model recognizes keywords related to user tags, but the keywords do not belong to user tags, thus further improving the accuracy of the model in generating user tags.

[0028] (4) Compared with the prior art, the present invention calculates the second loss function by the second loss function calculation formula, compares the second output and the second expectation of the model to determine the performance of the model, and then finds the optimization direction, thereby further improving the performance of the model. Attached Figure Description

[0029] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:

[0030] Figure 1 This is a simplified flowchart of the training method for the user tag generation model of the present invention;

[0031] Figure 2 This is a simplified framework diagram of the training device for the user tag generation model of the present invention. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, not all embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. 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.

[0033] like Figure 1 As shown, a training method for a user tag generation model according to the present invention includes the following steps: S1, pre-training stage: acquiring training data, setting a user tag generation task placeholder in the training data, and using it as the first input of the model; the user tag generation task placeholder is used to execute the user tag generation task to generate predicted user tags; S2, first training stage: randomly acquiring training data and predicted user tags, randomly combining them, and setting a text classification task placeholder as the second input of the model; the text classification task placeholder is used to execute the text classification task to generate multiple text classification categories, which are used as the second output of the model; S3, second training stage: acquiring all second outputs, and scoring each second output according to a preset scoring standard to obtain the corresponding score of each second output; sorting according to the score of each second output, and updating the model weights to obtain the user tag generation model.

[0034] This invention generates predicted user tags in the pre-training stage, generates multiple text classification categories in the first training stage, and scores the text classification categories in the second training stage. The resulting user tag generation model can accurately generate user tags.

[0035] For the two dialogue examples in the background art, the model obtained by the training method of the present invention can directly input group chat / one-on-one chat data into the model in chronological order and accurately generate tags for each user.

[0036] For example: Enter: "User A: My platelet and white blood cell counts were low some time ago."

[0037] Then, the output will be: "User A has low platelet count and low white blood cell count".

[0038] Alternatively, you can enter: "User A: My platelet and white blood cell counts were low a while ago. User B: Me too."

[0039] Then, the output will be: "User A has low platelet count and low white blood cell count. User B has low platelet count and low white blood cell count."

[0040] In this embodiment, the training data is specifically: a text data set obtained by acquiring the text content in the user chat data, which contains multiple text data.

[0041] Preferably, all the user chat data in the text data set is sorted in chronological order.

[0042] In this embodiment, the specific steps of the pre-training stage are as follows: S10. Acquire the text data set and set corresponding preset label data for each text data therein; S11. Concatenate each text data and its corresponding preset label data, and set a placeholder for the user label generation task; S12. Use the result obtained in step S11 as the first input x1 of the model, and m1 < n < m2, where m1 is the text length of the text data, m2 is the text length of the first input x1, and n is a random number.

[0043] Since in the pre-training task, what needs to be trained is the model's "continuation writing" ability for incomplete input texts. For example, for the training data "[gen] Sisters, hello. After taking toremifene, the endometrium is thick. Had a hysteroscopy, the pathology shows hyperplasia. Can I still continue taking toremifene? Or change the medicine? What medicine should I change? Please give some advice [label] Female, taking toremifene, corresponding side effect: thick endometrium, hyperplasia, surgical situation: hysteroscopy", after being fully trained by the training method, the model can continue writing the truncated label content.

[0044] For example: for the input of the user label generation model: "[gen] Sisters, hello. After taking toremifene, the endometrium is thick. Had a hysteroscopy, the pathology shows hyperplasia. Can I still continue taking toremifene? Or change the medicine? What medicine should I change? Please give some advice [label]", the user label generation model can continue writing the remaining content: "Female, taking toremifene, corresponding side effect: thick endometrium, hyperplasia, surgical situation: hysteroscopy".

[0045] In the training task, there is no need to continue writing the user input. For the input "[gen] Sisters, hello. After taking toremifene, the uterus is", there is no need to generate "membrane thick. Had a hysteroscopy, the pathology shows hyperplasia. Can I still continue taking toremifene?....". Therefore, m1 can be set, and the continuation writing starts from a position greater than m1, that is, the [label] position. At the same time, it is required that the model can start continuing writing from any truncation after [label]. Therefore, a random number n is set to randomly truncate the training data to improve the model's ability to generate text from any position.

[0046] In this embodiment, [gen] represents a placeholder for the user tag generation task, and [label1] indicates that the content on the right is the content where the user tag generation begins. For example, the first input x1 = "[gen] Hi sisters, I have thick endometrium after taking toremifol, I had a hysteroscopic surgery, and the pathological examination showed hyperplasia. Can I continue taking toremifol? Or should I change medication, and if so, what kind? Please advise. [label1] Gender: ". Here, [gen] represents a placeholder for the user tag generation task, and [label1] indicates that the content on the right is the content where the user tag generation begins.

[0047] In this embodiment, the specific formula for calculating the loss function of the model in the pre-training stage is as follows: loss_1 = classify_loss(one_hot(target1), y1); where loss_1 represents the first loss function, classify_loss is the classification loss function, target1 is the first expected output of the model, and the text length of target1 is x1 + a, where a is the text length of the preset label data corresponding to the text data, one_hot means that target1 is one-hot encoded according to the preset dictionary, y1 represents the first output of the model; y1 = GEN(x1), y1 is specifically a b*1 vector, b represents the size of the preset dictionary, the value of each element in the vector represents the probability of the corresponding word appearing in the dictionary, and GEN represents the user label generation task.

[0048] For example, the first input x1 = "[gen]Hello sisters, I have thick endometrium after taking toremifol and had a hysteroscopic surgery. The pathological examination showed hyperplasia. Can I continue taking toremifol? Or should I change medication, and if so, what medication? Please advise. [label1]Gender:".

[0049] The expected output is target1 = "[gen]Hello sisters, I have thick endometrium after taking toremifol, and I had a hysteroscopic surgery with pathological hyperplasia. Can I continue taking toremifol? Or should I change medication, and if so, what kind? Please advise. [label1]Gender: Female". Since the text length of target1 is x1 + a, where a is the text length of the preset label data corresponding to the text data, a = 1 in this example.

[0050] Of course, the above is just an example and does not constitute an improper limitation of the present invention.

[0051] The first training stage of this invention mainly trains the model's ability to understand the entire text. The first loss function is calculated using the first loss function calculation formula, and the text length of the first expected output is set. The model's performance is determined by comparing the model's first output with the first expected output, thereby finding optimization directions and improving the model's performance.

[0052] In this embodiment, the specific formula for calculating the loss function in the first training phase is as follows: loss_2 = classify_loss(target2, y2), where loss_2 represents the second loss function, classify_loss is the classification loss function, y2 represents the second output of the model, and target2 is the second expected output of the model; the second expected output is specifically: the predicted user label is completely unrelated to the training data, or the predicted user label is obtained based on the training data.

[0053] Preferably, the second expected output can be represented by 1.0 to indicate that the predicted user label is obtained from the training data, or by 0.0 to indicate that the predicted user label is completely unrelated to the training data.

[0054] For example, the second input is: "[cla]Hello sisters, I had endometrial thickening after taking toremifol and underwent hysteroscopy. The pathological examination showed hyperplasia. Can I continue taking toremifol? Or should I switch medications, and if so, which? Please advise. [label2]Female, medication is toremifol, corresponding side effects are endometrial thickening and pathological hyperplasia, surgical condition: hysteroscopy." Here, [cla] represents a placeholder for the text classification task, which the model needs to generate in the subsequent predictions. [label2] indicates that the content on the right is the predicted user label.

[0055] At this point, the second expected output is: "target2 = 1.0", indicating that the predicted user label is obtained based on the training data.

[0056] Alternatively, the second input could be: "[cla]Hello sisters, I had endometrial thickening after taking toremifol and underwent hysteroscopic surgery. The pathological examination showed hyperplasia. Can I continue taking toremifol? Or should I switch medications, and if so, which? Please advise. [label2]Male, medication used: tamoxifen, surgical status: none."

[0057] At this point, the second expected output is: "target2 = 0.0", indicating that the predicted user label is completely unrelated to the training data.

[0058] Of course, the above is just an example and does not constitute an improper limitation of the present invention.

[0059] This invention calculates the second loss function using a second loss function calculation formula, compares the model's second output with the second expectation to determine the model's performance, and then seeks optimization directions, thereby further improving model performance.

[0060] Preferably, the classification loss function includes at least one of 0-1 loss and cross-entropy loss.

[0061] After the first training phase is completed, due to random sampling, multiple different second outputs can be obtained for a single input, as shown in Table 1:

[0062]

[0063] Table 1

[0064] Therefore, in the second training phase, each second output can be scored according to the preset scoring criteria to obtain the corresponding score for each second output.

[0065] Furthermore, after obtaining the corresponding score for each second output, the scores are sorted from high to low, with higher scores indicating higher quality of the corresponding second output.

[0066] This invention generates predicted user tags in the pre-training stage, and then scores and sorts the text classification categories in the second training stage, resulting in a user tag generation model that can accurately generate user tags.

[0067] Preferably, the preset scoring criteria are used to select a function or perform manual scoring based on actual needs. Similarly, the ranking is performed to select a function, perform manual scoring, or train a model that outputs a score for ranking based on actual needs.

[0068] Preferably, the model weights are updated using gradient descent.

[0069] In this embodiment, the specific formula for calculating the loss function in the third training phase is as follows: loss_3 = rank_loss(y2_w); where loss_3 represents the third loss function, rank_loss represents the ranking loss, y2_w represents multiple second outputs, and w∈N * N * It represents the set of positive integers.

[0070] Preferably, the ranking loss includes at least one of the following: single-point loss, pairing loss, and list loss.

[0071] This invention uses the value of each element in the first output vector to represent the probability of a word appearing in the corresponding dictionary. Therefore, the probability value can be used as a weight to perform weighted random sampling to obtain training data and randomly combine it with predicted user tags. By setting placeholders for text classification tasks, multiple different second outputs can be generated from a single text. The second outputs are then sorted and the model weights are updated by combining the scoring operation in the second training stage. This avoids situations where the model recognizes keywords related to user tags, but these keywords do not belong to user tags, thus further improving the accuracy of the model in generating user tags.

[0072] like Figure 2 As shown, the present invention also provides a training device for a user tag generation model, comprising: a pre-training module 10, used to acquire training data, set a user tag generation task placeholder in the training data, and use it as the first input of the model; the user tag generation task placeholder is used to execute the user tag generation task to generate predicted user tags; a first training module 20, used to randomly acquire training data and predicted user tags, randomly combine them, and set a text classification task placeholder as the second input of the model; the text classification task placeholder is used to execute the text classification task to generate multiple text classification categories as the second output of the model; a second training module 30, used to acquire all second outputs, score each second output according to a preset scoring standard, and obtain the corresponding score of each second output; sort according to the score of each second output, and update the model weights to obtain the user tag generation model.

[0073] This invention also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the memory described in the above embodiments; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores at least one instruction, which is loaded and executed by a processor to implement... Figure 1 The training method for the user tag generation model is shown. The computer-readable storage medium may be a read-only memory, a hard disk, or an optical disk, etc.

[0074] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the device embodiments, equipment embodiments, and storage medium embodiments, since they are basically similar to the method embodiments, the descriptions are relatively simple, and relevant parts can be referred to the descriptions of the method embodiments.

[0075] Furthermore, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0076] The foregoing description illustrates and describes preferred embodiments of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the inventive concept by means of the foregoing teachings or techniques or knowledge in related fields. Any modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.

Claims

1. A training method for a user tag generation model, characterized in that, Including: S1. Pre-training stage: Obtain training data, set a placeholder for the user label generation task in the training data, and use it as the first input to the model. The placeholder for the user label generation task is used to perform the user label generation task to generate predicted user labels. The training data is specifically: a text data set obtained by acquiring the text content in the user chat data, including multiple text data. S2. First training stage: Randomly obtain training data and predicted user labels, perform random combination, and set a placeholder for the text classification task and then use it as the second input to the model. The placeholder for the text classification task is used to perform the text classification task to generate multiple text classification categories as the second output of the model. S3. Second training stage: Obtain all the second outputs, score each second output according to a preset scoring criterion to obtain the corresponding score for each second output. Sort according to the scores of each second output and update the model weights to obtain the user label generation model. The specific steps of the pre-training stage are as follows: S10. Obtain the text data set and set the corresponding preset label data for each text data in it. S11. Concatenate each text data and its corresponding preset label data as a string and set a placeholder for the user label generation task. S12. Use the result obtained in step S11 as the first input x1 to the model, and m1 < n < m2, where m1 is the text length of the text data, m2 is the text length of the first input x1, and n is a random number. The calculation formula for the loss function in the first training stage is specifically as follows: loss_2 = classify_loss(target2, y2), where loss_2 represents the second loss function, classify_loss is the classification loss function, y2 represents the second output of the model, and target2 is the second expected output of the model. The second expected output is specifically: the predicted user label has nothing to do with the training data, or the predicted user label is obtained based on the training data. The classification loss function includes at least one of the 0-1 loss and the cross-entropy loss. The calculation formula for the loss function in the second training stage is specifically as follows: loss_3 = rank_loss(y2_w); where loss_3 represents the third loss function, rank_loss represents the ranking loss, y2_w represents multiple second outputs, and w ∈ N*, and N* represents the set of positive integers.

2. The training method for the user tag generation model according to claim 1, characterized in that: The calculation formula for the loss function of the model in the pre-training stage is specifically as follows: loss_1 = classify_loss(one_hot(target1), y1); where loss_1 represents the first loss function, classify_loss is the classification loss function, target1 is the first expected output of the model, and the text length of target1 is x1 + a, a is the text length of the preset label data corresponding to the text data, one_hot represents one-hot encoding of target1 according to the preset dictionary, and y1 represents the first output of the model. y1 = GEN(x1), where y1 is specifically a b * 1 vector, b represents the preset dictionary size, and the value of each element in the vector represents the probability of the corresponding word in the dictionary appearing. GEN represents the user label generation task.

3. The training method for the user tag generation model according to claim 1, characterized in that: The ranking loss includes at least one of the point loss, pairwise loss, and list loss.

4. A training device for a user tag generation model, characterized in that, It includes: A pre-training module for obtaining training data, setting a placeholder for the user label generation task in the training data, and using it as the first input of the model; The placeholder for the user label generation task is used to execute the user label generation task to generate predicted user labels. The training data is specifically: a text data set obtained by acquiring the text content in the user chat data, which contains multiple text data. The specific steps of the pre-training stage are as follows: S10. Obtain the text data set and set the corresponding preset label data for each text data; S11. Concatenate each text data and its corresponding preset label data, and set a placeholder for the user label generation task; S12. Use the result obtained in step S11 as the first input x1 of the model, and m1 < n < m2, where m1 is the text length of the text data, m2 is the text length of the first input x1, and n is a random number. A first training module for randomly obtaining training data and predicted user labels, randomly combining them, and setting a placeholder for the text classification task and then using it as the second input of the model; the placeholder for the text classification task is used to execute the text classification task to generate multiple text classification categories as the second output of the model; the calculation formula of the loss function in the first training stage is specifically as follows: loss_2 = classify_loss(target2, y2), where loss_2 represents the second loss function, classify_loss is the classification loss function, y2 represents the second output of the model, and target2 is the second expected output of the model; the second expected output is specifically: the predicted user label has nothing to do with the training data, or the predicted user label is obtained based on the training data; the classification loss function includes at least one of the 0-1 loss and cross-entropy loss. A second training module for obtaining all second outputs, scoring each second output according to a preset scoring criterion to obtain the corresponding score of each second output; sorting according to the scores of each second output and updating the model weights to obtain the user label generation model; the calculation formula of the loss function in the second training stage is specifically as follows: loss_3 = rank_loss(y2_w); Where loss_3 represents the third loss function, rank_loss represents the ranking loss, y2_w represents multiple second outputs, and w ∈ N*, N* represents the set of positive integers.

5. A computer-readable storage medium, characterized in that, A training program for the user label generation model is stored on the computer-readable storage medium. When the training program for the user label generation model is executed by a processor, it implements the steps of the training method for the user label generation model as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Model processing method and device, electronic equipment and storage medium

    CN115269844A