Question and answer method, device, equipment and storage medium

By extracting table information and generating prompt words, and using big models to generate and run codes, the problems of inflexible and inefficient table question and answer system in the existing technology are solved, and efficient and accurate question and answer capabilities are achieved.

CN119761499APending Publication Date: 2025-04-04CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411782319.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

In the prior art, the form Q&A system relies on hand-written rules and templates, resulting in inflexibility, labor and material resources, and poor Q&A effect.

Method used

By receiving user forms and questions, extracting table information, generating preset prompt words, entering a big model to generate result code, and running the code to get the target answer. If the result code verification fails, an error correction prompt word is generated to correct the error.

Benefits of technology

It improves the efficiency and accuracy of form Q&A, avoids the tedious process of manually writing rules and templates, and realizes flexible and intelligent Q&A capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119761499A_ABST
    Figure CN119761499A_ABST
Patent Text Reader

Abstract

The embodiments of the present application relate to the field of data processing technology, and specifically to a question-and-answer method, device, equipment, and storage medium, which are intended to improve the efficiency and accuracy of form question-and-answer. The method comprises: receiving a user form and a user question corresponding to the user form; generating a first prompt word according to a preset first format based on the form information extracted from the user form and the user question; inputting the first prompt word into a large model to obtain a first result code; and running the first result code to obtain a target answer corresponding to the user question.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing technology, and more specifically, to a question-answering method, apparatus, device, and storage medium. Background Art

[0002] Tabular data is widely present in various fields. Answering questions based on the content of a table is called a tabular question-answering task. In the prior art, a series of rules and templates are usually used to define how the question-answering system parses user questions, extracts data from tables, and generates questions and answers.

[0003] In the prior art, form question and answering is usually implemented by relying on manually written rules and templates. These methods are not flexible enough, waste manpower and resources, and have poor question and answering effects. Summary of the invention

[0004] The embodiments of the present application provide a question-and-answer method, apparatus, device, and storage medium, which aim to improve the efficiency and accuracy of form question-and-answer.

[0005] A first aspect of an embodiment of the present application provides a question-answering method, the method comprising: Receiving a user form and a user question corresponding to the user form; Generating a first prompt word in a preset first format according to the table information extracted from the user table and the user question; Inputting the first prompt word into the large model to obtain a first result code; Run the first result code to obtain the target answer corresponding to the user question.

[0006] Optionally, before running the result code to obtain a target answer corresponding to the user question, the method further includes: Performing operation verification on the first result code; If the first result code fails to be verified, a corresponding second prompt word is generated; Inputting the second prompt word into the large model to obtain a second result code; Run the second result code to obtain the target answer corresponding to the user question.

[0007] Optionally, in the case where the result code fails to run the verification, generating a corresponding second prompt word includes: If the first result code fails to run and verify, obtaining error information corresponding to the first code; The second prompt word is generated according to the error information in a preset second format.

[0008] Optionally, before generating a first prompt word in a preset first format according to the table information extracted from the user form and the user question, the method further includes: Extract information from the user table to obtain the table title, table introduction, number of rows and columns, and name of each column corresponding to the user table; Extracting data from the user table to obtain the data format of the data in each column of the user table; Extract the value with the highest occurrence frequency from the data in each column to obtain sample data; The table title, the table introduction, the number of rows and columns, the column name, the data format, and the sample data are summarized to obtain the table information.

[0009] Optionally, extracting data from the user table to obtain a data format of the data in each column of the user table includes: Read the data in each column of the user table; The data in each column of the user table is parsed using a regular expression to determine a data format corresponding to the data in each column.

[0010] Optionally, the method further comprises: The data in each column is stored according to a corresponding data format.

[0011] Optionally, generating a first prompt word in a preset first format according to the table information extracted from the user form and the user question includes: Read the table information to determine the table title, table introduction, number of rows and columns, column name, data format, and sample data contained in the table information; The table title, the table introduction, the number of rows and columns, the column name, the data format, the sample data and the user question are arranged according to a preset first format to obtain the first prompt word.

