Instruction fine tuning data generation method and device, equipment and medium

Through text data conversion and mask template matching, the fine-tuning data is generated, combined with keyword extraction and referee model evaluation, the problems of diversity and low efficiency of training data in the existing technology are solved, and high-quality and efficient fine-tuning data generation is achieved. .

CN119149690APending Publication Date: 2024-12-17VOYAH AUTOMOBILE TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411166841.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

The existing instruction fine-tuning technology has strict requirements on text formats, inaccurate paragraph divisions and data quality, resulting in low diversity and efficiency of training data, and relies on manual proofreading and high data preparation.

Method used

By obtaining text data, converting it into preset text format, building multiple preset templates to generate mask templates, matching text information to generate question-and-answer pair data, and using keyword extraction technology to generate instruction fine-tuning data, applying referee model evaluation and verification , until the quality standards are met.

Benefits of technology

Improve the accuracy and diversity of instruction fine-tuning data, reduce dependence on manual proofreading and data preparation, and improve the efficiency and data quality of the training process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149690A_ABST
    Figure CN119149690A_ABST
Patent Text Reader

Abstract

The invention discloses an instruction fine tuning data generation method and device, equipment and a medium, and relates to the technical field of vehicle models.The instruction fine tuning data generation method comprises the steps that text information is obtained by obtaining text data and converting the text data into a preset text format, a mask template is constructed based on multiple preset template contents, and mask template contents are obtained; and matching the text information with the mask template content to obtain question and answer pair data, and generating instruction fine tuning data based on the question and answer pair data. The instruction fine tuning data is generated through text data conversion and mask template matching, so that the accuracy of the instruction fine tuning data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of vehicle model technology, and in particular to a method, device, equipment and medium for generating instruction fine-tuning data. Background Art

[0002] In the field of artificial intelligence (AI) large model training, the training process is usually divided into three stages: general knowledge pre-training, professional field pre-training, and professional field instruction fine-tuning training. Instruction fine-tuning training has become a popular method in AI large model training due to its high flexibility and transferability. This training method can further optimize the pre-trained model for specific tasks or fields to improve the performance of the model on specific tasks.

[0003] The current instruction generation technology mainly includes obtaining multiple texts from a preset corpus and performing preprocessing to obtain input representations. The input representations are processed according to preset rules to obtain block-level texts. The block-level texts are input into a search library for retrieval to obtain a certain amount of search texts. The input representations and search texts are input into a preset model for training to obtain an enhanced model.

[0004] Although the existing fine-tuning instruction generation technology has made some progress, it still has obvious shortcomings. First, there are certain requirements for the format of the text, which limits the diversity and extensiveness of the training data. Secondly, when processing text, the division of paragraphs may not be accurate enough, which may affect the model's understanding of the text content and the training effect. Finally, due to the above limitations, the generated training data may have quality problems, which will directly affect the effect of model training and the final performance. Therefore, there is an urgent need for a more efficient and accurate method to improve the quality and diversity of training data, while reducing dependence on manual proofreading and data preparation, and improving the efficiency of the entire training process. Summary of the invention

[0005] The main purpose of this application is to provide a method, device, equipment and medium for generating instruction fine-tuning data, aiming to solve the technical problem of how to improve the accuracy of generated instruction fine-tuning data.

[0006] To achieve the above objectives, the present application proposes a method for generating instruction fine-tuning data, the method comprising:

[0007] Get text data;

[0008] Converting the text data into a preset text format to obtain text information;

[0009] Constructing a mask template based on multiple preset template contents to obtain mask template contents;

[0010] Matching the text information with the mask template content to obtain question-answer pair data;

[0011] Based on the question-answer pair data, instruction fine-tuning data is generated.

[0012] In one embodiment, the step of constructing a mask template based on a plurality of preset template contents to obtain the mask template contents includes:

[0013] Determine multiple preset templates, each of which corresponds to a different question-answer pair generation scenario, including summary templates, judgment templates, completion templates, and attribution templates;

