Table question and answer processing method, apparatus and device

CN117332054BActive Publication Date: 2026-08-07HANGZHOU ALIBABA INT INTERNET IND CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU ALIBABA INT INTERNET IND CO LTD
Filing Date
2023-09-13
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

目前的表格问答技术中要么需要预先训练用于将自然语言转换成SQL语言的模型,比较繁琐,要么得到的答案准确度较低

Benefits of technology

[0009] The beneficial effects of the embodiments in this specification are as follows: When using various language models to process table-based question-and-answer tasks, in order to improve the accuracy of the answers output by the language model, in addition to outputting the question to be queried and the corresponding table data to the language model, one or more pre-built template thought chains can also be input. Each template thought chain corresponds to a set of template question-and-answer pairs, and the template thought chain is used to describe the derivation process from the question to the answer in that set of template question-and-answer pairs. Since the language model is provided with additional template thought chains that derive the derivation process from the question to the answer based on the table data, the language model can imitate the derivation process in these one or more template thought chains to determine the target thought chain used to describe the derivation process for obtaining the answer corresponding to the question to be queried, so as to obtain the answer corresponding to the question to be queried. Through the above method, since the language model can learn the derivation process provided in the template thought chains and then use it in the analysis and derivation of the current question to be queried, a more accurate answer can be obtained, thus improving the accuracy of the language model in processing table-based question-and-answer tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117332054B_ABST
    Figure CN117332054B_ABST
Patent Text Reader

Abstract

Embodiments of the present specification provide a table question and answer processing method, device and equipment. The method comprises: obtaining a target question to be queried, target table data corresponding to the target question, and one or more template thinking chains; wherein a template thinking chain is used to describe the derivation process of a question to an answer in a group of template question and answer pairs in a table question and answer task; inputting the target question, the target table data and the one or more template thinking chains into a preset language model, so that the language model determines a target thinking chain used to describe the derivation process of obtaining a target answer corresponding to the target question based on the one or more template thinking chains and the target table data, to obtain the target answer based on the target thinking chain. In this way, the language model can obtain a more accurate answer when processing a table question and answer task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of computer technology, and in particular to a table-based question-and-answer processing method, apparatus, and device. Background Technology

[0002] Table-based question answering (TableQA) technology refers to the ability to provide intelligent question answers based on a given table and the user's questions related to that table. This technology is widely used in intelligent dialogue systems, search engines, and other fields. From a technical perspective, TableQA technology is based on Natural Language Processing (NLP) technology. It converts the user's natural language questions into SQL (Structured Query Language) statements and uses these SQL statements to directly interact with the table data to extract relevant information and generate accurate and useful answers. Current TableQA technologies either require pre-training a model to convert natural language into SQL, which is cumbersome, or the accuracy of the answers obtained is relatively low. Therefore, it is necessary to provide a more convenient and accurate solution. Summary of the Invention

[0003] To overcome the problems existing in related technologies, embodiments of this specification provide a table question-and-answer processing method, apparatus, and device.

[0004] According to a first aspect of the embodiments of this specification, a table-based question-and-answer processing method is provided, the method comprising:

[0005] Obtain the target question to be queried, the target table data corresponding to the target question, and one or more template thinking chains; wherein, a template thinking chain is used to describe the derivation process from question to answer in a set of template question-answer pairs in the table question-answering task;

[0006] The target question, the target table data, and the one or more template thought chains are input into a preset language model, so that the language model determines a target thought chain based on the one or more template thought chains and the target table data to describe the derivation process of obtaining the target answer corresponding to the target question, so as to obtain the target answer based on the target thought chain.

[0007] According to a second aspect of the embodiments of this specification, an electronic device is provided, the electronic device including a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein the computer program, when executed, implements the method mentioned in the first aspect above.

[0008] According to a third aspect of the embodiments of this specification, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, it implements the method mentioned in the first aspect above.