[0012] A second aspect of an embodiment of the present application provides a question-answering device, the device comprising: A question receiving module, used for receiving a user form and a user question corresponding to the user form; A first prompt word generating module, configured to generate a first prompt word in a preset first format according to the table information extracted from the user table and the user question; A first result code acquisition module, used for inputting the first prompt word into a large model to obtain a first result code; The first target answer acquisition module is used to run the first result code to obtain the target answer corresponding to the user question.

[0013] Optionally, the device further comprises: An operation verification module, used for performing operation verification on the first result code; A second prompt word generating module, used for generating a corresponding second prompt word when the first result code fails to run the verification; A second result code acquisition module, used for inputting the second prompt word into the large model to obtain a second result code; The second target answer acquisition module is used to run the second result code to obtain the target answer corresponding to the user question.

[0014] Optionally, the second prompt word generating module includes: An error information acquisition submodule, used for acquiring error information corresponding to the first code when the first result code fails to run the verification; The second prompt word generating submodule is used to generate the second prompt word according to the error information and in a preset second format.

[0015] Optionally, the device further comprises: A table information acquisition module is used to extract information from the user table, and obtain the table title, table introduction, number of rows and columns, and the name of each column corresponding to the user table; A data format acquisition module, used to extract data from the user table to obtain the data format of the data in each column of the user table; An example data extraction module is used to extract the value with the highest occurrence frequency in the data of each column to obtain example data; The table information summary module is used to summarize the table title, the table introduction, the number of rows and columns, the column name, the data format, and the sample data to obtain the table information.

[0016] Optionally, the data format acquisition module includes: A data reading submodule, used for reading the data in each column of the user table; The data format parsing submodule is used to parse the data in each column of the user table through a regular expression to determine the data format corresponding to the data in each column.

[0017] Optionally, the device further comprises: The data storage module is used to store the data in each column according to a corresponding data format.

[0018] Optionally, the first prompt word generating module includes: An information reading submodule, used for reading the table information, and determining the table title, table introduction, number of rows and columns, column name, data format, and sample data contained in the table information; The first prompt word generating submodule is used to arrange the table title, the table introduction, the number of rows and columns, the column name, the data format, the sample data and the user question according to a preset first format to obtain the first prompt word.

[0019] A third aspect of an embodiment of the present application provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps in the method described in the first aspect of the present application are implemented.

[0020] A fourth aspect of an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method described in the first aspect of the present application are implemented.

[0021] The question-and-answer method provided in the present application is adopted to receive a user form and a user question corresponding to the user form; generate a first prompt word according to a preset first format based on the table information extracted from the user form and the user question; input the first prompt word into a large model to obtain a first result code; and run the first result code to obtain a target answer corresponding to the user question.

[0022] In this method, data is extracted from user tables to obtain table information, corresponding prompt words are generated based on the table information and user questions, and then the big model is used to get the corresponding answers based on the prompt words. There is no need to answer questions through preset templates and rules. The big model is used to intelligently and flexibly answer table-based questions, and corresponding prompt words are generated through the original table and questions. Instead of directly inputting the table into the big model, the data is effectively extracted, which further improves the efficiency and accuracy of table question and answering. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0024] Figure 1 is a flow chart of a question-and-answer method proposed in one embodiment of the present application; Figure 2It is a schematic diagram of a question-and-answer process proposed in an embodiment of the present application; Figure 3 is a schematic diagram of a question-and-answer device proposed in an embodiment of the present application; Figure 4 It is a schematic diagram of an electronic device proposed in an embodiment of the present application. DETAILED DESCRIPTION

[0025] 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 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.

[0026] With the continuous development and popularization of artificial intelligence technology, large language models have made remarkable achievements in the field of natural language processing. These large models have performed well in text understanding and generation, greatly improving the performance and effectiveness of intelligent question-answering systems. Based on this background, some researchers have tried to apply large models to table question-answering tasks to improve the accuracy of table question-answering tasks. However, due to the obvious differences between table-based question-answering tasks and knowledge-based question-answering tasks, large models still face considerable challenges in table question-answering tasks.

