Question answering method and system based on general table big model and data intelligent agent

Through the question-and-answer method based on the general table model and data agent, the commonality and automation problems of the existing technology when processing structured tables are solved, the deep understanding of table information and tool calls are achieved, and the generalization of the model is improved. Ability and landing ability.

CN119003535BActive Publication Date: 2025-02-11ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411492178.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-02-11
Estimated Expiration
2044-10-24

AI Technical Summary

Technical Problem

The prior art lacks universality when processing structured tables, it is difficult to automate natural language operations, and deep learning methods are limited to specific table types, and the maintenance costs are high, making it difficult to implement in actual scenarios.

Method used

Using a question-and-answer method based on a general table model and a data agent, the open source data sets of different categories of table tasks are obtained and processed, and the table instruction data sets are generated and the table instruction fine-tuning is fine-tuned on the base model, and the model is further enhanced through the agent fine-tuning. tool calling capability.

Benefits of technology

It realizes the full understanding of table information by the large language model and the call of related tools, solves various problems in the table field, improves the generalization and implementation capabilities of the model, and reduces maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003535B_ABST
    Figure CN119003535B_ABST
Patent Text Reader

Abstract

The present invention discloses a question-answering method and system based on a general table large model and a data agent, and belongs to the field of large models. The present invention first fine-tunes the table instruction of the base large model on the table instruction data set, and then fine-tunes the agent on the general table large model after the table instruction fine-tuning on the data agent instruction data set, and finally inputs the question to be generated and the table file and the pre-built prompt words into the general table large model after the agent fine-tuning. When the agent does not need to call the tool, the answer to the question is obtained directly. When the agent needs to call the tool, the general table large model after the agent fine-tuning and the agent interact to obtain the answer to the question. The present invention makes full use of the table processing capability of the base large model, designs the agent operation process for various table tasks, and enhances the versatility and generalization ability of the base large model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This 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 agent. Background Technology

[0002] Structured tables are ubiquitous, typically existing in the form of spreadsheets and databases. Structured data usually contains important information. Previously, processing structured tables required manual software operation, which was difficult to automate. Now, natural language commands can be used to manipulate structured tables, significantly improving efficiency across various industries.

[0003] Currently, various deep learning methods have been applied to table-related tasks. These methods typically require pre-training of the table or design of a special model architecture, are limited by specific table types, or make simplified assumptions about the table and the task. Firstly, these methods generally lack universality, making it difficult to solve all types of problems with a single, general model. Secondly, their performance varies across different table-related tasks, and the cost of later maintenance is also high, making them difficult to implement in real-world scenarios.

[0004] In recent years, the emergence of large-scale modeling technology has greatly enhanced the language capabilities of artificial intelligence, enabling it to engage in conversations like humans. However, two-dimensional data such as structured tables differ from natural language and are often difficult for large-scale models to understand directly, requiring further in-depth research. Summary of the Invention

[0005] The purpose of this 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 model and a data intelligence agent.

[0006] To achieve the above-mentioned objectives, the present invention specifically adopts the following technical solution:

[0007] In a first aspect, the present invention provides a question-answering method based on a general table model and a data intelligence agent, which includes the following steps:

[0008] S1. Obtain and process open-source datasets of different types of table tasks, generate table instruction datasets, fine-tune the base large model on the table instruction dataset, and obtain the 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. On the data agent instruction dataset, perform agent fine-tuning on the general table model after fine-tuning the table instructions to obtain the general table model after agent fine-tuning.

[0010] S3. Input the question to be answered, the table file, and the pre-built prompts into the general table model after the agent is fine-tuned. When the agent does not need to call the tool, the general table model after the agent is fine-tuned will output the answer to the question. When the agent needs to call the tool, the general table model after the agent is fine-tuned will interact with the agent to finally obtain the answer to the question.

[0011] Based on the above scheme, each step can be implemented in the following preferred manner.

[0012] As a preferred embodiment of the first aspect above, in step S1, the table task specifically includes table question answering, natural language SQL generation, table text generation, data analysis, and table entity alignment.

[0013] As a preferred embodiment of the first aspect mentioned above, the specific process of step S1 is as follows:

[0014] S11. Process the open-source labeled data in the open-source dataset, and generate table instruction data from the processed open-source labeled data based on a specific sample format. The specific sample format fields are [instruction; table; question; answer];

[0015] S12. The instructions in the table instruction data are rewritten by the large language model, and the tables, questions and answers in the table instruction data are augmented by the large language model.

[0016] S13. Generate a table instruction dataset from the processed table instruction data, and fine-tune the base large model on the table instruction dataset using the LoRa method to obtain the general table large model after table instruction fine-tuning.

[0017] As a preferred embodiment of the first aspect mentioned above, the specific process of step S2 is as follows:

