Table data reasoning method and device, electronic equipment and computer storage medium
By adopting a full programming method with standardized analytical thinking and a large language model to generate operation chains in tabular data inference, the problems of logical division and operation space limitations in the existing technology are solved, and a highly accurate and trustworthy tabular data inference effect is achieved.
Patent Information
- Application Number
- CN202411899208.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
There is non-standard logical division and highly limited operation space for the use of symbolic tools in the prior art, making it difficult to effectively deal with complex tabular data inference tasks.
The full programming method based on standardized analytical thinking is adopted to divide the table data understanding and reasoning process into standardized stages according to the thinking of human analysts, and expand the way programming execution intermediate reasoning steps to the entire table reasoning process. The large language model is used to generate operation chains and executable code, execute and update the table state through the interpreter until the answer to the question is generated.
It realizes a highly accurate, trustworthy and fully executable code process, provides high-quality analysis results, and expands the operation space of the tabular reasoning process, avoiding misleading errors in traditional methods.
Smart Images

Figure CN119740670A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and computer storage medium for inference of tabular data. Background Art
[0002] As a special form of data, tabular data is widely used in various scientific and technological documents to convey important information to readers intuitively and clearly. With the substantial increase in the total amount of tabular data used in life and the vigorous development of artificial intelligence technology, the demand for automated processing of tabular data is increasing day by day. In recent years, the multi-step prompting method of large language models has gradually replaced the model training paradigm of traditional deep learning, which has greatly improved the understanding and reasoning process in a series of downstream tabular tasks.
[0003] In the research of this field, an important trend is to introduce symbolic tools (such as database software, high-level programming languages, etc.) to assist the tabular reasoning process, so as to reduce the bias of large language models when storing and memorizing two-dimensional structured tabular data, and avoid the generation of misleading erroneous intermediate results in the process of complex logical and arithmetic operations.
[0004] However, the use of symbolic tools in the prior art still has the following defects: non-standard logical division and highly limited operating space. Summary of the invention
[0005] In view of this, the present application provides a method, device, electronic device and computer storage medium for reasoning of tabular data, which is a full programming method based on standardized analytical thinking. The overall table understanding and reasoning process is divided into standardized stages according to the thinking of human analysts, and the way of programming to execute intermediate reasoning steps is expanded to the entire table reasoning process, and their scope of use is no longer limited.
[0006] The first aspect of the present application provides a method for inferring tabular data, comprising:
[0007] Receive forms, questions and stage goals;
[0008] Input the table, the question and the stage goal into a large language model, and output an operation chain required to complete the stage goal; wherein the operation chain includes at least one operation;
[0009] Input the operation, the table, the question and the code base into a large language model, and output a first executable code;
[0010] Executing the first executable code using an interpreter to obtain feedback information;
[0011] If the feedback information is error information, the interpreter is reset to a state before executing the first executable code;
[0012] Inputting the error information and historical dialogue information into a large language model, and outputting a second executable code;
[0013] The second executable code is used as a new first executable code, and the step of executing the first executable code by using the interpreter to obtain feedback information is returned until the interpreter no longer feeds back error information;
[0014] If the feedback information is not an error message, adding the first executable code as a target executable code to the code base, and updating the state of the table based on the table variables of the interpreter at the current moment;
[0015] The table after the updated state is used as a new table, and the next operation in the operation chain is selected to perform the step of inputting the operation, the table, the question and the code base into the large language model and outputting a first executable code, until all operations in the operation chain complete the generation of the target executable code;
[0016] When all operations in the operation chain complete the generation of the target executable code, the answer to the question is generated according to the code base containing all the target executable codes.
[0017] Optionally, before inputting the table, the question and the stage goal into the large language model and outputting an operation chain required to complete the stage goal, the method further includes:
[0018] The table data is read and stored in a data structure built into the programming language.
[0019] Optionally, before inputting the table, the question and the stage goal into the large language model and outputting an operation chain required to complete the stage goal, the method further includes:
[0020] Redundant rows in the table are removed.
[0021] Optionally, before inputting the table, the question and the stage goal into the large language model and outputting an operation chain required to complete the stage goal, the method further includes:
[0022] Correct and adjust the data type of each column in the table.
[0023] A second aspect of the present application provides an inference device for tabular data, comprising:
[0024] Receiving unit, used to receive forms, questions and stage goals;
[0025] An operation chain generating unit, used for inputting the table, the question and the stage goal into a large language model, and outputting an operation chain required to complete the stage goal; wherein the operation chain includes at least one operation;
[0026] A first executable code generating unit, configured to input the operation, the table, the question and the code base into a large language model, and output a first executable code;
[0027] A code execution unit, configured to execute the first executable code using an interpreter to obtain feedback information;
[0028] a reset unit, configured to reset the interpreter to a state before executing the first executable code if the feedback information is error information;
[0029] A second executable code generating unit, used for inputting the error information and the historical dialogue information into a large language model, and outputting a second executable code;
[0030] A first activation unit is used to use the second executable code as a new first executable code, activate the code execution unit to execute the first executable code by using the interpreter, and obtain feedback information until the interpreter no longer feeds back error information;
[0031] An updating unit, configured to add the first executable code as a target executable code to a code base if the feedback information is not error information, and update a state of the table based on a table variable of the interpreter at a current moment;
[0032] a second activation unit, configured to use the table after the updated state as a new table, select the next operation in the operation chain, activate the first executable code generation unit to execute the operation, the table, the question and the code base input into the large language model, and output the first executable code until all operations in the operation chain complete the generation of the target executable code;
[0033] The answer generation unit is used to generate the answer to the question according to the code base containing all the target executable codes after all the operations in the operation chain complete the generation of the target executable codes.
[0034] Optionally, the inference device for the tabular data further includes:
[0035] The storage unit is used to read the table data and store the table data in a data structure built into the program language.
[0036] Optionally, the inference device for the tabular data further includes:
[0037] The removing unit is used to remove redundant rows in the table.
[0038] Optionally, the inference device for the tabular data further includes:
[0039] The adjustment unit is used to correct and adjust the data type of each column in the table.
[0040] A third aspect of the present application provides an electronic device, including:
[0041] one or more processors;
[0042] a storage device having one or more programs stored thereon;
[0043] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for reasoning about tabular data as described in any one of the first aspects.
[0044] A fourth aspect of the present application provides a computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for inferring tabular data as described in any one of the first aspects is implemented.
[0045] As can be seen from the above scheme, the present application provides a method, device, electronic device and computer storage medium for reasoning of tabular data. After receiving a table, a question and a stage goal, a large language model is used to generate an operation chain required to complete the stage goal; wherein the operation chain includes at least one operation; then, the operation, the table, the question and the code base are input into the large language model, and the first executable code is output; the first executable code is executed by the interpreter to obtain feedback information; and the target executable code is determined according to the feedback information, added to the code base, and the state of the table is updated based on the table variables of the interpreter at the current moment; when all operations in the operation chain complete the generation of the target executable code, the answer to the question is generated according to the code base containing all the target executable codes. Through a full programming method based on standardized analytical thinking, the overall table understanding and reasoning process is divided into standardized stages according to the thinking of human analysts, and the way of programming execution of intermediate reasoning steps is extended to the entire table reasoning process, and their scope of use is no longer limited. In addition, through efficient logical division of the entire reasoning process and complete code execution, the framework can provide high-accuracy, strong credibility and fully executable code flow while giving high-quality analysis results based on user problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0047] Figure 1 A specific flow chart of a method for reasoning about tabular data provided in an embodiment of the present application;
[0048] Figure 2 An architectural diagram of a method for implementing reasoning of tabular data provided in another embodiment of the present application;
[0049] Figure 3 A schematic diagram of a table data inference device provided in another embodiment of the present application;
[0050] Figure 4 A schematic diagram of an electronic device for implementing a method for reasoning about tabular data provided in another embodiment of the present application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0052] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0053] It should be noted that the 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 laws, regulations and standards of relevant countries and regions.
[0054] It should be noted that the concepts such as "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0055] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0056] All steps of the overall process of table reasoning involved in this application are implemented through code execution to replace the traditional large language model result generation mode. The overall framework integrates a large language model, which is responsible for planning specific steps for each stage and generating corresponding executable code for each step; it also integrates an interpreter to execute the generated code in real time and provide feedback in a timely manner, such as Figure 1 As shown, the embodiment of the present application provides a method for reasoning about table data, which specifically includes the following steps:
[0057] S101. Receive forms, questions and stage goals.
[0058] Specifically, in the implementation process of this application, any table and any problem can be given, and a stage goal can be set for each stage, requiring planning and execution within each stage based on the stage goal.
[0059] It should be noted that the stage goals can be macro goals and are not limited here.
[0060] S102, input the table, questions and stage goals into the large language model, and output the operation chain required to complete the stage goals.
[0061] The operation chain includes at least one operation.
[0062] It should be noted that based on the reasoning ability of the large language model, the thought chain reasoning method can be used to perform fine-grained planning for each stage goal and generate an operation chain that can achieve the stage goal. The large language model L can generate a text output y that conforms to the input instruction based on the semantic information of the text input x and the historical conversation information R, that is, y=L(x|R). The text output can then be processed as a string to extract the result that conforms to a specific format. In the actual application process of this application, any general open source model with strong planning and code generation capabilities can be used as the base of the large model without retraining. When R=Ø below, it indicates that the historical conversation information is not retained, otherwise the input will be asked again based on the previous conversation information by default.
[0063] Specifically, the table T, question Q and stage goal G are input into the large language model L, and its powerful problem decomposition and reasoning capabilities are used to generate an operation chain O={o1,o2,...,o n}.
[0064] For example: the input x of a large language model is [ <text1> ,T; <text2> ,Q; <text3> ,G; <instruct>],in <text1>Can be "Given the following table:", <text2>It can be "Now you need to find the answer to the following question" or "Now you need to verify the truth of the following proposition", <text3>The macro goal of this stage is <instruct>Please generate an operation chain in the following format: <start>->[OP1]->[OP2]->...-> <end>Based on the above input, the large model will generate a text output y=L(x|Ø) containing the required operation chain. Simple string processing on y can extract the operation chain O.
[0065] S103: Input the operation, table, question and code base into the large language model, and output a first executable code.
[0066] The code generation capability of the large language model is utilized to generate executable code c, that is, the first executable code, which is adapted to the current operation o and can be connected to the existing code base C according to the operation sequence.
[0067] It should be noted that in the case of operation o i During the execution process, o1, o2, ..., o i-1 The code base.
[0068] Specifically, for the operation chain O={o1,o2,...,o n }, we will sequentially target the current operation o i , o i Belong to O, the current table T, question Q, code base C i ={c1,c2,...,c i-1 } and input the large language model L, using its powerful code generation capabilities to generate the adapted executable code c i .
[0069] For example: the input x of a large language model is [ <text1> ,T; <text2> ,Q; <text3> ,C i ; <text4> ,o i ; <instruct>],in <text1>Can be "Given the following table:", <text2>It can be "Now you need to find the answer to the following question" or "Now you need to verify the truth of the following proposition", <text3>The following code has been generated. <text4>It can be "The following operations need to be performed now", <instruct>Please generate executable code that can continue the current operation of the code base. Based on the above input, the large model will generate a text output y=L(x|Ø) containing the required code. Simple string processing on y can extract the code c i .
[0070] S104: Utilize the interpreter to execute the first executable code and obtain feedback information.
[0071] The interpreter may be a programming language interpreter, which is not limited here.
[0072] In the specific implementation process of this application, a Python language interpreter can be used, which is an interpreter officially released by Python, to simulate a real programming environment and execute the generated first executable code, whose output can be used for intermediate feedback and recording of the final answer A.
[0073] S105. If the feedback information is an error message, the interpreter is reset to the state before executing the first executable code.
[0074] Here, the state before the execution of the first executable code is reset to that before the execution of the first executable code, that is, the state where only the code base C has been executed. In the specific implementation process, this process only requires reinitializing the interpreter and executing C. i That's it.
[0075] S106: Input the error information and historical dialogue information into the large language model, and output a second executable code.
[0076] For example: the input x of a large language model is [ <text1> ,c i ; <text2> ,e; <instruct>], where e is the error message, <text1>The code that can be generated for "the following:", <text2>Can be "The following error message was returned after execution", <instruct>Please regenerate executable code for the requested operation. Based on the above input, the large model will generate a text output y=L(x|R) containing the required code. Simple string processing on y can extract the regenerated code c i , that is, the second executable code.
[0077] S107: Use the second executable code as a new first executable code.
[0078] Specifically, the second executable code is used as the new first executable code, and the step of executing the first executable code by using the interpreter to obtain feedback information is returned until the interpreter no longer feeds back error information.
[0079] S108. If the feedback information is not an error message, the first executable code is added to the code base as the target executable code, and the state of the table is updated based on the table variables of the interpreter at the current moment.
[0080] Specifically, the target executable code c i Added to code base C i Middle, i.e. C i +1←C i ∪{c i }.
[0081] S109: Use the table after the updated state as a new table, and select the next operation in the operation chain.
[0082] Specifically, the table after the updated state is used as a new table, and the next operation in the operation chain is selected to input the operation, table, question and code base into the large language model, and output the first executable code step until all operations in the operation chain complete the generation of the target executable code.
[0083] S110: When all operations in the operation chain complete the generation of the target executable code, an answer to the question is generated according to a code base including all the target executable codes.
[0084] Specifically, when all operations in the operation chain have completed the generation of the target executable code, the post-processing stage is entered to record the answer output by the code base containing all the target executable codes, and the entire process ends. That is, the intermediate results of the previous stages are integrated to generate the final answer to the output question Q.
[0085] It should be noted that the post-processing stage will also generate an operation chain O, but the last operation o must be the code that outputs the generated answer. After this stage, the answer generated by the code execution will be recorded and the entire process will end.
[0086] Through the planning and execution of each stage, this application can finally output a highly accurate answer to a given question, and at the same time provide a highly accurate, highly reliable, and fully executable code flow. Overall, the method proposed in this application has strong effectiveness and interpretability.
[0087] Optionally, in another embodiment of the present application, an implementation of the method for inferring tabular data further includes:
[0088] Read the table data and store it in the data structure built into the programming language, waiting for subsequent analysis and processing.
[0089] Optionally, in another embodiment of the present application, an implementation of the method for inferring tabular data further includes:
[0090] Remove redundant rows from the table.
[0091] It is understood that redundant rows do not represent independent table records and are not relevant to the given problem.
[0092] Optionally, in another embodiment of the present application, an implementation of the method for inferring tabular data further includes:
[0093] Correct and adjust the data types of each column in the table to facilitate subsequent reasoning and analysis.
[0094] like Figure 2 As shown, it is an architecture diagram of a method for implementing reasoning of tabular data provided by an embodiment of the present application, which includes five main stages, namely, the initialization stage, the record screening stage, the data type cleaning stage, the reasoning stage, and the post-processing output stage. The initialization stage reads the tabular data and stores the tabular data in the data structure built into the programming language, waiting for subsequent analysis and processing. The record screening stage removes redundant rows in the table. The data type cleaning stage corrects and adjusts the data type of each column in the table for subsequent reasoning analysis. After the large language model receives the table, question, and stage goal, it outputs the operation chain required to complete the stage goal, and then inputs the operation, table, question, and code base into the large language model, and outputs the first executable code; the first executable code is executed by the interpreter to obtain feedback information; if the feedback information is an error message, the interpreter is reset to the state before the first executable code is executed; the error message and historical dialogue information are input into the large language model, and the second executable code is output; the second executable code is used as the new first executable code, and the execution returns to the step of executing the first executable code by the interpreter to obtain feedback information until the interpreter no longer feedbacks error message; if the feedback information is not an error message, add the first executable code as the target executable code to the code base, and update the state of the table based on the table variables of the interpreter at the current moment; use the table after the updated state as a new table, and select the next operation in the operation chain, execute the operation, table, question and code base into the large language model, and output the first executable code step until all operations in the operation chain complete the generation of the target executable code; when all operations in the operation chain complete the generation of the target executable code, enter the post-processing stage, and generate the answer to the question according to the code base containing all the target executable codes.
[0095] From the above scheme, it can be seen that this application provides a method for reasoning about tabular data. Through a full programming method based on standardized analytical thinking, the overall table understanding and reasoning process is divided into standardized stages according to the thinking of human analysts, and the way of programming to execute intermediate reasoning steps is extended to the entire table reasoning process, and their scope of use is no longer limited. In addition, through the efficient logical division of the entire reasoning process and full code execution, the framework can provide high-quality analysis results based on user problems while also providing highly accurate, highly reliable, and fully executable code processes.
[0096] The present application embodiment provides a table data reasoning device, such as Figure 3 As shown, including:
[0097] The receiving unit 301 is used to receive forms, questions and stage goals.
[0098] The operation chain generation unit 302 is used to input the table, question and stage goal into the large language model, and output the operation chain required to complete the stage goal.
[0099] The operation chain includes at least one operation.
[0100] The first executable code generating unit 303 is used to input operations, tables, questions and code bases into the large language model, and output a first executable code.
[0101] The code execution unit 304 is used to execute the first executable code using the interpreter to obtain feedback information.
[0102] The reset unit 305 is used to reset the interpreter to the state before executing the first executable code if the feedback information is error information.
[0103] The second executable code generating unit 306 is used to input the error information and the historical dialogue information into the large language model, and output a second executable code.
[0104] The first activation unit 307 is used to use the second executable code as a new first executable code, activate the code execution unit to execute the first executable code using the interpreter, and obtain feedback information until the interpreter no longer feeds back error information.
[0105] The updating unit 308 is used to add the first executable code as the target executable code to the code base if the feedback information is not error information, and update the state of the table based on the table variables of the interpreter at the current moment.
[0106] The second activation unit 309 is used to use the table after the updated state as a new table, select the next operation in the operation chain, activate the first executable code generation unit to input the operation, table, question and code base into the large language model, and output the first executable code until all operations in the operation chain complete the generation of the target executable code.
[0107] The answer generation unit 310 is used to generate an answer to the question according to a code base including all target executable codes after all operations in the operation chain complete the generation of the target executable codes.
[0108] For the specific working process of the units disclosed in the above embodiments of the present application, please refer to the corresponding method embodiments, such as Figure 1 As shown, no further description is given here.
[0109] Optionally, in another embodiment of the present application, an implementation of the inference device for table data further includes:
[0110] The storage unit is used to read the table data and store the table data into the data structure built into the programming language.
[0111] The specific working process of the units disclosed in the above embodiments of the present application can be found in the corresponding method embodiments, which will not be repeated here.
[0112] Optionally, in another embodiment of the present application, an implementation of the inference device for table data further includes:
[0113] The removal unit is used to remove redundant rows in the table.
[0114] The specific working process of the units disclosed in the above embodiments of the present application can be found in the corresponding method embodiments, which will not be repeated here.
[0115] Optionally, in another embodiment of the present application, an implementation of the inference device for table data further includes:
[0116] The adjustment unit is used to correct and adjust the data type of each column in the table.
[0117] The specific working process of the units disclosed in the above embodiments of the present application can be found in the corresponding method embodiments, which will not be repeated here.
[0118] As can be seen from the above scheme, the present application provides a reasoning device for tabular data. After receiving the table, question and stage goal, the large language model is used to generate the operation chain required to complete the stage goal; wherein the operation chain includes at least one operation; then, the operation, table, question and code base are input into the large language model, and the first executable code is output; the first executable code is executed by the interpreter to obtain feedback information; and the target executable code is determined according to the feedback information, added to the code base, and the state of the table is updated based on the table variables of the interpreter at the current moment; when all operations in the operation chain complete the generation of the target executable code, the answer to the question is generated according to the code base containing all the target executable codes. Through the full programming method based on standardized analytical thinking, the overall table understanding and reasoning process is divided into standardized stages according to the thinking of human analysts, and the way of programming execution of intermediate reasoning steps is extended to the entire table reasoning process, and their scope of use is no longer limited. In addition, through the efficient logical division of the entire reasoning process and the complete code execution, the framework can provide high-accuracy, strong credibility and fully executable code flow while giving high-quality analysis results based on user problems.
[0119] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0120] Another embodiment of the present application provides an electronic device, such as Figure 4 As shown, including:
[0121] One or more processors 401 .
[0122] The storage device 402 stores one or more programs.
[0123] When the one or more programs are executed by the one or more processors 401 , the one or more processors 401 implement the method for inferring tabular data as described in any one of the above embodiments.
[0124] Another embodiment of the present application provides a computer storage medium on which a computer program is stored, wherein when the computer program is executed by a processor, the method for inferring tabular data as described in any one of the above embodiments is implemented.
[0125] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0126] It should be noted that the computer-readable medium mentioned above in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0127] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0128] Another embodiment of the present application provides a computer program product. When the computer program product is executed, it is used to perform the above-mentioned method for reasoning about tabular data.
[0129] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, the above-mentioned functions defined in the method of the embodiment of the present application are executed.
[0130] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in this application is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing this application.
[0131] Although several specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present application. Certain features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination.
[0132] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of application involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above application concept. For example, the above features are replaced with (but not limited to) technical features with similar functions applied in the present application.< / instruct> < / instruct> < / text2> < / text1> < / instruct> < / instruct> < / text4> < / text3> < / text2> < / text1> < / end> < / start> < / instruct> < / instruct> < / text3> < / text2> < / text1>
Claims
1. A method for inference of tabular data, characterized in that: include: Receive forms, questions and stage goals; Input the table, the question and the stage goal into a large language model, and output an operation chain required to complete the stage goal; wherein the operation chain includes at least one operation; Input the operation, the table, the question and the code base into a large language model, and output a first executable code; Executing the first executable code using an interpreter to obtain feedback information; If the feedback information is error information, the interpreter is reset to a state before executing the first executable code; Inputting the error information and historical dialogue information into a large language model, and outputting a second executable code; The second executable code is used as a new first executable code, and the step of executing the first executable code by using the interpreter to obtain feedback information is returned until the interpreter no longer feeds back error information; If the feedback information is not an error message, adding the first executable code as a target executable code to the code base, and updating the state of the table based on the table variables of the interpreter at the current moment; The table after the updated state is used as a new table, and the next operation in the operation chain is selected to perform the step of inputting the operation, the table, the question and the code base into the large language model and outputting a first executable code, until all operations in the operation chain complete the generation of the target executable code; When all operations in the operation chain complete the generation of the target executable code, the answer to the question is generated according to the code base containing all the target executable codes.
2. The method for inferring tabular data according to claim 1, characterized in that: Before inputting the table, the question and the stage goal into the large language model and outputting the operation chain required to complete the stage goal, the method further includes: The table data is read and stored in a data structure built into the programming language.
3. The method for inferring tabular data according to claim 1, characterized in that: Before inputting the table, the question and the stage goal into the large language model and outputting the operation chain required to complete the stage goal, the method further includes: Redundant rows in the table are removed.
4. The method for inferring tabular data according to claim 1, characterized in that: Before inputting the table, the question and the stage goal into the large language model and outputting the operation chain required to complete the stage goal, the method further includes: Correct and adjust the data type of each column in the table.
5. A tabular data inference device, characterized in that: include: Receiving unit, used to receive forms, questions and stage goals; An operation chain generating unit, used for inputting the table, the question and the stage goal into a large language model, and outputting an operation chain required to complete the stage goal; wherein the operation chain includes at least one operation; A first executable code generating unit, configured to input the operation, the table, the question and the code base into a large language model, and output a first executable code; A code execution unit, configured to execute the first executable code using an interpreter to obtain feedback information; a reset unit, configured to reset the interpreter to a state before executing the first executable code if the feedback information is error information; A second executable code generating unit, used for inputting the error information and the historical dialogue information into a large language model, and outputting a second executable code; A first activation unit is used to use the second executable code as a new first executable code, activate the code execution unit to execute the first executable code by using the interpreter, and obtain feedback information until the interpreter no longer feeds back error information; An updating unit, configured to add the first executable code as a target executable code to a code base if the feedback information is not error information, and update a state of the table based on a table variable of the interpreter at a current moment; a second activation unit, configured to use the table after the updated state as a new table, select the next operation in the operation chain, activate the first executable code generation unit to execute the operation, the table, the question and the code base input into the large language model, and output the first executable code until all operations in the operation chain complete the generation of the target executable code; The answer generation unit is used to generate the answer to the question according to the code base containing all the target executable codes after all the operations in the operation chain complete the generation of the target executable codes.
6. The inference device for tabular data according to claim 5, characterized in that: Also includes: The storage unit is used to read the table data and store the table data in a data structure built into the program language.
7. The inference device for tabular data according to claim 5, characterized in that: Also includes: The removing unit is used to remove redundant rows in the table.
8. The inference device for tabular data according to claim 5, characterized in that: Before outputting the operation chain required to complete the stage objectives, it also includes: The adjustment unit is used to correct and adjust the data type of each column in the table.
9. An electronic device, characterized in that: include: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method for inferring tabular data as claimed in any one of claims 1 to 4.
10. A computer storage medium, characterized in that: A computer program is stored thereon, wherein when the computer program is executed by a processor, the method for inferring tabular data as claimed in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Table question and answer method and device, electronic equipment and storage medium
CN118626621A
Cited By
Information processing method and device based on table data, storage medium and program product
CN121681618A