[0027] Specifically, the types of questions that traditional question-answering systems face, such as common sense questions, factual questions, and explanatory questions, have a relatively broad knowledge system that covers a variety of topics and scenarios. Since the large model has been exposed to a large amount of training corpus covering various aspects during its pre-training phase, it has prior knowledge of these questions and can often answer them more accurately. The table question-answering system, on the other hand, is more focused on processing query questions about table data. The answers to such questions are often strictly dependent on the specific tables uploaded by the user, and it is difficult for the large model to answer them using its own prior knowledge.

[0028] refer to Figure 1 , Figure 1 : is a flow chart of a question-answering method proposed in one embodiment of the present application. Figure 1 As shown, the method comprises the following steps: S11: Receive a user form and user questions corresponding to the user form.

[0029] In this embodiment, the user form is a form uploaded by the user, and the user question is a corresponding question raised by the user with respect to the form.

[0030] In this embodiment, when executing the form question and answer task, firstly, the user form uploaded by the user and the user questions raised for the form are received.

[0031] For example, the user table may be a statistical table of the prices of various types of cars, and the corresponding user question may be "What is the cheapest model among all car models?" S12: Generate a first prompt word in a preset first format according to the table information extracted from the user form and the user question.

[0032] In this embodiment, the table information includes the table title, table introduction, number of rows and columns, column names of each column, data format, sample data, etc. The sample data is the value with the highest frequency in each column. The first prompt word is the prompt word input into the large model. The prompt word (Prompt) in the large language model is a text input method used to interact with the natural language processing model. Prompt is usually a phrase or a sentence that can start the model and generate output related to Prompt. These outputs can be a single word, a sentence, or a complete paragraph. Prompt plays an important role in the field of artificial intelligence language generation because it can help the model better understand user intentions and generate more accurate and meaningful text content. By providing a suitable Prompt, the large language model can generate natural language text related to user dialogue and simulate the interaction mode of human dialogue. Prompt can be used to generate various text content, such as copywriting, news reports, emails, etc. By adjusting Prompt, the model can generate texts of different styles and themes. In the fields of finance, law, media, etc., the large language model can complete tasks such as copywriting, translation, and code writing through Prompt to improve work efficiency. By providing accurate prompts, the model can better understand the user's intentions and needs and generate output that is more in line with user expectations. Correct prompt writing can significantly improve the quality and accuracy of generated text, ensuring that the output text is more natural and meaningful. By adjusting the prompt, users can control the output content and style of the model and achieve more refined text generation and control. ‌

[0033] In this embodiment, after receiving the user form and the user question, the user form is parsed to obtain the user form information, and the first prompt word is generated according to the preset first format. By parsing the user form, table information including the table title, table introduction, number of rows and columns, column names of each column, data format, sample data, etc. can be obtained, and then combined with the question raised by the user, the corresponding first prompt word is generated in the first preset format.

[0034] In this embodiment, the specific steps of generating the first prompt word in a preset first format according to the table information extracted from the user table and the user question include: S12-1: Read the table information to determine the table title, table introduction, number of rows and columns, column name, data format, and sample data contained in the table information.

[0035] In this embodiment, the table information is first read to determine the table title contained in the table information, the table title is used to identify what type of list the table is, the table introduction, the table introduction is a field that briefly introduces the contents of the table, the number of rows and columns is how many rows and columns there are in the table, the column name is the name of each column in the table, the data format is the format of the data in each column of the table, and the sample data is the most frequently appearing value in each column of the table.

[0036] For example, a user table has a title of "August Salary Statistics Table", a table description of "Salary Statistics of Employees in a Certain Unit in August", row and column data of "100 rows, 8 columns", column names of "basic salary, performance salary, full attendance bonus, business trip allowance,...", data formats of integer data, floating point data and other types, the sample data of the basic salary column is 8000, the sample data of the performance salary column is 5000, and so on.

[0037] S12-2: Arrange the table title, the table introduction, the number of rows and columns, the column name, the data format, the sample data, and the user question according to a preset first format to obtain the first prompt word.