[0009] The beneficial effects of the embodiments in this specification are as follows: When using various language models to process table-based question-and-answer tasks, in order to improve the accuracy of the answers output by the language model, in addition to outputting the question to be queried and the corresponding table data to the language model, one or more pre-built template thought chains can also be input. Each template thought chain corresponds to a set of template question-and-answer pairs, and the template thought chain is used to describe the derivation process from the question to the answer in that set of template question-and-answer pairs. Since the language model is provided with additional template thought chains that derive the derivation process from the question to the answer based on the table data, the language model can imitate the derivation process in these one or more template thought chains to determine the target thought chain used to describe the derivation process for obtaining the answer corresponding to the question to be queried, so as to obtain the answer corresponding to the question to be queried. Through the above method, since the language model can learn the derivation process provided in the template thought chains and then use it in the analysis and derivation of the current question to be queried, a more accurate answer can be obtained, thus improving the accuracy of the language model in processing table-based question-and-answer tasks.

[0010] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit the embodiments of this specification. Attached Figure Description

[0011] The accompanying drawings, which are incorporated herein by reference and form part of the embodiments thereof, illustrate embodiments consistent with those described herein and, together with the description, serve to explain the principles of those embodiments.

[0012] Figure 1 This is a schematic diagram illustrating the use of language models to process table-based question-and-answer tasks in the related technologies described in this specification.

[0013] Figure 2 A flowchart illustrating a form-based question-and-answer task using a language model, as shown in an exemplary embodiment of this specification;

[0014] Figures 3(a) and 3(b) are schematic diagrams illustrating application scenarios in the embodiments of this specification;

[0015] Figure 4 A flowchart illustrating a form question-and-answer processing method as an exemplary embodiment of this specification;

[0016] Figure 5 This is a schematic diagram illustrating a training mind chain generation model as an exemplary embodiment of this specification;

[0017] Figure 6This is a schematic diagram illustrating the generation of template thought chains through a language model, as an exemplary embodiment of this specification.

[0018] Figure 7 This is a schematic diagram illustrating a table-based question-and-answer task using a language model, as an exemplary embodiment of this specification.

[0019] Figure 8 This is a logic block diagram of a device illustrated in an exemplary embodiment of this specification. Detailed Implementation

[0020] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those described in this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the embodiments described in this specification as detailed in the appended claims.

[0021] The terminology used in the embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the embodiments of this specification. The singular forms “a,” “described,” and “the” as used in the embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0022] It should be understood that although the terms first, second, third, etc., may be used to describe various information in the embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of the embodiments of this specification, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0023] Table-based question answering (TableQA) technology refers to the ability to provide intelligent question answers based on a given table and the user's questions related to that table. This technology is widely used in intelligent dialogue systems, search engines, and other fields. From a technical perspective, TableQA technology is based on Natural Language Processing (NLP) technology. It converts the user's natural language questions into SQL (Structured Query Language) statements and uses these SQL statements to directly interact with the table data to extract relevant information and generate accurate and useful answers.

[0024] The key to table-based question answering technology is accurately understanding the natural language questions posed by users in order to convert them into accurate SQL statements and thus obtain accurate answers. In related technologies, one approach to handling table-based question answering tasks is to train a model using a large amount of sample data. The trained model then converts the natural language questions into SQL statements, which are used to query a given table to obtain the corresponding answers. However, this method requires pre-training the model, making it rather cumbersome.

[0025] With the emergence of various open-source language models such as ChatGPT, another approach is to directly utilize existing language models to handle table-based question-answering tasks, such as... Figure 1 As shown, users can directly input natural language questions and corresponding tabular data into language model 10, which then analyzes the data to obtain the answers. Using the existing language model 10 directly for table-based question-answering tasks is more convenient and faster because it eliminates the need for pre-training. However, currently, the accuracy of language model 10 in processing table-based question tasks is relatively low, and the answers obtained are not accurate enough. Therefore, a more convenient and accurate solution for table-based question-answering tasks is needed.