[0014] Constructing a mask template according to the plurality of preset templates, wherein the mask template includes one or more placeholders for subsequent filling of actual text content;

[0015] According to the mask template, the content of the mask template is obtained.

[0016] In one embodiment, the step of matching the text information with the mask template content to obtain question-answer pair data includes:

[0017] Using the text information to match the mask template content to determine whether to generate a question-answer pair;

[0018] When the match is successful, the text information is filled in according to the mask template content to generate question-answer pair data;

[0019] After matching the text information with the mask template content, the method further includes:

[0020] When the matching is unsuccessful, the text information range is expanded for matching until the text data range is reached.

[0021] In one embodiment, the step of generating instruction fine-tuning data based on the question-answer pair data includes:

[0022] Based on the question-answer data, key information is obtained by using keyword extraction technology;

[0023] The mask template and the key information are combined to generate instruction fine-tuning data.

[0024] In one embodiment, after the step of converting the text data into a preset text format to obtain text information, the following steps are included:

[0025] Identify and document missing information and misidentification issues during the conversion process;

[0026] Proofread the text information item by item according to the information omission and misrecognition problems to obtain a proofreading result;

[0027] The text information is corrected based on the proofreading result to obtain corrected text information.

[0028] In one embodiment, after the step of generating instruction fine-tuning data based on the question-answer pair data, the following steps are included:

[0029] Applying a preset referee model to evaluate the instruction fine-tuning data to obtain an evaluation result;

[0030] Classifying the instruction fine-tuning data according to the evaluation result to obtain a classification result;

[0031] The instruction data is output to the intelligent model for optimization according to the classification results.

[0032] In one embodiment, after the step of classifying the instruction fine-tuning data according to the evaluation result to obtain the classification result, the following steps are included:

[0033] According to the classification results, high-confidence data and low-confidence data are obtained;

[0034] Verifying and correcting the low-confidence data to obtain corrected data;

[0035] The corrected data are re-evaluated until they meet the preset quality standards.

[0036] In addition, to achieve the above purpose, the present application also proposes an instruction fine-tuning data generating device, the instruction fine-tuning data generating device comprising:

[0037] An acquisition module, used to acquire text data;

[0038] A conversion module, used for converting the text data into a preset text format to obtain text information;

[0039] A construction module, used to construct a mask template based on multiple preset template contents to obtain the mask template content;

[0040] A matching module, used to match the text information with the mask template content to generate question-answer pair data;

[0041] The result module is used to generate instruction fine-tuning data based on the question-answer pair data.

[0042] In addition, to achieve the above-mentioned purpose, the present application also proposes a medium, which is a computer-readable medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the instruction fine-tuning data generation method described above are implemented.

[0043] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the instruction fine-tuning data generation method described above are implemented.

[0044] The present application obtains text data, converts the text data into a preset text format, obtains text information, constructs a mask template based on multiple preset template contents, obtains mask template contents, matches the text information with the mask template contents, obtains question-answer pair data, and generates instruction fine-tuning data based on the question-answer pair data. The instruction fine-tuning data is generated by converting the text data and matching the mask template, thereby improving the accuracy of the instruction fine-tuning data. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0046] Figure 1 This is a flow chart of the first embodiment of the method for generating instruction fine-tuning data of the present application;

[0047] Figure 2 A flowchart of a second embodiment of the method for generating instruction fine-tuning data of the present application;

[0048] Figure 3 This is a schematic diagram of the module structure of the instruction fine-tuning data generating device according to an embodiment of the present application;

[0049] Figure 4 A schematic diagram of the device structure of the hardware operating environment involved in the instruction fine-tuning data generation method in the embodiment of the present application;

[0050] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0051] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0052] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0053] The main solution of the embodiment of the present application is: by acquiring text data, converting the text data into a preset text format, obtaining text information, constructing a mask template based on multiple preset template contents, obtaining mask template content, matching the text information with the mask template content, obtaining question-answer pair data, and generating instruction fine-tuning data based on the question-answer pair data.