[0038] In this embodiment, the obtained table title, table introduction, number of rows and columns, column name, data format, sample data and user question are arranged according to a preset first format to obtain a first prompt word.

[0039] For example, the preset first format is <existing form E, user question Q, please generate a piece of code to complete the user question>.

[0040] S13: Input the first prompt word into the large model to obtain a first result code.

[0041] In this embodiment, the large model refers to a machine learning model with large-scale parameters and complex computing structure. These models are usually built from deep neural networks and have billions or even hundreds of billions of parameters. The design purpose of the large model is to improve the expressiveness and predictive performance of the model, and to be able to handle more complex tasks and data. Large models are widely used in various fields, including natural language processing, computer vision, speech recognition, and recommendation systems. The large model learns complex patterns and features by training massive data, has a more powerful generalization ability, and can make accurate predictions for unseen data. The first result code is the code obtained by the large model based on the first prompt word, and running the code can get the answer to the question corresponding to the first prompt word.

[0042] In this embodiment, the first prompt word is input into the large model, and the large model parses the first prompt word to obtain corresponding table information and user questions, and generates a first result code in combination with the table information and user questions.

[0043] In this embodiment, when asking a question, the language type corresponding to the first result code may be required, such as C language, Python language, etc.

[0044] S14: Run the first result code to obtain a target answer corresponding to the user question.

[0045] In this embodiment, after obtaining the first result code, the first result code is executed to obtain the target answer corresponding to the user's question.

[0046] For example, the first prompt word includes tabular information of a car price list, including the user question "What is the price of the cheapest car of each model?" The large model generates a first result code based on the first prompt word. After running the first result code, the actual price of the cheapest car of each model in the user's table can be obtained.

[0047] In this embodiment, the prompt is constructed flexibly and quickly by describing the table's own information, such as the number of rows and columns, the column names, data formats, sample data, etc. The important semantic information of the table is provided to the big model without any additional overhead in both training and reasoning. The code generation capability that the big model is good at is simply and efficiently applied to the field of table question answering.

[0048] In another embodiment of the present application, before running the result code to obtain the target answer corresponding to the user question, the method further includes: S21: Perform operation verification on the first result code.

[0049] In this embodiment, after the first result code is obtained, the first result code is run and verified.

[0050] In this embodiment, when verifying the code, the code can be verified by a preset code verification tool. The code verification tool is added to the question-answering system in advance, and the first result code is input into the corresponding code verification tool for verification. Code verification tools are software tools used to automatically check for errors, coding standard violations, and potential performance issues in the code. They can be automatically run during the code writing process or the continuous integration process to ensure that the code has been fully verified before submission, thereby improving code quality and development efficiency.

[0051] S22: When the first result code fails to be verified, a corresponding second prompt word is generated.

[0052] In this embodiment, the second prompt word is used to make a request to the large model to modify the errors in the first result code.

[0053] In this embodiment, when the first result code fails to be verified, error information corresponding to the first result code is obtained, and a corresponding second prompt word is generated according to the error information.

[0054] In this embodiment, when the result code fails to run the verification, the specific steps of generating the corresponding second prompt word include: S22-1: When the first result code fails to be verified, obtain error information corresponding to the first code.

[0055] In this embodiment, the error information includes information such as the number of error items in the first result code and the specific location where the error occurred.

[0056] In this embodiment, when the first result code fails to run the verification, error information corresponding to the first code is obtained.

[0057] In this embodiment, a code verification tool may be used to verify the first result code. When an error occurs in the first result code, the code verification tool will generate corresponding error information.

[0058] S22-2: Generate the second prompt word according to the error information in a preset second format.

[0059] In this embodiment, the second prompt word is a prompt word used to allow the large model to correct errors in the first code.

[0060] In this embodiment, after the error information is obtained, a second prompt word is generated according to a preset second format.

[0061] For example, the second prompt word is "There is an existing form E, and you are given the following user question: Q. In order to solve this problem, you generated the following code C and an error error occurred. Please correct the error and regenerate the code."