[0026] Based on this, the embodiments of this specification provide a table-based question-and-answer processing method, such as... Figure 2 As shown, when using various language models 10 to process table-based question-and-answer tasks, in order to improve the accuracy of the answers output by the language model 10, in addition to outputting the question to be queried and the corresponding table data to the language model 10, one or more pre-built template thought chains can also be input. Each template thought chain corresponds to a set of template question-and-answer pairs, and this template thought chain is used to describe the derivation process from the question to the answer in that set of template question-and-answer pairs. Since the language model 10 is provided with additional template thought chains that derive the derivation process from the question to the answer based on the table data, the language model 10 can imitate these one or more template thought chains to determine the target thought chain used to describe the derivation process for obtaining the answer corresponding to the question to be queried, so as to obtain the answer corresponding to the question to be queried. Through the above method, since the language model 10 can learn the derivation process provided in the template thought chains and then use it in the analysis and derivation of the current question to be queried, it can obtain a more accurate answer, thereby improving the accuracy of the language model 10 in processing table-based question-and-answer tasks.

[0027] The table-based question-and-answer processing method provided in the embodiments of this specification can be used in various scenarios that require intelligent question-and-answer capabilities. For example, taking the risk control scenario under an e-commerce platform as an example, e-commerce platforms contain a large amount of user data and transaction data. Table-based question-and-answer technology can be used to ask questions about this data in order to quickly obtain risk information from the massive amount of data, and then determine the corresponding risk control strategy based on the risk information. Of course, this table-based question-and-answer processing method can also be used in other scenarios, and the embodiments of this specification do not impose any limitations.

[0028] The table-based question-and-answer processing method provided in the embodiments of this specification can be executed by various electronic devices, such as terminal devices, servers, or server clusters. As shown in Figure 3(a), it is a schematic diagram of an application scenario of an embodiment of this specification. The user can input the target question to be queried through the user client 21. The user client 21 can send the target question to the business server 22. The business server 22 is equipped with a language model 10 and stores the target table data corresponding to the target question. At the same time, the business server 22 also stores a template thinking chain library. The template thinking chain library stores multiple template thinking chains. Each template thinking chain includes a set of template question-and-answer pairs, the table data corresponding to the template question-and-answer pair, and the derivation process from the question to the answer in the question-and-answer pair (for example, template thinking chain 1 is used to describe the derivation process A from the question to the answer in template question-and-answer pair A, and the table data corresponding to template question-and-answer pair A is table data A). After obtaining the target question, the business server 22 can retrieve one or more template thinking chains that are suitable for the target question from the template thinking chain library. Then, it inputs the target question, template thinking chain, and target table data into the language model 10, and the language model 10 outputs the target thinking chain. The business server 22 then sends the target thinking chain to the client, or extracts the target answer from the target thinking chain and sends the target answer to the user client 21.

[0029] Figure 3(b) illustrates an application scenario of another embodiment of this specification. The language model 10 can be an open-source model provided by a third-party server 23. A user can input a target question to be queried through a user client 21. The user client 21 can send the target question to a business server 22. The business server 22 stores target table data corresponding to the target question and a template thought chain library, which stores multiple template thought chains. After receiving the target question, the business server 22 can retrieve one or more template thought chains matching the target question from the template thought chain library. Then, the target question, target table data, and template thought chains are sent to the third-party server 23, which inputs them into the language model 10 to obtain the target thought chain and returns it to the business server 22. The business server 22 then sends the target thought chain back to the client, or extracts the target answer from the target thought chain and sends the target answer to the user client 21.

[0030] like Figure 4 As shown, the question-and-answer processing method for this form may include the following steps:

[0031] S402. Obtain the target question to be queried, the target table data corresponding to the target question, and one or more template thinking chains; wherein, a template thinking chain is used to describe the derivation process from question to answer in a set of template question-answer pairs in the table question-answering task;