[0054] Based on this, the present application embodiment provides a method for generating instruction fine-tuning data, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for generating instruction fine-tuning data of the present application.

[0055] In this embodiment, the instruction fine-tuning data generation method includes steps S10 to S50:

[0056] Step S10, obtaining text data.

[0057] It should be noted that obtaining text data involves collecting relevant information from professional fields, which may include academic papers, technical manuals, online documents and other forms.

[0058] Step S20, converting the text data into a preset text format to obtain text information.

[0059] It should be noted that this process involves converting the original data, whether it is an electronic document, a scanned PDF file or a web page content, into a format that is easy to analyze and process, such as Markdown or plain text, and unstructured data directly uses the txt text format. During the conversion process, special attention should be paid to maintaining the original structure and semantic information of the text to avoid information loss or deformation.

[0060] After the format conversion is completed, the obtained text information will enter the next step of processing, namely content calibration. This step is crucial because automated conversion technologies such as OCR may not be able to perfectly recognize all texts, especially when faced with complex layouts, charts or handwritten content. Expert intervention can correct these errors and ensure the accuracy of the text information, laying a solid foundation for subsequent data processing.

[0061] Furthermore, information omissions and misrecognition issues during the conversion process are identified and recorded. This is done by using expert calibration, where experts in the field carefully review the converted text to ensure its accuracy. Experts will check the converted text against the original document to see if there are any missing key information or misrecognized characters, and make corresponding corrections. For example, if a professional term is mistakenly recognized as another word, the expert will correct the error; if some important table data is not correctly extracted, they will also supplement the missing information. In this way, we can ensure that the text materials used for training not only maintain the integrity of the original materials, but also avoid errors introduced by automated tools such as OCR, thereby ensuring the quality of the training data.

[0062] Furthermore, the text information is proofread item by item based on the information omission and misrecognition problems to obtain the proofreading results. In the process of text information conversion, especially when converting from non-text formats such as PDF to electronic text, information omission and misrecognition problems are often encountered. These problems are mainly due to the limitations of optical character recognition (OCR) technology when dealing with complex layouts, blurred images or special characters. During the expert proofreading process, the converted text content will be checked against the original document one by one to ensure that no important information is omitted and the recognition errors are corrected. For example, if the original document contains complex mathematical formulas or professional terms, and the OCR technology fails to correctly recognize these contents, the experts will manually correct them based on the original document. In addition, for some recognition errors caused by special symbols, punctuation marks or typesetting differences, the experts will also conduct detailed proofreading and correction.

[0063] Furthermore, the text information is corrected based on the proofreading results to obtain the corrected text information. Correcting the text information based on the proofreading results is a key step in ensuring data quality. This process involves systematically solving all problems found during the expert proofreading process. The correction work not only includes the direct correction of typos, grammatical errors, inconsistent formats, etc. in the text, but may also involve in-depth analysis and adjustment of logical errors, incomplete or inaccurate information in the text. During the correction process, the reviser needs to carefully compare the original data to ensure that every change is faithful to the intention and content of the original text. In addition, the reviser must also consider the readability and fluency of the text to ensure that the corrected text is both accurate and easy to understand and read.

[0064] Step S30, constructing a mask template based on multiple preset template contents to obtain mask template contents.

[0065] It is important to understand that the design of mask templates requires a deep understanding of the knowledge structure and language characteristics of the target domain in order to accurately capture the key information in the text. These templates usually contain specific tags or placeholders to guide the extraction and conversion of text information to form question-answer pairs. When building mask templates, developers analyze a large amount of domain text to identify common question types and answer patterns. Once the mask templates are built, they will be used to automatically extract information from text materials. This process involves matching the text with the template and identifying text fragments that can be filled in the template. These fragments are then converted into question-answer pairs, where the questions usually correspond to the placeholders in the template and the answers are the corresponding text fragments.

