Model optimization method based on data annotation and related equipment
The model optimization method and device enhance the efficiency and quality of annotation processes for large language models by implementing a unified online standardized approach, addressing inefficiencies and quality issues in manual offline methods.
Patent Information
- Application Number
- CN202411174407.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-24
- Publication Date
- 2024-12-13
AI Technical Summary
The inefficiency and uneven quality of manual offline annotation processes for question-answering dialogues in large language models, such as ChatGPT, result in reduced model optimization efficiency and effectiveness.
A model optimization method and device that utilizes a unified online standardized process for data annotation, including acquisition, determination, extraction, and training of annotation results to optimize dialogue models.
Improves the efficiency of model optimization by standardizing the annotation process, ensuring high-quality results and avoiding the negative impacts of offline operations.
Smart Images

Figure CN119128516A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of data processing and financial technology, and is applied to the scenario of optimizing a large language model through the annotation operation of question-answering dialogues, and in particular to a model optimization method based on data annotation and related equipment. Background Art
[0002] In recent years, with the development of AI, large language models such as ChatGPT have been widely used in financial technology related industries. For large language models, in order to achieve the expected business results, massive business badcase data is required as support to continuously optimize the model.
[0003] Badcase data refers to input data that does not conform to conventional language rules, has special contexts, or is difficult for the model to correctly understand and process. Generally speaking, it is necessary to manually annotate the screened question-answering dialogues. However, since conversational large language models such as ChatGPT are relatively new and related ecological tools are missing, the annotation work for question-answering dialogues is mostly completed offline in the form of Excel.
[0004] However, using this method, it is easy for the annotation results to exist in multiple Excel files, resulting in a large amount of online log data and difficulty in aggregation, which reduces the efficiency of model optimization. In addition, manual offline operations lead to uneven quality of annotation results, affecting the effect of model optimization. Summary of the invention
[0005] The purpose of the embodiments of the present application is to propose a model optimization method based on data annotation and related equipment to solve the technical problem of low efficiency in annotation operations for question-answering dialogues of large language models.
[0006] In order to solve the above technical problems, the embodiment of the present application provides a model optimization method based on data annotation, which adopts the following technical solution:
[0007] A model optimization method based on data annotation includes the following steps:
[0008] Get the session information to be annotated in the target round and display it on the preset annotation page;
[0009] Determining whether an answer to the conversation information to be annotated is correct or not according to the annotation instruction carrying the annotation information received on the annotation page;
[0010] Extracting annotation label information and annotation text information of the conversation information to be annotated from the annotation information according to the correctness result of the answer;
[0011] Generate a labeling result of the to-be-labeled session information according to the labeling tag information and the labeling text information;
[0012] The preset dialogue model is optimized and trained according to the annotation results to obtain a trained target model.
[0013] Furthermore, the step of extracting the annotation tag information and the annotation text information of the conversation information to be annotated from the annotation information according to the correctness result of the answer specifically includes:
[0014] Determining whether the answer in the conversation information to be marked is correct according to the answer correctness result;
[0015] If the answer is correct, extracting question classification label information and answer legality label information from the annotation information as the annotation label information, and extracting remark text information from the annotation information as the annotation text information;
[0016] If the answer is wrong, question classification label information, answer validity label information and error type label information are extracted from the annotation information as the annotation label information, and remark text information and correct answer text information are extracted from the annotation information as the annotation text information.
[0017] Furthermore, the step of determining whether the answer to the to-be-annotated conversation information is correct or not according to the annotation instruction carrying the annotation information received on the annotation page specifically includes:
[0018] According to the annotation instruction, determining the correct or incorrect answer options corresponding to the conversation information to be annotated in the annotation page, wherein the correct or incorrect answer options include correct options and incorrect options;
[0019] If the answer right or wrong option is the correct option, then the answer in the conversation information to be marked is determined to be correct, and the answer is taken as the answer right or wrong result;
[0020] If the correct answer option is an incorrect option, the answer in the conversation information to be marked is determined to be incorrect, and the answer is taken as the correct answer result.
[0021] Furthermore, the correct or incorrect answer options also include incomplete options. After the step of determining the correct or incorrect answer options corresponding to the to-be-annotated session information in the annotated page according to the annotating instruction, the method further includes:
[0022] If the correct or incorrect answer option is an incomplete option, the session information to be marked is transferred to a preset questionable database, and an early warning prompt message is sent to the administrator user terminal.
[0023] Furthermore, the step of generating the annotation result of the to-be-annotated session information according to the annotation tag information and the annotation text information specifically includes:
[0024] Filtering a preset annotation template corresponding to the to-be-annotated session information according to the annotation tag information and the annotation text information;
[0025] The annotation label information and the annotation text information are filled into the preset annotation template to obtain the annotation result.
[0026] Furthermore, the step of optimizing and training the preset dialogue model according to the annotation results to obtain a trained target model specifically includes:
[0027] Perform feature extraction according to the annotation results to obtain a feature data set;
[0028] Preprocessing the feature data set to obtain a preprocessed target training set;
[0029] The target training set is input into the dialogue model for optimization training to obtain the target model.
[0030] Furthermore, the step of preprocessing the feature data set to obtain a preprocessed target training set specifically includes:
[0031] The feature data set is normalized and data enhanced in sequence to obtain the target training set.
[0032] In order to solve the above technical problems, the embodiment of the present application also provides a model optimization device based on data annotation, which adopts the following technical solution:
[0033] A model optimization device based on data annotation, comprising:
[0034] The acquisition module is used to obtain the session information to be annotated in the target round and display it on a preset annotation page;
[0035] A determination module, configured to determine whether an answer to the to-be-annotated session information is correct or not according to the annotation instruction carrying the annotation information received on the annotation page;
[0036] An extraction module, configured to extract annotation label information and annotation text information of the conversation information to be annotated from the annotation information according to the correctness result of the answer;
[0037] A generating module, configured to generate a marking result of the to-be-marked session information according to the marking label information and the marking text information;
[0038] The training module is used to optimize the preset dialogue model according to the annotation results to obtain a trained target model.
[0039] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0040] A computer device includes a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the model optimization method based on data labeling as described above are implemented.
[0041] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0042] A computer-readable storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by a processor, implement the steps of the model optimization method based on data labeling as described above.
[0043] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0044] The model optimization method based on data annotation disclosed in the present application obtains the conversation information to be annotated of the target round and displays it in a preset annotation page; then, according to the annotation instruction carrying the annotation information received by the annotation page, determines the correctness of the answer of the conversation information to be annotated; then, according to the correctness of the answer, extracts the annotation label information and annotation text information of the conversation information to be annotated from the annotation information; and generates the annotation result of the conversation information to be annotated according to the annotation label information and the annotation text information; thus, the preset dialogue model is optimized and trained according to the annotation result to obtain the trained target model. The present application realizes the annotation operation for question-answering dialogues through a unified online standardized process. In the process of model optimization based on data annotation, the efficiency of model optimization is improved, and the influence of offline operations on the quality of annotation results is avoided, ensuring the effect of model optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0046] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0047] Figure 2 is a flow chart of an embodiment of a model optimization method based on data annotation according to the present application;
[0048] Figure 3 is a structural schematic diagram of an embodiment of a model optimization device based on data annotation according to the present application;
[0049] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0051] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0052] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0053] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0054] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0055] The terminal devices 101, 102, and 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 (Moving Picture Experts Group Audio Layer III) players, MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, and the like.
[0056] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0057] It should be noted that the model optimization method based on data annotation provided in the embodiment of the present application is generally executed by a server, and accordingly, the model optimization device based on data annotation is generally set in the server.
[0058] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0059] Continue to refer Figure 2 , shows a flow chart of an embodiment of a model optimization method based on data annotation according to the present application. The model optimization method based on data annotation comprises the following steps:
[0060] Step S201, obtaining the to-be-annotated session information of the target round, and displaying it in a preset annotation page.
[0061] In this embodiment, the electronic device (e.g. Figure 1 The server shown in the figure) can send or receive data through a wired connection or a wireless connection. It should be noted that the above wireless connection method may include but is not limited to 3G / 4G / 5G connection, Wi-Fi connection, Bluetooth connection, Wi MAX connection, Zigbee connection, UWB (Ultra Wi-Fi Band) connection, and other wireless connection methods currently known or to be developed in the future.
[0062] It should be noted that with the development of financial technology, after its combination with artificial intelligence models, it has been increasingly used in business scenarios in financial industries such as insurance and banking. Channel innovation, product innovation and service innovation based on the Internet are inseparable from the participation of artificial intelligence. Users can obtain the information they want or handle business through dialogue with artificial intelligence, making the financial industry's business more diversified and the services more comprehensive.
[0063] In this embodiment, by annotating business-related question-and-answer conversations, more business Badcase data can be obtained for optimizing conversational large language models such as ChatGPT. First, the conversation information to be annotated of the target round can be obtained and displayed in a preset annotation page. Specifically, according to different business scenarios, all question-and-answer conversations produced by the large language model can be divided into different rounds in the form of rounds, so that each time an annotation operation is performed, one of the rounds can be used as the target round, and the question-and-answer conversation of the round can be used as the conversation information to be annotated, and the conversation information to be annotated can be displayed in a preset annotation page, and the relevant annotation personnel can perform data annotation through online operations in the annotation page to complete the annotation operation.
[0064] It is understandable that a large language model (LLM for short), also known as a large language model, is an artificial intelligence model designed to understand and generate human language. The parameters it contains generally reach tens of billions or more. Therefore, in order to continuously optimize the large language model, a large amount of business badcase data is needed as support. Improving the efficiency of labeling question-answering dialogues for large language models can improve the efficiency of obtaining business badcase data, thereby making model optimization more efficient.
[0065] Step S202: determining whether an answer to the conversation information to be annotated is correct or not according to the annotation instruction carrying the annotation information received on the annotation page.
[0066] In this embodiment, after obtaining the conversation information to be annotated of the target round and displaying it in a preset annotation page, the answer correctness result of the conversation information to be annotated can be determined according to the annotation instruction carrying the annotation information received by the annotation page. Specifically, when the conversation information to be annotated is displayed in the preset annotation page, it is also accompanied by corresponding answer correctness options, and the answer correctness options include correct options and incorrect options. When the relevant annotator performs annotation work in the annotation page, the annotation page will receive the annotation instruction carrying the annotation information. According to the annotation instruction, the answer correctness option selected by the relevant annotator in the annotation page can be determined. If the answer correctness option is the correct option, the answer in the conversation information to be annotated is judged to be correct, as the answer correctness result; if the answer correctness option is the incorrect option, the answer in the conversation information to be annotated is judged to be incorrect, as the answer correctness result.
[0067] Step S203: extracting annotation label information and annotation text information of the conversation information to be annotated from the annotation information according to the answer being correct or incorrect.
[0068] In this embodiment, after determining the correctness of the answer to the conversation information to be annotated, the annotation label information and annotation text information of the conversation information to be annotated can be extracted from the annotation information carried by the annotation instruction according to the correctness of the answer. Specifically, the annotation information includes the annotation label information and the annotation text information, and different correctness of the answer corresponds to different annotation information. According to the correctness of the answer, it is determined whether the answer in the conversation information to be annotated is correct. If the answer is correct, the question classification label information and the answer legality label information can be extracted from the annotation information as the annotation label information, and the remark text information can be extracted from the annotation information as the annotation text information; if the answer is wrong, the question classification label information, the answer legality label information and the error type label information can be extracted from the annotation information as the annotation label information, and the remark text information and the correct answer text information can be extracted from the annotation information as the annotation text information.
[0069] It is understandable that in the preset annotation page, when displaying the conversation information to be annotated, the corresponding label list and text input box will also be displayed. For example, when the correct answer option is selected as the correct option, the question classification list and the answer legality list are displayed as the label list, and the remark input box is displayed as the text input box; when the correct answer option is selected as the wrong option, the question classification list, the answer legality list and the error type list are displayed as the label list, and the remark input box and the correct answer input box are displayed as the text input box. Through the question classification list, the answer legality list and the error type list, the question classification label information, the answer legality label information and the error type label information selected by the relevant annotator can be obtained respectively; through the remark input box and the correct answer input box, the remark text information and the correct answer text information entered by the relevant annotator can be obtained respectively.
[0070] Step S204: generating a labeling result of the conversation information to be labeled according to the labeling tag information and the labeling text information.
[0071] In this embodiment, after extracting the annotation label information and annotation text information of the session information to be annotated from the annotation information according to the correct answer result, the annotation result of the session information to be annotated can be generated according to the annotation label information and annotation text information. Specifically, compared with the session information to be annotated with a correct answer, the session information to be annotated with an incorrect answer has additional error type label information as the annotation label information, and additional correct answer text information as the annotation text information, so the two correspond to different preset annotation templates. According to the annotation label information and annotation text information corresponding to the session information to be annotated, the preset annotation template corresponding to the session information to be annotated can be screened, and then the annotation label information and annotation text information are filled into the preset annotation template, and finally the annotation result of the session information to be annotated is obtained.
[0072] Step S205, optimizing and training the preset dialogue model according to the annotation results to obtain a trained target model.
[0073] In this embodiment, after obtaining the annotation results of the conversation information to be annotated, the preset dialogue model can be optimized and trained according to the annotation results to obtain a trained target model. Specifically, the preset dialogue model is a large language model that needs to be optimized. After obtaining the annotation results, feature extraction can be performed according to the annotation results to obtain a feature data set, and then the feature data set is preprocessed, for example, normalization and data enhancement are performed on the feature data set in sequence, so as to obtain a preprocessed target training set, and then the target training set is input into the preset dialogue model for optimization training, and finally the trained target model can be obtained.
[0074] This application implements labeling operations for question-answering dialogues through a unified online standardized process. In the process of model optimization based on data labeling, the efficiency of model optimization is improved, and the impact of offline operations on the quality of labeling results is avoided, ensuring the effect of model optimization.
[0075] In some optional implementations of this embodiment, the step of extracting the annotation tag information and the annotation text information of the to-be-annotated conversation information from the annotation information according to the correctness result of the answer includes:
[0076] Determining whether the answer in the conversation information to be marked is correct according to the answer correctness result;
[0077] If the answer is correct, extracting question classification label information and answer legality label information from the annotation information as the annotation label information, and extracting remark text information from the annotation information as the annotation text information;
[0078] If the answer is wrong, question classification label information, answer validity label information and error type label information are extracted from the annotation information as the annotation label information, and remark text information and correct answer text information are extracted from the annotation information as the annotation text information.
[0079] In this embodiment, after determining the correctness of the answer to the session information to be annotated, it can be determined whether the answer in the session information to be annotated is correct according to the correctness of the answer. If the answer is correct, the question classification label information and the answer legality label information are extracted from the annotation information as the annotation label information, and the remark text information is extracted from the annotation information as the annotation text information; if the answer is wrong, the question classification label information, the answer legality label information and the error type label information are extracted from the annotation information as the annotation label information, and the remark text information and the correct answer text information are extracted from the annotation information as the annotation text information. Specifically, the preset annotation page will display the corresponding label list and text input box while displaying the session information to be annotated. When the correct answer option is selected as the correct option, the label list includes the question classification list and the answer legality list, and the text input box includes the remark input box; when the correct answer option is selected as the wrong option, the label list includes the question classification list, the answer legality list and the error type list, and the text input box includes the remark input box and the correct answer input box. Relevant annotators can select tags in the tag list as annotation tag information, and enter text in the text input box as annotation text information. After the annotation instruction is triggered, the preset annotation page will accept the annotation tag information and annotation text information as the annotation information carried by the annotation instruction, wherein the question classification tag information represents the category to which the question in the to-be-annotated session information belongs, such as common sense judgment, property insurance / auto insurance, etc.; the answer legitimacy tag information represents the legitimacy of the answer in the to-be-annotated session information, such as irrelevant answers, containing violent information, containing pornographic information, etc.; the error type tag information represents the error type of the answer in the to-be-annotated session information, such as outdated knowledge, numerical errors, etc.; the remark text information represents the remark text entered by the annotator on the annotation page; the correct answer text information represents the correct answer text entered by the annotator on the annotation page.
[0080] This application improves the online process of labeling jobs for question-answering dialogues by standardizing the labels and texts in the labeling process. In the process of model optimization based on data labeling, the efficiency of model optimization is improved, and the impact of offline operations on the quality of labeling results is avoided, ensuring the effect of model optimization.
[0081] In some optional implementations of this embodiment, the step of determining whether the answer to the to-be-annotated session information is correct or incorrect according to the annotation instruction carrying the annotation information received on the annotation page includes:
[0082] According to the annotation instruction, determining the correct or incorrect answer options corresponding to the conversation information to be annotated in the annotation page, wherein the correct or incorrect answer options include correct options and incorrect options;
[0083] If the answer right or wrong option is the correct option, then the answer in the conversation information to be marked is determined to be correct, and the answer is taken as the answer right or wrong result;
[0084] If the correct answer option is an incorrect option, the answer in the conversation information to be marked is determined to be incorrect, and the answer is taken as the correct answer result.
[0085] In this embodiment, after obtaining the session information to be annotated of the target round and displaying it in a preset annotation page, the correct or incorrect answer options corresponding to the session information to be annotated in the annotation page can be determined according to the annotation instruction, wherein the correct or incorrect answer options include correct options and incorrect options. If the correct or incorrect answer option is the correct option, the answer in the session information to be annotated is judged to be correct as the correct or incorrect answer result; if the correct or incorrect answer option is the incorrect option, the answer in the session information to be annotated is judged to be incorrect as the correct or incorrect answer result. Specifically, when the session information to be annotated is displayed in the preset annotation page, it is also accompanied by corresponding correct or incorrect answer options, including correct options and incorrect options. When the relevant annotator performs the annotation work in the annotation page, it needs to select one of them and trigger the annotation instruction carrying the annotation information. After the annotation page receives the annotation instruction, it can determine the correct or incorrect answer options selected by the relevant annotator in the annotation page according to the annotation instruction. If the correct or incorrect answer option is the correct option, the answer in the session information to be annotated is judged to be correct; if the correct or incorrect answer option is the incorrect option, the answer in the session information to be annotated is judged to be incorrect; and finally the correct or incorrect answer is taken as the correct or incorrect answer result.
[0086] This application improves the online process of labeling jobs for question-and-answer dialogues by standardizing the correct and incorrect options in the labeling process. In the process of model optimization based on data labeling, the efficiency of model optimization is improved, and the impact of offline operations on the quality of labeling results is avoided, thereby ensuring the effect of model optimization.
[0087] In some optional implementations of this embodiment, the above-mentioned right or wrong answer options also include incomplete options. After the above-mentioned step of determining the right or wrong answer options corresponding to the to-be-annotated session information in the annotated page according to the annotating instruction, the following steps are further included:
[0088] If the correct or incorrect answer option is an incomplete option, the session information to be marked is transferred to a preset questionable database, and an early warning prompt message is sent to the administrator user terminal.
[0089] In this embodiment, the correct answer option also includes an incomplete option. According to the annotation instruction, after determining the correct answer option corresponding to the session information to be annotated in the annotation page, if the correct answer option is an incomplete option, the session information to be annotated is transferred to a preset doubt database, and an early warning prompt message is sent to the administrator user terminal. Specifically, the incomplete option means that it is impossible to determine whether the answer in the session information to be annotated is correct or wrong, and the relevant annotator has doubts about the session information, so the incomplete option is selected. When the correct answer option is an incomplete option, the session information to be annotated is transferred to the doubt database, and an early warning prompt message is sent to the administrator user terminal, so that the relevant management personnel can subsequently re-verify the session information, manually annotate, and perform other operations.
[0090] While standardizing the correct and incorrect options in the annotation process, this application adds fault-tolerant options and improves the online process of annotation jobs for question-answering dialogues. In the process of model optimization based on data annotation, it not only improves the efficiency of model optimization, but also enhances the robustness of model optimization, ensuring the effect of model optimization.
[0091] In some optional implementations of this embodiment, the step of generating a labeling result of the to-be-labeled session information according to the labeling tag information and the labeling text information includes:
[0092] Filtering a preset annotation template corresponding to the to-be-annotated session information according to the annotation tag information and the annotation text information;
[0093] The annotation label information and the annotation text information are filled into the preset annotation template to obtain the annotation result.
[0094] In this embodiment, after extracting the annotation label information and annotation text information of the session information to be annotated from the annotation information according to the correct answer result, the preset annotation template corresponding to the session information to be annotated can be screened according to the annotation label information and annotation text information, and the annotation label information and annotation text information can be filled into the preset annotation template to obtain the annotation result. Specifically, for the session information to be annotated with an incorrect answer, the annotation label information can also contain error type label information, and the annotation text information can also contain correct answer text information. Therefore, the session information to be annotated with a correct answer and the session information to be annotated with an incorrect answer correspond to different preset annotation templates. After determining the preset annotation template corresponding to the session information to be annotated according to the correct answer result, the annotation label information and annotation text information are filled into the preset annotation template, and finally the annotation result of the session information to be annotated can be obtained.
[0095] This application finally obtains standardized annotation results through template filling, so that the online process of annotation work for question-answering dialogues is unified. In the process of model optimization based on data annotation, the efficiency of model optimization is improved, and the influence of offline operations on the quality of annotation results is avoided, thereby ensuring the effect of model optimization.
[0096] In some optional implementations of this embodiment, the step of optimizing and training the preset dialogue model according to the annotation results to obtain a trained target model includes:
[0097] Perform feature extraction according to the annotation results to obtain a feature data set;
[0098] Preprocessing the feature data set to obtain a preprocessed target training set;
[0099] The target training set is input into the dialogue model for optimization training to obtain the target model.
[0100] In this embodiment, after obtaining the annotation results of the conversation information to be annotated, feature extraction can be performed according to the annotation results to obtain a feature data set, and then the feature data set is preprocessed to obtain a preprocessed target training set, and the target training set is input into a preset dialogue model for optimization training to obtain a trained target model. Specifically, the preset dialogue model is a large language model that needs to be optimized. The goal of the model optimization is to minimize the loss function of the dialogue model. Through the annotation operation of the question-answering dialogue, a large amount of Badcase data can be obtained, which is used to optimize the dialogue model and obtain the trained target model. The target model will still continuously generate question-answering dialogues, thereby achieving continuous optimization of the dialogue model.
[0101] This application implements labeling operations for question-answering dialogues through a unified online standardized process, thereby continuously optimizing and training the large language model based on the results of the labeling operations, improving the efficiency of model optimization, and avoiding the impact of offline operations on the quality of labeling results, thereby ensuring the effect of model optimization.
[0102] In some optional implementations of this embodiment, the step of preprocessing the feature data set to obtain a preprocessed target training set includes:
[0103] The feature data set is normalized and data enhanced in sequence to obtain the target training set.
[0104] In this embodiment, after feature extraction is performed based on the annotation results and a feature data set is obtained, the feature data set needs to be preprocessed. The preprocessing process includes normalizing and data enhancement of the feature data set in sequence, and finally obtaining a target training set after preprocessing. Specifically, normalizing the data set is to scale the data to a similar range, which can help speed up training and reduce the gradient vanishing problem, while data enhancement of the data set is to expand the feature data set by random rotation, flipping, cropping, etc., which can reduce the risk of overfitting.
[0105] This application can accelerate training, reduce the gradient vanishing problem, and reduce the risk of overfitting by preprocessing the feature data set during the model optimization process, thereby improving the efficiency of model optimization and ensuring the effect of model optimization.
[0106] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0107] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0108] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0109] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0110] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a model optimization device based on data annotation, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0111] like Figure 3 As shown, the model optimization device 300 based on data annotation described in this embodiment includes: an acquisition module 301, a determination module 302, an extraction module 303, a generation module 304 and a training module 305. Among them:
[0112] The acquisition module 301 is used to acquire the to-be-annotated session information of the target round and display it in a preset annotation page;
[0113] A determination module 302, configured to determine whether an answer to the conversation information to be annotated is correct or not according to the annotation instruction carrying the annotation information received on the annotation page;
[0114] An extraction module 303 is used to extract the annotation label information and the annotation text information of the conversation information to be annotated from the annotation information according to the correctness result of the answer;
[0115] A generating module 304, configured to generate a labeling result of the to-be-labeled session information according to the labeling tag information and the labeling text information;
[0116] The training module 305 is used to optimize and train the preset dialogue model according to the annotation results to obtain a trained target model.
[0117] The model optimization device based on data annotation provided in the present application realizes the annotation operation for question-answering dialogues through a unified online standardized process. In the process of model optimization based on data annotation, the efficiency of model optimization is improved, and the influence of offline operations on the quality of annotation results is avoided, thereby ensuring the effect of model optimization.
[0118] In some optional implementations of this embodiment, the extraction module 303 is further used to:
[0119] Determining whether the answer in the conversation information to be marked is correct according to the answer correctness result;
[0120] If the answer is correct, extracting question classification label information and answer legality label information from the annotation information as the annotation label information, and extracting remark text information from the annotation information as the annotation text information;
[0121] If the answer is wrong, question classification label information, answer validity label information and error type label information are extracted from the annotation information as the annotation label information, and remark text information and correct answer text information are extracted from the annotation information as the annotation text information.
[0122] The model optimization device based on data annotation provided in the present application improves the online process of annotation operations for question-answering dialogues by standardizing labels and texts in the annotation process. In the model optimization process based on data annotation, the efficiency of model optimization is improved, and the influence of offline operations on the quality of annotation results is avoided, thereby ensuring the effect of model optimization.
[0123] In some optional implementations of this embodiment, the determining module 302 is further configured to:
[0124] According to the annotation instruction, determining the correct or incorrect answer options corresponding to the conversation information to be annotated in the annotation page, wherein the correct or incorrect answer options include correct options and incorrect options;
[0125] If the answer right or wrong option is the correct option, then the answer in the conversation information to be marked is determined to be correct, and the answer is taken as the answer right or wrong result;
[0126] If the correct answer option is an incorrect option, the answer in the conversation information to be marked is determined to be incorrect, and the answer is taken as the correct answer result.
[0127] The model optimization device based on data annotation provided in the present application improves the online process of annotation operations for question-answering dialogues by standardizing the correct and incorrect options in the annotation process. In the model optimization process based on data annotation, the efficiency of model optimization is improved, and the influence of offline operations on the quality of annotation results is avoided, thereby ensuring the effect of model optimization.
[0128] In some optional implementations of this embodiment, the above-mentioned right or wrong answer options also include incomplete options, and the model optimization device 300 based on data annotation is further used to:
[0129] If the correct or incorrect answer option is an incomplete option, the session information to be marked is transferred to a preset questionable database, and an early warning prompt message is sent to the administrator user terminal.
[0130] The model optimization device based on data annotation provided in the present application standardizes the correct and incorrect options in the annotation process, adds fault-tolerant options, and improves the online process of annotation operations for question-answering dialogues. In the model optimization process based on data annotation, it not only improves the efficiency of model optimization, but also enhances the robustness of model optimization, thereby ensuring the effect of model optimization.
[0131] In some optional implementations of this embodiment, the generating module 304 is further configured to:
[0132] Filtering a preset annotation template corresponding to the to-be-annotated session information according to the annotation tag information and the annotation text information;
[0133] The annotation label information and the annotation text information are filled into the preset annotation template to obtain the annotation result.
[0134] The model optimization device based on data annotation provided in the present application finally obtains standardized annotation results through template filling, so that the online process of annotation operations for question-answering dialogues is unified. In the process of model optimization based on data annotation, the efficiency of model optimization is improved, and the influence of offline operations on the quality of annotation results is avoided, thereby ensuring the effect of model optimization.
[0135] In some optional implementations of this embodiment, the training module 305 is further used to:
[0136] Perform feature extraction according to the annotation results to obtain a feature data set;
[0137] Preprocessing the feature data set to obtain a preprocessed target training set;
[0138] The target training set is input into the dialogue model for optimization training to obtain the target model.
[0139] The model optimization device based on data annotation provided in the present application realizes the annotation operation for question-answering dialogues through a unified online standardized process, thereby continuously optimizing and training the large language model according to the results of the annotation operation, improving the efficiency of model optimization, and avoiding the influence of offline operations on the quality of the annotation results, thereby ensuring the effect of model optimization.
[0140] In some optional implementations of this embodiment, the training module 305 is further used to:
[0141] The feature data set is normalized and data enhanced in sequence to obtain the target training set.
[0142] The data annotation-based model optimization device provided in the present application can achieve the effects of accelerating training, reducing the gradient vanishing problem, and reducing the risk of overfitting by preprocessing the feature data set during the model optimization process, thereby improving the efficiency of model optimization and ensuring the effect of model optimization.
[0143] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0144] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital processors (DSPs), embedded devices, etc.
[0145] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0146] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 4. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of a model optimization method based on data annotation, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0147] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the computer-readable instructions stored in the memory 41 or process data, such as running the computer-readable instructions of the model optimization method based on data annotation.
[0148] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0149] The computer equipment provided in this application implements labeling operations for question-answering dialogues through a unified online standardized process. In the process of model optimization based on data labeling, the efficiency of model optimization is improved, and the influence of offline operations on the quality of labeling results is avoided, thereby ensuring the effect of model optimization.
[0150] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the model optimization method based on data labeling as described above.
[0151] The computer-readable storage medium provided in this application implements labeling operations for question-answering dialogues through a unified online standardized process. In the process of model optimization based on data labeling, the efficiency of model optimization is improved, and the influence of offline operations on the quality of labeling results is avoided, thereby ensuring the effect of model optimization.
[0152] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0153] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A model optimization method based on data annotation, characterized in that: The steps include: Get the session information to be annotated in the target round and display it on the preset annotation page; Determining whether an answer to the conversation information to be annotated is correct or not according to the annotation instruction carrying the annotation information received on the annotation page; Extracting annotation label information and annotation text information of the conversation information to be annotated from the annotation information according to the correctness result of the answer; Generate a labeling result of the to-be-labeled session information according to the labeling tag information and the labeling text information; The preset dialogue model is optimized and trained according to the annotation results to obtain a trained target model.
2. The model optimization method based on data annotation according to claim 1, characterized in that: The step of extracting the annotation tag information and the annotation text information of the conversation information to be annotated from the annotation information according to the correctness result of the answer specifically includes: Determining whether the answer in the conversation information to be marked is correct according to the answer correctness result; If the answer is correct, extracting question classification label information and answer legality label information from the annotation information as the annotation label information, and extracting remark text information from the annotation information as the annotation text information; If the answer is wrong, question classification label information, answer validity label information and error type label information are extracted from the annotation information as the annotation label information, and remark text information and correct answer text information are extracted from the annotation information as the annotation text information.
3. The model optimization method based on data annotation according to claim 2, characterized in that: The step of determining the correctness of the answer to the to-be-annotated conversation information according to the annotation instruction carrying the annotation information received on the annotation page specifically includes: According to the annotation instruction, determining the correct or incorrect answer options corresponding to the conversation information to be annotated in the annotation page, wherein the correct or incorrect answer options include correct options and incorrect options; If the answer right or wrong option is the correct option, then the answer in the conversation information to be marked is determined to be correct, and the answer is taken as the answer right or wrong result; If the correct answer option is an incorrect option, the answer in the conversation information to be marked is determined to be incorrect, and the answer is taken as the correct answer result.
4. The model optimization method based on data annotation according to claim 3, characterized in that: The correct or incorrect answer options also include incomplete options. After the step of determining the correct or incorrect answer options corresponding to the to-be-annotated session information in the annotated page according to the annotating instruction, the step further includes: If the correct or incorrect answer option is an incomplete option, the session information to be marked is transferred to a preset questionable database, and an early warning prompt message is sent to the administrator user terminal.
5. The model optimization method based on data annotation according to claim 1, characterized in that: The step of generating the annotation result of the to-be-annotated session information according to the annotation tag information and the annotation text information specifically includes: Filtering a preset annotation template corresponding to the to-be-annotated session information according to the annotation tag information and the annotation text information; The annotation label information and the annotation text information are filled into the preset annotation template to obtain the annotation result.
6. The model optimization method based on data annotation according to any one of claims 1 to 5, characterized in that: The step of optimizing and training the preset dialogue model according to the annotation results to obtain a trained target model specifically includes: Perform feature extraction according to the annotation results to obtain a feature data set; Preprocessing the feature data set to obtain a preprocessed target training set; The target training set is input into the dialogue model for optimization training to obtain the target model.
7. The model optimization method based on data annotation according to claim 6, characterized in that: The step of preprocessing the feature data set to obtain a preprocessed target training set specifically includes: The feature data set is normalized and data enhanced in sequence to obtain the target training set.
8. A model optimization device based on data annotation, characterized in that: include: The acquisition module is used to obtain the session information to be annotated in the target round and display it on a preset annotation page; A determination module, configured to determine whether an answer to the to-be-annotated session information is correct or not according to the annotation instruction carrying the annotation information received on the annotation page; An extraction module, configured to extract annotation label information and annotation text information of the conversation information to be annotated from the annotation information according to the correctness result of the answer; A generating module, configured to generate a marking result of the to-be-marked session information according to the marking label information and the marking text information; The training module is used to optimize the preset dialogue model according to the annotation results to obtain a trained target model.
9. A computer device, characterized in that: It includes a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the model optimization method based on data labeling as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the model optimization method based on data labeling are implemented as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Model optimization method and device, computer equipment and storage medium
CN110457683A
Question and answer knowledge base construction method and device and electronic equipment
CN115269805A
Dialogue pre-labeling method and system, computer equipment and storage medium
CN116860921A
Error question annotation data generation method and device
CN118364905A