[0032] In step S402, the target question to be queried, the target table data corresponding to the target question, and one or more template thought chains can be obtained. The target question can be a natural language question input by the user, which can be input by the user through various means such as voice or text; this embodiment of the specification does not impose any limitations. The target table data can be pre-given table data related to the target question; that is, the answer to the target question can be extracted from the target table data.

[0033] These one or more template thought chains can be pre-built or generated ad-hoc. For example, in some scenarios, multiple template thought chains covering different types of derivation processes can be pre-built, and for each target question to be queried, these pre-built template thought chains can be input into language model 10. In other scenarios, for each target question to be queried, one or more template thought chains adapted to that target question can also be generated ad-hoc and then output into language model 10. These one or more template thought chains can be manually built by the user or automatically generated.

[0034] Each template mind chain corresponds to a set of template question-and-answer pairs in a table-based question-and-answer task. Each template question-and-answer pair includes a question and its corresponding answer. The template mind chain describes the derivation process of obtaining the answer to the question in the template question-and-answer pair from the table data. For example, suppose template question-and-answer pair 1 includes question Q1 and answer A1. The answer A1 corresponding to question Q1 needs to be derived from table data T1 through analysis and reasoning. Then, the template mind chain corresponding to template question-and-answer pair 1 is used to describe the derivation process of obtaining the answer A1 corresponding to question Q1 from table data T1.

[0035] The template thought chain can be a thought chain describing the derivation process using natural language, or the derivation process described by the template thought chain can simultaneously include natural language and structured query language. For each target question to be queried, one template thought chain can be obtained, or multiple template thought chains can be obtained simultaneously; this specification does not impose any limitations on the embodiments.

[0036] S404. Input the target question, the target table data, and the one or more template thinking chains into a preset language model 10, so that the language model 10 determines a target thinking chain based on the one or more template thinking chains and the target table data to describe the derivation process of obtaining the target answer corresponding to the target question, so as to obtain the target answer based on the target thinking chain.

[0037] In step S404, after obtaining the above information, the acquired target question, target table data, and one or more template thought chains can be input into a preset language model 10. In some embodiments, the language model 10 can be any existing open-source language model, such as ChatGPT. The language model 10 can imitate and learn from the one or more template thought chains to obtain a target thought chain that describes the derivation process of obtaining the target answer corresponding to the target question based on the target table data. The target thought chain describes the entire process of deriving the target answer from the analysis of the target question, and the target answer corresponding to the target question can be determined based on the target thought chain. Furthermore, since the language model 10 learns and imitates the derivation process from question to answer in the template question-answer pair, the obtained target thought chain and target answer are more accurate.

[0038] In some embodiments, the target question to be queried can be input by the user through user client 21. Considering that the level of detail the user ultimately wants in the answer varies depending on the scenario, for example, in some scenarios, the user may only want to obtain a simple answer and does not care about the derivation process of the answer. In other scenarios, the user may also want to obtain the derivation process of the answer in order to conduct subsequent data analysis based on the derivation process. Therefore, in some embodiments, considering that the target thought chain includes the entire derivation process from the target question to the target answer, that is, it also includes the answer, after obtaining the target thought chain through language model 10, the target answer can be extracted from the target thought chain and then returned to user client 21 for display to the user.

[0039] In some embodiments, the target thought chain can also be directly returned to the user client 21 for display, allowing the user to extract the target answer and understand the detailed derivation process. In related technologies, when processing table-based question-and-answer tasks, models typically only output the answer to the question without knowing the basis for the model's derivation from the question to the answer. However, in this embodiment, the model can directly output the target thought chain describing the derivation process from the question to the answer and return it to the user. This method enhances the interpretability and comprehensibility of the question-and-answer process, allowing users to understand the problem-solving process. Simultaneously, users can verify the accuracy of the answer based on the target thought chain.