[0066] Furthermore, multiple preset templates are determined, each corresponding to a different question-answer pair generation scenario, including summary template, judgment template, completion template and attribution template. The summary template focuses on extracting the main points of the text, while the judgment template is used to identify and generate affirmative or negative answers. The completion template and attribution template are used to generate explanations of definitions or concepts, and explanations of the causes of events or phenomena, respectively.

[0067] Further, a mask template is constructed based on multiple preset templates, wherein the mask template includes one or more placeholders for subsequent filling of actual text content. The process of constructing a mask template based on multiple preset templates is a key step in combining the knowledge of domain experts and language processing technology to automatically generate training data. The placeholders in the mask template act as a bridge, and they reserve space waiting for the actual text content to be filled in, so as to form a complete question-answer pair. The design of these placeholders is very particular, and they need to be able to flexibly adapt to different text structures and information types. For example, in a summary template, the placeholder may represent the theme or key points of the text; while in a judgment template, they may be used to insert statements or facts that need to be judged. Placeholders in a completion template may be used to insert key parts of a definition or description, while placeholders in an attribution template may be used to capture causes or results. The construction of the mask template also needs to take into account the diversity and complexity of the text. Developers ensure that the template is general enough to adapt to different text styles and expressions, while being specific enough to ensure that the generated question-answer pairs are highly relevant and accurate.

[0068] Further, according to the mask template, the content of the mask template is obtained. The design of the mask template requires in-depth analysis of the language characteristics and common question-answering patterns in the target domain. For example, a summary template may contain a guide word such as "summary" or "overview", followed by a placeholder for inserting the main point of the text. A judgment template may start with "whether" or "can it", followed by a placeholder for inserting the statement that needs to be judged. A completion template may contain an incomplete statement or definition, followed by a placeholder for inserting the missing part. An attribution template may contain an event or phenomenon, followed by a placeholder for inserting its cause or result. Once the content of the mask template is determined, they will be used to automatically extract information from large amounts of text materials. This process involves matching the text with the template and identifying text fragments that can be filled in the template. These fragments are then converted into question-answer pairs, where the question corresponds to the placeholder in the template and the answer is the corresponding text fragment.

[0069] With this approach, training data can be generated on a large scale without human intervention. This not only improves the efficiency of data generation, but also enriches the diversity of training data by covering a wider range of topics and situations through the diversity and flexibility of templates. In addition, the automated generation process reduces human errors and improves the consistency and reliability of data.

[0070] Step S40, matching the text information with the mask template content to obtain question-answer pair data.

[0071] It should be noted that this process involves comparing text data with predefined mask templates to determine whether meaningful question-answer pairs can be generated. The placeholders contained in the mask template are the basis for identifying and extracting key information in the text, and they allow the system to flexibly adapt to different text structures and contents. In the matching process, the text data needs to be preprocessed first, including word segmentation, stop word removal, part-of-speech tagging, etc., so as to more accurately identify and match keywords and phrases in the text. Then, natural language processing techniques such as pattern matching and dependency syntactic analysis are used to compare the information in the text with the structure in the mask template. This step can identify text fragments that match the template and fill these fragments into the corresponding placeholders to form a complete question-answer pair. For example, if the mask template is a summary template, the system will identify the key sentences or phrases in the text and fill them into the template as answers to form a concise summary of the entire text content. For judgment templates, the system will identify declarative sentences in the text and use them as questions, while the affirmative or negative expressions in the text are used as answers. The matching process of completion templates and attribution templates is similar, and they are used to generate fill-in-the-blank or causal question-answer pairs, respectively.

[0072] Furthermore, the text information is used to match the mask template content to determine whether to generate a question-answer pair. During the matching process, the system first analyzes the text information and identifies the parts that may match the mask template. For example, if there are key sentences or phrases in the text that match the summary template, the system will extract them as answers and combine them with the question part to form a question-answer pair. Similarly, for templates of judgment, completion, or attribution types, the system will fill in the corresponding placeholders according to the text content and generate the corresponding question-answer pairs.

