Data table question and answer model optimization method and device, equipment, medium and product
By using a strong language model to optimize the initial question and answer data set, improve suggestions are generated and integrated into the initial language model, the problems of slow optimization speed and high usage overhead of data table question and answer model in the prior art are solved, and efficient data table question and answer model optimization is achieved.
Patent Information
- Application Number
- CN202411749909.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-03-18
AI Technical Summary
When the prior art optimizes the data table question and answer model by adding few samples to learn samples, it leads to problems such as slow generation speed and increased usage overhead of large language models.
By obtaining the initial question and answer dataset and the initial language model, using the strong language model and the initial question and answer dataset to optimize the initial language model, generate improvement suggestions, and fuse these improvement suggestions with the initial language model to obtain the target question and answer model.
It realizes the generation of improvement suggestions for a single question item and the generation of prompt information for all the improved question items, accurately identify the improvement space of the initial language model, and directional optimization, which improves the efficiency of the data table question and answer model.
Smart Images

Figure CN119646187A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device, equipment, medium and product for optimizing a data table question-and-answer model. Background Art
[0002] During the data table question and answer process, interactive instructions are input into the data table question and answer model, and the data table question and answer model generates answers based on the interactive instructions and the target data table.
[0003] Interactive instructions refer to text or instructions that provide input to the datasheet question-answering model to guide it to generate specific outputs. They are used to describe the information, answers, text, etc. that the user wants to obtain from the model. They can be a short question, a complete paragraph, or a set of instructions, depending on the user's needs and scenarios. Interactive instructions directly affect the content, style, and quality of the text generated by the datasheet question-answering model. In order to improve the accuracy of the answer, the interactive instructions input to the datasheet question-answering model need to be optimized.
[0004] In the related technology, there are two main forms: question-answering for data stored in the form of Excel and CSV files, and question-answering for data stored in the form of databases. The former usually uses a large language model (LLM) to generate Python code and execute the Python code to get the answer. The latter usually uses LLM to generate SQL code for the corresponding database system and executes the SQL code to get the answer. By inputting some question-answering samples into LLM, LLM can achieve few-shot learning. However, the method of optimizing the data table question-answering model by adding few-shot learning samples may require too long interactive instructions, which in turn leads to problems such as slow generation speed and increased LLM usage overhead. Summary of the invention
[0005] Based on this, it is necessary to provide a data table question and answer model optimization method, device, equipment, medium and product that can improve the response efficiency in response to the above technical problems.
[0006] In a first aspect, the present application provides a method for optimizing a data table question-answering model, the method comprising:
[0007] Obtain the initial question-answering dataset and initial language model;
[0008] Using the strong language model and the initial question-answering dataset, the initial language model is optimized for question-answering, and improvement suggestions corresponding to the initial language model are obtained;
[0009] Generate prompt information corresponding to the initial language model based on each improvement suggestion;
[0010] The prompt information is fused with the initial language model to obtain the target question-answering model.
[0011] In one embodiment, the initial question-answering dataset includes an initial question item and an initial answer item; obtaining the initial question-answering dataset includes:
[0012] Generate a first question item and a first answer item using the first interaction instruction and a preset first language model;
[0013] Performing a deduplication process on the first question item to obtain a second question item and a second answer item corresponding to the second question item;
[0014] Verify the second answer item to obtain a verification result corresponding to the second answer item;
[0015] When the verification result is that the verification is passed, the second answer item is used as the initial answer item, and the second question item corresponding to the second answer item is used as the initial question item.
[0016] In one embodiment, the strong language model and the initial question-answering dataset are used to perform question-answering optimization processing on the initial language model to obtain improvement suggestions corresponding to the initial language model, including:
[0017] For each initial question item in the initial question-answering dataset, the initial question item is input into the initial language model, and the test answer item corresponding to the initial language model is output;
[0018] Compare the test answer item with the initial answer item to obtain a test comparison result;
[0019] When the test comparison result is wrong, the initial question item is input into the strong language model, and the reference answer item corresponding to the strong language model is output;
[0020] Compare the reference answer item with the initial answer item to obtain a reference comparison result;
[0021] When the reference comparison result is correct, a strong language model is used to generate improvement suggestions for the test answer item.
[0022] In one embodiment, using a strong language model to generate improvement suggestions for test answer items includes:
[0023] generating a second interactive instruction according to the initial question item;
[0024] The second interaction instruction is input into the strong language model to generate improvement suggestions.
[0025] In one embodiment, when the reference comparison result is correct, using a strong language model to generate improvement suggestions for the test answer item, including:
[0026] Determine whether the number of times improvement suggestions are generated using the strong language model is greater than a preset threshold;
[0027] When the number of improvement suggestions is less than or equal to a threshold, a strong language model is used to generate improvement suggestions for the test answer item.
[0028] In one embodiment, prompt information corresponding to the initial language model is generated according to each improvement suggestion, including:
[0029] Acquiring data for improvement;
[0030] Using a preset vector model, the improvement suggestions corresponding to the improveable data are converted into improvement vectors;
[0031] The improved vectors are clustered to obtain improved category information; and prompt information is generated according to the improved category information.
[0032] In a second aspect, the present application also provides a data table question-answering model optimization device, the device comprising:
[0033] Data acquisition module, used to obtain the initial question-answering dataset and initial language model;
[0034] The question-answering optimization module is used to optimize the initial language model using the strong language model and the initial question-answering dataset, and obtain improvement suggestions corresponding to the initial language model;
[0035] An information generation module, used to generate prompt information corresponding to the initial language model according to each improvement suggestion;
[0036] The model optimization module is used to fuse the prompt information with the initial language model to obtain the target question-answering model.
[0037] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method of the first aspect are implemented.
[0038] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method of the first aspect when the computer program is executed by a processor.
[0039] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which implements the steps of the method of the first aspect when executed by a processor.
[0040] The above-mentioned data table question and answer model optimization method, device, equipment, medium and product, on the one hand, provide a data table question and answer model optimization method, by obtaining an initial question and answer data set and an initial language model; using a strong language model and an initial question and answer data set, the initial language model is optimized for question and answer, and improvement suggestions corresponding to the initial language model are obtained; according to each improvement suggestion, prompt information corresponding to the initial language model is generated; the prompt information is integrated with the initial language model to obtain a target question and answer model. In this way, by generating improvement suggestions for a single question item and generating prompt information for all improveable question items, it is possible to accurately identify the improvement space of the initial language model and achieve targeted optimization, thereby providing a clear direction for the optimization of the initial language model and avoiding processing a large number of improvement suggestions one by one, effectively improving the efficiency of the data table question and answer model optimization method. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 An application environment diagram of a data table question-answering model optimization method in an embodiment;
[0043] Figure 2 A schematic diagram of a flow chart of a method for optimizing a data table question-answering model in one embodiment;
[0044] Figure 3 A schematic diagram of a flow chart of a data table question-answering model optimization method in another embodiment;
[0045] Figure 4 It is a structural block diagram of a data table question-answering model optimization device in one embodiment;
[0046] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] The data table question-answering model optimization method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0049] In an exemplary embodiment, Figure 2 As shown, a data table interaction instruction optimization method is provided, and the method is applied to Figure 1 The server 104 in the example is used as an example to illustrate, including the following steps 202 to 208. Among them:
[0050] Step 202: Obtain an initial question-answering dataset and an initial language model.
[0051] Among them, the initial language model is a model used to perform data table questions and answers on the target data table. The initial language model used in the embodiment of the present application is a large language model (hereinafter referred to as LLM).
[0052] The initial question and answer dataset includes initial question items and initial answer items for the target data table. For the target data table, if there are initial question items and initial answer items, they can be reused directly; if there are no preset initial question items and initial answer items, information can be extracted from the target data table through design rules to generate relevant initial question items and initial answer items, or by investigating the common types of questions that users of the target data table use when using tabular data, a general natural language question template can be written to obtain initial question items and initial answer items; or an open source dataset can be used as the initial question and answer dataset.
[0053] In a possible implementation, there is no preset initial question item and initial answer item, and the process of obtaining the initial question and answer data set may include: using the first interaction instruction and the preset first language model to generate a first question item and a first answer item; performing deduplication processing on the first question item to obtain a second question item and a second answer item corresponding to the second question item; performing verification processing on the second answer item to obtain a verification result corresponding to the second answer item, and when the verification result is verification passed, using the second answer item as the initial answer item, and using the second question item corresponding to the second answer item as the initial question item.
[0054] The first language model may be an LLM, and the first interactive instruction includes question requirements, sample data, and answer formats, where the sample data is obtained by randomly sampling data in the target database. Considering that questions are asked for the same data, it cannot be guaranteed that the first question items generated by the first language model will never be repeated, so the first question items need to be deduplicated. Optionally, the first language model may be a larger-scale LLM.
[0055] Exemplarily, the initial answer item in the initial question-and-answer data set is the Python code corresponding to the initial question item, and the first interaction instruction can be expressed as:
[0056] "I have a data set with the following headers: student number, name, class, total score, and some sample data:
[0057] <data>
[0058] [{"Student ID": 1, "Name": "Li Lei", "Class": "Class 1", "Total score": 527},
[0059] {"Student ID": 2, "Name": "Han Meimei", "Class": "Class 1", "Total score": 642}]
[0060] < / data>
[0061] Please help me generate 10 questions that can be used for data analysis based on the sample data above. You can ask specific values of a single record, statistics for specific fields, or plots, as well as Python code to solve these problems. Please organize the answers in JSON array format, as follows:
[0062] [{"question": "...", "code": "..."}, ...]".
[0063] For the above-mentioned first interaction instruction, the first language model generates a first question item and a first answer item according to the first interaction instruction, deduplicates the first question item to obtain a second question item and a second answer item corresponding to the second question item, executes the code generated in the second answer item to obtain an execution result corresponding to the second answer item, verifies the execution result to obtain a verification result corresponding to the second answer item; when the verification result is verification passed, the second answer item is used as the initial answer item, and the second question item corresponding to the second answer item is used as the initial question item.
[0064] Optionally, the process of generating the initial question and answer data set is executed multiple times. In each process of generating the initial question and answer data set, the sample data in the first interaction instruction is adjusted to obtain the corresponding first question item and the first answer item. After reaching a preset number of executions, such as 200 times, the first question items generated in each execution process are deduplicated to obtain the second question item and the second answer item corresponding to the second question item. Alternatively, the first question items generated in each execution process are deduplicated to obtain the second question item and the second answer item corresponding to the second question item, until a preset number of second question items and the second answer items corresponding to the second question items are generated.
[0065] Step 204, using the strong language model and the initial question-answering dataset, perform question-answering optimization processing on the initial language model to obtain improvement suggestions corresponding to the initial language model.
[0066] Among them, the initial language model is denoted as LLMweak, and its parameter volume is usually in the billions or tens of billions; the strong language model refers to the ultra-large-scale LLM, denoted as LLMstrong, and its parameter volume is usually more than 100 billion. LLMstrong plays the role of a mentor, enabling human algorithm engineers to discover LLMweak problems and summarize experience during the optimization process.
[0067] In one possible implementation, the question-answer optimization process may include: traversing the initial question-answer data set, for each initial question item in the initial question-answer data set, inputting the initial question item into the initial language model, and outputting a test answer item corresponding to the initial language model; comparing the test answer item with the initial answer item to obtain a test comparison result; if the test comparison result is incorrect, inputting the initial question item into the strong language model, and outputting a reference answer item corresponding to the strong language model; comparing the reference answer item with the initial answer item to obtain a reference comparison result; if the reference comparison result is correct, using the strong language model to generate improvement suggestions for the test answer item.
[0068] Among them, when the test comparison result is correct, it means that the current question is within the capability of the initial language model LLMweak, and there is no need to use the strong language model LLMstrong for guidance. When the test comparison result is wrong, try to answer it with the strong language model LLMstrong. If the strong language model LLMstrong can answer it correctly, it means that the answer of the strong language model LLMweak to this question has room for improvement. The strong language model LLMstrong can give improvement suggestions after analyzing the test answer items corresponding to the initial language model.
[0069] Step 206: Generate prompt information corresponding to the initial language model according to each improvement suggestion.
[0070] In this step, the improvement suggestion is a suggestion formed for a specific initial question item, that is, an improvement suggestion generated for an initial question item whose test comparison result corresponding to the initial answer item is incorrect and whose reference comparison result is correct; and the prompt information is common information for some initial questions, that is, general prompt information generated for all initial question items whose test comparison results are correct after being improved based on the improvement suggestion.
[0071] Step 208: The prompt information is integrated with the initial language model to obtain a target question-answering model.
[0072] Among them, for the target question-answering model and the initial language model, for the input common interaction instructions, the target question-answering model can fuse the interaction instructions with the prompt information, and generate the target answer item based on the interaction instructions and the prompt information. In the target question-answering model, the prompt information can be reflected in the target answer item in the form of explicit information, or not displayed in the interaction interface, and only takes effect in the process of generating the target answer item.
[0073] The above-mentioned data table question-answering model optimization method obtains an initial question-answering data set and an initial language model; uses a strong language model and an initial question-answering data set to perform question-answering optimization processing on the initial language model to obtain improvement suggestions corresponding to the initial language model; generates prompt information corresponding to the initial language model according to each improvement suggestion; and fuses the prompt information with the initial language model to obtain a target question-answering model. In this way, by generating improvement suggestions for a single question item and generating prompt information for all improveable question items, it is possible to accurately identify the improvement space of the initial language model and achieve targeted optimization, thereby providing a clear direction for the optimization of the initial language model and avoiding processing a large number of improvement suggestions one by one, effectively improving the efficiency of the data table question-answering model optimization method.
[0074] In an exemplary embodiment, the process of generating improvement suggestions for test answer items using a strong language model in the provided method may further include: generating a second interaction instruction based on the initial question item; inputting the second interaction instruction into the strong language model to generate improvement information.
[0075] The second interaction instruction may include the initial question item and error information corresponding to the test answer item generated by the initial language model LLMweak based on the initial question item.
[0076] Exemplarily, the second interactive instruction is used to allow the strong language model LLMstrong to generate relevant prompt improvement information to guide the initial language model LLMweak, where {llm_weak_prompt} is the initial question item, and {error} is the error information corresponding to the initial language model LLMweak, which can be the error information generated by the initial language model LLMweak when the code is executed. The second interactive instruction can be expressed as:
[0077] "You are an engineer who is proficient in data analysis. I now have a prompt that I will use to let the big language model generate code, but the generated code contains errors. Please help me analyze this error and give some summary prompt information so that after adding this information to the prompt, the big language model can generate the correct code next time.
[0078] The prompt is as follows:
[0079] <prompt>
[0080] {llm_weak_prompt}
[0081] < / prompt>
[0082] The error message is as follows:
[0083] <error>
[0084] {error}
[0085] < / error>
[0086] Please generate:".
[0087] In an exemplary embodiment, in the provided method, when the reference comparison result is correct, the process of using a strong language model to generate improvement suggestions for a test answer item includes: determining whether the number of times the improvement suggestions are generated using the strong language model is greater than a preset threshold; and when the number of improvement suggestions is less than or equal to the threshold, generating improvement suggestions for the test answer item using the strong language model.
[0088] Exemplarily, the value of the threshold can be 3 times. Determine whether the number of improvement suggestions given by the strong language model LLMstrong to the current initial question item exceeds 3 times. If it exceeds 3 times, the test answer item generated by the initial language model LLMweak for the initial question item still cannot match the initial answer item, that is, the test comparison result is wrong for 3 consecutive times, indicating that even if the strong language model LLMstrong adds relevant improvement suggestions to the current initial question item, it is still difficult for the initial language model LLMweak. In order to avoid unlimited waste of resources, the improvement of the initial question item is directly skipped. If it is less than or equal to 3 times, the strong language model LLMstrong is used to analyze the initial answer item generated by the initial language model LLMweak for the initial question item, and give improvement suggestions.
[0089] In one possible implementation, the provided method includes: obtaining improveable data; using a preset vector model to convert improvement suggestions corresponding to the improveable data into improvement vectors; clustering the improvement vectors to obtain improvement category information; and generating prompt information based on the improvement category information.
[0090] Among them, the improvable data is the data whose test comparison result corresponding to the initial language model LLMweak is wrong, but after being improved by the improvement suggestions of the strong learning model LLMstrong, the process of obtaining the test comparison result is re-executed, and the test comparison result is correct. The improvable data may include the initial answer item when the test comparison result is wrong, the improvement suggestions, and the initial answer item when the test comparison result is correct.
[0091] Exemplarily, in the process of generating prompt information, a third interactive instruction can be generated according to the improved category information, and the third interactive instruction can be input into the strong learning model LLMstrong to summarize the improved category information to obtain prompt information, where {information} represents the improved category information. The third interactive instruction can be expressed as:
[0092] "I have some improvement category messages. Please ignore the details of the description, variable names, etc. in these prompts, summarize the commonalities of the prompts, and output a summary description.
[0093] The prompt information is as follows, each line represents a prompt information:
[0094] <information>
[0095] {information}
[0096] < / information>
[0097] Please summarize:"
[0098] When the initial language model provided in this embodiment is actually used, the strong learning model LLMstrong will no longer exist. This means that when the initial language model LLMweak gives an incorrect answer in actual use, there will be no strong learning model LLMstrong to provide guidance. At this time, it is necessary to classify and summarize the improvement suggestions that the initial language model LLMweak gives incorrect answers but can answer correctly after being guided by the improvement suggestions provided by the strong learning model LLMstrong, and add the summarized prompt information to the initial language model LLMweak, so that when it is actually used, the initial language model LLMweak can obtain the correct output according to the summarized prompt information.
[0099] In an exemplary embodiment, a method for optimizing a data table question-answering model is provided, the method comprising:
[0100] S1, obtain the initial question-answering dataset and initial language model.
[0101] Among them, the initial question and answer data set includes an initial question item and an initial answer item; obtaining the initial question and answer data set includes: using a first interactive instruction and a preset first language model to generate a first question item and a first answer item; deduplicating the first question item to obtain a second question item and a second answer item corresponding to the second question item; verifying the second answer item to obtain a verification result corresponding to the second answer item; when the verification result is verification passed, using the second answer item as the initial answer item, and using the second question item corresponding to the second answer item as the initial question item.
[0102] S2, for each initial question item in the initial question-answering dataset, input the initial question item into the initial language model, and output the test answer item corresponding to the initial language model;
[0103] S3, comparing the test answer item with the initial answer item to obtain a test comparison result;
[0104] S4, when the test comparison result is wrong, input the initial question item into the strong language model, and output the reference answer item corresponding to the strong language model;
[0105] S5, comparing the reference answer item with the initial answer item to obtain a reference comparison result;
[0106] S6, determining whether the number of times improvement suggestions are generated using the strong language model is greater than a preset threshold;
[0107] S7, when the number of improvement suggestions is less than or equal to the threshold, using the strong language model to generate improvement suggestions for the test answer item.
[0108] Specifically, a second interaction instruction is generated according to the initial question item; the second interaction instruction is input into the strong language model to generate improvement suggestions.
[0109] S8, obtain improvable data;
[0110] S9, using a preset vector model, converting the improvement suggestions corresponding to the improveable data into an improvement vector;
[0111] S10, performing clustering processing on the improved vectors to obtain improved category information; generating prompt information according to the improved category information.
[0112] S11, the prompt information is integrated with the initial language model to obtain the target question-answering model.
[0113] In a possible implementation manner, the execution process of the method provided in this embodiment is as follows: Figure 3 As shown, LLMw represents the initial language model LLMweak; LLMs represents the strong learning model LLMstrong.
[0114] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0115] Based on the same inventive concept, the embodiment of the present application also provides a data table question and answer model optimization device for implementing the data table question and answer model optimization method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more data table question and answer model optimization device embodiments provided below can refer to the limitations of the data table question and answer model optimization method above, and will not be repeated here.
[0116] In an exemplary embodiment, Figure 4 As shown, a data table question-answer model optimization device is provided, including: a data acquisition module 402, a question-answer optimization module 404, an information generation module 406 and a model optimization module 408, wherein:
[0117] A data acquisition module 402 is used to acquire an initial question-answering dataset and an initial language model;
[0118] The question-answer optimization module 404 is used to use the strong language model and the initial question-answer data set to perform question-answer optimization processing on the initial language model to obtain improvement suggestions corresponding to the initial language model;
[0119] The information generation module 406 is used to generate prompt information corresponding to the initial language model according to each improvement suggestion;
[0120] The model optimization module 408 is used to fuse the prompt information with the initial language model to obtain a target question-answering model.
[0121] In one embodiment, the initial question and answer data set includes an initial question item and an initial answer item; the initial question and answer data set is obtained, and the data acquisition module 402 is further used to generate a first question item and a first answer item using a first interactive instruction and a preset first language model; the first question item is deduplicated to obtain a second question item and a second answer item corresponding to the second question item; the second answer item is verified to obtain a verification result corresponding to the second answer item; when the verification result is verification passed, the second answer item is used as the initial answer item, and the second question item corresponding to the second answer item is used as the initial question item.
[0122] In one of the embodiments, the question and answer optimization module 404 is also used to input the initial question item into the initial language model for each initial question item in the initial question and answer data set, and output a test answer item corresponding to the initial language model; compare the test answer item with the initial answer item to obtain a test comparison result; if the test comparison result is incorrect, input the initial question item into the strong language model, and output a reference answer item corresponding to the strong language model; compare the reference answer item with the initial answer item to obtain a reference comparison result; if the reference comparison result is correct, use the strong language model to generate improvement suggestions for the test answer item.
[0123] In one embodiment, the question-answer optimization module 404 is further configured to generate a second interaction instruction based on the initial question item; and input the second interaction instruction into the strong language model to generate improvement suggestions.
[0124] In one of the embodiments, the question and answer optimization module 404 is also used to determine whether the number of improvement suggestions generated using the strong language model is greater than a preset threshold; when the number of improvement suggestions is less than or equal to the threshold, the strong language model is used to generate improvement suggestions for the test answer items.
[0125] In one embodiment, the information generation module 406 is also used to obtain improveable data; use a preset vector model to convert improvement suggestions corresponding to the improveable data into improvement vectors; cluster the improvement vectors to obtain improvement category information; and generate prompt information based on the improvement category information.
[0126] Each module in the above-mentioned data table question-answering model optimization device can be implemented in whole or in part by software, hardware, and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0127] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store an initial question and answer data set. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data table question and answer model optimization method is implemented.
[0128] Those skilled in the art will understand that Figure 5The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0129] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0130] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0131] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0132] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0133] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0134] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0135] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data table question-answering model optimization method, characterized in that: The method comprises: Obtain the initial question-answering dataset and initial language model; Using the strong language model and the initial question-answering dataset, performing question-answering optimization processing on the initial language model to obtain improvement suggestions corresponding to the initial language model; Generating prompt information corresponding to the initial language model according to each of the improvement suggestions; The prompt information is fused with the initial language model to obtain a target question-answering model.
2. The method according to claim 1, characterized in that The initial question-answering data set includes an initial question item and an initial answer item; The obtaining of the initial question-answering dataset comprises: Generate a first question item and a first answer item using the first interaction instruction and a preset first language model; De-duplication processing is performed on the first question item to obtain a second question item and a second answer item corresponding to the second question item; Verifying the second answer item to obtain a verification result corresponding to the second answer item; When the verification result is that the verification is passed, the second answer item is used as the initial answer item, and the second question item corresponding to the second answer item is used as the initial question item.
3. The method according to claim 2, characterized in that The using of the strong language model and the initial question-answering dataset to perform question-answering optimization processing on the initial language model to obtain improvement suggestions corresponding to the initial language model includes: For each initial question item in the initial question-answering data set, input the initial question item into the initial language model, and output a test answer item corresponding to the initial language model; Compare the test answer item with the initial answer item to obtain a test comparison result; In the case where the test comparison result is an error, inputting the initial question item into the strong language model, and outputting a reference answer item corresponding to the strong language model; Compare the reference answer item with the initial answer item to obtain a reference comparison result; In a case where the reference comparison result is correct, the strong language model is used to generate improvement suggestions for the test answer item.
4. The method according to claim 3, characterized in that: The generating improvement suggestions for the test answer items using the strong language model includes: generating a second interactive instruction according to the initial question item; The second interaction instruction is input into the strong language model to generate the improvement suggestion.
5. The method according to claim 3, characterized in that: When the reference comparison result is correct, generating improvement suggestions for the test answer item using the strong language model includes: Determining whether the number of times the improvement suggestion is generated using the strong language model is greater than a preset threshold; When the number of improvement suggestions is less than or equal to the threshold, the strong language model is used to generate improvement suggestions for the test answer item.
6. The method according to claim 1, characterized in that Generating prompt information corresponding to the initial language model according to each of the improvement suggestions includes: Acquiring data for improvement; Using a preset vector model, converting the improvement suggestion corresponding to the improveable data into an improvement vector; The improved vectors are clustered to obtain improved category information; and the prompt information is generated according to the improved category information.
7. A data table question-answering model optimization device, characterized in that: The device comprises: Data acquisition module, used to obtain the initial question-answering dataset and initial language model; A question-answering optimization module, used to use the strong language model and the initial question-answering dataset to perform question-answering optimization processing on the initial language model to obtain improvement suggestions corresponding to the initial language model; An information generation module, used to generate prompt information corresponding to the initial language model according to each of the improvement suggestions; The model optimization module is used to fuse the prompt information with the initial language model to obtain a target question-answering model.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.