[0040] In some embodiments, the one or more template thought chains may contain only the derivation process described in natural language. Similarly, the target thought chain obtained by the language model 10 by imitating the one or more template thought chains also contains only the derivation process described in natural language. However, since the language model 10 ultimately needs to use structured language to query and perform related operations on the table data to obtain the answer to the question, this method makes the language model 10 slower and less accurate in processing table question-and-answer tasks.

[0041] Since the accuracy of the answers output by language model 10 in a table-based question-answering task primarily depends on the accuracy of converting natural language questions into SQL statements, in order to further improve the processing efficiency and accuracy of language model 10 in processing table-based question-answering tasks, in some embodiments, the one or more template thought chains also include SQL statements. These SQL statements are used to query the answers corresponding to the questions in the template question-answer pairs from the table data corresponding to those pairs. That is, the template thought chain not only includes the derivation process of the natural language description but can also include SQL statements. Similarly, the target thought chain generated by language model 10 based on the one or more template thought chains also includes SQL statements. The reason why adding SQL statements to the thought chain can improve the processing efficiency and accuracy of language model 10 is as follows:

[0042] First, by incorporating SQL statements into the template thinking chain, language model 10 can mimic the SQL statements in the template thinking chain to generate the SQL statements for the target thinking chain, resulting in more accurate SQL statements in the final transformation. Second, since SQL is specifically designed for processing structured data, it can efficiently query and filter data through optimization techniques such as database indexing. Therefore, including this structured statement in the thinking chain significantly improves processing efficiency. In contrast, processing based solely on natural language may require more text parsing and computation, resulting in relatively lower efficiency. Furthermore, including SQL statements in the thinking chain allows for precise specification of query conditions and operations, avoiding ambiguity or misunderstanding. For specific query requirements in table-based question-and-answer systems, SQL can more accurately express user intent, reducing potential errors and thus improving the accuracy of the answers output by language model 10. Finally, SQL possesses powerful aggregation, filtering, and analysis capabilities, enabling the extraction of key information from large amounts of data. This is extremely useful in table-based question-and-answer scenarios that require summarizing, statistical analysis, or logical deduction, making the processing of table data more flexible. Therefore, a thought chain based on SQL statements can fully leverage the advantages of SQL statements in table-based question and answering, improving the accuracy, efficiency, and flexibility of question answers.

[0043] In some embodiments, the SQL statement includes instructions for querying table data and instructions for manipulating the table data, wherein the instructions for manipulating the table data are used to perform one or more of the following: selecting specific columns from the table data, filtering specific rows from the table data, and performing aggregation processing on the table data using aggregate functions.

[0044] Considering that the closer the standard derivation process from the target question to the target answer is to the derivation process from the question to the answer in the template question-answer pair (i.e., the derivation process described by one or more template thinking chains mentioned above), the more accurate the derivation process described by the target thinking chain obtained by the language model 10 in learning and imitating the template thinking chain will be, i.e., the closer it is to the standard derivation process. Therefore, in some embodiments, when selecting one or more template thinking chains corresponding to the target question, the similarity between the derivation process of the selected one or more template thinking chains and the standard derivation process is greater than a preset similarity threshold.

[0045] In some embodiments, it is considered that if two questions belong to similar types, the derivation process for obtaining the corresponding answer to the question is also similar.

[0046] For example, Question 1: What is the average score of student XX in all subjects?

[0047] Question 2: What is the average income of residents in city XX?

[0048] Since both problems involve averaging, their methods of querying data from tables and calculations are largely similar, meaning the reasoning processes for obtaining the answers to the two problems are also quite similar. Therefore, the reasoning process for the other problem, derived from the reasoning process of one problem using language model 10, is also relatively accurate. Thus, a template reasoning chain library can be pre-built. The template reasoning chains in this library can be categorized according to the type of questions in the corresponding template question-and-answer pairs. The question types can be determined based on actual scenarios, and the reasoning processes for deriving answers from questions of the same type are relatively similar. When obtaining one or more reasoning chains corresponding to a target problem, the type of the target problem can be determined first. Then, one or more template reasoning chains can be obtained from the template reasoning chain library as the template reasoning chains for that target problem. The type of questions in the template question-and-answer pairs corresponding to the obtained template reasoning chains must match the type of the target problem. For example, assuming the target problem belongs to type X, template question-and-answer pairs belonging to type X can be obtained from the template reasoning chain library, and the template reasoning chains corresponding to these pairs can be used as the template reasoning chains adapted to the target problem.