[0073] Furthermore, when the match is successful, the text information is filled in according to the content of the mask template to generate question-answer pair data. If the text information successfully matches the mask template, the system will generate question-answer pair data, which can be directly used for the training of the AI ​​model to improve the model's understanding and application of knowledge in specific fields. When the match is unsuccessful, the scope of the text information is expanded for matching until the text data range is reached. Specifically, if the match is unsuccessful, the system may try to expand the context range or adjust the mask template to better adapt to the text content to ensure that as much effective information as possible can be extracted from the diverse text materials.

[0074] Step S50, generating instruction fine-tuning data based on the question-answer pair data.

[0075] It should be noted that this process involves further refining and optimizing the question-answer pair data to adapt to specific instruction fine-tuning needs. By conducting in-depth analysis of the question-answer pairs and extracting key instructions and response patterns, a more accurate instruction fine-tuning dataset can be constructed. These datasets not only contain direct question and answer information, but may also include specific parameters, conditions, or contextual information of the instructions, so that the AI ​​model can better understand and execute complex instructions. In addition, the generated instruction fine-tuning data can also be used to test and verify the performance of the model to ensure its accuracy and reliability in practical applications.

[0076] Further, the key information is obtained based on the question-answer pair data by using the keyword extraction technology. Based on the question-answer pair data, the key information can be efficiently identified and extracted from a large amount of text. This technology usually includes a variety of algorithms in natural language processing (NLP), such as TF-IDF, TextRank, or machine learning-based classifiers, which can evaluate the importance and relevance of words in the text. The purpose of keyword extraction is to identify the subject words or concept words in the text, which can represent the core content of the text. For example, in technical documents, keywords may be technical terms or specific operating steps; in news reports, they may be the names of events, places or people. By extracting these keywords, the main idea of ​​the text can be quickly grasped, providing strong information support for generating question-answer pairs. In addition, keyword extraction technology can also assist in building more accurate mask templates, because these keywords are the best candidates for placeholders in the template. In the process of automatically generating question-answer pairs, the identification of keywords helps the system to more accurately locate information fragments in the text, thereby generating higher quality question-answer pairs.

[0077] Furthermore, the mask template and key information are combined to generate instruction fine-tuning data. When the key information is combined with the mask template, highly targeted and semantically rich instruction fine-tuning data can be generated. For example, if the key information is about a certain technical parameter, the mask template can be designed to ask about the specific value or influencing factor of the parameter, and the corresponding answer is directly extracted or summarized from the text.

[0078] The generated instruction fine-tuning data is directly input into the training process of the AI ​​model to optimize and improve the model's responsiveness to specific instructions. The implementation of this method not only improves the quality and diversity of training data, but also significantly reduces the cost of manual proofreading and data preparation by reducing dependence on domain experts. At the same time, the automated question-answer pair generation process speeds up data preparation, improves the efficiency of the entire training process, and helps train more accurate and robust AI models.

[0079] This embodiment provides a method for generating instruction fine-tuning data, which obtains text data, converts the text data into a preset text format, obtains text information, constructs a mask template based on multiple preset template contents, obtains mask template contents, matches the text information with the mask template contents, obtains question-answer pair data, and generates instruction fine-tuning data based on the question-answer pair data. The instruction fine-tuning data is generated by converting the text data and matching the mask template, thereby improving the accuracy of the instruction fine-tuning data.

[0080] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 2The instruction fine-tuning data generation method further includes steps S501 to S503 after step S50:

[0081] Step S501, applying a preset referee model to evaluate the instruction fine-tuning data to obtain an evaluation result.

