Label optimization method and device based on generative pre-training GPT model

By using labeled text data in the field of natural language processing, the GPT model is iteratively optimized, and the problem of manual verification is solved, and the effect of improving manual verification efficiency is achieved.

CN120162687APending Publication Date: 2025-06-17QINGDAO HAIER TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311703394.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-12
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

In the field of natural language processing, the annotation method based on generative pre-trained GPT model has the problem of manual verification being difficult and time-consuming.

Method used

By training the initial classification model using the labeled first text data, an intermediate classification model is obtained, and the second text data to be labeled is input into the intermediate classification model to obtain M prediction categories. Then, the correct category among the M predicted categories that matches the second text data is determined through the manual feedback mechanism, and the intermediate classification model is trained using the labeled second text data to obtain the target classification model.

Benefits of technology

It reduces the difficulty and time of manual verification, improves the efficiency of manual verification, and solves the problem of difficult and time-consuming manual verification in the annotation optimization method based on the generative pre-trained GPT model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120162687A_ABST
    Figure CN120162687A_ABST
Patent Text Reader

Abstract

The invention discloses an annotation optimization method and device based on a generative pre-training GPT model, and relates to the technical field of artificial intelligence, and the method comprises the steps: training an initial classification model (GPT model) with N preset categories through annotated first text data, and obtaining an intermediate classification model; inputting to-be-labeled second text data into the intermediate classification model to obtain M preset categories predicted by the intermediate classification model and having the highest matching degree with the second text data in the N preset categories; under the condition that a feedback result corresponding to at least one prediction category in the M prediction categories is obtained and only one target category exists in the at least one prediction category, the target category is determined as a labeling category of the second text data, labeled second text data is obtained, and the feedback result is used for indicating whether the corresponding prediction category is correct or not; the feedback result of the target category indicates to be correct; and training the intermediate classification model by using the labeled second text data to obtain a target classification model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, and in particular, to a method and device for annotation optimization based on the generative pre-trained GPT model. Background Art

[0002] In the field of NLP (Natural Language Processing), annotating data is a labor-intensive task. Annotations can include tasks such as text classification, entity recognition, and sentiment analysis. Currently, through a data annotation system, text data can be automatically annotated. For example, through a GPT (Generative Pre-trained Transformer) model, text data can be automatically annotated. However, since the results of automatic annotation are generated automatically by the model, there may be inaccurate annotation situations. If inaccurate annotation data is used for model training, the model will be unreliable.

[0003] To address the above problems, an artificial feedback mechanism can be added to the data annotation system, and manual verification and correction of the annotation results can be performed. However, if the correct results are re-annotated manually for each text data to be annotated, the labor cost is too high because each text data may correspond to many types of labels, and it is difficult for humans to select one from hundreds of labels, and it will consume a lot of time.

[0004] It can be seen that in the related art, the annotation optimization method based on the generative pre-trained GPT model has technical problems of high difficulty and long time consumption in manual verification. Summary of the Invention

[0005] Embodiments of this application provide a method and device for annotation optimization based on the generative pre-trained GPT model, so as to at least solve the technical problems of high difficulty and long time consumption in manual verification existing in the annotation optimization method based on the generative pre-trained GPT model in the related art.

[0006] According to one aspect of the embodiments of the present application, there is provided a method for optimizing annotation based on the generative pre-trained GPT model, including: training an initial classification model to be trained using the labeled first text data to obtain an intermediate classification model, where the initial classification model is a GPT model with N preset categories; inputting the second text data to be annotated into the intermediate classification model to obtain M predicted categories, where the M predicted categories are the M preset categories with the highest matching degree to the second text data predicted by the intermediate classification model among the N preset categories, and M < N; when a feedback result corresponding to a set of first categories among the M predicted categories is obtained and there is only one first target category in the set of first categories, determining the first target category as the annotation category of the second text data to obtain the labeled second text data, where the feedback result corresponding to each first category in the set of first categories is used to indicate whether the corresponding first category is the correct category, and the first target category is the first category indicated as the correct category by the corresponding feedback result; training the intermediate classification model using the labeled second text data to obtain a target classification model.

[0007] In an exemplary embodiment, the step of inputting the second text data to be annotated into the intermediate classification model to obtain M predicted categories includes: passing a target query request and the second text data into the intermediate classification model by calling a preset model interface of the intermediate classification model, where the target query request is used to request to query the M categories with the highest matching degree to the second text data; receiving a query response message returned by the intermediate classification model, where the query response message carries the M preset categories with the highest matching degree to the second text data.

[0008] In an exemplary embodiment, after inputting the second text data to be annotated into the intermediate classification model, the method further includes: sending a first feedback request to the terminal device of the target object, where the first feedback request carries the second text data and indication information of the M predicted categories, and the first feedback request is used to request to determine the correct category that matches the second text data among the M predicted categories; receiving a first response message returned by the terminal device in response to the first feedback request, where the first response message carries the feedback result corresponding to the set of first categories.

[0009] In an exemplary embodiment, after sending the first feedback request to the terminal device of the target object, the method further includes: in response to receiving the first feedback request, displaying the second text data and a display area corresponding to each of the M prediction categories through a display component of the terminal device, wherein each display area corresponding to each prediction category displays each prediction category and two options, and the two options include a correct option for indicating that the corresponding prediction category is the correct category and an incorrect option for indicating that the corresponding prediction category is not the correct category; generating the first response message in response to a selection operation performed on the two options corresponding to the set of first categories.

[0010] In an exemplary embodiment, after inputting the second text data to be annotated into the intermediate classification model, the method further includes: when a feedback result corresponding to the set of first categories is obtained and there is no first category in the set of first categories whose corresponding feedback result indicates that it is the correct category, sending a second feedback request to the terminal device of the target object, wherein the second feedback request carries the second text data and indication information of (N - M) prediction categories, and the second feedback request is used to request to determine the correct category that matches the second text data among the (N - M) prediction categories, and the (N - M) prediction categories are other prediction categories among the N preset categories except the M prediction categories; receiving a second response message returned by the terminal device in response to the second feedback request, wherein the second response message carries a feedback result corresponding to a set of second categories among the (N - M) prediction categories, and the feedback result corresponding to each second category in the set of second categories is used to indicate whether the corresponding second category is the correct category; when there is only one second target category in the set of second categories, determining the second target category as the annotation category of the second text data to obtain the annotated second text data, wherein the second target category is the second category whose corresponding feedback result indicates that it is the correct category; using the annotated second text data to train the intermediate classification model to obtain a target classification model.

