Table question and answer method, device, equipment, readable storage medium and program product

By parsing the tabular file to obtain a set of candidate labels, combining the question data for spoken language comprehension and reverse verification, constructing prompt words to call a large language model for question answering, the problem of input limitations and output randomness of large models in large-scale tabular question answering is solved, thus improving the accuracy and stability of question answering.

CN119647455BActive Publication Date: 2026-01-27CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411788048.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2026-01-27
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

Existing technologies for large models suffer from input limitations and significant output randomness when processing large tables of data, resulting in a large deviation between the question-and-answer results and user expectations. Furthermore, they lack prior knowledge about the table information and cannot accurately represent user needs.

Method used

The candidate label set is obtained by parsing the table file, and the spoken language comprehension result is determined by combining the question data. Reverse verification is performed, prompt words are constructed to call the large language model for question answering, including intent recognition and slot filling. Secondary verification and error correction are performed to improve accuracy.

Benefits of technology

It enables the processing of large tables without providing complete table files, improving the accuracy and stability of question answering, and enhancing the versatility and inference speed of large models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119647455B_ABST
    Figure CN119647455B_ABST
Patent Text Reader

Abstract

The application relates to a table question and answer method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: obtaining a table file and question data uploaded by a target user; analyzing table information in the table file to obtain a candidate label set; determining a spoken language understanding result corresponding to the question data based on the question data and the candidate label set, wherein the spoken language understanding result comprises an intent and a keyword corresponding to the question data; performing reverse verification on the spoken language understanding result according to the question data to obtain a verification result; in the case that the verification result indicates that the spoken language understanding result passes the verification, constructing a prompt word according to the table information in the table file, the question data and the spoken language understanding result; and performing question and answer on the prompt word by calling a large language model to obtain a question and answer result. The method can process large amounts of table data, and can improve the accuracy and stability of large model table question and answer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of natural language processing technology, and in particular to a form-based question-and-answer method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Technology

[0002] With the development of natural language processing technology, users' demand for intelligent question answering based on tables is increasing. As large language model technology matures, it can intelligently extract answers from tables by analyzing user questions through the semantic understanding capabilities of large models. However, current methods of converting tables into semantic vectors and simultaneously inputting user questions and table semantic vectors into the model for question answering heavily rely on inputting complete tables. Large models, however, have limitations in data input, making them unable to handle large tables. Furthermore, the outputs of large models typically exhibit significant randomness and uncontrollability, resulting in poor robustness and a tendency to produce illusions during question answering. Additionally, the knowledge encountered by large models during pre-training has low overlap with the table data itself, making it difficult to apply their prior knowledge to table-based responses. Under the combined influence of a lack of prior knowledge about table information and the potential for illusions in large model outputs, the SQL statements generated by existing large models cannot accurately represent user needs, leading to significant discrepancies between the question-and-answer results and user expectations. Summary of the Invention

[0003] Therefore, it is necessary to provide a table question-answering method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can handle large data tables while improving the accuracy and stability of large model table question-answering, in order to address the above-mentioned technical problems.

[0004] Firstly, this application provides a form-based question-and-answer method, including:

[0005] Obtain the form files and question data uploaded by the target user;

[0006] The table information in the table file is parsed to obtain a set of candidate tags;

[0007] Based on the question data and the candidate tag set, a spoken language comprehension result corresponding to the question data is determined, wherein the spoken language comprehension result includes the intent and keywords corresponding to the question data;

[0008] The spoken language comprehension results are then reverse-verified based on the question data to obtain the verification results.

[0009] If the verification result indicates that the spoken language comprehension result has passed verification, prompt words are constructed based on the table information in the table file, the question data, and the spoken language comprehension result;

[0010] The large language model is invoked based on the prompt words to perform question-and-answer operations and obtain the question-and-answer results.

[0011] In one embodiment, the candidate label set includes intent recognition labels and slot filling labels; parsing the table information in the table file to obtain the candidate label set includes:

[0012] The table information is parsed to obtain the intent recognition label and the slot filling label. In one embodiment, determining the spoken language comprehension result corresponding to the question data based on the question data and the candidate label set includes:

[0013] The intent is obtained by performing intent recognition on the question data based on the candidate label set;

[0014] The keywords are obtained by filling slots in the question data based on the candidate tag set.

[0015] In one embodiment, the step of reverse-verifying the spoken language comprehension result based on the question data to obtain a verification result includes:

[0016] Based on the question data, the intent is subjected to conflict verification to obtain the intent verification result;

[0017] Based on the question data, the keywords are subjected to conflict verification to obtain the keyword verification results;

[0018] The verification result is determined based on the intent verification result and the keyword verification result.

[0019] In one embodiment, after invoking a large language model to perform question-and-answer operations based on the prompt words and obtaining the question-and-answer results, the method further includes:

[0020] The question-and-answer results are then verified a second time based on the question data and the spoken language comprehension results to obtain the question-and-answer verification results.

[0021] If the question-and-answer verification result indicates that the verification of the question-and-answer result has failed, obtain the conflict information corresponding to the question-and-answer verification result;

[0022] The prompt words are corrected based on the conflict information to obtain the corrected prompt words;

[0023] The large language model is invoked based on the error correction prompts to perform question-and-answer operations and obtain error correction question-and-answer results.

[0024] In one embodiment, after performing secondary verification on the prompt words based on the question-and-answer results to obtain the question-and-answer verification results, the method further includes:

[0025] If the question-and-answer verification result indicates that the question-and-answer result has been successfully verified or if the question-and-answer verification result indicates that the current number of verifications is greater than a preset threshold, the question-and-answer result will be sent to the target user.

[0026] Secondly, this application also provides a form-based question-and-answer device, comprising:

[0027] The acquisition module is used to acquire the form files and question data uploaded by the target user;

[0028] The parsing module is used to parse the table information in the table file to obtain a set of candidate tags;

[0029] The determination module is used to determine the spoken language comprehension result corresponding to the question data based on the question data and the candidate tag set, wherein the spoken language comprehension result includes the intent and keywords corresponding to the question data;

[0030] The verification module is used to perform reverse verification of the spoken language comprehension results based on the question data to obtain the verification results;

[0031] The construction module is used to construct prompt words based on the table information in the table file, the question data, and the spoken language comprehension result when the verification result indicates that the spoken language comprehension result has been verified as passed.

[0032] The question-and-answer module is used to call the large language model to perform question-and-answer operations based on the prompt words and obtain the question-and-answer results.

[0033] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0034] Obtain the form files and question data uploaded by the target user;

[0035] The table information in the table file is parsed to obtain a set of candidate tags;

[0036] Based on the question data and the candidate tag set, a spoken language comprehension result corresponding to the question data is determined, wherein the spoken language comprehension result includes the intent and keywords corresponding to the question data;

[0037] The spoken language comprehension results are then reverse-verified based on the question data to obtain the verification results.

[0038] If the verification result indicates that the spoken language comprehension result has passed verification, prompt words are constructed based on the table information in the table file, the question data, and the spoken language comprehension result;

[0039] The large language model is invoked based on the prompt words to perform question-and-answer operations and obtain the question-and-answer results.

[0040] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0041] Obtain the form files and question data uploaded by the target user;

[0042] The table information in the table file is parsed to obtain a set of candidate tags;

[0043] Based on the question data and the candidate tag set, a spoken language comprehension result corresponding to the question data is determined, wherein the spoken language comprehension result includes the intent and keywords corresponding to the question data;

[0044] The spoken language comprehension results are then reverse-verified based on the question data to obtain the verification results.

[0045] If the verification result indicates that the spoken language comprehension result has passed verification, prompt words are constructed based on the table information in the table file, the question data, and the spoken language comprehension result;

