Question and answer method and system based on general table large model and data agent
By fine-tuning the big model with table instructions and agent fine-tuning, a general table model is formed, which solves the problem of low efficiency in structured table processing under natural language instructions, realizes the big model's understanding and processing of table information, and improves processing efficiency and Generalization ability.
Patent Information
- Application Number
- CN202411492178.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-10-24
AI Technical Summary
The prior art is difficult to automate the processing of structured tables through natural language instructions, resulting in low processing efficiency and high maintenance costs, and large models are difficult to understand structured tables, which lacks universality.
By obtaining and processing open source data sets of table tasks of different categories, generating table instruction data sets to fine-tune the base model, further fine-tune the agent on the data agent instruction data set, forming a general table model, which can be understood Table information and call relevant tools to process table tasks.
It realizes the full understanding and processing of table information by the large language model, provides a general model to solve various table problems, has strong generalization capabilities, reduces maintenance costs, and is closer to actual implementation.
Smart Images

Figure CN119003535A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of large models, and in particular relates to a question-answering method and system based on a general table large model and a data intelligent body. Background Art
[0002] Structured tables are everywhere. These tables usually exist in the form of spreadsheet files, databases, etc. Structured data usually contains important information. Previously, if you want to process structured tables, you need to manually operate the software, which is difficult to automate and operate directly through natural language instructions. Natural language operation of structured tables makes related work in various industries more efficient and of great significance.
[0003] Currently, various deep learning methods have been applied to table tasks, which usually require pre-training of tables or special model architecture design, are limited to specific table types, or make simplified assumptions about tables and tasks. First of all, these methods generally lack universality and it is difficult to solve various problems with a universal model. Secondly, the effects on various table tasks are also different, and the cost of subsequent maintenance is also high, which may be difficult to implement in actual scenarios.
[0004] In recent years, the emergence of big model technology has greatly enhanced the language ability of artificial intelligence, allowing it to complete conversations like humans. However, two-dimensional data such as structured tables are different from natural language forms and are usually difficult for big models to understand directly, requiring further in-depth research. Summary of the invention
[0005] The purpose of the present invention is to solve the problems existing in the prior art and to provide a question-answering method and system based on a general table large model and a data intelligent body.
[0006] In order to achieve the above-mentioned invention object, the present invention specifically adopts the following technical solutions:
[0007] In a first aspect, the present invention provides a question-answering method based on a general table model and a data agent, which comprises the following steps:
[0008] S1. Obtain and process open source data sets of different types of table tasks, generate table instruction data sets, perform table instruction fine-tuning on the base large model based on the table instruction data sets, and obtain a general table large model after table instruction fine-tuning;
[0009] S2. Generate a data agent instruction dataset based on the open source dataset of some table tasks, perform agent fine-tuning on the general table model after fine-tuning the table instructions on the data agent instruction dataset, and obtain the general table model after agent fine-tuning;
[0010] S3. Input the question to be answered, the table file and the pre-built prompt words into the general table model fine-tuned by the intelligent agent. When the intelligent agent does not need to call the tool, the general table model fine-tuned by the intelligent agent outputs the answer to the question. When the intelligent agent needs to call the tool, the general table model fine-tuned by the intelligent agent interacts with the intelligent agent to finally get the answer to the question.
[0011] Based on the above scheme, each step can be implemented in the following preferred specific manner.
[0012] As a preferred embodiment of the above-mentioned first aspect, in step S1, the table tasks specifically include table question answering, natural language generation of SQL, table text generation, data analysis and table entity alignment.
[0013] As a preferred embodiment of the first aspect, the specific process of step S1 is as follows:
[0014] S11. Processing the open source annotated data in the open source data set, generating table instruction data based on a specific sample format from the processed open source annotated data, wherein the fields of the specific sample format are [instruction; table; question; answer];
[0015] S12. The large language model rewrites the instructions in the tabular instruction data, and the large language model performs data enhancement on the tables, questions, and answers in the tabular instruction data;
[0016] S13. Generate a table instruction data set from the processed table instruction data, and perform table instruction fine-tuning on the base large model based on the table instruction data set using the Lora method to obtain a general table large model after the table instruction fine-tuning.
[0017] As a preferred embodiment of the first aspect, the specific process of step S2 is as follows:
[0018] S21. Based on the open source datasets of some tabular tasks, we use the prompt learning method and generate agent trajectory data based on the large language model and React reasoning framework;
[0019] S22. Evaluate whether the answer generated by the large language model is correct: if it is correct, keep it, and finally obtain the processed intelligent agent trajectory data; if it is incorrect, filter it out, and check whether there are repeated or illogical tool call steps in the problem analysis process generated by the large language model: if it exists, filter it out; if it does not exist, keep it, and finally obtain the processed intelligent agent trajectory data;
[0020] S23. Generate a data agent instruction data set from the processed agent trajectory data, and perform agent fine-tuning on the general table large model after fine-tuning the table instructions on the data agent instruction data set through the Lora method to obtain the general table large model after agent fine-tuning.
[0021] As a preferred embodiment of the above-mentioned first aspect, in step S21, the specific process of generating the agent trajectory data is as follows: the tabular instruction data is filled into the pre-constructed React few-sample prompt words, and the prompt learning method inputs the filled React few-sample prompt words into the large language model, so that the large language model generates the problem analysis process and the called tools and parameters, the intelligent agent calls the relevant tools and returns the tool call results to the large language model, and the large language model regenerates the problem analysis process until the answer corresponding to the question in the tabular instruction data is generated, and the problem analysis process and the answer generated by the large language model constitute the agent trajectory data.
[0022] As a preferred embodiment of the first aspect, the specific process of step S3 is as follows:
[0023] S31. Input the question to be answered, the table file and the pre-built prompt words into the general table model fine-tuned by the agent, and the user specifies the question type; wherein the table file is an Excel file or a database file, and the question type is specifically table question and answer, table reasoning, database question and answer, table operation and chart generation;
[0024] S32. The general table large model fine-tuned by the intelligent agent determines whether it is necessary for the intelligent agent to call a tool according to the type of question specified by the user: if it is not necessary to call a tool, the general table large model fine-tuned by the intelligent agent outputs the answer to the question; if it is necessary to call a tool, the general table large model fine-tuned by the intelligent agent outputs the type of tool to be called and the problem analysis process, and the intelligent agent is configured with different tools. The intelligent agent calls various tools based on the general table large model fine-tuned by the intelligent agent and returns the tool calling results to the general table large model fine-tuned by the intelligent agent. The general table large model fine-tuned by the intelligent agent regenerates the problem analysis process, and finally the general table large model fine-tuned by the intelligent agent outputs the answer to the question.
[0025] As a preferred embodiment of the above-mentioned first aspect, in step S32, the tools called by the intelligent agent include a Python interpreter, a SQL executor, an Excel table column name query tool, a database table query tool, a database table column name query tool, a line chart generation tool, and a bar chart generation tool.
[0026] As a preferred embodiment of the above-mentioned first aspect, the large base model adopts LLaMa.
[0027] In a second aspect, the present invention provides a question-answering system based on a general table model and a data agent, which comprises:
[0028] A table instruction fine-tuning module is used to obtain and process open source data sets of different types of table tasks, generate table instruction data sets, perform table instruction fine-tuning on the base large model based on the table instruction data sets, and obtain a general table large model after table instruction fine-tuning;
[0029] An agent fine-tuning module is used to generate a data agent instruction dataset based on the open source dataset of some table tasks, and perform agent fine-tuning on the general table model after the table instruction fine-tuning on the data agent instruction dataset to obtain the general table model after agent fine-tuning;
[0030] The result acquisition module is used to input the questions and table files to be answered and the pre-built prompt words into the general table model fine-tuned by the intelligent agent. When the intelligent agent does not need to call the tool, the general table model fine-tuned by the intelligent agent outputs the answer to the question. When the intelligent agent needs to call the tool, the general table model fine-tuned by the intelligent agent interacts with the intelligent agent to finally obtain the answer to the question.
[0031] In a third aspect, the present invention provides a computer electronic device comprising a memory and a processor;
[0032] The memory is used to store computer programs;
[0033] The processor is used to implement the question-answering method based on the general table big model and data intelligent agent as described in any one of the solutions of the first aspect above when executing the computer program.
[0034] Compared with the prior art, the present invention has the following beneficial effects:
[0035] The universal table model of the present invention enables the large language model to fully understand the table information and call related tools to process table tasks. Compared with traditional methods, the present invention only uses a universal table model to solve various problems in the table field, with stronger generalization ability and closer to implementation. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 is a flow chart of the steps of the method of the present invention;
[0037] Figure 2 A flowchart of table instruction fine-tuning and agent fine-tuning of the present invention;
[0038] Figure 3 A flowchart showing the specific process of the data agent of the present invention processing the table task;
[0039] Figure 4 It is a system block diagram of the present invention. DETAILED DESCRIPTION
[0040] In order to make the above-mentioned purpose, features and advantages of the present invention more obvious and easy to understand, the specific implementation mode of the present invention is described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. The technical features in each embodiment of the present invention can be combined accordingly without conflicting with each other.
[0041] In the description of the present invention, it should be understood that the terms "first" and "second" are only used for the purpose of distinguishing descriptions, and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features.
[0042] like Figure 1 As shown, in a preferred implementation of the present invention, the above-mentioned question-answering method based on the general table model and data agent mainly has the following three subtasks: table instruction fine-tuning, agent fine-tuning, and data agent processing table task, including the following steps S1 to S3. The specific implementation process is described in detail below.
[0043] 1. Fine-tuning table instructions
[0044] S1. Obtain and process open source datasets of different categories of table tasks, generate table instruction datasets, fine-tune the table instructions of the base large model on the table instruction dataset, and obtain the general table large model after the table instruction fine-tuning.
[0045] It should be noted that in step S1 of the embodiment of the present invention, the table tasks mainly include table question answering, natural language generation of SQL, table text generation, data analysis, and table entity alignment.
[0046] It should be noted that in step S1 of the embodiment of the present invention, the open source data sets include Fetaqa, Spider, Dart, Totto, HybridQA, Tabfact, Wikitableqa, Ds-1000, Bird-sql, TURL, SQA, etc. Figure 2 As shown, the specific process of step S1 of the present invention is as follows:
[0047] S11. Processing the open source annotated data in the open source data set, generating table instruction data based on a specific sample format from the processed open source annotated data, wherein the fields of the specific sample format are [instruction; table; question; answer];
[0048] S12. The large language model rewrites the instructions in the tabular instruction data, and the large language model performs data enhancement on the tables, questions, and answers in the tabular instruction data;
[0049] It should be noted that in step S12 of the embodiment of the present invention, a large model such as GPT-4 is specifically used to complete the instruction rewriting and data enhancement process of tables, questions and answers. The advantage is that the diversity of table instruction data is improved and the generalization ability of the general table large model is enhanced.
[0050] S13. Generate a table instruction data set from the processed table instruction data, and perform table instruction fine-tuning on the base large model based on the table instruction data set using the Lora method to obtain a general table large model after the table instruction fine-tuning.
[0051] It should be noted that in step S13 of the embodiment of the present invention, LLaMa is specifically used as the base large model, and after Lora fine-tuning it, a general table large model (i.e. Figure 2 The general table large model v1 in .
[0052] 2. Agent Fine-tuning
[0053] S2. Generate a data agent instruction dataset based on the open source dataset of some table tasks, and perform agent fine-tuning on the general table big model after fine-tuning the table instructions on the data agent instruction dataset, so that the general table big model can obtain tool calling capabilities, and obtain the general table big model after agent fine-tuning.
[0054] like Figure 2 As shown, the specific process of step S2 of the present invention is as follows:
[0055] S21. Based on the open source datasets of some tabular tasks, we use the prompt learning method and generate agent trajectory data based on the large language model and React reasoning framework.
[0056] It should be noted that the React reasoning framework mentioned in step S21 of the present invention is a reasoning framework based on few-sample learning and contextual learning. The core is to write some question-answering examples, and its implementation method belongs to the prior art. In the React reasoning framework, "thinking", "action" and "observation" are the core operation steps within the framework, which are used to efficiently perform reasoning tasks of large-scale models.
[0057] It should be noted that in step S21 of the embodiment of the present invention, a large model such as GPT-4 is specifically used as the large language model.
[0058] It should be noted that in step S21 of the embodiment of the present invention, the specific method of generating the agent trajectory data is: filling the tabular instruction data into the pre-constructed React few-sample prompt words, and the prompt learning method inputs the filled React few-sample prompt words into the large language model, so that the large language model generates the problem analysis process and the called tools and parameters, the intelligent agent calls the relevant tools and returns the tool call results to the large language model, and the large language model regenerates the problem analysis process until the answer corresponding to the question in the tabular instruction data is generated, and the problem analysis process and the answer generated by the large language model constitute the agent trajectory data.
[0059] S22. Evaluate whether the answer generated by the large language model is correct: if it is correct, keep it, and finally obtain the processed intelligent agent trajectory data; if it is incorrect, filter it out, and check whether there are repeated or illogical tool call steps in the problem analysis process generated by the large language model: if it exists, filter it out; if it does not exist, keep it, and finally obtain the processed intelligent agent trajectory data;
[0060] S23. Generate a data agent instruction data set from the processed agent trajectory data, and perform agent fine-tuning on the general table model after fine-tuning the table instruction on the data agent instruction data set by using the Lora method to obtain the general table model after fine-tuning the agent (i.e. Figure 2 The general table large model v2 in .
[0061] 3. Data Agent Processing Table Tasks
[0062] S3. Input the question to be answered, the table file and the pre-built prompt words into the general table model fine-tuned by the intelligent agent. When the intelligent agent does not need to call the tool, the general table model fine-tuned by the intelligent agent outputs the answer to the question. When the intelligent agent needs to call the tool, the general table model fine-tuned by the intelligent agent interacts with the intelligent agent to finally get the answer to the question.
[0063] like Figure 3 As shown, the specific process of step S3 of the present invention is as follows:
[0064] S31. Input the question to be answered, the table file and the pre-built prompt words into the general table model fine-tuned by the agent, and the user specifies the question type; wherein the table file is an Excel file or a database file, and the question type is specifically table question and answer, table reasoning, database question and answer, table operation and chart generation;
[0065] S32. The general table large model fine-tuned by the intelligent agent determines whether it is necessary for the intelligent agent to call a tool according to the type of question specified by the user: if it is not necessary to call a tool, the general table large model fine-tuned by the intelligent agent outputs the answer to the question; if it is necessary to call a tool, the general table large model fine-tuned by the intelligent agent outputs the type of tool called and the problem analysis process, and the intelligent agent is configured with different tools. The intelligent agent calls various tools based on the general table large model fine-tuned by the intelligent agent and returns the tool calling results to the general table large model fine-tuned by the intelligent agent. The general table large model fine-tuned by the intelligent agent regenerates the problem analysis process, and finally the general table large model fine-tuned by the intelligent agent outputs the answer to the question; wherein, the called tools include Python interpreter, SQL executor, Excel table column name query tool, database table query tool, database table column name query tool, line chart generation tool and bar chart generation tool.
[0066] In order to better demonstrate the specific implementation and technical effects of the present invention, the question-answering method based on the general table big model and data intelligent agent shown in steps S1 to S3 in the above preferred implementation method is applied to a specific example.
[0067] Example
[0068] The specific implementation process of the question-and-answer method based on the general table big model and data intelligent agent adopted in this embodiment is as described above and will not be repeated here.
[0069] In this embodiment, as shown below, an example of solving table reasoning through a data agent is specifically given: for the question: "How many patents have a legal status of "under review"?", the question type is table reasoning. The table mentioned is: patent information.xlsx, and the specific content is shown in Table 1.
[0070] 1. Prompt word generation
[0071] The question and form path will be filled into the prompt word template to generate a complete prompt word. The prompt word provided to the general form large model is as follows:
[0072] "Please try your best to answer the following questions. You can use the following tools: python_repl(code: str) -> str - A Python interpreter. Used to execute Python commands. Input should be valid Python commands. If you want to see the output of a value, you should print it out using print(...). QueryColumns(file_path: str) -> str - Query the columns in an Excel file. Use the following format:
[0073] Question: Input question you must answer
[0074] Think: You should always think about what you are going to do
[0075] Action: The action to take, should be one of [python_repl, QueryColumns]
[0076] Action Input: Input for action
[0077] Observation: The results of action
[0078] ... (this thought / action / action input / observation can be repeated N times)
[0079] Thinking: I now know the final answer
[0080] Final Answer: The final answer to the original input question
[0081] start!
[0082] Question: Solve a question-answering task based on a given data file.
[0083] Data file path: patent information.xlsx
[0084] Question: How many patents have a legal status of "under review"?
[0085] 2. Data Agent Reasoning
[0086] According to the above prompts, the general table model outputs <Thinking> "I need to query the relevant column names in the table.", and then outputs <Action> "Action: QueryColumns Action Input: "Patent Information.xlsx"", where Action is the tool name and Action Input is the tool parameter. The tool is for viewing the column names of Excel tables.
[0087] Execute the tool and get <Observation> "['Serial number', 'Patent name', 'Patent type', 'Legal status', 'Application number', 'Application date', 'Publication (announcement) number', 'Publication (announcement) date']", which is the column name of the table.
[0088] Continue iterating, generate <Thinking> "I need to use the 'Legal Status' column to count the number of companies under review.", output <Action> "Action: python_repl
[0089] Action Input:
[0090] import pandas as pd
[0091] data = pd.read_excel("Patent Information.xlsx")
[0092] count = data[data['Legal status'] == 'Under review']['Serial number'].count()
[0093] print(count)"
[0094] The python_repl tool is called to execute the code. The result is "4".
[0095] Continue iterating and generate <Thinking> "I now know the number of companies in the data file whose legal status is under review." Get <Final Answer> "There are 4 companies whose legal status is under review."
[0096] In summary, when solving tabular reasoning problems, the above-mentioned data agents generate thoughts, call tools, observe results, and call the general tabular model to ultimately solve the problem.
[0097] Table 1. Patent details
[0098]
[0099] It should also be noted that the question-answering method based on the general table big model and data intelligent body in the above embodiment can essentially be executed by a computer program or module. Therefore, similarly, based on the same inventive concept, another preferred embodiment of the present invention also provides a question-answering system based on the general table big model and data intelligent body corresponding to the question-answering method based on the general table big model and data intelligent body provided in the above embodiment, such as Figure 4 As shown, it includes:
[0100] A table instruction fine-tuning module is used to obtain and process open source data sets of different types of table tasks, generate table instruction data sets, perform table instruction fine-tuning on the base large model based on the table instruction data sets, and obtain a general table large model after table instruction fine-tuning;
[0101] An agent fine-tuning module is used to generate a data agent instruction dataset based on the open source dataset of some table tasks, and perform agent fine-tuning on the general table model after the table instruction fine-tuning on the data agent instruction dataset to obtain the general table model after agent fine-tuning;
[0102] The result acquisition module is used to input the questions and table files to be answered and the pre-built prompt words into the general table model fine-tuned by the intelligent agent. When the intelligent agent does not need to call the tool, the general table model fine-tuned by the intelligent agent outputs the answer to the question. When the intelligent agent needs to call the tool, the general table model fine-tuned by the intelligent agent interacts with the intelligent agent to finally obtain the answer to the question.
[0103] Similarly, based on the same inventive concept, another preferred embodiment of the present invention also provides a computer electronic device corresponding to the question-answering method based on the general table big model and data intelligent agent provided in the above embodiment, which includes a memory and a processor;
[0104] The memory is used to store computer programs;
[0105] The processor is used to implement the question-answering method based on the general table big model and data intelligent agent in the above embodiment when executing the computer program.
[0106] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.
[0107] It is understandable that the above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0108] It should also be noted that those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the various embodiments provided in this application, the division of steps or modules in the system and method is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or steps can be combined or integrated together, and a module or step can also be split.
[0109] The above-described embodiment is only a preferred solution of the present invention, but it is not intended to limit the present invention. A person skilled in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.
Claims
1. A question-answering method based on a general table model and a data agent, characterized in that: The following steps are involved: S1. Obtain and process open source data sets of different types of table tasks, generate table instruction data sets, perform table instruction fine-tuning on the base large model based on the table instruction data sets, and obtain a general table large model after table instruction fine-tuning; S2. Generate a data agent instruction dataset based on the open source dataset of some table tasks, perform agent fine-tuning on the general table model after fine-tuning the table instructions on the data agent instruction dataset, and obtain the general table model after agent fine-tuning; S3. Input the question to be answered, the table file and the pre-built prompt words into the general table model fine-tuned by the intelligent agent. When the intelligent agent does not need to call the tool, the general table model fine-tuned by the intelligent agent outputs the answer to the question. When the intelligent agent needs to call the tool, the general table model fine-tuned by the intelligent agent interacts with the intelligent agent to finally get the answer to the question.
2. A question-answering method based on a general table model and a data agent as claimed in claim 1, characterized in that: In step S1, the table tasks specifically include table question answering, natural language generation of SQL, table text generation, data analysis, and table entity alignment.
3. A question-answering method based on a general table model and a data agent as claimed in claim 1, characterized in that: The specific process of step S1 is as follows: S11. Processing the open source annotated data in the open source data set, generating table instruction data based on a specific sample format from the processed open source annotated data, wherein the fields of the specific sample format are [instruction; table; question; answer]; S12. The large language model rewrites the instructions in the tabular instruction data, and the large language model performs data enhancement on the tables, questions, and answers in the tabular instruction data; S13. Generate a table instruction data set from the processed table instruction data, and perform table instruction fine-tuning on the base large model based on the table instruction data set using the Lora method to obtain a general table large model after the table instruction fine-tuning.
4. A question-answering method based on a general table model and a data agent as claimed in claim 1, characterized in that: The specific process of step S2 is as follows: S21. Based on the open source datasets of some tabular tasks, we use the prompt learning method and generate agent trajectory data based on the large language model and React reasoning framework; S22. Evaluate whether the answer generated by the large language model is correct: if it is correct, keep it, and finally obtain the processed intelligent agent trajectory data; if it is incorrect, filter it out, and check whether there are repeated or illogical tool call steps in the problem analysis process generated by the large language model: if it exists, filter it out; if it does not exist, keep it, and finally obtain the processed intelligent agent trajectory data; S23. Generate a data agent instruction data set from the processed agent trajectory data, and perform agent fine-tuning on the general table large model after fine-tuning the table instructions on the data agent instruction data set through the Lora method to obtain the general table large model after agent fine-tuning.
5. A question-answering method based on a general table model and a data agent as claimed in claim 4, characterized in that: In step S21, the specific process of generating the agent trajectory data is as follows: the table instruction data is filled into the pre-constructed React few-sample prompt words, and the prompt learning method inputs the filled React few-sample prompt words into the large language model, so that the large language model generates the problem analysis process and the called tools and parameters, the intelligent agent calls the relevant tools and returns the tool call results to the large language model, and the large language model regenerates the problem analysis process until the answer corresponding to the question in the table instruction data is generated, and the problem analysis process and answer generated by the large language model constitute the agent trajectory data.
6. A question-answering method based on a general table model and a data agent as claimed in claim 1, characterized in that: The specific process of step S3 is as follows: S31. Input the question to be answered, the table file and the pre-built prompt words into the general table model fine-tuned by the agent, and the user specifies the question type; wherein the table file is an Excel file or a database file, and the question type is specifically table question and answer, table reasoning, database question and answer, table operation and chart generation; S32. The general table large model fine-tuned by the intelligent agent determines whether it is necessary for the intelligent agent to call a tool according to the type of question specified by the user: if it is not necessary to call a tool, the general table large model fine-tuned by the intelligent agent outputs the answer to the question; if it is necessary to call a tool, the general table large model fine-tuned by the intelligent agent outputs the type of tool to be called and the problem analysis process, and the intelligent agent is configured with different tools. The intelligent agent calls various tools based on the general table large model fine-tuned by the intelligent agent and returns the tool calling results to the general table large model fine-tuned by the intelligent agent. The general table large model fine-tuned by the intelligent agent regenerates the problem analysis process, and finally the general table large model fine-tuned by the intelligent agent outputs the answer to the question.
7. A question-answering method based on a general table model and a data agent as claimed in claim 6, characterized in that: In step S32, the tools called by the intelligent agent include a Python interpreter, a SQL executor, an Excel table column name query tool, a database table query tool, a database table column name query tool, a line chart generation tool, and a bar chart generation tool.
8. A question-answering method based on a general table model and a data agent as claimed in claim 1, characterized in that: The large base model adopts LLaMa.
9. A question-answering system based on a general table model and a data agent, characterized in that: include: A table instruction fine-tuning module is used to obtain and process open source data sets of different types of table tasks, generate table instruction data sets, perform table instruction fine-tuning on the base large model based on the table instruction data sets, and obtain a general table large model after table instruction fine-tuning; An agent fine-tuning module is used to generate a data agent instruction dataset based on the open source dataset of some table tasks, and perform agent fine-tuning on the general table model after the table instruction fine-tuning on the data agent instruction dataset to obtain the general table model after agent fine-tuning; The result acquisition module is used to input the questions and table files to be answered and the pre-built prompt words into the general table model fine-tuned by the intelligent agent. When the intelligent agent does not need to call the tool, the general table model fine-tuned by the intelligent agent outputs the answer to the question. When the intelligent agent needs to call the tool, the general table model fine-tuned by the intelligent agent interacts with the intelligent agent to finally obtain the answer to the question.
10. A computer electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is used to implement the question-answering method based on the general table big model and data intelligent agent as described in any one of claims 1 to 8 when executing the computer program.
Citation Information
Patent Citations
Railway industry intelligent question and answer assistant system
CN117633179A
Table question and answer optimization method and device, electronic equipment and readable storage medium
CN117874161A
Aerial document analysis and test case generation system driven by large model agent
CN117909243A
Table data processing large language model training method and device, medium and equipment
CN118132969A
Personalized complex report generation method based on multi-agent system
CN118569237A
Cited By
Power grid analysis tool calling method and system based on large language model
CN119336796A
Domain-level agent system construction method and system and intelligent question answering method and system
CN120804373A