[0011] In an exemplary embodiment, after inputting the second text data to be labeled into the intermediate classification model, the method further includes: when obtaining a feedback result corresponding to the group of first categories and there are multiple first target categories in the group of first categories, sending a third feedback request to the terminal device of the target object, where the third feedback request carries the second text data and indication information of the multiple first target categories, and the third feedback request is used to request to determine the correct category that matches the second text data among the multiple first target categories; receiving a third response message returned by the terminal device in response to the third feedback request, where the third response message carries a feedback result corresponding to the multiple first target categories, and the feedback result corresponding to each first target category is used to indicate whether the corresponding first target category is the correct category; when there is only one third target category among the multiple first target categories, determining the third target category as the labeled category of the second text data to obtain the labeled second text data, where the third target category is the first target category whose corresponding feedback result indicates it is the correct category; using the labeled second text data to perform model training on the intermediate classification model to obtain a target classification model.

[0012] In an exemplary embodiment, after determining the first target category as the labeled category of the second text data, the method further includes: using the labeled second text data to perform model training on the initial task model to obtain a target task model, where the target task model is a single-task model different from the target classification model.

[0013] According to another aspect of the embodiments of the present application, there is also provided an annotation optimization device based on the generative pre-trained GPT model, including: a first training unit, configured to train an initial classification model to be trained using the labeled first text data to obtain an intermediate classification model, where the initial classification model is a GPT model with N preset categories; an input unit, configured to input the second text data to be annotated into the intermediate classification model to obtain M predicted categories, where the M predicted categories are the M preset categories in the N preset categories that have the highest matching degree with the second text data predicted by the intermediate classification model, and M < N; a first determination unit, configured to, when a feedback result corresponding to a set of first categories in the M predicted categories is obtained and there is only one first target category in the set of first categories, determine the first target category as the annotation category of the second text data to obtain the labeled second text data, where the feedback result corresponding to each first category in the set of first categories is used to indicate whether the corresponding first category is the correct category, and the first target category is the first category whose corresponding feedback result indicates that it is the correct category; a second training unit, configured to train the intermediate classification model using the labeled second text data to obtain a target classification model.

[0014] In an exemplary embodiment, the input unit includes: an input module, configured to pass a target query request and the second text data into the intermediate classification model by calling a preset model interface of the intermediate classification model, where the target query request is used to request to query the M categories with the highest matching degree with the second text data; a receiving module, configured to receive a query response message returned by the intermediate classification model, where the query response message carries the M preset categories with the highest matching degree with the second text data.

[0015] In an exemplary embodiment, the device further includes: a first sending unit, configured to send a first feedback request to the terminal device of the target object after inputting the second text data to be annotated into the intermediate classification model, where the first feedback request carries the second text data and indication information of the M predicted categories, and the first feedback request is used to request to determine the correct category in the M predicted categories that matches the second text data; a first receiving unit, configured to receive a first response message returned by the terminal device in response to the first feedback request, where the first response message carries the feedback result corresponding to the set of first categories.

[0016] In an exemplary embodiment, the apparatus further comprises: a display unit, configured to, after sending a first feedback request to the terminal device of the target object, in response to receiving the first feedback request, display the second text data and a display area corresponding to each of the M predicted categories through a display component of the terminal device, wherein each display area corresponding to each predicted category displays each predicted category and two options, and the two options include a correct option for indicating that the corresponding predicted category is the correct category and an incorrect option for indicating that the corresponding predicted category is not the correct category; a generating unit, configured to generate the first response message in response to a selection operation performed on the two options corresponding to the group of first categories.

[0017] In an exemplary embodiment, the apparatus further comprises: a second sending unit, configured to, after inputting the second text data to be labeled into the intermediate classification model, when obtaining a feedback result corresponding to the group of first categories and there is no first category in the group of first categories whose corresponding feedback result indicates that it is the correct category, send a second feedback request to the terminal device of the target object, wherein the second feedback request carries the second text data and indication information of (N - M) predicted categories, and the second feedback request is used to request to determine the correct category that matches the second text data among the (N - M) predicted categories, and the (N - M) predicted categories are other predicted categories among the N preset categories except the M predicted categories; a second receiving unit, configured to receive a second response message returned by the terminal device in response to the second feedback request, wherein the second response message carries a feedback result corresponding to a group of second categories among the (N - M) predicted categories, and the feedback result corresponding to each second category in the group of second categories is used to indicate whether the corresponding second category is the correct category; a second determining unit, configured to, when there is only one second target category in the group of second categories, determine the second target category as the labeled category of the second text data, so as to obtain the labeled second text data, wherein the second target category is the second category whose corresponding feedback result indicates that it is the correct category; a third training unit, configured to use the labeled second text data to perform model training on the intermediate classification model to obtain a target classification model.

[0018] In an exemplary embodiment, the device further includes: a third sending unit, configured to, after inputting the second text data to be labeled into the intermediate classification model, when a feedback result corresponding to the set of first categories is obtained and there are multiple first target categories in the set of first categories, send a third feedback request to the terminal device of the target object, where the third feedback request carries the second text data and indication information of the multiple first target categories, and the third feedback request is used to request to determine the correct category that matches the second text data among the multiple first target categories; a third receiving unit, configured to receive a third response message returned by the terminal device in response to the third feedback request, where the third response message carries a feedback result corresponding to the multiple first target categories, and the feedback result corresponding to each first target category is used to indicate whether the corresponding first target category is the correct category; a third determining unit, configured to, when there is only one third target category among the multiple first target categories, determine the third target category as the labeled category of the second text data, and obtain the labeled second text data, where the third target category is the first target category whose corresponding feedback result indicates that it is the correct category; a fourth training unit, configured to use the labeled second text data to perform model training on the intermediate classification model to obtain a target classification model.

[0019] In an exemplary embodiment, the device further includes: a fifth training unit, configured to, after determining the first target category as the labeled category of the second text data, use the labeled second text data to perform model training on the initial task model to obtain a target task model, where the target task model is a single-task model different from the target classification model.

[0020] According to another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the above-mentioned annotation optimization method based on the generative pre-training GPT model when running.

[0021] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the above-mentioned processor executes the above-mentioned annotation optimization method based on the generative pre-training GPT model through the computer program.

[0022] In the embodiments of the present application, at least one predicted category with the highest matching degree to the data to be labeled predicted by the GPT model is manually judged for correctness, and then the classification model is iteratively optimized based on the calibrated and labeled data. The initially trained classification model is trained using the labeled first text data to obtain an intermediate classification model, where the initial classification model is a GPT model with N preset categories; the second text data to be labeled is input into the intermediate classification model to obtain M predicted categories, where the M predicted categories are the M preset categories with the highest matching degree to the second text data among the N preset categories predicted by the intermediate classification model, and M < N; when a feedback result corresponding to a group of first categories among the M predicted categories is obtained and there is only one first target category in the group of first categories, the first target category is determined as the labeled category of the second text data to obtain the labeled second text data, where the feedback result corresponding to each first category in the group of first categories is used to indicate whether the corresponding first category is the correct category, and the first target category is the first category whose corresponding feedback result indicates it is the correct category; the intermediate classification model is trained using the labeled second text data to obtain a target classification model. Since only at least one predicted category with the highest matching degree to the data to be labeled predicted by the intermediate classification model is manually verified in the form of a "true or false question", rather than in the form of a "multiple-choice question" or a "fill-in-the-blank question", the purpose of reducing the difficulty of manual verification can be achieved, and the technical effect of improving the efficiency of manual verification can be achieved, thereby solving the technical problems of high difficulty and long time consumption in manual verification existing in the labeling optimization method based on the generative pre-trained GPT model in the related art. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application and, together with the specification, are used to explain the principles of the present application.

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.