[0046] The large language model is invoked based on the prompt words to perform question-and-answer operations and obtain the question-and-answer results.

[0047] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0048] Obtain the form files and question data uploaded by the target user;

[0049] The table information in the table file is parsed to obtain a set of candidate tags;

[0050] Based on the question data and the candidate tag set, a spoken language comprehension result corresponding to the question data is determined, wherein the spoken language comprehension result includes the intent and keywords corresponding to the question data;

[0051] The spoken language comprehension results are then reverse-verified based on the question data to obtain the verification results.

[0052] If the verification result indicates that the spoken language comprehension result has passed verification, prompt words are constructed based on the table information in the table file, the question data, and the spoken language comprehension result;

[0053] The large language model is invoked based on the prompt words to perform question-and-answer operations and obtain the question-and-answer results.

[0054] The aforementioned table-based question-answering method, apparatus, computer device, computer-readable storage medium, and computer program product acquire a table file and question data uploaded by the target user; parse the table information in the table file to obtain a set of candidate tags; determine the spoken language understanding result corresponding to the question data based on the question data and the candidate tag set, the spoken language understanding result including the intent and keywords corresponding to the question data; perform reverse verification on the spoken language understanding result based on the question data to obtain a verification result; if the verification result indicates that the spoken language understanding result has passed verification, construct prompt words based on the table information in the table file, the question data, and the spoken language understanding result; and call a large language model to perform question-answering based on the prompt words to obtain the question-answering result. Therefore, by parsing the table information in the table file to obtain a set of candidate tags, determining the spoken language understanding result corresponding to the question data in combination with the question data, and ensuring the correctness of the spoken language understanding result through reverse verification, and then constructing prompt words, the method achieves the ability to handle long tables with a large amount of content without requiring a complete table file in the large model inference stage, and is not limited by the input length of the large model, thus improving the versatility and inference speed of table-based question answering. Attached Figure Description

[0055] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0056] Figure 1 This is a diagram illustrating the application environment of the table-based question-and-answer method in one embodiment.

[0057] Figure 2 This is a flowchart illustrating a table-based question-and-answer method in one embodiment;

[0058] Figure 3 This is a flowchart illustrating a table-based question-and-answer method in one embodiment;

[0059] Figure 4 This is a schematic diagram of the complete process of a table-based question-and-answer method in one embodiment;

[0060] Figure 5 This is a structural block diagram of a table-based question-and-answer device in one embodiment;

[0061] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0063] The table-based question-and-answer method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Server 104 obtains the form file and question data uploaded by the target user; parses the table information in the form file to obtain a set of candidate tags; determines the spoken language understanding result corresponding to the question data based on the question data and the set of candidate tags. The spoken language understanding result includes the intent and keywords corresponding to the question data; performs reverse verification on the spoken language understanding result based on the question data to obtain a verification result; if the verification result indicates that the spoken language understanding result has passed verification, constructs prompt words based on the table information in the form file, the question data, and the spoken language understanding result; and calls a large language model to perform question-and-answer based on the prompt words to obtain the question-and-answer result. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. Headset devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0064] In one exemplary embodiment, such as Figure 2 As shown, a table-based question-and-answer method is provided, which can be applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 202 to 212. Wherein:

[0065] Step 202: Obtain the form file and question data uploaded by the target user.

[0066] The table file contains various table information, such as table title, table description, number of rows and columns, column names, and data format.

[0067] In some embodiments, the table file uploaded by the target user can be obtained by loading the table file uploaded by the target user from the table cache database, or by loading the table file uploaded by the target user in real time, and is not limited thereto.

[0068] In some embodiments, the target user's question data can be obtained in real time through a recording device, or the target user's question data can be obtained through a question database, but this is not the only option.

[0069] Step 204: Parse the table information in the table file to obtain a set of candidate tags.

[0070] The parsing process involves analyzing the table information and constructing a set of candidate labels.