[0018] S21. Based on an open-source dataset for a partial table task, generate agent trajectory data using a cue-based learning method and a large language model and React inference framework;

[0019] S22. Evaluate whether the answer generated by the large language model is correct: if correct, retain it and finally obtain the processed agent trajectory data; if incorrect, filter it out. Verify whether there are duplicate or illogical tool call steps in the problem analysis process generated by the large language model: if there are, filter them out; if not, retain them and finally obtain the processed agent trajectory data.

[0020] S23. Generate a data agent instruction dataset from the processed agent trajectory data. On the data agent instruction dataset, fine-tune the general table model after table instruction fine-tuning and then fine-tune the agent using the LoRa method to obtain the general table model after agent fine-tuning.

[0021] As a preferred embodiment of the first aspect, the specific process of generating agent trajectory data in step S21 is as follows: the table instruction data is filled into the pre-constructed React few-shot prompt words, the prompt learning method inputs the filled React few-shot prompt words into the large language model, the large language model generates the problem analysis process and the tools and parameters called, the agent calls the relevant tools and returns the tool call results to the large language model, 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.

[0022] As a preferred embodiment of the first aspect mentioned above, the specific process of step S3 is as follows:

[0023] S31. Input the questions to be answered, the table file, and the pre-built prompts into the general table model after fine-tuning the agent, and let the user specify the question type; wherein, the table file is an Excel file or a database file, and the question type is specifically table question answering, table reasoning, database question answering, table operation, and chart generation;

[0024] S32. The general table model, fine-tuned by the agent, determines whether the agent needs to call a tool based on the user-specified question type: if no tool is needed, the general table model outputs the question answer; if a tool is needed, the general table model outputs the type of tool to be called and the question analysis process. Different tools are configured for the agent, which calls various tools based on the general table model and returns the tool call results to the general table model. The general table model then regenerates the question analysis process and finally outputs the question answer.

[0025] As a preferred embodiment of the first aspect mentioned above, in step S32, the tools invoked by the agent include a Python interpreter, an SQL executor, an Excel column name lookup tool, a database table lookup tool, a line chart generation tool, and a bar chart generation tool.

[0026] As a preferred embodiment of the first aspect mentioned above, the large model of the base adopts LLaMa.

[0027] Secondly, the present invention provides a question-answering system based on a general table model and a data intelligence agent, comprising:

[0028] The table instruction fine-tuning module is used to acquire and process open-source datasets of different types of table tasks, generate table instruction datasets, and fine-tune the base large model on the table instruction datasets to obtain a general table large model after table instruction fine-tuning.

[0029] The agent fine-tuning module is used to generate a data agent instruction dataset based on a partial open-source dataset of table tasks. The general table model after the table instruction fine-tuning is then fine-tuned 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 question and table file to be generated, along with the pre-built prompts, into the general table model after the agent is fine-tuned. When the agent does not need to call the tool, the general table model after the agent is fine-tuned will output the question answer. When the agent needs to call the tool, the general table model after the agent is fine-tuned will interact with the agent to finally obtain the question answer.

[0031] Thirdly, the present invention provides a computer electronic device, which includes a memory and a processor;

[0032] The memory is used to store computer programs;

[0033] The processor is configured to, when executing the computer program, implement the question-answering method based on a general table-based large model and data agent as described in any of the first aspects above.

[0034] Compared with the prior art, the present invention has the following advantages:

[0035] The general table model of this invention enables large language models to fully understand table information and call relevant tools to process table tasks. Compared with traditional methods, this invention solves various problems in the table domain with only a single general table model, exhibiting stronger generalization ability and being closer to practical application. Attached Figure Description

[0036] Figure 1 This is a flowchart of the steps of the method of the present invention;

[0037] Figure 2 This is a flowchart of the table instruction fine-tuning and agent fine-tuning of the present invention;

[0038] Figure 3 This is a flowchart illustrating the specific process of the data intelligent agent in this invention processing table tasks.

[0039] Figure 4 This is a system block diagram of the present invention. Detailed Implementation

[0040] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of the present invention. However, the present invention can be practiced in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. Technical features in various embodiments of the present invention can be combined accordingly without mutual conflict.

[0041] In the description of this invention, it should be understood that the terms "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first" and "second" may explicitly or implicitly include at least one of those features.

[0042] like Figure 1 As shown, in a preferred embodiment of the present invention, the question-answering method based on the general table model and data agent mainly comprises the following three sub-tasks: table instruction fine-tuning, agent fine-tuning, and data agent processing of table tasks, including the following steps S1 to S3. The specific implementation process of each is described in detail below.

[0043] I. Fine-tuning of table instructions

[0044] S1. Obtain and process open-source datasets of different types of table tasks, generate a table instruction dataset, fine-tune the base large model on the table instruction dataset, and obtain a general table large model after table instruction fine-tuning.