[0025] Figure 1 It is a schematic diagram of the hardware environment of an optional labeling optimization method based on the generative pre-trained GPT model according to an embodiment of the present application;

[0026] Figure 2 It is a schematic flowchart of an optional labeling optimization method based on the generative pre-trained GPT model according to an embodiment of the present application;

[0027] Figure 3 It is a schematic diagram of the display area of a display component of an optional terminal device according to an embodiment of the present application;

[0028] Figure 4 It is a schematic diagram of the display area of a display component of another optional terminal device according to an embodiment of the present application;

[0029] Figure 5 It is a schematic flowchart of another optional annotation optimization method based on the generative pre-trained GPT model according to an embodiment of the present application;

[0030] Figure 6 It is a schematic flowchart of yet another optional annotation optimization method based on the generative pre-trained GPT model according to an embodiment of the present application;

[0031] Figure 7 It is a block diagram of the structure of an optional annotation optimization device based on the generative pre-trained GPT model according to an embodiment of the present application;

[0032] Figure 8 It is a block diagram of the structure of an optional electronic device according to an embodiment of the present application. Detailed implementation manners

[0033] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of the present application described herein can be implemented in an order different from those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0035] According to one aspect of an embodiment of the present application, a labeling optimization method based on a generative pre-trained GPT model is provided. The labeling optimization method based on a generative pre-trained GPT model is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned labeling optimization method based on a generative pre-trained GPT model can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal device or a client installed on the terminal device. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.

[0036] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, and the like.

[0037] The annotation optimization method based on the generative pre-trained GPT model of the embodiment of the present application can be executed by the server 104, or by the terminal device 102, or by the server 104 and the terminal device 102. The terminal device 102 executes the annotation optimization method based on the generative pre-trained GPT model of the embodiment of the present application, or the client installed thereon.

[0038] Taking the server 104 as an example to execute the annotation optimization method based on the generative pre-trained GPT model in this embodiment, Figure 2It is a schematic flowchart of an optional annotation optimization method based on the generative pre-trained GPT model according to an embodiment of the present application. As Figure 2 shown, the process of this method may include the following steps:

[0039] Step S202, use the labeled first text data to train the initial classification model to be trained, and obtain an intermediate classification model. Among them, the initial classification model is a GPT model with N preset categories.

[0040] The annotation optimization method based on the generative pre-trained GPT model in this embodiment can be applied to the scenario of optimizing the annotation results of a data annotation model. Here, the data annotation model may include, but is not limited to, a text classification model, an image recognition model, and a speech recognition model. In the embodiment of the present application, the GPT model is taken as an example. By optimizing the annotation results of the GPT model, the model annotation results can be made more accurate and the model reliability can be improved.

[0041] Since the results of automatic annotation are generated by the model, inaccurate situations may occur. If inaccurate annotation data is used to train the model, the model will be unreliable. Therefore, it is necessary to manually verify and correct the model annotation results.

[0042] However, if each text data is manually re-annotated with the correct result, the consumption of human resources is relatively large, because each text data may correspond to many types of labels, and it is difficult for humans to select one from hundreds of labels, which will consume a large amount of manual annotation time.

[0043] To solve at least part of the above problems, in this embodiment, at least part of the model prediction results with the highest matching degree with the data to be annotated are manually verified, that is, by manually giving feedback on whether the model prediction results are correct, and collecting the feedback results for optimizing the model, forming a closed loop with feedback, which can improve the efficiency of manual verification.

[0044] In this embodiment, an initial classification model to be trained and a labeled text classification dataset can be prepared first. The dataset can include a set of first text data and corresponding category indication information, and the category indication information can be, but is not limited to, in the form of text, images, symbols, etc. Using the labeled first text data (i.e., the first text data and the corresponding category indication information) to train the initial classification model to be trained, an intermediate classification model can be obtained. Here, the initial classification model can be a GPT model with N preset categories. The preset categories can include the categories corresponding to a set of labeled first text data used to train the initial classification model, or can be categories defined by other means, and this is not limited in this embodiment. The intermediate classification model obtained through model training can automatically identify text data of N preset categories, and N can be any integer greater than 1.

[0045] Here, the Generative Pretrained Transformer (GPT) model is a natural language processing model based on neural networks. It is pre-trained with a large amount of text data and can then be used for various text generation and understanding tasks. The GPT model captures the dependencies and semantic information in the text through multiple layers of attention mechanisms. The GPT model in the pre-training stage can learn rich language knowledge and patterns, thus achieving good performance in downstream tasks. At the same time, the pre-training of the GPT model uses an unsupervised autoregressive language model, that is, the model learns the probability distribution and semantic information of the language by predicting the next word in the text. This pre-training method enables the GPT model to generate smooth and accurate text and can be applied to various tasks such as text classification, abstract generation, and dialogue systems.

[0046] Step S204: Input the second text data to be labeled into the intermediate classification model to obtain M predicted categories, where the M predicted categories are the M preset categories with the highest matching degree to the second text data among the N preset categories predicted by the intermediate classification model, and M < N.

[0047] After inputting the second text data to be labeled into the intermediate classification model, the intermediate classification model can predict the category of the second text data to be labeled to obtain at least one predicted category. The matching degrees of different predicted categories to the second text data to be labeled are different. Here, the predicted category with the highest matching degree can be the preset category that the intermediate classification model "thinks" has the highest matching degree to the text data to be labeled.

[0048] In this embodiment, the second text data to be labeled is input into the intermediate classification model, and M predicted categories can be obtained. Here, the M predicted categories can be the predicted categories that the intermediate classification model predicts may correspond to the second text data to be labeled. To reduce the number of model predicted categories for manual verification, the M predicted categories can be the M preset categories with the highest matching degree to the second text data selected from the N preset categories that the intermediate classification model can recognize. At this time, M is less than N, and M is greater than or equal to 0.

[0049] Step S206, when a feedback result corresponding to a set of first categories among the M predicted categories is obtained and there is only one first target category in the set of first categories, the first target category is determined as the labeled category of the second text data, and the labeled second text data is obtained. Among them, the feedback result corresponding to each first category in the set of first categories is used to indicate whether the corresponding first category is the correct category, and the first target category is the first category whose corresponding feedback result indicates that it is the correct category.