[0082] It should be noted that applying the preset referee model to evaluate the instruction fine-tuning data is a key step to ensure data quality and model performance. The referee model is usually built based on advanced algorithms, which can comprehensively analyze and score the generated instruction fine-tuning data from multiple dimensions. During the evaluation process, the referee model considers key indicators such as data accuracy, completeness, semantic relevance, and confidence. The accuracy evaluation ensures that the question-answer pairs in the data are consistent with the original text, while the completeness check ensures that the question-answer pairs are clearly expressed and the information is comprehensive. The semantic relevance evaluates whether the logical and semantic connection between the question and the answer is close, while the confidence reflects the model's confidence in the data quality. Through the careful evaluation of the instruction fine-tuning data, potential problems and deficiencies in the data can be identified, providing a basis for further data cleaning and optimization. For example, if it is found that the semantic relevance of some question-answer pairs is not high, it may be necessary to redesign the mask template or adjust the keyword extraction strategy to improve the relevance of the data.

[0083] Step S502: classify the instruction fine-tuning data according to the evaluation result to obtain a classification result.

[0084] It is important to understand that this classification process usually involves dividing the data into several levels or categories, such as high, medium, and low confidence, or dividing it according to indicators such as accuracy and completeness. The classification results enable developers to quickly identify high-quality data, which can be used directly for model training, thereby improving the learning efficiency and ultimate performance of the model. At the same time, it also reveals those data that need further improvement or verification, providing a clear direction for data cleaning and optimization. In addition, classification can also help developers understand patterns and trends in data sets. For example, if it is found that a certain category of data generally has accuracy problems, it may indicate that the relevant mask templates or keyword extraction strategies need to be adjusted. In this way, classification is not only a data management tool, but also a way to continuously improve and optimize AI systems.

[0085] Furthermore, after obtaining the classification results, high-confidence data and low-confidence data are obtained according to the classification results, and the low-confidence data is verified and corrected to obtain the corrected data, and the corrected data is re-evaluated until the preset quality standards are met. After obtaining the classification results, further verification and correction of the data is an important part of improving the overall quality of the data set. High-confidence data can usually be used directly for model training because they have met or exceeded the preset quality standards and can provide accurate and reliable learning samples for the model. For low-confidence data, detailed verification work is required. This includes re-examining indicators such as data accuracy, completeness, and semantic relevance. Possible correction measures include: re-extracting keywords, adjusting mask templates to better match text content, and even manual review and editing to ensure the correctness of question-answer pairs. This process may require the intervention of domain experts to ensure that the corrected data can truly reflect the intention and information of the text material. The corrected data will re-enter the evaluation process and be re-evaluated using the same referee model. This cyclic process ensures that the data can be improved in each iteration and gradually improved to meet the preset quality standards. Through continuous evaluation and correction, the availability and effectiveness of data can be significantly improved, providing a more solid and high-quality foundation for the training of AI models.

[0086] Step S503: output the instruction data to the intelligent model for optimization according to the classification results.

[0087] It should be noted that the process of obtaining corrected data based on the classification results and outputting the corrected data to the intelligent model for optimization also includes monitoring model performance and adjusting model parameters. By tracking the performance of the model during training and verification, developers can adjust the model structure or learning strategy in a timely manner to achieve the best learning effect.

[0088] This embodiment evaluates the instruction fine-tuning data by applying a preset referee model to obtain an evaluation result, classifies the instruction fine-tuning data according to the evaluation result to obtain a classification result, and outputs the instruction data to the intelligent model for optimization according to the classification result, thereby improving data quality and optimizing AI model performance.

[0089] This application also provides a device for generating instruction fine-tuning data, please refer to Figure 3 , the device comprises:

[0090] An acquisition module 10, used for acquiring text data;

[0091] The conversion module 20 is used to convert the text data into a preset text format to obtain text information;

[0092] A construction module 30, configured to construct a mask template based on a plurality of preset template contents to obtain mask template contents;

[0093] A matching module 40, used to match the text information with the mask template content to generate question-answer pair data;

[0094] The result module 50 is used to generate instruction fine-tuning data based on the question-answer pair data.