[0062] S23: Input the second prompt word into the large model to obtain a second result code.

[0063] In this embodiment, the second prompt word is input into the large model, and the large model modifies the first result code according to the error information and code in the second prompt word to obtain the second result code.

[0064] S24: Run the second result code to obtain the target answer corresponding to the user question.

[0065] In this embodiment, after obtaining the second result code, the second result code is executed to obtain the target answer corresponding to the user question.

[0066] In this embodiment, after obtaining the second result code, a run verification is still required. If an error still occurs during the run verification, a new prompt word is generated again and entered into the large model to obtain the modified result code. When the number of verification failures reaches the preset upper limit, an error message is generated to inform the user that the correct answer cannot be obtained.

[0067] In this embodiment, the code is verified and the answer to the user's question is obtained by running the code on the basis of ensuring feasibility and security.

[0068] In another embodiment of the present application, before generating the first prompt word in a preset first format according to the table information extracted from the user form and the user question, the method further includes: S31: extract information from the user table to obtain the table title, table introduction, number of rows and columns, and name of each column corresponding to the user table.

[0069] In this embodiment, after obtaining the user table, information is extracted from the user table to obtain the table title, table introduction, number of rows and columns, and name of each column corresponding to the user table. These data can be obtained directly by reading the table.

[0070] S32: extracting data from the user table to obtain the data format of the data in each column of the user table.

[0071] In this embodiment, the data format includes integer types: such as byte, short, int, long, etc., which are used to represent integers without decimal points, floating point types: such as float, double, which are used to represent numbers with decimal points, character types: such as char, which are used to represent character (text) sequences, Boolean types: such as boolean, which represent binary values, usually True or False, character strings: such as string, which is a string of numbers, letters, and underscores, and time and date information: such as datetime, which is used to store time and date.

[0072] In this embodiment, the specific steps of extracting data from the user table and obtaining the data format of each column in the user table include: S32-1: Read the data in each column of the user table.

[0073] In this embodiment, the data of each column in the user table is read first.

[0074] S32-2: Parse the data in each column of the user table using a regular expression to determine a data format corresponding to the data in each column.

[0075] In this embodiment, regular expression is a tool for describing string rules, which is widely used in text processing and data verification. When writing programs or web pages that process strings, it is often necessary to find strings that meet certain complex rules. Regular expression is a tool for describing these rules.

[0076] In this embodiment, the regular expression can identify the data format of each column of data in the user table. The data of each column in the user table is parsed by the regular expression to obtain the data format corresponding to each column of data.

[0077] For example, in a salary table, the basic salary "5000" is an integer type, the performance salary "2236.5" is a floating point type, and the employee's name "Zhang San" is a character type.

[0078] S33: Extract the value with the highest occurrence frequency from the data in each column to obtain sample data.

[0079] In this embodiment, the value with the highest occurrence frequency is extracted from the data in each column to obtain sample data.

[0080] In this embodiment, the sample data is provided for reference during calculation of the large model to improve the calculation effect.

[0081] S34: Summarize the table title, the table introduction, the number of rows and columns, the column name, the data format, and the sample data to obtain the table information.

[0082] In this embodiment, the table title, table introduction, number of rows and columns, column name, data format, and sample data are aggregated together to obtain corresponding table information.

[0083] In this embodiment, the method further includes: S35: storing the data in each column according to a corresponding data format.

[0084] In this embodiment, after the data format corresponding to each column of data is obtained, the data of the corresponding column is stored according to the corresponding data format to facilitate the subsequent generation of prompt words.

[0085] refer to Figure 2 , Figure 2 is a schematic diagram of a question-and-answer process proposed in an embodiment of the present application, such as Figure 2 As shown, during the question-and-answer process, the user form is parsed to obtain the user's questions, a prompt is constructed based on the user form and the user's questions, the prompt is input into the model, the result code is obtained, and the generated code is verified. If the verification fails, an error correction prompt is constructed. When the number of attempts exceeds the limit, no more attempts are made. When the code verification passes, the corresponding result is output.