[0050] To improve the reliability of the classification model, the predicted categories of the classification model can be manually reviewed and corrected. In this embodiment, it can be determined whether the predicted categories of the classification model are the correct categories based on the feedback results, and the feedback results can be generated manually on the terminal device of the target object.

[0051] When M predicted categories corresponding to the second text data to be labeled are obtained based on the intermediate classification model, a feedback result corresponding to a set of first categories among the M predicted categories can be obtained. Here, a set of first categories among the M predicted categories can refer to one or more predicted categories among the M predicted categories. When there is a first target category in the set of first categories, the set of first categories can be part of the M predicted categories. The feedback result corresponding to each first category in the set of first categories can be used to indicate whether the corresponding first category is the correct category, and the first target category is the first category whose corresponding feedback result indicates that it is the correct category.

[0052] When there is only one first target category in the set of first categories, the first target category is determined as the labeled category of the second text data, and the labeled second text data is obtained.

[0053] Step S208, the intermediate classification model is trained using the labeled second text data to obtain the target classification model.

[0054] According to the feedback results, the intermediate classification model can be iterated and optimized. Specifically, it can be adjusting model parameters, increasing training data, improving annotation criteria, etc., to improve the performance of the model. In this embodiment, after obtaining the labeled second text data, the labeled second text data can be used to train the intermediate classification model to obtain the target classification model.

[0055] Through the above steps S202 to S208, the initial classification model to be trained is trained using the labeled first text data to obtain an intermediate classification model, where the initial classification model is a GPT model with N preset categories; the second text data to be labeled is input into the intermediate classification model to obtain M predicted categories, where the M predicted categories are the M preset categories in the N preset categories that have the highest matching degree with the second text data predicted by the intermediate classification model, and M < N; in the case where a feedback result corresponding to a set of first categories in the M predicted categories is obtained and there is only one first target category in the set of first categories, the first target category is determined as the annotation category of the second text data to obtain the labeled second text data, where the feedback result corresponding to each first category in the set of first categories is used to indicate whether the corresponding first category is the correct category, and the first target category is the first category indicated as the correct category by the corresponding feedback result; the labeled second text data is used to train the intermediate classification model to obtain the target classification model, which solves the technical problems of high difficulty and long time consumption in manual verification existing in the annotation optimization method based on the generative pre-training GPT model in the related art.

[0056] In an exemplary embodiment, inputting the second text data to be labeled into the intermediate classification model to obtain M predicted categories includes:

[0057] S11, passing the target query request and the second text data into the intermediate classification model by calling the preset model interface of the intermediate classification model, where the target query request is used to request to query the M categories with the highest matching degree with the second text data;

[0058] S12, receiving the query response message returned by the intermediate classification model, where the query response message carries the M preset categories with the highest matching degree with the second text data.

[0059] The preset model interface can refer to a set of interfaces predefined in software or a system for interacting and communicating with other modules or components. These interfaces define the input and output formats, data types, parameters, etc., so that different modules or components can interact according to the specified interfaces to achieve function combination and reuse. The existence of the preset model interface can make the system more flexible and extensible, and different modules can interact according to the preset interfaces without understanding the specific implementation details of other modules.

[0060] The target query request and the second text data to be annotated are input into the intermediate classification model by calling the preset model interface of the intermediate classification model. The intermediate classification model can generate M categories with the highest matching degree with the second text data based on the target query request and the second text data to be annotated, and carry the M categories with the highest matching degree with the second text data in the query response information and feedback them to the terminal device.

[0061] For example, in this embodiment, in order to reduce the difficulty of manual verification, the intermediate classification model can be made to generate two most likely predicted classifications. At this time, M = 2. For example, Figure 3 and Figure 4 As shown, compared with directly manually annotating the second text data, it is much simpler and more efficient for a person to select from 2 labels.

[0062] Through this embodiment, by obtaining the two predicted categories predicted by the intermediate classification model and having the highest matching degree with the second text data, the complexity of manual verification can be reduced.

[0063] In an exemplary embodiment, after the second text data to be annotated is input into the intermediate classification model, the above method further includes:

[0064] S21. Sending a first feedback request to the terminal device of the target object, where the first feedback request carries the second text data and indication information of M predicted categories, and the first feedback request is used to request to determine the correct category that matches the second text data among the M predicted categories;

[0065] S22. Receiving a first response message returned by the terminal device in response to the first feedback request, where the first response message carries a feedback result corresponding to a set of first categories.

[0066] After the second text data to be annotated is input into the intermediate classification model, the server can send a first feedback request to the terminal device of the target object. The terminal device of the target object can send a first response message to the server in response to the first feedback request received from the server, and the server can receive the first response message returned by the terminal device in response to the first feedback request. Here, the first feedback request can carry the second text data and indication information of M predicted categories, and the first feedback request can be used to request to determine the correct category that matches the second text data among the M predicted categories. The first response message carries a feedback result corresponding to a set of first categories. Similar to the foregoing embodiments, the feedback result can be used to indicate whether the corresponding model predicted category is the correct category.

[0067] For example, in this embodiment, as Figure 3As shown, the second text data may be "I want to travel to a certain place". Taking the prediction classification obtained from the intermediate classification model as an example with 2 predictions, the predicted category 1 is tourism, and the predicted category 2 is work. By sending a first feedback request to the terminal device of the target object, the terminal device can generate a first response message carrying the feedback result through manual click feedback in response to the received first feedback request.

[0068] In an exemplary embodiment, after sending the first feedback request to the terminal device of the target object, the above method further includes:

[0069] S31, in response to the received first feedback request, display the second text data and a display area corresponding to each of the M predicted categories through the display component of the terminal device, where each predicted category and two options are displayed in the display area corresponding to each predicted category, and the two options include a correct option for indicating that the corresponding predicted category is the correct category and an incorrect option for indicating that the corresponding predicted category is not the correct category;

[0070] S32, generate a first response message in response to the selection operation performed on the two options corresponding to a set of first categories.

[0071] To improve the convenience of manual feedback, in this embodiment, for the terminal device, after receiving the first feedback request, it can, in response to the received first feedback request, display the second text data and a display area corresponding to each of the M predicted categories through the display component of the terminal device. Here, each predicted category and two options are displayed in the display area corresponding to each predicted category, and the two options include a correct option for indicating that the corresponding predicted category is the correct category and an incorrect option for indicating that the corresponding predicted category is not the correct category.

[0072] For example, in this embodiment, the display component of the terminal device may be as Figure 3 、 Figure 4 shown, with the thumb pointing up representing the correct option for the corresponding predicted category being the correct category, and the thumb pointing down representing the incorrect option for the corresponding predicted category not being the correct category. It may also be other forms of correct / incorrect option forms, which are not limited in this embodiment.

