Table question and answer method, apparatus and device, readable storage medium and program product
By analyzing table information, determining oral comprehension results, constructing prompt words and calling large language models for question-and-answer questions, the problem of processing and question-and-answer in the prior art is solved, and higher accuracy and stability are achieved.
Patent Information
- Application Number
- CN202411788048.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-06
AI Technical Summary
The prior art has input limitations when processing large data scale tables, and the output randomness and robustness of the large model are poor, resulting in a deviation from the user's expectations.
By obtaining the table files and question data uploaded by the user, analyzing the table information to obtain the candidate tag collection, determining the oral comprehension results and performing reverse verification, constructing prompt words to call the large language model for question-and-answer, and finally performing secondary verification of the question-and-answer results to improve accuracy.
It realizes processing large data scale tables without providing complete table files, improves the accuracy and stability of large-model table questions and answers, and reduces the occurrence of hallucinations.
Smart Images

Figure CN119647455A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of natural language processing, and in particular to a form question answering method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of natural language processing technology, users' demand for intelligent question and answer for tables is increasing. With the increasing maturity of large language model technology, users' questions can be analyzed through the semantic understanding ability of large models, and answers can be obtained from tables intelligently. However, in the prior art, the method of converting tables into semantic vectors and inputting user questions and table semantic vectors into the model for question and answer is highly dependent on inputting complete tables. However, large models have data input restrictions and cannot process large data tables. On the other hand, since the output of large models is usually highly random and uncontrollable, the robustness of the results is poor, and hallucination problems are prone to occur when answering questions. In addition, the knowledge that large models are exposed to in their pre-training stage has a low degree of overlap with the table data itself, and the prior knowledge they possess is difficult to apply to table answers. Under the dual influence of the lack of prior knowledge for table information and the hallucination of large model output, the SQL statements generated by large models in the prior art cannot accurately represent the needs of users, so there is a large deviation between the question and answer results and the user's expectations. Summary of the invention
[0003] Based on this, it is necessary to provide a form question and answer method, device, computer equipment, computer-readable storage medium and computer program product that can process large data volumes of tables while improving the accuracy and stability of large model form question and answer in response to the above technical problems.
[0004] In a first aspect, the present application provides a form question-and-answer method, comprising:
[0005] Get the form files and question data uploaded by the target user;
[0006] Parsing the table information in the table file to obtain a candidate tag set;
[0007] Determine, based on the question data and the candidate tag set, a spoken language understanding result corresponding to the question data, wherein the spoken language understanding result includes an intention and a keyword corresponding to the question data;
[0008] Reversely verify the spoken language comprehension result according to the question data to obtain a verification result;
[0009] When the verification result indicates that the spoken language comprehension result has been verified, constructing prompt words according to the table information in the table file, the question data and the spoken language comprehension result;
[0010] The large language model is called to perform question and answer based on the prompt word to obtain a question and answer result.
[0011] In one embodiment, the candidate tag set includes an intent recognition tag and a slot filling tag; and the parsing of the table information in the table file to obtain the candidate tag set includes:
[0012] The table information is parsed to obtain the intention recognition tag and the slot filling tag. In one embodiment, determining the spoken language understanding result corresponding to the question data based on the question data and the candidate tag set includes:
[0013] Performing intent recognition on the question data according to the candidate tag set to obtain the intent;
[0014] The question data is slot-filled according to the candidate tag set to obtain the keyword.
[0015] In one embodiment, the reverse verification of the spoken language comprehension result according to the question data to obtain the verification result includes:
[0016] Performing conflict verification on the intention according to the question data to obtain an intention verification result;
[0017] Performing conflict verification on the keywords according to the question data to obtain a keyword verification result;
[0018] The verification result is determined according to the intention verification result and the keyword verification result.
[0019] In one embodiment, after the large language model is called according to the prompt word to perform question and answer and obtain the question and answer result, the method further includes:
[0020] Performing secondary verification on the question and answer result according to the question data and the spoken language comprehension result to obtain a question and answer verification result;
[0021] When the question and answer verification result indicates that the question and answer result verification fails, obtaining conflict information corresponding to the question and answer verification result;
[0022] Correct the prompt word according to the conflict information to obtain a correction prompt word;
[0023] The large language model is called to perform question and answer according to the error correction prompt word to obtain an error correction question and answer result.
[0024] In one embodiment, after performing secondary verification on the prompt word according to the question and answer result to obtain the question and answer verification result, the method further includes:
[0025] When the question and answer verification result indicates that the question and answer verification is successful or the question and answer verification result indicates that the current verification times is greater than a preset threshold, the question and answer result is sent to the target user.
[0026] In a second aspect, the present application also provides a form question-answering device, comprising:
[0027] The acquisition module is used to obtain the table files and question data uploaded by the target user;
[0028] A parsing module, used to parse the table information in the table file to obtain a candidate tag set;
[0029] A determination module, configured to determine a spoken language understanding result corresponding to the question data based on the question data and the candidate tag set, wherein the spoken language understanding result includes an intention and a keyword corresponding to the question data;
[0030] A verification module, used for reversely verifying the spoken language comprehension result according to the question data to obtain a verification result;
[0031] A construction module, configured to construct prompt words according to 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;
[0032] The question-answering module is used to call the large language model to perform question-answering based on the prompt word to obtain the question-answering result.
[0033] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0034] Get the form files and question data uploaded by the target user;
[0035] Parsing the table information in the table file to obtain a candidate tag set;
[0036] Determine, based on the question data and the candidate tag set, a spoken language understanding result corresponding to the question data, wherein the spoken language understanding result includes an intention and a keyword corresponding to the question data;
[0037] Reversely verify the spoken language comprehension result according to the question data to obtain a verification result;
[0038] When the verification result indicates that the spoken language comprehension result has been verified, constructing prompt words according to the table information in the table file, the question data and the spoken language comprehension result;
[0039] The large language model is called to perform question and answer based on the prompt word to obtain a question and answer result.
[0040] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0041] Get the form files and question data uploaded by the target user;
[0042] Parsing the table information in the table file to obtain a candidate tag set;
[0043] Determine, based on the question data and the candidate tag set, a spoken language understanding result corresponding to the question data, wherein the spoken language understanding result includes an intention and a keyword corresponding to the question data;
[0044] Reversely verify the spoken language comprehension result according to the question data to obtain a verification result;
[0045] When the verification result indicates that the spoken language comprehension result has been verified, constructing prompt words according to the table information in the table file, the question data and the spoken language comprehension result;
[0046] The large language model is called to perform question and answer based on the prompt word to obtain a question and answer result.
[0047] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0048] Get the form files and question data uploaded by the target user;
[0049] Parsing the table information in the table file to obtain a candidate tag set;
[0050] Determine, based on the question data and the candidate tag set, a spoken language understanding result corresponding to the question data, wherein the spoken language understanding result includes an intention and a keyword corresponding to the question data;
[0051] Reversely verify the spoken language comprehension result according to the question data to obtain a verification result;
[0052] When the verification result indicates that the spoken language comprehension result has been verified, constructing prompt words according to the table information in the table file, the question data and the spoken language comprehension result;
[0053] The large language model is called to perform question and answer based on the prompt word to obtain a question and answer result.
[0054] The above table question-answering method, device, computer equipment, computer-readable storage medium and computer program product obtain the table file and question data uploaded by the target user; parse the table information in the table file to obtain a candidate tag set; determine the oral understanding result corresponding to the question data based on the question data and the candidate tag set, and the oral understanding result includes the intention and keywords corresponding to the question data; reversely verify the oral understanding result according to the question data to obtain the verification result; when the verification result indicates that the oral understanding result is verified, construct prompt words according to the table information, question data and oral understanding result in the table file; call the large language model for question-answering according to the prompt words to obtain the question-answering result. Therefore, by parsing the table information in the table file, obtaining the candidate tag set, and determining the oral understanding result corresponding to the question data in combination with the question data, and ensuring the correctness of the oral understanding result through reverse verification, and then by constructing prompt words, it is realized that the large model reasoning link does not need to provide a complete table file, is not limited by the input length of the large model, and can process long tables with more content, thereby improving the versatility and reasoning speed of table question-answering. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions 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 related drawings can be obtained based on these drawings without paying creative work.
[0056] Figure 1 is an application environment diagram of a table question-answering method in an embodiment;
[0057] Figure 2 A schematic diagram of a flow chart of a table question-and-answer method in one embodiment;
[0058] Figure 3 A schematic diagram of a flow chart of a table question-and-answer method in one embodiment;
[0059] Figure 4 A complete flowchart of a table question-and-answer method in one embodiment;
[0060] Figure 5 is a structural block diagram of a table question-and-answer device in one embodiment;
[0061] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0063] The table question-and-answer method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The server 104 obtains the table file and question data uploaded by the target user; parses the table information in the table file to obtain a candidate tag set; determines the spoken language understanding result corresponding to the question data based on the question data and the candidate tag set, and the spoken language understanding result includes the intention and keywords corresponding to the question data; reversely verifies the spoken language understanding result according to the question data to obtain the verification result; when the verification result indicates that the spoken language understanding result is verified, constructs a prompt word according to the table information, question data and spoken language understanding result in the table file; calls the large language model for question and answer according to the prompt word to obtain the question and answer result. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head mounted device may be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 104 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0064] In an exemplary embodiment, Figure 2 As shown, a table question-answering method is provided, which is applied to Figure 1 The server 104 in the example is used as an example to illustrate, including the following steps 202 to 212. Among them:
[0065] Step 202, obtaining the table file and question data uploaded by the target user.
[0066] The table file contains various table information, which may include table title, table introduction, number of rows and columns, column names, data format and other information.
[0067] In some embodiments, the table file uploaded by the target user may be obtained by loading the table file uploaded by the target user from a table cache database, or by loading the table file uploaded by the target user in real time, but is not limited thereto.
[0068] In some embodiments, the question data of the target user may be obtained in real time through a recording device, or the question data of the target user may be obtained from a question database, but the present invention is not limited thereto.
[0069] Step 204: parse the table information in the table file to obtain a candidate tag set.
[0070] The parsing process is the process of analyzing the table information and constructing a set of candidate labels.
[0071] In some embodiments, the candidate tag set includes an intent identification tag and a slot filling tag; parsing the table information in the table file to obtain the candidate tag set includes: parsing the table information to obtain the intent identification tag and the slot filling tag.
[0072] Among them, the intent recognition tag is used to indicate the intent recognition classification type of the table information in the table file, and the slot filling tag is used to indicate the key information of the table information in the table file;
[0073] In some embodiments, the intent recognition result is obtained by parsing the table information in the table file, and the intent recognition tag is constructed according to the intent recognition result, thereby obtaining the intent recognition tag.
[0074] In some embodiments, the slot filling result is obtained by parsing the table information in the table file, and the slot filling tag is constructed according to the slot filling result, thereby obtaining the slot filling tag.
[0075] Step 206 : determining a spoken language understanding result corresponding to the question data based on the question data and the candidate tag set, wherein the spoken language understanding result includes the intention and keywords corresponding to the question data.
[0076] The intention is the purpose of the question data, and the keyword is key information related to the question data.
[0077] In some embodiments, the spoken language comprehension result corresponding to the question data is determined based on the question data and the candidate tag set, including: performing intent recognition on the question data according to the candidate tag set to obtain the intent; and filling slots on the question data according to the candidate tag set to obtain keywords.
[0078] Among them, a few-shot learning strategy is adopted for intent recognition and slot filling, and the few-shot learning strategy refers to the few-shot strategy.
[0079] In some embodiments, a few-sample learning strategy is used in combination with question data to perform intent recognition, so as to obtain all intents related to the question data in the candidate tag set, obtain the intent, and count the number of user intents.
[0080] In some embodiments, a few-sample learning strategy is used in combination with question data to perform slot filling, thereby obtaining all key slot information about the question data in the candidate tag set, obtaining the intent, and counting the number of slots.
[0081] Step 208, reverse verification is performed on the spoken language comprehension result according to the question data to obtain a verification result.
[0082] Among them, reverse verification is a process of verifying whether there is a conflict between question data and oral comprehension results. Reverse verification is used to determine whether the oral comprehension results conflict with the question data, and the number of conflicts is recorded to score the oral comprehension results, thereby determining the verification results based on the verification scores.
[0083] In some embodiments, reverse verification of the spoken language comprehension result is performed based on the question data to obtain a verification result, including: performing conflict verification of the intent based on the question data to obtain an intent verification result; performing conflict verification of the keyword based on the question data to obtain a keyword verification result. The verification result is determined based on the intent verification result and the keyword verification result.
[0084] In some embodiments, the intent is verified for conflict based on the question data to determine whether the intent has an information conflict with the question data, and the intent conflict results are recorded. The number of times all intents conflict with the question data is counted. The greater the number of times, the lower the intent recognition score corresponding to the calculated intent verification result. The intent recognition score and the intent conflict result are constructed into an intent verification result.
[0085] In some embodiments, conflict verification is performed on keywords based on question data to determine whether there is any information conflict between the keywords and the question data, and the keyword conflict results are recorded. The number of times all keywords conflict with the question data is counted. The greater the number of times, the lower the keyword recognition score corresponding to the calculated keyword verification result. The keyword recognition score and the keyword conflict result are constructed into an intent verification result.
[0086] In some embodiments, if the keyword recognition score of the keyword verification result is less than a first preset threshold, or the intent recognition score of the intent verification result is less than a first preset threshold, the spoken language understanding 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 re-performed, and the verification result is set to a failed spoken language understanding result verification.
[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 result and the intent conflict result are recorded as a verification result, and the verification result is set as a spoken language comprehension result verification passed.
[0088] Step 210: when the verification result indicates that the spoken language comprehension result has been verified, construct prompt words according to the table information in the table file, the question data and the spoken language comprehension result.
[0089] Among them, the prompt word is an AI model prompt word adopted, and the AI model prompt word can be prompt information.
[0090] In some embodiments, in combination with the user's question being Q, the spoken language comprehension result being Y, and the table information being E, a prompt word P is constructed according to the table information in the table file, the question data, and the spoken language comprehension result. The format of the prompt word P is as follows: <Existing table E; The user asked the following question: Q; The user's main intentions include: ; The user's question contains the following key semantic information ; Please complete the user's question based on the above content>, where the prompt word P is a prompt information.
[0091] It should be noted that the spoken language understanding result will indicate the intention of the current user's question and the keywords contained in the user's question. Since the spoken language understanding result label is constructed based on the candidate label set corresponding to the table information and predicted based on the user's question, the spoken language understanding result contains both the main semantic information of the table file and the key semantics of the user's question. This embodiment introduces the spoken language understanding result into the prompt, which plays an important role in providing the table semantics to the large model without providing a complete table.
[0092] Step 212, calling the large language model to perform question and answer based on the prompt word to obtain the question and answer result.
[0093] Among them, the large language model refers to the large-scale language model technology in artificial intelligence technology, which is mainly used in the field of natural language processing.
[0094] In some embodiments, the prompt word is input into the called large language model for question and answer, and the question and answer result is obtained. In this embodiment, there is no limitation on the specific output scheme. The question and answer result can be the answer directly given by the large language model, or the question and answer result obtained by using SQL, but is not limited to this.
[0095] In the above table question-answering method, the table file and question data uploaded by the target user are obtained; the table information in the table file is parsed to obtain a candidate tag set; the oral understanding result corresponding to the question data is determined based on the question data and the candidate tag set, and the oral understanding result includes the intention and keywords corresponding to the question data; the oral understanding result is reversely verified according to the question data to obtain a verification result; when the verification result indicates that the oral understanding result is verified, a prompt word is constructed according to the table information, question data and oral understanding result in the table file; the large language model is called for question-answering according to the prompt word to obtain the question-answering result. Therefore, by parsing the table information in the table file, a candidate tag set is obtained, and the oral understanding result corresponding to the question data is determined in combination with the question data, and the correctness of the oral understanding result is ensured by reverse verification, and then by constructing the prompt word, it is realized that the large model reasoning link does not need to provide a complete table file, and is not limited by the input length of the large model, and can process long tables with more content, thereby improving the versatility and reasoning speed of the table question-answering.
[0096] In an exemplary embodiment, Figure 3 As shown, after the large language model is called according to the prompt word to perform question and answer and obtain the question and answer result, the method further includes: a prompt word verification step, which includes steps 302 to 308. Among them:
[0097] Step 302, perform secondary verification on the question and answer results based on the question data and the oral comprehension results to obtain a question and answer verification result.
[0098] Among them, the secondary verification is also a conflict verification process, which is used to determine whether the question and answer results are inconsistent with the prompt words, or whether the question and answer results produce hallucination problems.
[0099] In some embodiments, the question-answering result is verified twice in combination with the question data and the spoken language comprehension result of the target user to determine whether the question-answering result has any information contradiction or conflict with the question data and the spoken language comprehension result.
[0100] In some embodiments, if there is a conflict, the 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 has failed, and the current verification number plus 1 is recorded in the question-and-answer verification result.
[0101] In some embodiments, if there is no conflict, the conflict information is recorded and a question-and-answer verification result is constructed, which indicates that the question-and-answer result verification is successful.
[0102] Step 304: when the question and answer verification result indicates that the question and answer verification has failed, obtain conflict information corresponding to the question and answer verification result.
[0103] The conflicting information may be table information in the prompt words, question data, and spoken language comprehension results.
[0104] In some embodiments, when the question and answer verification result indicates that the question and answer verification failed and the current verification times are 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 process of constructing error correction prompt words, 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 word according to the conflict information to obtain a corrected prompt word.
[0106] The error correction prompt word refers to a prompt word obtained by modifying the part of the prompt word related to the conflicting information according to the conflicting information.
[0107] In some embodiments, the prompt word is corrected according to the conflict information, and the format of the corrected prompt word is: <table file E and user question: Q; user's intention includes: ; The user's question contains the following keywords ; Your answer to this question R and the user's intention or keyword A conflict has occurred. The specific conflict is as follows: error; please correct the error and answer again>, where error is the specific conflict information.
[0108] It should be noted that the double verification process of the oral comprehension results and the question-answering results generated by the large model reduces the negative impact of the large model hallucination problem on tabular question-answering and improves the stability and security of the question-answering system.
[0109] Step 308, calling the large language model to perform question and answer based on the error correction prompt word to obtain the error correction question and answer result.
[0110] In some embodiments, the error correction prompt words are input into the large language model and the error correction question and answer results are obtained. This embodiment does not limit the specific output scheme. The error correction question and answer results can be the answers directly given by the model, or the error correction question and answer results obtained using SQL, but are not limited to this.
[0111] In some embodiments, after performing a secondary verification on the prompt word based on the question and answer result to obtain the question and answer verification result, the method also includes: when the question and answer verification result indicates that the question and answer result verification is successful or the question and answer verification result indicates that the current verification times is greater than a preset threshold, sending the question and answer result to the target user.
[0112] The preset threshold can be set according to actual needs, and the default setting is 3.
[0113] In order to understand the solution of this application more clearly, Figure 4 The details are as follows:
[0114] in, Figure 4 The user questions in include question data, prompt is an AI prompt word model, and model refers to a large language model.
[0115] First, parse the table file uploaded by the user, and construct a set of spoken language understanding labels containing intent recognition classification labels and slot filling labels by parsing the table title, table introduction, number of rows and columns, column names, data format and other information in the table file. Then, combine the user's questions and use the few-shot strategy to predict the spoken language understanding results (including intent and keywords), and reversely verify the spoken language understanding results in combination with the user's questions to ensure the correctness of spoken language understanding. After successful verification, construct the prompt word prompt in combination with the user's question data, table information and spoken language understanding results, where the spoken language understanding results will indicate the main intent of the current user's question data and which keywords are included in the user's question data. Since the spoken language understanding result label is constructed based on the table information and predicted based on the user's question data, the spoken language understanding result contains both the main semantic information of the table file and the keywords of the user's question. This method introduces the spoken language understanding results into the prompt word prompt here, which plays an important role in providing the table semantics to the large model without providing a complete table.
[0116] Secondly, the prompt word prompt is input into the large language model for question and answer, and the question and answer result is obtained from the output of the large language model. The method of obtaining the question and answer result here in the specific implementation process is not limited. For example, you can choose to directly let the model answer or you can get the answer by generating an SQL query table. The specific implementation scheme in this step is not the core technology of this method.
[0117] Finally, the question-answering results generated by the large language model are verified again by combining the user's question data and the oral understanding results to ensure the accuracy of the question-answering results. If the verification fails, the model is asked again using the error message obtained in step 6 and the process is repeated. If the verification passes, the question-answering results of the user's question are returned.
[0118] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0119] Based on the same inventive concept, the embodiment of the present application also provides a table question and answer device for implementing the table question and answer method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more table question and answer device embodiments provided below can refer to the limitations of the table question and answer method above, and will not be repeated here.
[0120] In an exemplary embodiment, Figure 5 As shown, a table question-answering 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-answering module 506, wherein:
[0121] The acquisition module 501 is used to acquire the table file and question data uploaded by the target user;
[0122] The parsing module 502 is used to parse the table information in the table file to obtain a candidate tag set;
[0123] A determination module 503 is used to determine a spoken language understanding result corresponding to the question data based on the question data and the candidate tag set, where the spoken language understanding result includes the intention and keywords corresponding to the question data;
[0124] Verification module 504, used to reversely verify the spoken language comprehension result according to the question data to obtain a verification result;
[0125] A construction module 505, configured to construct prompt words according to 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 verification is passed;
[0126] The question-answering module 506 is used to call the large language model to perform question-answering according to the prompt words and obtain the question-answering result.
[0127] In some embodiments, the candidate tag set includes an intent identification tag and a slot filling tag; the parsing module 502 is further used to parse the table information to obtain the intent identification tag and the slot filling tag.
[0128] In some embodiments, the determination module 503 is further used to perform intent recognition on the question data according to the candidate tag set to obtain the intent; and to perform slot filling on the question data according to the candidate tag set to obtain keywords.
[0129] In some embodiments, the verification module 504 is also used to perform conflict verification on the intent according to the question data to obtain the intent verification result; perform conflict verification on the keyword according to the question data to obtain the keyword verification result; and determine the verification result according to the intent verification result and the keyword verification result.
[0130] In some embodiments, after calling a large language model to conduct question and answer based on a prompt word and obtaining a question and answer result, the device also includes: an error correction module, which is used to perform a secondary verification on the question and answer result based on the question data and the oral comprehension result to obtain a question and answer verification result; when the question and answer verification result indicates that the question and answer result verification failed, obtain conflict information corresponding to the question and answer verification result; correct the prompt word based on the conflict information to obtain a correction prompt word; call the large language model to conduct question and answer based on the correction prompt word to obtain a correction question and answer result.
[0131] In some embodiments, after performing a secondary verification on the prompt word based on the question and answer result to obtain the question and answer verification result, the device also includes: a sending module, which is used to send the question and answer result to the target user when the question and answer verification result indicates that the question and answer result verification is successful or the question and answer verification result indicates that the current verification times is greater than a preset threshold.
[0132] In the above table question-and-answer device, the table file and question data uploaded by the target user are obtained; the table information in the table file is parsed to obtain a candidate tag set; the spoken language understanding result corresponding to the question data is determined based on the question data and the candidate tag set, and the spoken language understanding result includes the intention and keywords corresponding to the question data; the spoken language understanding result is reversely verified according to the question data to obtain a verification result; when the verification result indicates that the spoken language understanding result is verified, a prompt word is constructed according to the table information, question data and spoken language understanding result in the table file; the large language model is called for question-and-answer according to the prompt word to obtain the question-and-answer result. Therefore, by parsing the table information in the table file, a candidate tag set is obtained, and the spoken language understanding result corresponding to the question data is determined in combination with the question data, and the correctness of the spoken language understanding result is ensured by reverse verification, and then by constructing the prompt word, it is realized that the large model reasoning link does not need to provide a complete table file, and is not limited by the input length of the large model, and can process long tables with more content, thereby improving the versatility and reasoning speed of the table question-and-answer.
[0133] Each module in the above table question-answering device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.
[0134] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store table files and question data uploaded by the target user. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a table question and answer method is implemented.
[0135] Those skilled in the art will understand that Figure 6The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0136] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned table question and answer method when executing the computer program.
[0137] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned table question and answer method are implemented.
[0138] In one embodiment, a computer program product is provided, including a computer program, which implements the steps of the above-mentioned table question and answer method when executed by a processor.
[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, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0140] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0141] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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 above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A table question-answering method, characterized in that: The method comprises: Get the form files and question data uploaded by the target user; Parsing the table information in the table file to obtain a candidate tag set; Determine, based on the question data and the candidate tag set, a spoken language understanding result corresponding to the question data, wherein the spoken language understanding result includes an intention and a keyword corresponding to the question data; Reversely verify the spoken language comprehension result according to the question data to obtain a verification result; When the verification result indicates that the spoken language comprehension result has been verified, constructing prompt words according to the table information in the table file, the question data and the spoken language comprehension result; The large language model is called to perform question and answer based on the prompt word to obtain a question and answer result.
2. The method according to claim 1, characterized in that The candidate tag set includes an intent recognition tag and a slot filling tag; the parsing of the table information in the table file to obtain the candidate tag set includes: The table information is parsed to obtain the intent identification tag and the slot filling tag.
3. The method according to claim 1, characterized in that The determining, based on the question data and the candidate tag set, a spoken language comprehension result corresponding to the question data includes: Performing intent recognition on the question data according to the candidate tag set to obtain the intent; The question data is slot-filled according to the candidate tag set to obtain the keyword.
4. The method according to claim 1, characterized in that: The reverse verification of the spoken language comprehension result according to the question data to obtain the verification result includes: Performing conflict verification on the intention according to the question data to obtain an intention verification result; Performing conflict verification on the keywords according to the question data to obtain a keyword verification result; The verification result is determined according to the intention verification result and the keyword verification result.
5. The method according to claim 1, characterized in that After the large language model is called according to the prompt word to perform question and answer and obtain the question and answer result, the method further includes: Performing secondary verification on the question and answer result according to the question data and the spoken language comprehension result to obtain a question and answer verification result; When the question and answer verification result indicates that the question and answer result verification fails, obtaining conflict information corresponding to the question and answer result verification result; Correct the prompt word according to the conflict information to obtain a correction prompt word; The large language model is called to perform question and answer according to the error correction prompt word to obtain an error correction question and answer result.
6. The method according to claim 5, characterized in that After performing secondary verification on the prompt word according to the question and answer result to obtain the question and answer verification result, the method further includes: When the question and answer verification result indicates that the question and answer verification is successful or the question and answer verification result indicates that the current verification times is greater than a preset threshold, the question and answer result is sent to the target user.
7. A table question-answering device, characterized in that: The device comprises: The acquisition module is used to obtain the table files and question data uploaded by the target user; A parsing module, used to parse the table information in the table file to obtain a candidate tag set; A determination module, configured to determine a spoken language understanding result corresponding to the question data based on the question data and the candidate tag set, wherein the spoken language understanding result includes an intention and a keyword corresponding to the question data; A verification module, used for reversely verifying the spoken language comprehension result according to the question data to obtain a verification result; A construction module, configured to construct prompt words according to 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; The question-answering module is used to call the large language model to perform question-answering based on the prompt word to obtain the question-answering result.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
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 of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Financial data query method and device and readable storage medium
CN113515549A
Table question and answer data processing method, electronic equipment and computer storage medium
CN114579605A
Table question and answer processing method, device and equipment
CN117332054A
Table question and answer method, system and equipment based on large model
CN119046287A
Intelligent auxiliary judgment method and apparatus, and computer device and storage medium
WO2021031383A1
Cited By
Multi-modal fine-grained instruction fine-tuning data construction method based on reverse verification
CN121835802A
Multi-modal fine-grained instruction fine-tuning data construction method based on reverse verification
CN121835802B
Excel data knowledge question-answering method based on table structure semantic collaboration
CN122390090A