[0071] In some embodiments, the candidate label set includes intent recognition labels and slot filling labels; parsing the table information in the table file to obtain the candidate label set includes: parsing the table information to obtain intent recognition labels and slot filling labels.

[0072] Among them, the intent recognition label is used to indicate the intent recognition classification type of the table information in the table file, while the slot filling label is used to indicate the key information of the table information in the table file;

[0073] In some embodiments, intent recognition results are obtained by parsing the table information in the table file, and intent recognition labels are constructed based on the intent recognition results, thereby obtaining intent recognition labels.

[0074] In some embodiments, slot filling results are obtained by parsing the table information in the table file, and slot filling labels are constructed based on the slot filling results, thereby obtaining slot filling labels.

[0075] Step 206: Determine the spoken language comprehension result corresponding to the question data based on the question data and the candidate label set. The spoken language comprehension result includes the intent and keywords corresponding to the question data.

[0076] Here, "intent" refers to the purpose of the question data, and "keyword" refers to key information related to the question data.

[0077] In some embodiments, determining the spoken language comprehension result corresponding to the question data based on the question data and the candidate label set includes: performing intent recognition on the question data according to the candidate label set to obtain the intent; and performing slot filling on the question data according to the candidate label set to obtain keywords.

[0078] Among them, a few-shot learning strategy is used for intent recognition and slot filling, and the few-shot learning strategy refers to the few-shot strategy.

[0079] In some embodiments, a few-shot learning strategy is employed in conjunction with question data for intent recognition, thereby obtaining all intents related to the question data from the candidate label set, obtaining the intents, and counting the number of user intents.

[0080] In some embodiments, a few-shot learning strategy is employed in conjunction with the question data for slot filling, thereby obtaining all key slot information about the question data from the candidate label set, obtaining the intent, and counting the number of slots.

[0081] Step 208: Perform reverse verification of the oral comprehension results based on the question data to obtain the verification results.

[0082] Reverse verification is a process of verifying whether there is a conflict between the question data and the oral comprehension results. By reverse verification, it is determined whether there is a conflict between the oral comprehension results and the question data, and the number of conflicts is recorded to score the oral comprehension results. The verification result is then determined based on the verification score.

[0083] In some embodiments, the spoken language comprehension results are reverse-verified based on the question data to obtain a verification result, including: performing conflict verification on the intent based on the question data to obtain an intent verification result; and performing conflict verification on the keywords based on the question data to obtain a keyword verification result. The verification result is then determined based on the intent verification result and the keyword verification result.

[0084] In some embodiments, conflict verification of intent based on question data can determine whether there is an information contradiction or conflict between the intent and the question data, and the intent conflict result is recorded. The number of times all intents conflict with the question data is counted. The more times the conflict occurs, the lower the intent recognition score corresponding to the intent verification result is. The intent recognition score and the intent conflict result are used to construct the intent verification result.

[0085] In some embodiments, keyword conflict verification is performed based on the question data to determine whether the keyword has an information contradiction or conflict with the question data. The keyword conflict results are recorded, and the number of times all keywords conflict with the question data is counted. The more times the keyword conflict occurs, the lower the keyword recognition score corresponding to the calculated keyword verification result. The keyword recognition score and the keyword conflict results are used to construct the intent verification result.

[0086] In some embodiments, if the keyword recognition score of the keyword verification result is less than the first preset threshold, or the intent recognition score of the intent verification result is less than the first preset threshold, then the spoken language comprehension result corresponding to the question data is re-determined based on the question data and the candidate tag set, and the reverse verification process is repeated, and the verification result is set as a spoken language comprehension result verification failure.

[0087] In some embodiments, if both the keyword recognition score and the intent recognition score are greater than or equal to a first preset threshold, the keyword conflict results and intent conflict results are recorded to construct a verification result, and the verification result is set as the spoken language comprehension result verification passed.