[0095] The instruction fine-tuning data generating device provided by the present application adopts the instruction fine-tuning data generating method in the above embodiment, which can solve the technical problem of how to improve the accuracy of the generated instruction fine-tuning data. Compared with the prior art, the beneficial effects of the instruction fine-tuning data generating device provided by the present application are the same as the beneficial effects of the instruction fine-tuning data generating method provided by the above embodiment, and the other technical features in the instruction fine-tuning data generating device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0096] In one embodiment, the construction module 30 is also used to determine multiple preset templates, each template corresponds to a different question-answer pair generation scenario, including a summary template, a judgment template, a completion template and an attribution template; based on the multiple preset templates, a mask template is constructed, wherein the mask template includes one or more placeholders for subsequent filling of actual text content; based on the mask template, the mask template content is obtained.

[0097] In one embodiment, the matching module 40 is also used to match the text information with the mask template content to determine whether to generate a question-answer pair; when the match is successful, fill in the text information according to the mask template content to generate question-answer pair data; after matching the text information with the mask template content, it also includes: when the match is unsuccessful, expand the text information range for matching until the text data range is reached.

[0098] In one embodiment, the result module 50 is further used to obtain key information based on the question-answer pair data using a keyword extraction technique; and generate instruction fine-tuning data by combining the mask template and the key information.

[0099] In one embodiment, the conversion module 20 is also used to identify and record information omissions and misrecognition problems during the conversion process; proofread the text information item by item according to the information omissions and misrecognition problems to obtain proofreading results; and correct the text information based on the proofreading results to obtain corrected text information.

[0100] In one embodiment, the result module 50 is also used to apply a preset referee model to evaluate the instruction fine-tuning data to obtain an evaluation result; classify the instruction fine-tuning data according to the evaluation result to obtain a classification result; and output the instruction data to the intelligent model for optimization according to the classification result.

[0101] In one embodiment, the result module 50 is further used to obtain high-confidence data and low-confidence data based on the classification results; verify and correct the low-confidence data to obtain corrected data; and re-evaluate the corrected data until it meets the preset quality standards.

[0102] The present application provides an instruction fine-tuning data generating device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the instruction fine-tuning data generating method in the above-mentioned embodiment 1.

[0103] Reference below Figure 4 , which shows a schematic diagram of the structure of a device for generating instruction fine-tuning data suitable for implementing the embodiment of the present application. The device for generating instruction fine-tuning data in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The instruction fine-tuning data generating device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0104] like Figure 4As shown, the instruction fine-tuning data generating device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. Various programs and data required for the operation of the instruction fine-tuning data generating device are also stored in the RAM 1004. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems may be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 may allow the instruction fine-tuning data generating device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows an instruction fine-tuning data generating device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.

[0105] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0106] The instruction fine-tuning data generating device provided by the present application adopts the instruction fine-tuning data generating method in the above embodiment, which can solve the technical problem of how to improve the accuracy of the generated instruction fine-tuning data. Compared with the prior art, the beneficial effects of the instruction fine-tuning data generating device provided by the present application are the same as the beneficial effects of the instruction fine-tuning data generating method provided by the above embodiment, and the other technical features in the instruction fine-tuning data generating device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0107] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0108] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0109] The present application provides a computer-readable medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the instruction fine-tuning data generation method in the above-mentioned embodiment.

[0110] The computer-readable medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0111] The computer-readable medium may be included in the instruction fine-tuning data generating device; or may exist independently without being assembled into the instruction fine-tuning data generating device.

[0112] The computer-readable medium carries one or more programs, and when the one or more programs are executed by the instruction fine-tuning data generating device, the instruction fine-tuning data generating device can write computer program codes for performing the operations of the present application in one or more programming languages ​​or a combination thereof, and the programming languages ​​include object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0113] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0114] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0115] The readable medium provided by the present application is a computer-readable medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned instruction fine-tuning data generation method, and can solve the technical problem of how to improve the accuracy of the generated instruction fine-tuning data. Compared with the prior art, the beneficial effects of the computer-readable medium provided by the present application are the same as the beneficial effects of the instruction fine-tuning data generation method provided by the above-mentioned embodiment, and will not be repeated here.

[0116] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned instruction fine-tuning data generation method when executed by a processor.