[0049] In some embodiments, considering that manually constructing template-based thought chains by users is cumbersome, and that such thought chains are unlikely to cover various types of problems and derivation processes, therefore, as... Figure 5 As shown, a thought chain generation model 11 can be pre-trained. Then, the questions from pre-set template question-and-answer pairs and the corresponding table data are input into this model 11 to generate one or more template thought chains. To ensure the generated template thought chains are more closely matched to the target question (i.e., the derivation processes of the two questions are more similar), when obtaining template question-and-answer pairs, pairs with the same question type as the target question can be selected. This approach makes the construction of template thought chains more convenient and faster, and also allows for the generation of more suitable template thought chains for different questions.

[0050] In some embodiments, in order to train a thought chain generation model 11 that can accurately generate template thought chains corresponding to the target problem, the model can be trained using reinforcement learning. For example, ... Figure 5As shown, training samples can be pre-constructed. Each training sample may include a sample question, sample table data corresponding to the sample question, and multiple pre-constructed labeled thought chains describing the derivation process for obtaining the answer to the sample question. Each labeled thought chain corresponds to a score, which describes the accuracy of the labeled thought chain. For example, the closer the derivation process described by the labeled thought chain is to the standard derivation process for obtaining the answer to the sample question, the higher its score. Then, the sample question and sample table data in each training sample can be input into a pre-set initial model 12, which outputs a predicted thought chain. The predicted thought chain can then be compared with multiple labeled thought chains to determine the degree of closeness between the predicted thought chain and the multiple labeled thought chains. Based on the scores corresponding to each of the multiple labeled thought chains, a target score for the predicted thought chain is obtained. Then, the parameters of the initial model 12 are continuously adjusted based on the target score to train the aforementioned thought chain generation model 11.

[0051] In some embodiments, in order to obtain a more accurate thought chain generation model 11, when constructing training samples, the sample questions in the training samples can include different types of questions. Similarly, the sample table data can also include multiple tables with different structures, making the training samples more diverse to cover different types.

[0052] In some embodiments, considering that specifically training the thought chain generation model 11 is rather cumbersome, therefore, as Figure 6 As shown, one or more template thought chains can also be generated using some open-source language models 10. Similarly, to enable language model 10 to generate more accurate template thought chains, additional prompts can be input into language model 10. For example, the questions in the template question-answer pair, the corresponding table data of the template question-answer pair, and pre-set prompts can be input into language model 10, and language model 10 can output one or more template thought chains. The prompts describe the thought chain generation process. For example, the prompts can describe the process of generating a template thought chain corresponding to a specified question-answer pair based on a specified question-answer pair and the table data matching the question-answer pair, thereby guiding language model 10 to imitate the prompts to generate the thought chain corresponding to the template question-answer pair. By additionally inputting prompts describing the thought chain generation process into language model 10, language model 10 can imitate the prompts to generate template thought chains for the target question, thus obtaining accurate thought chains without training a dedicated model.

[0053] In related technologies, when processing table-based question-and-answer tasks, models typically only output the answer to the question, without knowing the basis for the model's derivation from the question to the answer. However, in the embodiments of this specification, the model can directly output a target thought chain describing the derivation process from the question to the answer. This method enhances the interpretability and comprehensibility of the question-and-answer process, enabling users to gain a deeper understanding of the problem-solving process and verify the accuracy of the answer. Furthermore, by incorporating SQL statements, it also possesses flexible query and manipulation capabilities for table data, supporting more complex and flexible table-based question-and-answer tasks. Moreover, since the target thought chain encompasses the derivation process from the question to the answer—that is, it extracts more key information from the table data—it can be further utilized for subsequent analysis.