[0088] Step 210: If the verification result indicates that the oral comprehension result has been verified, construct prompt words based on the table information, question data and oral comprehension result in the table file.

[0089] The prompt word is an AI model prompt word, which can be a prompt message.

[0090] In some embodiments, combining the user's question Q, the spoken comprehension result Y, and the table information E, a cue word P is constructed based on the table information, question data, and spoken comprehension result in the table file. The format of cue word P is as follows: <Existing table E; The user asked the following question: Q; The user's main intent includes: The user's question contained the following key semantic information. Please complete the user question based on the above content, where the prompt word P is a type of prompt information.

[0091] It should be noted that the spoken language understanding results indicate the intent of the current user's question and which keywords are included in the question. Since the spoken language understanding result labels are constructed based on the candidate label set corresponding to the table information and predicted based on the user's question, the spoken language understanding results contain both the main semantic information of the table file and the key semantics of the user's question. In this embodiment, the spoken language understanding results are introduced into the prompt, playing a crucial role in providing the table's semantics to the larger model without providing the complete table.

[0092] Step 212: Based on the prompt words, call the large language model to perform question answering and obtain the question answering results.

[0093] Among them, large language model refers to the large-scale language model technology in artificial intelligence technology, which is mainly applied in the field of natural language processing.

[0094] In some embodiments, prompt words are input into a large language model for question-and-answer processing, and the question-and-answer results are obtained. In this embodiment, there are no restrictions on the specific output scheme. The question-and-answer results can be the answers directly provided by the large language model, or they can be the question-and-answer results obtained using SQL, and are not limited to these.

[0095] In the aforementioned table-based question-answering method, the following steps are taken: First, the table file and question data uploaded by the target user are obtained. Then, the table information in the table file is parsed to obtain a set of candidate tags. Based on the question data and the candidate tag set, the spoken language comprehension result corresponding to the question data is determined. This spoken language comprehension result includes the intent and keywords corresponding to the question data. The spoken language comprehension result is then reverse-verified based on the question data to obtain a verification result. If the verification result indicates that the spoken language comprehension result has passed verification, prompt words are constructed based on the table information in the table file, the question data, and the spoken language comprehension result. Finally, the large language model is invoked based on the prompt words to perform question-answering and obtain the question-answering result. Therefore, by parsing the table information in the table file to obtain a set of candidate tags, combining this with the question data to determine the spoken language comprehension result corresponding to the question data, and ensuring the correctness of the spoken language comprehension result through reverse verification, and then constructing prompt words, the method achieves the ability to handle long tables with a large amount of content without requiring a complete table file during the large model inference stage, and without being limited by the input length of the large model. This improves the versatility and inference speed of table-based question answering.

[0096] In one exemplary embodiment, such as Figure 3 As shown, after calling the large language model to perform question-and-answer operations based on the prompt words and obtaining the question-and-answer results, the method further includes: a prompt word verification step, which includes steps 302 to 308. Wherein:

[0097] Step 302: Perform a second verification of the question-and-answer results based on the question data and oral comprehension results to obtain the question-and-answer verification results.

[0098] Secondary verification is also a conflict verification process, used to determine whether the question-and-answer result contradicts the prompt, or whether the question-and-answer result creates an illusion.

[0099] In some embodiments, the question-and-answer results are further verified by combining the target user's question data and spoken language comprehension results to determine whether there is any information contradiction or conflict between the question-and-answer results and the question data and spoken language comprehension results.

[0100] In some embodiments, if a conflict exists, conflict information is recorded and a question-and-answer verification result is constructed based on the conflict information. The question-and-answer result indicates that the question-and-answer result verification failed, and the current verification count is incremented by 1 in the question-and-answer verification result.

[0101] In some embodiments, if there is no conflict, conflict information is recorded and a question-and-answer verification result is constructed, which indicates that the question-and-answer result verification was successful.