[0045] It should be noted that in step S1 of the present invention, the table tasks mainly include table question answering, natural language SQL generation, table text generation, data analysis, and table entity alignment.

[0046] It should be noted that in step S1 of this embodiment of the invention, the open-source datasets 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. Process the open-source labeled data in the open-source dataset, and generate table instruction data from the processed open-source labeled data based on a specific sample format. The specific sample format fields are [instruction; table; question; answer];

[0048] S12. The instructions in the table instruction data are rewritten by the large language model, and the tables, questions and answers in the table instruction data are augmented by the large language model.

[0049] It should be noted that in step S12 of the present invention, a large model such as GPT-4 is specifically used to complete the instruction rewriting and data augmentation process for tables, questions and answers. The advantage of this is that it increases the diversity of table instruction data and enhances the generalization ability of the general table model.

[0050] S13. Generate a table instruction dataset from the processed table instruction data, and fine-tune the base large model on the table instruction dataset using the LoRa method to obtain the general table large model after table instruction fine-tuning.

[0051] It should be noted that in step S13 of this embodiment of the invention, LLaMa is specifically used as the base large model. After LoRa fine-tuning, a general table large model after table command fine-tuning is obtained (i.e., Figure 2 The general table model v1).

[0052] II. Agent Fine-tuning

[0053] S2. Generate a data agent instruction dataset based on the open-source dataset of some table tasks. On the data agent instruction dataset, perform agent fine-tuning on the general table model after fine-tuning the table instructions, so that the general table model can obtain the tool calling ability, and obtain the general table 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 an open-source dataset for a partial table task, generate agent trajectory data using a cue-based learning method and a large language model and React inference framework.

[0056] It should be noted that the React inference framework mentioned in step S21 of this invention is an inference framework based on few-shot learning and contextual learning. Its core is the creation of question-answering examples, and its implementation method belongs to existing technology. In the React inference framework, "thinking," "acting," and "observing" are the core operational steps within the framework, used to efficiently execute inference tasks for 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 a large language model.

[0058] It should be noted that, in step S21 of this embodiment of the invention, the specific method for generating agent trajectory data is as follows: the table instruction data is filled into the pre-constructed React few-shot prompt words, the prompt learning method inputs the filled React few-shot prompt words into the large language model, the large language model generates the problem analysis process and the tools and parameters called, the agent calls the relevant tools and returns the tool call results to the large language model, 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.

[0059] S22. Evaluate whether the answer generated by the large language model is correct: if correct, retain it and finally obtain the processed agent trajectory data; if incorrect, filter it out. Verify whether there are duplicate or illogical tool call steps in the problem analysis process generated by the large language model: if there are, filter them out; if not, retain them and finally obtain the processed agent trajectory data.

[0060] S23. Generate a data agent instruction dataset from the processed agent trajectory data. Then, fine-tune the general table model based on the table instructions on the data agent instruction dataset using the LoRa method to obtain the fine-tuned general table model (i.e.,...). Figure 2 The general table large model v2).

[0061] III. Data Agent Processing Table Tasks

[0062] S3. Input the question to be answered, the table file, and the pre-built prompts into the general table model after the agent is fine-tuned. When the agent does not need to call the tool, the general table model after the agent is fine-tuned will output the answer to the question. When the agent needs to call the tool, the general table model after the agent is fine-tuned will interact with the agent to finally obtain 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 questions to be answered, the table file, and the pre-built prompts into the general table model after fine-tuning the agent, and let the user specify the question type; wherein, the table file is an Excel file or a database file, and the question type is specifically table question answering, table reasoning, database question answering, table operation, and chart generation;

[0065] S32. The general table model, fine-tuned by the agent, determines whether the agent needs to call a tool based on the user-specified question type: if no tool is needed, the general table model outputs the answer; if a tool is needed, the general table model outputs the type of tool to be called and the question analysis process. Different tools are configured for the agent, which calls various tools based on the general table model and returns the tool call results to the general table model. The general table model then regenerates the question analysis process and finally outputs the answer. The tools called include a Python interpreter, an SQL executor, an Excel column name lookup tool, a database table lookup tool, a line chart generator, and a bar chart generator.

[0066] To better demonstrate the specific implementation and technical effects of the present invention, the question-answering method based on the general table large model and data intelligence agent shown in steps S1 to S3 of the above preferred implementation is applied to a specific example.

[0067] Example

[0068] The question-answering method based on a general table model and data intelligence agent used in this embodiment is implemented as described above and will not be repeated here.

[0069] In this embodiment, as shown below, a specific example of solving table-based reasoning using a data intelligence agent is given: For the question, "How many patents are in the 'under review' legal status?", the question type is table-based reasoning. The table mentioned is: Patent Information.xlsx.

[0070] I. Prompt word generation