[0054] For example, in some embodiments, this table-based question-and-answer processing method can be used in online payment risk control scenarios. For instance, the target table data can be transaction data from an online payment scenario, and the target question is a risk control-related question. Since the generated target thought chain describes the derivation process of obtaining the aforementioned question, meaning the target thought chain includes some key information related to risk control extracted from the target table data, after the language model 10 generates the target thought chain, key features can be extracted from the target thought chain, such as transaction amount, transaction frequency, login location, etc., and then risk management strategies can be formulated based on these key features. Since the analysis and derivation process in the target thought chain is actually also derived from extracting a large amount of information from the table data, directly extracting key features from the target thought chain is faster and more useful than directly analyzing the table data and extracting key information, thus enabling the formulation of risk management strategies.

[0055] In some embodiments, correlation analysis can also be performed using SQL statements within the target thought chain to discover relationships between transactions, such as multiple accounts with the same IP address or device. This can also detect abnormal transactions, identify common fraud patterns, and make anti-fraud decisions. Through these applications, the derivation process, including SQL language, can be used in risk control scenarios to achieve more accurate risk identification and decision-making. This not only strengthens the identification of abnormal transactions but also allows for continuous optimization of risk control strategies based on historical data, improving the system's automation and accuracy.

[0056] To further explain the table-based question-and-answer processing method provided in this embodiment, the following explanation is based on a specific embodiment.

[0057] For example, such as Figure 7As shown, suppose we have tables T1 and T2. Table T1 contains the table data corresponding to the template question-and-answer pair, and table T2 contains the table data corresponding to the target question to be queried in the current table question-and-answer task. To accurately obtain the answer to the target question, we can input table T1, the template thought chain, the target question, and table T2 into language model 10 (e.g., GPT Model). The model can then predict and derive the target thought chain, which describes the derivation process for the answer to the target question. To improve the processing efficiency and accuracy of language model 10, the template thought chain can include SQL statements, and thus the generated target thought chain also includes SQL statements. After obtaining the target thought chain, since it not only includes the answer to the target question but also describes the derivation process, users can verify the accuracy of the answer based on the target thought chain and use it for subsequent question analysis.

[0058] Corresponding to the table question-and-answer processing method embodiments provided in this specification, this specification also provides a table question-and-answer processing apparatus, the apparatus comprising:

[0059] The acquisition module is used to acquire the target question to be queried, the target table data corresponding to the target question, and one or more template thinking chains; wherein, each template thinking chain is used to describe the derivation process from question to answer in a set of template question-answer pairs in the table question-answering task;

[0060] The processing module is used to input the target question, the target table data, and the one or more template thinking chains into a preset language model, so that the language model determines a target thinking chain based on the one or more template thinking chains and the target table data to describe the derivation process of obtaining the target answer corresponding to the target question, so as to obtain the target answer based on the target thinking chain.

[0061] The specific implementation process of the functions and roles of each unit in the above-mentioned device can be found in the implementation process of the corresponding steps in the above-mentioned memory allocation method, and will not be repeated here.

[0062] For the apparatus embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The apparatus embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the embodiments in this specification, depending on actual needs. Those skilled in the art can understand and implement this without creative effort.

[0063] From a hardware perspective, such as Figure 8 The diagram shown is a hardware structure diagram of a device containing a table-based question-and-answer processing apparatus according to an embodiment of this specification. Except for... Figure 8 In addition to the processor 82 and memory 84 shown, this device may also include other hardware, such as a forwarding chip responsible for processing messages; from a hardware structure perspective, this device may also be a distributed device, possibly including multiple interface cards to extend message processing at the hardware level. The memory 84 stores computer instructions, and when the processor 82 executes the computer instructions, it implements the methods mentioned in any of the above embodiments.