[0102] Step 304: If the question-and-answer verification result indicates that the question-and-answer verification failed, obtain the conflict information corresponding to the question-and-answer verification result.

[0103] The conflicting information can be related to table information in the prompts, question data, and spoken comprehension results.

[0104] In some embodiments, if the question-and-answer verification result indicates that the question-and-answer result verification has failed, and the current number of verifications is less than or equal to a preset threshold, the conflict information corresponding to the question-and-answer verification result can be sent to the step of constructing error correction prompts, so that the error correction step can quickly obtain the conflict information corresponding to the question-and-answer verification result.

[0105] Step 306: Correct the prompt words based on the conflict information to obtain the correction prompt words.

[0106] Among them, the error correction prompt word refers to the prompt word obtained by modifying the part of the prompt word related to the conflict information based on the conflict information.

[0107] In some embodiments, the prompt words are corrected based on conflict information, and the format of the corrected prompt words is: <Form file E and user question: Q; user intent includes: The user's question contained the following keywords Regarding this question, your answer R relates to the user's intent. or keywords A conflict has occurred, specifically: error; Please correct the error and answer again >, where error refers to the specific conflict information.

[0108] It should be noted that the two-stage verification process of the spoken language comprehension results and the question-and-answer results generated by the large model reduces the negative impact of the large model illusion problem on the table-based question-and-answer system, thereby improving the stability and security of the question-and-answer system.

[0109] Step 308: Call the large language model to perform question-and-answer based on the error correction prompts and obtain the error correction question-and-answer results.

[0110] In some embodiments, error correction prompts are input into a large language model to obtain error correction question-and-answer results. This embodiment does not limit the specific output scheme. The error correction question-and-answer results can be the answers directly provided by the model or the error correction question-and-answer results obtained using SQL, and are not limited to these.

[0111] In some embodiments, after performing secondary verification on the prompt words based on the question-and-answer results to obtain the question-and-answer verification results, the method further includes: sending the question-and-answer results to the target user when the question-and-answer verification results indicate that the question-and-answer results have been successfully verified or when the question-and-answer verification results indicate that the current number of verifications is greater than a preset threshold.

[0112] The preset threshold can be set according to actual needs, with the default value being 3.

[0113] To gain a clearer understanding of the scheme in this application, this section combines... Figure 4 The explanation is as follows:

[0114] in, Figure 4 The user questions in the text contain question data, and prompt is an AI prompt word model. The model refers to a large language model.

[0115] First, the user-uploaded table file is parsed. Information such as the table title, table description, number of rows and columns, column names, and data format is analyzed to construct a spoken language understanding label set, including intent recognition classification labels and slot-filling labels. Then, the spoken language understanding results (containing intent and keywords) are predicted using a few-shot strategy in conjunction with the user's question. The spoken language understanding results are then back-verified using the user's question to ensure accuracy. After successful verification, a prompt is constructed based on the user's question data, table information, and spoken language understanding results. The spoken language understanding results indicate the main intent of the user's question and the keywords contained within it. Since the spoken language understanding result labels are constructed based on table information and predicted based on the user's question data, the spoken language understanding results contain both the main semantic information of the table file and the keywords from the user's question. This method introduces the spoken language understanding results into the prompt here, playing a crucial role in providing table semantics to the larger model without providing the complete table.

[0116] Secondly, the prompt word is input into a large language model for question-and-answer processing, and the answer results are obtained from the output of the large language model. The specific method for obtaining the answer results here is not limited. For example, the model can be instructed to answer directly, or an SQL query table can be generated to obtain the answer. The specific implementation scheme in this step is not considered the core technology of this method.

[0117] Finally, the question-and-answer results generated by the large language model are validated a second time by combining user question data and spoken language comprehension results to ensure accuracy. If the validation fails, the model is asked a new question using the error information obtained in step 6, and this process is repeated. If the validation passes, the question-and-answer results for the user's question are returned.