[0117] The computer program product provided by the present application can solve the technical problem of how to improve the accuracy of the generated instruction fine-tuning data. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the instruction fine-tuning data generation method provided by the above embodiment, which will not be repeated here.

[0118] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for generating instruction fine-tuning data, characterized in that: The method comprises: Get text data; Converting the text data into a preset text format to obtain text information; Constructing a mask template based on multiple preset template contents to obtain mask template contents; Matching the text information with the mask template content to obtain question-answer pair data; Based on the question-answer pair data, instruction fine-tuning data is generated.

2. The method according to claim 1, characterized in that The step of constructing a mask template based on a plurality of preset template contents to obtain the mask template contents comprises: Determine multiple preset templates, each of which corresponds to a different question-answer pair generation scenario, including summary templates, judgment templates, completion templates, and attribution templates; Constructing a mask template according to the plurality of preset templates, wherein the mask template includes one or more placeholders for subsequent filling of actual text content; According to the mask template, the content of the mask template is obtained.

3. The method according to claim 1, characterized in that The step of matching the text information with the mask template content to obtain question-answer pair data includes: Using the text information to match the mask template content to determine whether to generate a question-answer pair; When the match is successful, the text information is filled in according to the mask template content to generate question-answer pair data; After matching the text information with the mask template content, the method further includes: When the matching is unsuccessful, the text information range is expanded for matching until the text data range is reached.

4. The method according to claim 1, characterized in that The step of generating instruction fine-tuning data based on the question-answer pair data comprises: Based on the question-answer data, key information is obtained by using keyword extraction technology; The mask template and the key information are combined to generate instruction fine-tuning data.

5. The method according to claim 1, characterized in that After the step of converting the text data into a preset text format to obtain text information, the method further comprises: Identify and document missing information and misidentification issues during the conversion process; Proofread the text information item by item according to the information omission and misrecognition problems to obtain a proofreading result; The text information is corrected based on the proofreading result to obtain corrected text information.

6. The method according to claim 1, characterized in that After the step of generating instruction fine-tuning data based on the question-answer pair data, the method further comprises: Applying a preset referee model to evaluate the instruction fine-tuning data to obtain an evaluation result; Classifying the instruction fine-tuning data according to the evaluation result to obtain a classification result; The instruction data is output to the intelligent model for optimization according to the classification results.

7. The method according to claim 6, characterized in that After the step of classifying the instruction fine-tuning data according to the evaluation result to obtain the classification result, the method further comprises: According to the classification results, high-confidence data and low-confidence data are obtained; Verifying and correcting the low-confidence data to obtain corrected data; The corrected data are re-evaluated until they meet the preset quality standards.

8. A device for generating instruction fine-tuning data, characterized in that: The device comprises: An acquisition module, used to acquire text data; A conversion module, used for converting the text data into a preset text format to obtain text information; A construction module, used to construct a mask template based on multiple preset template contents to obtain the mask template content; A matching module, used to match the text information with the mask template content to generate question-answer pair data; A result module is used to generate instruction fine-tuning data based on the question-answer pair data.

9. A device for generating instruction fine-tuning data, characterized in that: The device comprises: a memory, a processor, and an instruction fine-tuning data generation program stored in the memory and executable on the processor, wherein the instruction fine-tuning data generation program is configured to implement the steps of the instruction fine-tuning data generation method according to any one of claims 1 to 7.

10. A medium, characterized in that The medium stores an instruction fine-tuning data generation program, and when the instruction fine-tuning data generation program is executed by a processor, the steps of the instruction fine-tuning data generation method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Question and answer library generation method and device based on knowledge graph, electronic equipment and storage medium

    CN113590844A

  • Research report question and answer generation method and system and computer readable storage medium

    CN114492362A

  • Verb tense-based generalization causal network construction method, equipment and medium

    CN116227601A

  • Question answering method and device based on knowledge graph, storage medium and equipment

    CN117112770A

  • Design method and device for intelligent question and answer recommendation system for field geological work and medium

    CN117828044A