[0064] 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 manual are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0065] Since the parts of the embodiments in this specification that contribute to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, the computer software product is stored in a storage medium and includes several instructions to cause a terminal device to execute all or part of the steps of the methods in the various embodiments of this specification. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0066] The above description is merely a preferred embodiment of the embodiments of this specification and is not intended to limit the embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this specification should be included within the scope of protection of the embodiments of this specification.

Claims

1. A table-based question-and-answer processing method, characterized in that, The method includes: The system obtains the target question to be queried, the target table data corresponding to the target question, and one or more template thinking chains. A template thinking chain describes the derivation process from question to answer in a set of template question-answer pairs in a table-based question-answering task. The derivation process of the one or more template thinking chains has a similarity greater than a preset similarity threshold to the standard derivation process from the target question to the target answer corresponding to the target question. Furthermore, the one or more template thinking chains include SQL statements used to query the answer corresponding to the question in the template question-answer pair from the table data corresponding to the template question-answer pair. The target question, the target table data, and the one or more template thought chains are input into a preset language model, so that the language model determines a target thought chain based on the one or more template thought chains and the target table data to describe the derivation process of obtaining the target answer; wherein, the target thought chain includes a target SQL statement; The target answer is obtained by querying the target table data based on the target SQL statement.

2. The method according to claim 1, characterized in that, The target question is input by the user through a user client, and the method further includes: Extract the target answer from the target thought process and return it to the user client; or The target thought chain is directly returned to the user client.

3. The method according to claim 1, characterized in that, The SQL statement includes instructions for querying table data and instructions for manipulating table data. The instructions for manipulating table data are used to perform one or more of the following: select specific columns from table data, filter specific rows from table data, and perform aggregation processing on table data using aggregate functions.

4. The method according to claim 1, characterized in that, The one or more template-based thought chains are obtained based on the following methods: Determine the type of the target problem; Based on the type of the target question, one or more template thinking chains are obtained from a pre-built template thinking chain library; wherein, the type of the question in the template question-answer pair corresponding to the one or more obtained template thinking chains is consistent with the type of the target question.

5. The method according to claim 1, characterized in that, The one or more template-based thought chains are obtained based on the following method: The questions in the preset template question-and-answer pairs and the corresponding table data of the template question-and-answer pairs are input into the pre-trained mind chain generation model, and the mind chain generation model outputs one or more template mind chains. The thought chain generation model is trained in the following way: Acquire a sample question, sample table data corresponding to the sample question, and multiple pre-set tag thinking chains for describing the derivation process of obtaining the answer to the sample question. Each tag thinking chain corresponds to a score for characterizing the accuracy of the tag thinking chain. The sample question and the sample table data are input into a preset initial model, and the initial model outputs a predictive thought chain. Based on the scores corresponding to each of the multiple labeled thought chains, the target score of the predicted thought chain is obtained, and the parameters of the initial model are continuously adjusted based on the target score to train the thought chain generation model.

6. The method according to claim 5, characterized in that, The sample table data includes multiple data tables, each with a different structure.

7. The method according to claim 1, characterized in that, The one or more template-based thought chains are obtained based on the following method: The questions in the preset template question-and-answer pairs, the corresponding table data of the template question-and-answer pairs, and the pre-set prompt information are input into the language model. The language model outputs one or more template thinking chains, wherein the prompt information is used to describe the generation process of the template thinking chain.

8. The method according to claim 1, characterized in that, The target table data is transaction data in an online payment scenario, and the target problem is a problem related to online payment risk control. After obtaining the target thought chain through a language model, the method further includes: Key features related to risk control are extracted from the derivation process of the target thinking chain description; Risk control strategies are determined based on the aforementioned key characteristics.

9. An electronic device, characterized in that, The electronic device includes a processor, a memory, and a computer program stored in the memory that can be executed by the processor, wherein the computer program, when executed, implements the method according to any one of claims 1-8.

10. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1-8.

Citation Information

Patent Citations

  • Data query method and device, electronic equipment and storage medium

    CN116303537A