[0118] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0119] Based on the same inventive concept, this application also provides a table question-and-answer apparatus for implementing the table question-and-answer method described above. The solution provided by this apparatus is similar to the solution described in the above method. Therefore, the specific limitations of one or more table question-and-answer apparatus embodiments provided below can be found in the limitations of the table question-and-answer method above, and will not be repeated here.

[0120] In one exemplary embodiment, such as Figure 5 As shown, a form-based question-and-answer device is provided, including: an acquisition module 501, a parsing module 502, a determination module 503, a verification module 504, a construction module 505, and a question-and-answer module 506, wherein:

[0121] Module 501 is used to obtain the form file and question data uploaded by the target user;

[0122] Parsing module 502 is used to parse the table information in the table file to obtain a set of candidate tags;

[0123] The determination module 503 is used to determine the spoken language understanding result corresponding to the question data based on the question data and the candidate label set. The spoken language understanding result includes the intent and keywords corresponding to the question data.

[0124] The verification module 504 is used to perform reverse verification of the oral comprehension results based on the question data to obtain the verification results.

[0125] The construction module 505 is used to construct prompt words based on the table information, question data and oral comprehension results in the table file when the verification result indicates that the oral comprehension result has been verified as passed.

[0126] The question-answering module 506 is used to call the large language model to perform question-answering based on prompt words and obtain the question-answering results.

[0127] In some embodiments, the candidate label set includes intent recognition labels and slot filling labels; the parsing module 502 is further configured to parse the table information to obtain the intent recognition labels and the slot filling labels.

[0128] In some embodiments, the determining module 503 is further configured to perform intent recognition on the question data based on the candidate tag set to obtain intent; and to fill slots in the question data based on the candidate tag set to obtain keywords.

[0129] In some embodiments, the verification module 504 is further configured to perform conflict verification on the intent based on the question data to obtain an intent verification result; perform conflict verification on the keywords based on the question data to obtain a keyword verification result; and determine the verification result based on the intent verification result and the keyword verification result.

[0130] In some embodiments, after invoking a large language model to perform question-and-answer operations based on prompt words and obtaining question-and-answer results, the device further includes: an error correction module, configured to perform secondary verification of the question-and-answer results based on question data and spoken language comprehension results to obtain a question-and-answer verification result; if the question-and-answer verification result indicates that the question-and-answer result verification has failed, to obtain conflict information corresponding to the question-and-answer verification result; to correct the prompt words based on the conflict information to obtain error correction prompt words; and to invoke a large language model to perform question-and-answer operations based on the error correction prompt words to obtain error-corrected question-and-answer results.

[0131] In some embodiments, after performing secondary verification on the prompt words based on the question-and-answer results to obtain the question-and-answer verification results, the device further includes: a sending module, used to send the question-and-answer results to the target user when the question-and-answer verification results indicate that the question-and-answer results have been successfully verified or the question-and-answer verification results indicate that the current number of verifications is greater than a preset threshold.

[0132] In the aforementioned table-based question-answering device, the following steps are taken: First, a table file and question data uploaded by the target user are acquired. Then, the table information in the table file is parsed to obtain a set of candidate tags. Based on the question data and the candidate tag set, a spoken language understanding result corresponding to the question data is determined. This spoken language understanding result includes the intent and keywords corresponding to the question data. Next, the spoken language understanding result is reverse-verified based on the question data to obtain a verification result. If the verification result indicates that the spoken language understanding result has passed verification, prompt words are constructed based on the table information in the table file, the question data, and the spoken language understanding result. Finally, a large language model is invoked based on the prompt words to perform question-answering and obtain the question-answering result. Therefore, by parsing the table information in the table file to obtain a set of candidate tags, and combining this with the question data to determine the spoken language understanding result corresponding to the question data, and by ensuring the correctness of the spoken language understanding result through reverse verification, the device achieves the ability to handle long tables with substantial content without requiring a complete table file during the large model inference process, and without being limited by the input length of the large model. This improves the versatility and inference speed of table-based question answering.