[0073] In response to a selection operation performed on two options corresponding to a set of first categories, the terminal device generates a first response message. Here, the display component of the terminal device can display each of the M predicted categories, but the selection operation performed on the two options corresponding to the predicted categories can be performed only on some of the M predicted categories. For example, when there is a correct category in a set of first categories among the M predicted categories, it can also be performed on all of the M predicted categories. This is not limited in this embodiment.

[0074] In this embodiment, by using the display component of the terminal device to display the feedback options of one or more predicted categories predicted by the intermediate prediction model, and by selecting the correct or incorrect feedback options corresponding to at least one predicted category, the target object can intuitively perform the operation of manual feedback based on the display interface of the terminal device.

[0075] In an exemplary embodiment, after inputting the second text data to be annotated into the intermediate classification model, the above method further includes:

[0076] S41, when obtaining the feedback result corresponding to a set of first categories and there is no first category in the set of first categories whose corresponding feedback result indicates a correct category, send a second feedback request to the terminal device of the target object, where the second feedback request carries the second text data and the indication information of (N - M) predicted categories, and the second feedback request is used to request to determine the correct category that matches the second text data among the (N - M) predicted categories, and the (N - M) predicted categories are the other predicted categories except the M predicted categories among the N preset categories;

[0077] S42, receive the second response message returned by the terminal device in response to the second feedback request, where the second response message carries the feedback result corresponding to a set of second categories among the (N - M) predicted categories, and the feedback result corresponding to each second category in the set of second categories is used to indicate whether the corresponding second category is the correct category;

[0078] S43, when there is only one second target category in the set of second categories, determine the second target category as the annotation category of the second text data to obtain the annotated second text data, where the second target category is the second category whose corresponding feedback result indicates a correct category;

[0079] S44, use the annotated second text data to train the intermediate classification model to obtain the target classification model.

[0080] In this embodiment, in combination with Figure 5In steps S502 to S508, for the server, when obtaining the feedback results corresponding to a set of first categories and there is no first category in the set of first categories whose corresponding feedback result indicates the correct category, that is, when it is determined that there is no prediction category in the M prediction categories predicted by the intermediate classification model whose corresponding feedback result indicates the correct category, a second feedback request is sent to the terminal device of the target object. The second feedback request carries second text data and indication information of (N - M) prediction categories. The second feedback request is used to request to determine the correct category that matches the second text data among the (N - M) prediction categories. The (N - M) prediction categories are the other prediction categories among the N preset categories except the M prediction categories.

[0081] For the terminal device, when receiving the second feedback request sent by the server, in response to the second feedback request, it is possible to generate a feedback result corresponding to a set of second categories among the (N - M) prediction categories based on the manual operation (by the target object) on the terminal device, that is, the target object generates a feedback result for one or more prediction categories among the (N - M) prediction categories on the terminal device. Here, the feedback result can be similar to the foregoing embodiments and will not be elaborated here. When there is a second target category in a set of second categories, the set of second categories can be some of the (N - M) prediction categories, and the second target category can be the second category whose corresponding feedback result indicates the correct category.

[0082] When there is only one second target category in a set of second categories, the second target category is determined as the labeled category of the second text data, and the labeled second text data is obtained. The intermediate classification model is trained using the labeled second text data to obtain the target classification model.

[0083] Through this embodiment, when there is no correct category among the M prediction categories predicted by the intermediate classification model, the indication information of the (N - M) preset categories that can be predicted by the intermediate classification model except the predicted categories and the text data to be labeled are sent to the terminal device of the target object. The target object determines the correct category that matches the text data to be labeled among the (N - M) preset categories based on the terminal device. The terminal device sends a second response message carrying the feedback result corresponding to one or more prediction categories among the (N - M) prediction categories to the server. When the server obtains the correct category of the data to be labeled based on the feedback result, the obtained labeled text data is used to train the intermediate classification model to obtain the target classification model, realizing the iterative optimization of the intermediate classification model.

[0084] In an exemplary embodiment, after inputting the second text data to be labeled into the intermediate classification model, the above method further includes:

[0085] S51. When obtaining a feedback result corresponding to a set of first categories and there are multiple first target categories in the set of first categories, send a third feedback request to the terminal device of the target object, where the third feedback request carries second text data and indication information of the multiple first target categories, and the third feedback request is used to request to determine the correct category that matches the second text data among the multiple first target categories;

[0086] S52. Receive a third response message returned by the terminal device in response to the third feedback request, where the third response message carries a feedback result corresponding to the multiple first target categories, and the feedback result corresponding to each first target category is used to indicate whether the corresponding first target category is the correct category;

[0087] S53. When there is only one third target category among the multiple first target categories, determine the third target category as the annotation category of the second text data to obtain the annotated second text data, where the third target category is the first target category whose corresponding feedback result indicates that it is the correct category;

[0088] S54. Use the annotated second text data to train the intermediate classification model to obtain the target classification model.

[0089] Considering that manual verification may also have misoperations, resulting in determining that there are multiple first target categories in the set of first categories based on the feedback result corresponding to the set of first categories. In this case, the multiple first target categories can be re-verified manually.

[0090] In this embodiment, for the server, when obtaining a feedback result corresponding to a set of first categories and there are multiple first target categories in the set of first categories, a third feedback request can be sent to the terminal device of the target object. Here, the third feedback request carries second text data and indication information of the multiple first target categories, and the third feedback request is used to request to determine the correct category that matches the second text data among the multiple first target categories. For the terminal device, in response to the received third feedback request, a third response message can be generated manually, and the third response message carries a feedback result corresponding to the multiple first target categories, where the feedback result corresponding to each first target category is used to indicate whether the corresponding first target category is the correct category.

[0091] The server receives a third response message returned by the terminal device in response to a third feedback request. When it is determined based on the third response message that there is only one third target category among multiple first target categories, the server determines the third target category as the annotation category of the second text data, obtaining the annotated second text data. Here, the third target category is the first target category whose corresponding feedback result indicates the correct category. Using the annotated second text data to train the intermediate classification model, a target classification model can be obtained.

[0092] Through this embodiment, when it is determined based on the manual feedback result that there are multiple (two or more) correct categories for the text data to be annotated, the determined multiple correct categories are re-verified manually to obtain the corresponding feedback result until it is determined based on the feedback result that there is only one correct category corresponding to the data to be annotated. Then, this correct category is determined as the annotation result of the final data to be annotated, thereby improving the accuracy of manual verification and the accuracy of training the target classification model.

[0093] In an exemplary embodiment, after determining the first target category as the annotation category of the second text data, the above method further includes:

[0094] S61, using the annotated second text data to train the initial task model to obtain a target task model, where the target task model is a single-task model different from the target classification model.

[0095] In this embodiment, a feedback result can be generated by, for example, the target object clicking on the display page of the display component of the terminal device. The correct categories corresponding to the data to be annotated determined based on the manual feedback result can be collected and used to train an initial task model, such as a small annotation model, thereby improving the accuracy of the small model. Moreover, the trained small model has a faster calculation speed and lower hardware resource requirements.