[0071] The question and form path will be entered into the prompt template to generate complete prompts. The prompts provided to the general form model are 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. The input should be a valid Python command. If you want to see the output of a specific value, you should use `print(...)` to print it out. `QueryColumns(file_path: str) -> str` - Query columns in an Excel file. Use the following format:

[0073] Questions: Input questions you must answer

[0074] Reflection: You should always consider what you need to do.

[0075] Action: The action to be taken should be one of [python_repl, QueryColumns].

[0076] Action input: Input of actions

[0077] Observation: The results of the 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 problem.

[0081] start!

[0082] Problem: Solve a question-answering task based on a given data file.

[0083] Data file path: patent information.xlsx

[0084] Question: How many patents are currently in the "under examination" legal status?

[0085] II. Data-driven intelligent agent reasoning

[0086] Based on the above prompts, the general table model outputs "<Thinking>"I need to query the relevant column names in the table.", followed by "<Action>"Action: QueryColumns Action Input: "Patent Information.xlsx"", where Action is the tool name, Action Input is the tool parameters, and this tool is for viewing the column names of the Excel table.

[0087] Running this tool yields the <Observation> "['Serial Number', 'Patent Name', 'Patent Type', 'Legal Status', 'Application Number', 'Application Date', 'Publication (Announcement) Number', 'Publication (Announcement) Date']", which serves as the column name for this table.

[0088] Continuing the iteration, the thought process is generated: "I need to use the 'Legal Status' column to calculate the number of companies under review." The action output is: "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 code is executed by calling the python_repl tool. The result is <Observation> "4".

[0095] Continuing the iteration, the following thought is generated: "I now know the number of companies in the data file whose legal status is 'under review'." The final answer is: "There are 4 companies whose legal status is 'under review'."

[0096] In summary, the aforementioned data intelligence agent solves the table reasoning problem by generating thought processes, calling upon tools, observing results, and invoking a general table model to ultimately resolve the issue.

[0097] It should also be noted that the question-answering method based on the general table model and data intelligence agent in the above embodiments 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 model and data intelligence agent, corresponding to the question-answering method based on the general table model and data intelligence agent provided in the above embodiments, such as... Figure 4 As shown, it includes:

[0098] The table instruction fine-tuning module is used to acquire and process open-source datasets of different types of table tasks, generate table instruction datasets, and fine-tune the base large model on the table instruction datasets to obtain a general table large model after table instruction fine-tuning.

[0099] The agent fine-tuning module is used to generate a data agent instruction dataset based on a partial open-source dataset of table tasks. The general table model after the table instruction fine-tuning is then fine-tuned on the data agent instruction dataset to obtain the general table model after agent fine-tuning.

[0100] The result acquisition module is used to input the question and table file to be generated, along with the pre-built prompts, into the general table model after the agent is fine-tuned. When the agent does not need to call the tool, the general table model after the agent is fine-tuned will output the question answer. When the agent needs to call the tool, the general table model after the agent is fine-tuned will interact with the agent to finally obtain the question answer.

[0101] 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 large model and data intelligent agent provided in the above embodiments, which includes a memory and a processor;

[0102] The memory is used to store computer programs;

[0103] The processor is configured to implement the question-answering method based on a general table model and data intelligence agent in the above embodiments when executing the computer program.

[0104] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0105] It is understood that the processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0106] It should also be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. In the embodiments provided in this application, the division of steps or modules in the system and method is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple modules or steps may be combined or integrated together, and a module or step may also be split.

[0107] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the invention. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, all technical solutions obtained through equivalent substitution or transformation fall 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 agent. When the agent does not need to call the tool, the general table model fine-tuned by the agent outputs the answer to the question. When the agent needs to call the tool, the general table model fine-tuned by the agent interacts with the agent to finally obtain the answer to the question. In step S1, the table tasks are specifically table question answering, natural language generation of SQL, table text generation, data analysis, and table entity alignment; 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 fine-tune the table instruction on the base large model by the Lora method on the table instruction data set to obtain a general table large model after fine-tuning the table instruction; 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.

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 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.

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 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.

4. A question-answering method based on a general table model and a data agent as claimed in claim 3, 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.

5. 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.

6. 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 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 obtain the answer to the question. In the table instruction fine-tuning module, table tasks include table question answering, natural language generation of SQL, table text generation, data analysis, and table entity alignment; The specific process in the table instruction fine-tuning module 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 fine-tune the table instruction on the base large model by the Lora method on the table instruction data set to obtain a general table large model after fine-tuning the table instruction; The specific process in the agent fine-tuning module 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.

7. 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 5 when executing the computer program.

Citation Information

Patent Citations

  • Railway industry intelligent question and answer assistant system

    CN117633179A

  • Aerial document analysis and test case generation system driven by large model agent

    CN117909243A