[0086] In another embodiment of the present application, the above steps are further explained in combination with actual application scenarios. The user uploads a table, and the question-and-answer system first loads the table uploaded by the user, parses the data format of each column of data through regular expressions, and stores each data format according to the corresponding variable, for example, the corresponding column is stored as an int, float, string or datetime variable.

[0087] The prompt word (pormpt) P is composed of the user question Q and the table information E, where the format of the table information E is <table title: xxx; table introduction: xxx; table size: x rows × y columns; table column information: i-th column, column name: xxx, data type: datatype, sample data: xxx>, where x, y represent the number of rows and columns in the table, xxx represents any text that may appear, datatype∈{int, float, string, datetime}, i∈[1,y] represents any column from 1 to y. The format of the prompt information P is as follows: <There is an existing table E, and you are given the following user question: Q, please give a Python code to complete the user question>.

[0088] Input P into the large model and obtain the output result R, extract the code part C from R, and use the code verification tool to verify the code C.

[0089] If C fails to verify and gets an error message error, construct an error correction prompt message P' and repeat the verification process until C can run successfully or this process is executed more than 3 times. The format of the error correction prompt message P' is: <Existing form E, give you the following user question: Q, in order to solve this problem, you generated the following code C and an error error occurred. Please correct the error and regenerate the code> If C is successfully verified, C is run to obtain the result A, which is formatted and output to the user.

[0090] In the above embodiment of the present application, a method for implementing intelligent table question and answer based on large model code generation is proposed. This method constructs prompts flexibly and quickly by describing the table's own information, such as the number of rows and columns, the column names of each column, the data format, sample data, etc. The large model uses the prompt to generate Python code that can solve the corresponding problem, and finally verifies the code, and runs the code to get the answer to the user's question on the basis of ensuring feasibility and security. Through this process, the important semantic information of the table is provided to the large model, and no additional overhead is generated in both training and reasoning. Simply and efficiently apply the code generation capabilities that the large model is good at to the field of table question and answer.

[0091] The table question and answer implementation method proposed in the embodiment of the present application does not need to provide a complete table to the large model. It only needs to provide partial information of the table so that the large model can understand the table and answer the user's questions. Without any additional training process, it can simply and efficiently use the code generation ability of the large model to solve the table question and answer problem, and has good portability and universality. It includes the post-processing and verification process of the Python code generated by the large model, which effectively alleviates the illusion problem of the large model, ensuring the feasibility and stability of the entire system and improving the security of the code.

[0092] Based on the same inventive concept, an embodiment of the present application provides a question-answering device. Figure 3 , Figure 3 FIG. 3 is a schematic diagram of a question-answering device 300 proposed in an embodiment of the present application. Figure 3 As shown, the device comprises: A question receiving module 301 is used to receive a user form and a user question corresponding to the user form; A first prompt word generating module 302, configured to generate a first prompt word in a preset first format according to the table information extracted from the user table and the user question; A first result code acquisition module 303, used for inputting the first prompt word into a large model to obtain a first result code; The first target answer acquisition module 304 is used to run the first result code to obtain the target answer corresponding to the user question.

[0093] Optionally, the device further comprises: An operation verification module, used for performing operation verification on the first result code; A second prompt word generating module, used for generating a corresponding second prompt word when the first result code fails to run the verification; A second result code acquisition module, used for inputting the second prompt word into the large model to obtain a second result code; The second target answer acquisition module is used to run the second result code to obtain the target answer corresponding to the user question.

[0094] Optionally, the second prompt word generating module includes: An error information acquisition submodule, used for acquiring error information corresponding to the first code when the first result code fails to run the verification; The second prompt word generating submodule is used to generate the second prompt word according to the error information and in a preset second format.

[0095] Optionally, the device further comprises: A table information acquisition module is used to extract information from the user table, and obtain the table title, table introduction, number of rows and columns, and the name of each column corresponding to the user table; A data format acquisition module, used to extract data from the user table to obtain the data format of the data in each column of the user table; An example data extraction module is used to extract the value with the highest occurrence frequency in the data of each column to obtain example data; The table information summary module is used to summarize the table title, the table introduction, the number of rows and columns, the column name, the data format, and the sample data to obtain the table information.