[0096] Through this embodiment, by using the manually verified and annotated text data to train the initial task model to be trained, a single-task model different from the aforementioned target classification model can be obtained, improving the reliability of the target task model.

[0097] Next, the annotation optimization method based on the generative pre-training GPT model in the embodiments of the present application will be explained with reference to optional examples.

[0098] Currently, there are two common annotation tasks, namely classification: assigning a single label to an entire sentence; and sequence annotation: assigning different labels to different segments of a sentence. For example, for the input "I want to visit a certain place", the classification output is "travel", and the keyword sequence annotation output is "O O O B-location I-location E-location O O O".

[0099] To address the issue that the results of automatic annotation are generated by an automatic annotation system and may be inaccurate, leading to unreliable model training, in this embodiment, in combination with Figure 6 , a query can refer to a search request or query input by a user. For example, for the text data to be annotated, the automatic annotation system will perform matching and analysis based on these queries and automatically annotate or classify the query results. By adding a human feedback mechanism to the automatic annotation system, the automatic annotation system can generate two (or more) different annotation results for each sentence. For example, for the input "I want to visit a certain place", as Figure 3 shown, the classification result 1 output is "travel", and the classification result 2 output is "travel"; as Figure 4 shown, the keyword sequence annotation 1 output is "O O O B-location I-location E-location O O O", and the keyword sequence annotation 2 output is "OOO B-Person I-Person E-Person O O O". The annotator compares the results and provides feedback by clicking buttons (like / dislike). The feedback results are collected and used to train the model, which can obtain a more reliable model, iteratively optimize the automatic annotation system, and improve the accuracy of its automatic annotation. Alternatively, the feedback results can be collected and used to train a small annotation model to improve the accuracy of the small model, and the small model has a faster calculation speed and lower hardware resource requirements.

[0100] Through this optional example, by having the model generate two most likely labels and allowing the annotator to choose between the two labels for verification, the difficulty of manual verification can be reduced and the manual verification efficiency can be improved; reusing the labels after human feedback to optimize and train the model can improve the reliability of the model.

[0101] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that this application is not limited by the described action sequence because, according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0102] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented 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, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM (Read-Only Memory), RAM (Random Access Memory), magnetic disk, optical disk), and includes several instructions to enable a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of various embodiments of the present application.

[0103] According to another aspect of the embodiments of the present application, there is also provided an annotation optimization device based on the generative pre-trained GPT model for implementing the above-mentioned annotation optimization method based on the generative pre-trained GPT model. Figure 7 It is a structural block diagram of an optional annotation optimization device based on the generative pre-trained GPT model according to the embodiments of the present application, as Figure 7 shown. The device may include:

[0104] A first training unit 702, configured to use the labeled first text data to train an initial classification model to be trained, and obtain an intermediate classification model, where the initial classification model is a GPT model with N preset categories;

[0105] An input unit 704, connected to the first training unit 702, configured to input the second text data to be annotated into the intermediate classification model, and obtain M predicted categories, where the M predicted categories are the M preset categories in the N preset categories that have the highest matching degree with the second text data predicted by the intermediate classification model, and M < N;

[0106] A first determination unit 706, connected to the input unit 704, configured to, when obtaining a feedback result corresponding to a group of first categories in the M predicted categories and there is only one first target category in the group of first categories, determine the first target category as the annotation category of the second text data, and obtain the labeled second text data, where the feedback result corresponding to each first category in the group of first categories is used to indicate whether the corresponding first category is the correct category, and the first target category is the first category indicated as the correct category by the corresponding feedback result.

[0107] A second training unit 708, connected to the first determination unit 706, configured to use the labeled second text data to train the intermediate classification model to obtain a target classification model.

[0108] It should be noted that the first training unit 702 in this embodiment may be used to execute the above step S202, the input unit 704 in this embodiment may be used to execute the above step S204, the first determination unit 706 in this embodiment may be used to execute the above step S206, and the second training unit 708 in this embodiment may be used to execute the above step S208.

[0109] Through the above modules, the initial classification model to be trained is trained using the labeled first text data to obtain an intermediate classification model, where the initial classification model is a classification model with N preset categories; the second text data to be labeled is input into the intermediate classification model to obtain M predicted categories, where the M predicted categories are the M preset categories with the highest matching degree to the second text data among the N preset categories predicted by the intermediate classification model, and M < N; in the case of obtaining a feedback result corresponding to a set of first categories in the M predicted categories and there is only one first target category in the set of first categories, the first target category is determined as the labeled category of the second text data to obtain the labeled second text data, where the feedback result corresponding to each first category in the set of first categories is used to indicate whether the corresponding first category is the correct category, and the first target category is the first category indicated as the correct category by the corresponding feedback result; the intermediate classification model is trained using the labeled second text data to obtain a target classification model, which solves the technical problem in the related art that the annotation optimization method based on the generative pre-training GPT model has a large manual verification difficulty and long time consumption due to the large number of possibilities of the model prediction results corresponding to the data to be annotated, and improves the manual verification efficiency.

[0110] In an exemplary embodiment, the input unit includes:

[0111] An input module, configured to pass the target query request and the second text data into the intermediate classification model by calling a preset model interface of the intermediate classification model, where the target query request is used to request to query the M categories with the highest matching degree to the second text data;

[0112] A receiving module, configured to receive a query response message returned by the intermediate classification model, where the query response message carries the M preset categories with the highest matching degree to the second text data.

[0113] In an exemplary embodiment, the above device further includes:

[0114] A first sending unit, configured to send a first feedback request to a terminal device of a target object after inputting second text data to be labeled into an intermediate classification model, where the first feedback request carries the second text data and indication information of M predicted categories, and the first feedback request is used to request to determine a correct category that matches the second text data among the M predicted categories;

[0115] A first receiving unit, configured to receive a first response message returned by the terminal device in response to the first feedback request, where the first response message carries a feedback result corresponding to a set of first categories.

[0116] In an exemplary embodiment, the above device further includes:

[0117] A display unit, configured to, after sending the first feedback request to the terminal device of the target object and in response to the received first feedback request, display, through a display component of the terminal device, the second text data and a display area corresponding to each of the M predicted categories, where each display area corresponding to each predicted category displays each predicted category and two options, and the two options include a correct option for indicating that the corresponding predicted category is the correct category and an incorrect option for indicating that the corresponding predicted category is not the correct category;

[0118] A generating unit, configured to generate a first response message in response to a selection operation performed on the two options corresponding to a set of first categories.

[0119] In an exemplary embodiment, the above device further includes:

[0120] A second sending unit, configured to send a second feedback request to the terminal device of the target object after inputting the second text data to be labeled into the intermediate classification model, when obtaining a feedback result corresponding to a set of first categories and there is no first category in the set of first categories whose corresponding feedback result indicates being the correct category, where the second feedback request carries the second text data and indication information of (N - M) predicted categories, and the second feedback request is used to request to determine a correct category that matches the second text data among the (N - M) predicted categories, and the (N - M) predicted categories are other categories among N preset categories except the M predicted categories;

[0121] A second receiving unit, configured to receive a second response message returned by the terminal device in response to the second feedback request, where the second response message carries a feedback result corresponding to a set of second categories among the (N - M) predicted categories, and the feedback result corresponding to each second category in the set of second categories is used to indicate whether the corresponding second category is the correct category;

[0122] A second determination unit, configured to, when there is only one second target category in a group of second categories, determine the second target category as the annotation category of the second text data, so as to obtain the annotated second text data, where the second target category is the second category whose corresponding feedback result indicates the correct category;

[0123] A third training unit, configured to use the annotated second text data to train an intermediate classification model to obtain a target classification model.

[0124] In an exemplary embodiment, the above device further includes:

[0125] A third sending unit, configured to, after inputting the second text data to be annotated into the intermediate classification model, when obtaining a feedback result corresponding to a group of first categories and there are multiple first target categories in the group of first categories, send a third feedback request to the terminal device of the target object, where the third feedback request carries the second text data and indication information of the multiple first target categories, and the third feedback request is used to request to determine the correct category that matches the second text data among the multiple first target categories;

[0126] A third receiving unit, configured to receive a third response message returned by the terminal device in response to the third feedback request, where the third response message carries a feedback result corresponding to the multiple first target categories, and the feedback result corresponding to each first target category is used to indicate whether the corresponding first target category is the correct category;

[0127] A third determination unit, configured to, when there is only one third target category in the multiple first target categories, determine the third target category as the annotation category of the second text data, so as to obtain the annotated second text data, where the third target category is the first target category whose corresponding feedback result indicates the correct category;

[0128] A fourth training unit, configured to use the annotated second text data to train an intermediate classification model to obtain a target classification model.

[0129] In an exemplary embodiment, the above device further includes:

[0130] A fifth training unit, configured to, after determining the first target category as the annotation category of the second text data, use the annotated second text data to train an initial task model to obtain a target task model, where the target task model is a single-task model different from the target classification model.

[0131] It should be noted here that the above modules and the corresponding steps have the same examples and application scenarios, but are not limited to the content disclosed in the above embodiments. It should be noted that the above modules, as part of the device, can run on, for exampleFigure 1 In the hardware environment shown, it can be implemented by software or by hardware. Among them, the hardware environment includes a network environment.

[0132] According to another aspect of the embodiments of the present application, a storage medium is also provided. Optionally, in this embodiment, the above storage medium can be used to execute the program code of any one of the above annotation optimization methods based on the generative pre-training GPT model in the embodiments of the present application.

[0133] Optionally, in this embodiment, the above storage medium can be located on at least one of the multiple network devices in the network shown in the above embodiment.

[0134] Optionally, in this embodiment, the storage medium is set to store program code for performing the following steps:

[0135] S1. Use the labeled first text data to train the initial classification model to be trained, and obtain an intermediate classification model. Among them, the initial classification model is a GPT model with N preset categories;

[0136] S2. Input the second text data to be labeled into the intermediate classification model, and obtain M predicted categories. Among them, the M predicted categories are the M preset categories in the N preset categories that have the highest matching degree with the second text data predicted by the intermediate classification model, and M < N;

[0137] S3. In the case where a feedback result corresponding to a group of first categories in the M predicted categories is obtained and there is only one first target category in the group of first categories, determine the first target category as the annotation category of the second text data to obtain the labeled second text data. Among them, the feedback result corresponding to each first category in the group of first categories is used to indicate whether the corresponding first category is the correct category, and the first target category is the first category whose corresponding feedback result indicates that it is the correct category;

[0138] S4. Use the labeled second text data to train the intermediate classification model to obtain a target classification model.

[0139] Optionally, the specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be elaborated herein.

[0140] Optionally, in this embodiment, the above storage medium may include, but is not limited to: various media such as USB flash drives, ROMs, RAMs, mobile hard disks, magnetic disks, or optical discs that can store program code.

[0141] According to another aspect of the embodiments of the present application, there is also provided an electronic device for implementing the above-mentioned annotation optimization method based on the generative pre-training GPT model. The electronic device can be a server, a terminal, or a combination thereof.

[0142] Figure 8 is a structural block diagram of an optional electronic device according to an embodiment of the present application. As Figure 8 shown, it includes a processor 802, a communication interface 804, a memory 806, and a communication bus 808. Among them, the processor 802, the communication interface 804, and the memory 806 communicate with each other through the communication bus 808. Among them,

[0143] The memory 806 is used to store computer programs;

[0144] The processor 802, when executing the computer program stored on the memory 806, implements the following steps:

[0145] S1, using the labeled first text data to train the initial classification model to be trained, and obtaining an intermediate classification model. Among them, the initial classification model is a GPT model with N preset categories;

[0146] S2, inputting the second text data to be labeled into the intermediate classification model, and obtaining M predicted categories. Among them, the M predicted categories are the M preset categories with the highest matching degree with the second text data among the N preset categories predicted by the intermediate classification model, and M < N;

[0147] S3, when obtaining a feedback result corresponding to a group of first categories among the M predicted categories and there is only one first target category in the group of first categories, determining the first target category as the annotation category of the second text data, and obtaining the labeled second text data. Among them, the feedback result corresponding to each first category in the group of first categories is used to indicate whether the corresponding first category is the correct category, and the first target category is the first category whose corresponding feedback result indicates that it is the correct category;

[0148] S4, using the labeled second text data to train the intermediate classification model to obtain a target classification model.

[0149] Optionally, the communication bus can be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 8It is represented by only a thick line, but it does not mean that there is only one bus or one type of bus. The communication interface is used for communication between the above-mentioned electronic device and other devices.

[0150] The memory may include RAM, or may also include non-volatile memory, for example, at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.

[0151] As an example, the above-mentioned memory 806 may but is not limited to include the first training unit 702, the input unit 704, the first determination unit 706, and the second training unit 708 in the above-mentioned annotation optimization device based on the generative pre-training GPT model. In addition, it may also include but is not limited to other module units in the above-mentioned annotation optimization device based on the generative pre-training GPT model, which will not be elaborated in this example.

[0152] The above-mentioned processor may be a general-purpose processor, which may include but is not limited to: CPU (Central Processing Unit, central processing unit), NP (Network Processor, network processor), etc.; it may also be a DSP (Digital Signal Processing, digital signal processor), ASIC (Application Specific Integrated Circuit, application-specific integrated circuit), FPGA (Field-Programmable Gate Array, field programmable gate array), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0153] Optionally, the specific examples in this embodiment may refer to the examples described in the above-mentioned embodiment, and will not be elaborated here.