[0133] Each module in the above-mentioned question-and-answer device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0134] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores form files and query data uploaded by target users. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a form-based question-and-answer method.

[0135] Those skilled in the art will understand that Figure 6The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0136] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described table question-and-answer method.

[0137] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described table question-and-answer method.

[0138] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the above-described table question-and-answer method.

[0139] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, 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 the relevant data must comply with relevant regulations.

[0140] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0141] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0142] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A table-based question-and-answer method, characterized in that, The method includes: Obtain the form files and question data uploaded by the target user; The table information in the table file is parsed to obtain a set of candidate tags; Based on the question data and the candidate tag set, a spoken language comprehension result corresponding to the question data is determined, wherein the spoken language comprehension result includes the intent and keywords corresponding to the question data; The spoken language comprehension results are then reverse-verified based on the question data to obtain the verification results. If the verification result indicates that the spoken language comprehension result has passed verification, prompt words are constructed based on the table information in the table file, the question data, and the spoken language comprehension result; The large language model is invoked based on the prompt words to perform question-and-answer operations and obtain the question-and-answer results.

2. The method according to claim 1, characterized in that, The candidate label set includes intent recognition labels and slot filling labels; parsing the table information in the table file to obtain the candidate label set includes: The table information is parsed to obtain the intent identification label and the slot filling label.

3. The method according to claim 1, characterized in that, The step of determining the spoken language comprehension result corresponding to the question data based on the question data and the candidate label set includes: The intent is obtained by performing intent recognition on the question data based on the candidate label set; The keywords are obtained by filling slots in the question data based on the candidate tag set.

4. The method according to claim 1, characterized in that, The step of performing reverse verification on the spoken language comprehension result based on the question data to obtain the verification result includes: Based on the question data, the intent is subjected to conflict verification to obtain the intent verification result; Based on the question data, the keywords are subjected to conflict verification to obtain the keyword verification results; The verification result is determined based on the intent verification result and the keyword verification result.

5. The method according to claim 1, characterized in that, After invoking the large language model based on the prompt words to perform question answering and obtain the question answering results, the method further includes: The question-and-answer results are then verified a second time based on the question data and the spoken language comprehension results to obtain the question-and-answer verification results. If the question-and-answer verification result indicates that the verification of the question-and-answer result has failed, obtain the conflict information corresponding to the question-and-answer verification result; The prompt words are corrected based on the conflict information to obtain the corrected prompt words; The large language model is invoked based on the error correction prompts to perform question-and-answer operations and obtain error correction question-and-answer results.

6. The method according to claim 5, characterized in that, After performing secondary verification on the prompt words based on the question-and-answer results to obtain the question-and-answer verification results, the method further includes: If the question-and-answer verification result indicates that the question-and-answer result has been successfully verified or if the question-and-answer verification result indicates that the current number of verifications is greater than a preset threshold, the question-and-answer result will be sent to the target user.

7. A form-based question-and-answer device, characterized in that, The device includes: The acquisition module is used to acquire the form files and question data uploaded by the target user; The parsing module is used to parse the table information in the table file to obtain a set of candidate tags; The determination module is used to determine the spoken language comprehension result corresponding to the question data based on the question data and the candidate tag set, wherein the spoken language comprehension result includes the intent and keywords corresponding to the question data; The verification module is used to perform reverse verification of the spoken language comprehension results based on the question data to obtain the verification results; The construction module is used to construct prompt words based on the table information in the table file, the question data, and the spoken language comprehension result when the verification result indicates that the spoken language comprehension result has been verified as passed. The question-and-answer module is used to call the large language model to perform question-and-answer operations based on the prompt words and obtain the question-and-answer results.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

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

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Financial data query method and device and readable storage medium

    CN113515549A

  • Table question and answer method, system and equipment based on large model

    CN119046287A