[0096] Optionally, the data format acquisition module includes: A data reading submodule, used for reading the data in each column of the user table; The data format parsing submodule is used to parse the data in each column of the user table through a regular expression to determine the data format corresponding to the data in each column.

[0097] Optionally, the device further comprises: The data storage module is used to store the data in each column according to a corresponding data format.

[0098] Optionally, the first prompt word generating module includes: An information reading submodule, used for reading the table information, and determining the table title, table introduction, number of rows and columns, column name, data format, and sample data contained in the table information; The first prompt word generating submodule is used to arrange the table title, the table introduction, the number of rows and columns, the column name, the data format, the sample data and the user question according to a preset first format to obtain the first prompt word.

[0099] Based on the same inventive concept, another embodiment of the present application provides a readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the question-and-answer method described in any of the above embodiments of the present application are implemented.

[0100] Based on the same inventive concept, another embodiment of the present application provides an electronic device, Figure 4 It is a schematic diagram of an electronic device 400 proposed in one embodiment of the present application, including a memory 401, a processor 402 and a computer program stored in the memory and executable on the processor, and the processor, when executed, implements the steps in the question-and-answer method described in any of the above embodiments of the present application.

[0101] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0102] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0103] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0104] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0105] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0106] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0107] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0108] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0109] The question-and-answer method, device, equipment and storage medium provided by the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A question-answering method, characterized in that: The method comprises: Receiving a user form and a user question corresponding to the user form; Generating a first prompt word in a preset first format according to the table information extracted from the user table and the user question; Inputting the first prompt word into the large model to obtain a first result code; Run the first result code to obtain the target answer corresponding to the user question.

2. The question-answering method according to claim 1, characterized in that: Before running the result code to obtain the target answer corresponding to the user question, the method further includes: Performing operation verification on the first result code; If the first result code fails to be verified, a corresponding second prompt word is generated; Inputting the second prompt word into the large model to obtain a second result code; Run the second result code to obtain the target answer corresponding to the user question.

3. The question-answering method according to claim 2, characterized in that: In the case where the result code running verification fails, generating a corresponding second prompt word includes: If the first result code fails to run and verify, obtaining error information corresponding to the first code; The second prompt word is generated according to the error information in a preset second format.

4. The question-answering method according to claim 1, characterized in that: Before generating a first prompt word in a preset first format according to the table information extracted from the user form and the user question, the method further includes: Extract information from the user table to obtain the table title, table introduction, number of rows and columns, and name of each column corresponding to the user table; Extracting data from the user table to obtain the data format of the data in each column of the user table; Extract the value with the highest occurrence frequency from the data in each column to obtain sample data; The table title, the table introduction, the number of rows and columns, the column name, the data format, and the sample data are summarized to obtain the table information.

5. The question-answering method according to claim 4, characterized in that: Extracting data from the user table to obtain the data format of the data in each column of the user table includes: Read the data in each column of the user table; The data in each column of the user table is parsed using a regular expression to determine a data format corresponding to the data in each column.

6. The question-answering method according to claim 5, characterized in that: The method further comprises: The data in each column is stored according to a corresponding data format.

7. The question-answering method according to claim 1, characterized in that: The step of generating a first prompt word in a preset first format according to the table information extracted from the user table and the user question includes: Read the table information to determine the table title, table introduction, number of rows and columns, column name, data format, and sample data contained in the table information; The table title, the table introduction, the number of rows and columns, the column name, the data format, the sample data and the user question are arranged according to a preset first format to obtain the first prompt word.

8. A question-answering device, characterized in that: The device comprises: A question receiving module, used for receiving a user form and a user question corresponding to the user form; A first prompt word generating module, configured to generate a first prompt word in a preset first format according to the table information extracted from the user table and the user question; A first result code acquisition module, used for inputting the first prompt word into a large model to obtain a first result code; The first target answer acquisition module is used to run the first result code to obtain the target answer corresponding to the user question.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 7 are implemented.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.