[0154] Those of ordinary skill in the art can understand that Figure 8 The structure shown is only for illustration. The device for implementing the above-mentioned annotation optimization method based on the generative pre-training GPT model may be a terminal device, and the terminal device may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, and a mobile Internet device (Mobile Internet Devices, MID), a PAD and other terminal devices. Figure 8 It does not limit the structure of the above-mentioned electronic device. For example, the electronic device may also include more or fewer components (such as a network interface, a display device, etc.) than those shown in Figure 8 or have a different configuration from that shown in Figure 8 shown.

[0155] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware of the terminal device through a program, and this program can be stored in a computer-readable storage medium. The storage medium can include: a flash drive, ROM, RAM, a magnetic disk, or an optical disc, etc.

[0156] The serial numbers of the above embodiments of the present application are only for description and do not represent the superiority or inferiority of the embodiments.

[0157] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable one or more computer devices (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0158] In the above embodiments of the present application, the descriptions of the various embodiments each have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0159] In the several embodiments provided by the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some interfaces. The indirect coupling or communication connection of units or modules can be in an electrical or other form.

[0160] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.

[0161] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or at least two units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0162] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.

Claims

1. A method for optimizing annotations based on the generative pre-trained GPT model, characterized in that, Including: Using the labeled first text data to train the initial classification model to be trained, obtaining an intermediate classification model, where the initial classification model is a GPT model with N preset categories; inputting the second text data to be labeled into the intermediate classification model, obtaining M predicted categories, where the M predicted categories are the M preset categories with the highest matching degree with the second text data predicted by the intermediate classification model among the N preset categories, and M < N; When obtaining a feedback result corresponding to a set of first categories among the M predicted categories and there is only one first target category in the set of first categories, determining the first target category as the labeled category of the second text data, obtaining the labeled second text data, where the feedback result corresponding to each first category in the set of first categories is used to indicate whether the corresponding first category is the correct category, and the first target category is the first category whose corresponding feedback result indicates it is the correct category; Using the labeled second text data to train the intermediate classification model to obtain a target classification model.

2. The method according to claim 1, characterized in that, The step of inputting the second text data to be labeled into the intermediate classification model to obtain M predicted categories includes: Passing a target query request and the second text data into the intermediate classification model by calling a preset model interface of the intermediate classification model, where the target query request is used to request to query the M categories with the highest matching degree with the second text data; Receiving a query response message returned by the intermediate classification model, where the query response message carries the M preset categories with the highest matching degree with the second text data.

3. The method according to claim 1, characterized in that, After inputting the second text data to be labeled into the intermediate classification model, the method further includes: Sending a first feedback request to the terminal device of the target object, where the first feedback request carries the second text data and indication information of the M predicted categories, and the first feedback request is used to request to determine the correct category among the M predicted categories that matches the second text data; Receiving a first response message returned by the terminal device in response to the first feedback request, where the first response message carries a feedback result corresponding to the set of first categories.

4. The method according to claim 3, characterized in that, After sending the first feedback request to the terminal device of the target object, the method further includes: In response to the received first feedback request, displaying, through a display component of the terminal device, the second text data and a display area corresponding to each of the M predicted categories, where in the display area corresponding to each predicted category, each predicted category and two options are displayed, and the two options include a correct option for indicating that the corresponding predicted category is the correct category and an incorrect option for indicating that the corresponding predicted category is not the correct category; Generating the first response message in response to a selection operation performed on the two options corresponding to the set of first categories.

5. The method according to claim 1, characterized in that, After inputting the second text data to be labeled into the intermediate classification model, the method further includes: When a feedback result corresponding to the set of first categories is obtained and there is no first category in the set of first categories for which the corresponding feedback result indicates a correct category, sending a second feedback request to the terminal device of the target object, where the second feedback request carries the second text data and indication information of (N - M) predicted categories, and the second feedback request is used to request determination of the correct category that matches the second text data among the (N - M) predicted categories, and the (N - M) predicted categories are the other predicted categories among the N preset categories except the M predicted categories; Receiving a second response message returned by the terminal device in response to the second feedback request, where the second response message carries a feedback result corresponding to a set of second categories among the (N - M) predicted categories, and the feedback result corresponding to each second category in the set of second categories is used to indicate whether the corresponding second category is the correct category; When there is only one second target category in the set of second categories, determining the second target category as the labeled category of the second text data to obtain the labeled second text data, where the second target category is the second category for which the corresponding feedback result indicates a correct category; Using the labeled second text data to perform model training on the intermediate classification model to obtain a target classification model.

6. The method according to claim 1, characterized in that, After inputting the second text data to be labeled into the intermediate classification model, the method further includes: When a feedback result corresponding to the set of first categories is obtained and there are multiple first target categories in the set of first categories, sending a third feedback request to the terminal device of the target object, where the third feedback request carries the second text data and indication information of the multiple first target categories, and the third feedback request is used to request determination of the correct category that matches the second text data among the multiple first target categories; Receiving a third response message returned by the terminal device in response to the third feedback request, where the third response message carries a feedback result corresponding to the multiple first target categories, and the feedback result corresponding to each first target category is used to indicate whether the corresponding first target category is the correct category; When there is only one third target category among the multiple first target categories, determining the third target category as the labeled category of the second text data to obtain the labeled second text data, where the third target category is the first target category for which the corresponding feedback result indicates a correct category; Using the labeled second text data to perform model training on the intermediate classification model to obtain a target classification model.

7. The method according to any one of claims 1 to 6, characterized in that, After determining the first target category as the labeled category of the second text data, the method further includes: Training the initial task model with the labeled second text data to obtain a target task model, where the target task model is a single-task model different from the target classification model.

8. An annotation optimization device based on the generative pre-trained GPT model, characterized in that, Including: A first training unit for training an initial classification model to be trained with the labeled first text data to obtain an intermediate classification model, where the initial classification model is a GPT model with N preset categories; An input unit for inputting the second text data to be labeled into the intermediate classification model to obtain M predicted categories, where the M predicted categories are the M preset categories with the highest matching degree to the second text data among the N preset categories predicted by the intermediate classification model, and M < N; a first determination unit for, when obtaining a feedback result corresponding to a set of first categories among the M predicted categories and there is only one first target category in the set of first categories, determining the first target category as the labeled category of the second text data to obtain the labeled second text data, where the feedback result corresponding to each first category in the set of first categories is used to indicate whether the corresponding first category is the correct category, and the first target category is the first category indicated as the correct category by the corresponding feedback result; A second training unit for training the intermediate classification model with the labeled second text data to obtain a target classification model.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, where the program, when running, executes the method according to any one of claims 1 to 7.

10. An electronic device, comprising a memory and a processor, characterized in that, A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.