Retrieval question and answer method, device, medium, equipment and program product for table

By conducting first-stage retrieval in a tabular database and employing an autonomous decision-making retrieval strategy, and utilizing a large language model and a hybrid retrieval mode, the system addresses the issues of insufficient retrieval accuracy and over-retrieval in tabular question-and-answer systems, achieving a more efficient and flexible tabular question-and-answer system.

CN120448407BActive Publication Date: 2026-01-27BEIJING FEISHU TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510941250.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-08
Publication Date
2026-01-27
Estimated Expiration
2045-07-08

AI Technical Summary

Technical Problem

Existing table-based question-answering technology suffers from insufficient accuracy or over-searching in real-world business scenarios, and requires additional intervention in table configuration.

Method used

The system performs a first-stage search in a tabular database, uses a Large Language Model (LLM) for search planning, autonomously decides on the best search strategy, reduces reliance on high-cost entity recognition and thesaurus, and adopts a hybrid search mode and tabular multi-path search technology to dynamically adjust the search strategy to adapt to different query needs.

Benefits of technology

It improves the intelligence and automation of the form-based question and answer system, reduces excessive searching, enhances the flexibility and accuracy of the search process, and ensures the reliability and comprehensiveness of the search results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448407B_ABST
    Figure CN120448407B_ABST
Patent Text Reader

Abstract

A retrieval question answering method, device, medium, equipment and program product for table are provided, which relate to the technical field of intelligent retrieval and can realize deep semantic connection between query questions and structured table content, and improve the intelligent and automatic level of retrieval question answering. The retrieval question answering method for table comprises the following steps: in response to a query question input by a user, performing first-stage retrieval on a table database according to the query question to obtain candidate table data for answering the query question; performing retrieval planning based on the query question and the candidate table data by using a first large model to obtain a retrieval strategy, wherein the retrieval strategy represents whether to perform second-stage retrieval or not; determining target table data for answering the query question based on the retrieval strategy; and generating an answer to the query question based on at least the candidate table data or the target table data by using a second large model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of intelligent retrieval technology, specifically to a retrieval question-and-answer method, apparatus, medium, device, and program product for tables. Background Technology

[0002] Table-based question answering technology is mainly based on semantic models, entity recognition technology, and template matching technology. It performs poorly on questions involving deep semantic understanding and requires additional intervention in table configuration.

[0003] In related technologies, the same retrieval strategy is used for different query problems in real business scenarios, which may result in insufficient accuracy of retrieval results or over-retrieval. Summary of the Invention

[0004] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0005] Firstly, this disclosure provides a retrieval question-and-answer method for tables, the retrieval question-and-answer method for tables including:

[0006] In response to a user's input query, a first-stage retrieval is performed in a tabular database based on the query to obtain candidate tabular data for answering the query.

[0007] The first major model performs a retrieval plan based on the query question and the candidate table data to obtain a retrieval strategy, wherein the retrieval strategy represents whether to perform a second-stage retrieval or not.

[0008] Based on the retrieval strategy, target table data for answering the query question is determined;

[0009] The second major model generates an answer to the query question based at least on the candidate table data or the target table data.

[0010] Secondly, this disclosure provides a query-answering device for tables, the query-answering device for tables comprising:

[0011] The response module is configured to respond to a query input by the user, and perform a first-stage retrieval in the tabular database based on the query to obtain candidate tabular data for answering the query.

[0012] The first execution module is configured to perform a retrieval plan based on the query question and the candidate table data using a first large model to obtain a retrieval strategy, wherein the retrieval strategy represents whether to perform a second-stage retrieval or not.

[0013] The second execution module is configured to determine the target table data for answering the query question based on the retrieval strategy.

[0014] The third execution module is configured to generate an answer to the query question using the second major model, based at least on the candidate table data or the target table data.

[0015] Thirdly, this disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the method described in the first aspect.

[0016] Fourthly, this disclosure provides an electronic device, comprising:

[0017] A storage device on which computer programs are stored;

[0018] A processing device for executing the computer program in the storage device to implement the method described in the first aspect.

[0019] Fifthly, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect.

[0020] The above technical solution allows for a first-stage retrieval of a tabular database based on the user's input query, yielding candidate tabular data to answer the query. This associates the text in the query with the rows or columns of the candidate tables, establishing a deep semantic connection between the user's query and the content of the tables in the database. This reduces reliance on costly and difficult-to-maintain entity recognition, thesaurus, or rule templates in subsequent retrieval processes. The first major model then plans the retrieval based on the query and the candidate tabular data obtained in the first stage, developing a retrieval strategy. Different queries can employ different retrieval strategies, and the system can autonomously decide the optimal strategy for subsequent queries, making the entire retrieval process task-aware and adaptive, thus improving its flexibility and reducing over-searching while maintaining accuracy. Based on the retrieval strategy, the target tabular data to answer the query is determined. Different retrieval strategies can be flexibly executed to determine the target tabular data, improving its reliability. Finally, the second major model generates an answer to the query based at least on either the candidate or target tabular data, thereby enhancing the intelligence and automation of the query answering process.

[0021] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description

[0022] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings:

[0023] Figure 1 This is a flowchart illustrating a retrieval question-and-answer method for tables according to an exemplary embodiment of this disclosure.

[0024] Figure 2 This is another flowchart illustrating a retrieval question-and-answer method for tables according to an exemplary embodiment of this disclosure.

[0025] Figure 3 This is a block diagram illustrating a table retrieval question-and-answer device according to an exemplary embodiment of the present disclosure.

[0026] Figure 4 This is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation

[0027] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0028] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0029] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0030] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0031] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0032] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0033] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0034] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.

[0035] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0036] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0037] Meanwhile, it is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0038] It should be understood that using the same retrieval strategy for different queries in real-world business scenarios may result in insufficient retrieval accuracy or over-retrieval. For example, if the current business scenario uses a coarse-grained retrieval strategy, executing a coarse-grained retrieval strategy for a query that requires a deeper retrieval may lead to insufficient retrieval accuracy. Conversely, if the current business scenario uses a deep-search strategy, executing a deep-search strategy for a query that requires a coarse-grained retrieval may lead to over-retrieval and wasted resources.

[0039] In view of the above, this disclosure provides a method, apparatus, medium, device and program product for searching and answering questions in tables, in order to solve some or all of the above-mentioned technical problems.

[0040] The disclosed embodiments will be further explained below with reference to the accompanying drawings.

[0041] Figure 1 This is a flowchart illustrating a retrieval question-and-answer method for tables according to an exemplary embodiment of this disclosure, with reference to... Figure 1 The question-and-answer method for retrieving information from tables may include the following steps:

[0042] In step S11, in response to the query question input by the user, a first-stage retrieval is performed in the table database based on the query question to obtain candidate table data for answering the query question.

[0043] In step S12, a retrieval strategy is obtained by performing a retrieval plan based on the query question and candidate table data using the first major model. The retrieval strategy represents whether to perform a second-stage retrieval or not.

[0044] In step S13, target table data for answering the query question is determined based on the retrieval strategy.

[0045] In step S14, the second major model generates an answer to the query question based at least on candidate table data or target table data.

[0046] In this embodiment, the query questions for user data include, but are not limited to, private domain knowledge, professional terms, or colloquial expressions. The table database is used to store table data of different table types. Each piece of table data includes metadata of the table cell to which the table data belongs and specific content. The metadata includes table name, column name, and table description, etc.

[0047] It's worth noting that before performing the first-stage retrieval in the tabular database based on the query question, the query rewriting module, driven by the Large Language Model (LLM), can perform semantic completion, typo correction, or referential elimination on the query question. For example, semantic completion and typo correction can be performed on the user-input query question "Who is A, and who is B?" to obtain "Who is A, and who is B?".

[0048] It is worth noting that pre-trained model technology, represented by LLM, has brought about a paradigm shift in the field of table question answering by leveraging its powerful context learning and text generation capabilities. It can directly understand and process natural language questions and interact with table data (i.e., adjust the detection strategy according to different query questions), significantly improving the system's flexibility and intelligence.

[0049] It should be understood that in real-world business scenarios, user queries are typically colloquial, ambiguous, and even contain domain-specific terminology, while tabular data is generally structured and precise. A significant semantic gap exists between user queries and tabular data. Related technologies, such as Named Entity Recognition (NER) combined with thesaurus or rule templates for retrieval, are costly to configure and cannot exhaustively enumerate all possibilities. Furthermore, when LLM is used as the core of a Retrieval-Augmented Generation (RAG) system, its final performance is largely limited by the quality of information provided by the upstream retrieval module. Therefore, in the absence of clear context, LLM cannot effectively associate the semantics of text with its meaning within a specific row or column structure.

[0050] In this embodiment, the first-stage retrieval (i.e., Base-Search) can employ a hybrid retrieval mode combining BM25 (Best Matching 25) and DPR (Dense Passage Retrieval). Specifically, using the hybrid retrieval mode combining BM25 and DPR, a preliminary, coarse-grained retrieval is performed in the tabular database based on the query question to obtain candidate tabular data for answering the query question.

[0051] In the above technical solution, a first-stage retrieval is performed in a tabular database based on the user's input query, obtaining candidate tabular data to answer the query. This associates the text in the query with the rows or columns of the candidate tabular data, achieving a deep semantic connection between the user's query and the content of the tables in the database. This reduces the reliance on costly and difficult-to-maintain entity recognition, thesaurus, or rule templates in subsequent retrieval processes. Then, a first-stage model performs retrieval planning based on the query and the candidate tabular data obtained in the first stage, resulting in a retrieval strategy. Different query questions can employ different retrieval strategies, and the system can autonomously decide the optimal strategy to use, giving the entire retrieval process task awareness and adaptability, thereby improving its flexibility and reducing over-searching while ensuring the accuracy of the retrieval results. Based on the retrieval strategy, target tabular data to answer the query is determined. Different retrieval strategies can be flexibly executed to determine the target tabular data, improving its reliability. Finally, a second-stage model generates an answer to the query based at least on either the candidate tabular data or the target tabular data, thereby improving the intelligence and automation of the query answering process.

[0052] To facilitate understanding of the table retrieval and response methods provided in this disclosure, the following describes possible implementations of this disclosure.

[0053] In some possible approaches, candidate table data includes metadata about the table to which the candidate table data belongs. A retrieval strategy is derived by performing a retrieval plan based on the query question and the candidate table data using the first major model. This strategy may include:

[0054] Based on the query question and metadata, determine the subquery question corresponding to the candidate table data;

[0055] The candidate table data and subquery questions are input into the first main model for retrieval planning, resulting in the retrieval strategy output by the first main model.

[0056] It is worth noting that the candidate table data obtained in the first stage of retrieval may belong to one or more candidate tables, and the subquery questions corresponding to the candidate table data may be the same or different. If the candidate table data belongs to one candidate table and the subquery questions are the same, then that candidate table corresponds to one subquery question. If the candidate table data belongs to one candidate table and the subquery questions are different, then that candidate table corresponds to multiple subquery questions. If the candidate table data belongs to multiple candidate tables, and the subquery questions corresponding to the candidate table data within the same candidate table are the same, then each candidate table corresponds to one subquery question. If the candidate table data belongs to multiple candidate tables, and the subquery questions corresponding to the candidate table data within the same candidate table are different, then each candidate table corresponds to multiple subquery questions. In summary, each candidate table may correspond to one or more subquery questions.

[0057] In this embodiment, candidate table data and subquery questions are input into an LLM-driven planner (i.e., the Plan module). The planner performs retrieval planning based on a preset structured evaluation framework, according to the candidate table data and subquery questions, and outputs the retrieval strategy to be executed next.

[0058] In the above technical solution, a retrieval strategy is obtained by performing retrieval planning based on the candidate table data and the subquery questions corresponding to each candidate table data. Compared with the existing RAG system, which directly inputs the candidate table data obtained in the first stage of retrieval into the generative model, this disclosure can autonomously decide the best retrieval strategy to be adopted subsequently, and the entire retrieval process has task awareness and adaptive capabilities, improving the flexibility of the entire retrieval process.

[0059] Among possible approaches, determining the subquery corresponding to the candidate table data based on the query question and metadata may include:

[0060] The query question and metadata are populated into the preset prompt word template to obtain the target prompt words. The target prompt words are used to prompt the third model to rewrite the query question based on the metadata.

[0061] Input the target prompts into the third model to obtain the subquery questions corresponding to the candidate table data output by the third model.

[0062] In this embodiment, the candidate table data obtained in the first stage provides context for subsequent query rewriting. The metadata of the query question and the candidate table data is input into the query rewriting module driven by LLM. The query rewriting module rewrites the query question based on the metadata and outputs the subquery question corresponding to the candidate table data.

[0063] It's worth noting that the following suggestions can be input into the first major model to obtain the retrieval strategy:

[0064] {{user_input}} / / Represents user input query issues

[0065] '''

[0066] {{query_result}} / / Example representing the search result

[0067] '''

[0068] By comparing and analyzing the search requirements and search results, and based on the table attributes (metadata) and sample data (candidate table data), the current search requirements are semantically aligned and optimized, and a subsequent search plan is provided.

[0069] In the above technical solution, by analyzing the characteristics of the query question and candidate table data, the optimal retrieval strategy can be determined, allowing for the rational allocation of computing resources and avoiding unnecessary computation and data processing, thereby improving retrieval efficiency. Furthermore, the retrieval strategy can be dynamically adjusted based on the query question and candidate table data to adapt to different retrieval scenarios and user query needs, enhancing the flexibility of the retrieval process.

[0070] Among the possible approaches, the third major model can be used to rewrite the query problem in at least one of the following ways:

[0071] Identify colloquial expressions in the query and associate column names in the metadata with these colloquial expressions;

[0072] Identify similar data with inconsistent formats in the query question and candidate table data, and normalize the similar data with inconsistent formats.

[0073] The query is subjected to intent identification, the intent identification result is obtained, and the query is generalized or completed based on the intent identification result.

[0074] Among them, similar data whose format is inconsistent with the candidate table data in the query question includes, but is not limited to, dates and currency units.

[0075] In this embodiment, rewriting the query can be summarized as field name association, field value format normalization, and semantic generalization or semantic completion. For example, regarding field name association: identify the colloquial expression "net profit" in the query and associate the column name "Net_Income" in the metadata of the candidate table data with "net profit". Regarding field value format normalization: identify the date "last year" in the query and the date "YYYY / MM / DD" in the candidate table data, and convert "last year" into the specific "YYYY / MM / DD". Regarding semantic generalization or semantic completion: perform semantic recognition on the query based on common sense to obtain the user's true intent, and perform reasonable semantic generalization on overly simplistic queries based on the user's true intent, or complete the missing conditions in the query.

[0076] In the above technical solution, by analyzing the query question and candidate table data, the query question is rewritten into a subquery question more suitable for execution on the candidate table to which the candidate table data belongs. This decomposes the global retrieval task into multiple independent intra-table retrieval tasks, preparing for the second stage of refined retrieval. Subsequent parallel processing of subquery questions can significantly reduce query time and improve retrieval efficiency, while avoiding unnecessary subsequent data scanning and processing, thereby reducing computational resource consumption. On the other hand, by decomposing the query question into multiple subquery questions, the target table data can be located more accurately, reducing false positives and interference from noisy data, and improving retrieval accuracy.

[0077] Among the possible approaches, the primary model can be used for retrieval planning in the following manner:

[0078] Based on the candidate table data and the subquery question, the directness result and the data density of the candidate table data are determined. The directness result indicates whether there is data in the candidate table data that can answer the query question, and the data density indicates whether there is data dilution in the candidate table data.

[0079] When the candidate table data for direct results does not contain data that can answer the query question, and the candidate table data for data density is semantically diluted, a retrieval strategy for generating representations to perform second-stage retrieval (i.e., Table-Search) is adopted.

[0080] A retrieval strategy that does not perform a second-stage retrieval is adopted when the candidate table data for direct results representation contains data that can answer the query question and the candidate table data for data density representation does not suffer from semantic dilution.

[0081] In this embodiment, based on two evaluation dimensions, namely directness and density, the system autonomously decides on the best retrieval strategy to follow (e.g., skipping the second-stage retrieval and performing the second-stage retrieval), and then orchestrates and schedules multiple subsystems, including the second-stage retrieval and extended retrieval.

[0082] In the above technical solution, by rationally selecting retrieval strategies from the perspectives of directness and data density, various complex query needs can be better handled, thereby improving the accuracy of retrieval results. Furthermore, unnecessary calculations and data processing can be avoided, significantly reducing the consumption of computing resources, and enabling the entire retrieval process to have task awareness and adaptive capabilities.

[0083] In possible ways, determining the target tabular data for answering the query question based on a retrieval strategy may include:

[0084] In the absence of a second-stage retrieval, the candidate table data is identified as the target table data for answering the query question.

[0085] In the above technical solution, when the retrieval strategy characterization does not perform a second-stage retrieval, the candidate table data is already direct and reliable enough. At this time, the complex second-stage retrieval is skipped, and the answer to the query question can be directly generated based on the candidate table data, which improves retrieval efficiency. This retrieval strategy is suitable for simple and clear query questions.

[0086] In possible ways, determining the target tabular data for answering the query question based on a retrieval strategy may include:

[0087] In the case of performing the second stage of retrieval using the retrieval strategy representation, the candidate table to which the candidate table data belongs and the subquery questions corresponding to the candidate table data obtained by rewriting the query question are determined respectively.

[0088] Parallel retrieval is performed in the candidate tables to which the corresponding candidate table data belongs based on the subquery question to obtain the target table data used to answer the query question.

[0089] It should be understood that document length bias exists in the field of information retrieval when dealing with tabular data from diverse sources, with heterogeneous structures, and significant differences in record length. For example, sparse retrieval algorithms based on keyword matching (such as BM25) inherently suffer from score accumulation problems, meaning that long documents may receive unreasonably high scores simply because they contain more terms. While dense retrieval methods, such as DPR, can capture semantic information, they may also suffer from semantic dilution when processing excessively long table rows or serialized tables, as key information may be surrounded by a large amount of irrelevant information, thus affecting retrieval accuracy—a phenomenon known as document length bias.

[0090] In this embodiment, when the second stage of retrieval is performed based on the retrieval strategy, a corresponding subquery task is generated according to the subquery question, and parallel and independent subquery tasks are initiated simultaneously for the candidate tables to which the candidate table data belongs. Parallel retrieval is performed in the middle of the candidate table data to realize table multi-way retrieval (i.e., Table-Search) and obtain the target table data used to answer the query question.

[0091] In the above technical solution, each subquery task is retrieved within the context of a single table, greatly narrowing the retrieval scope and avoiding semantic dilution caused by key information being surrounded by a large amount of irrelevant information. This allows for quick and accurate location of specific row-level information within the table. Furthermore, because candidate table data belonging to the same candidate table originates from a relatively uniform source, has the same data structure, and exhibits minimal differences in record length, independent retrieval is performed within the candidate table corresponding to the subquery question. This eliminates the inherent document length bias in traditional retrieval methods, ensuring fair and accurate relevance evaluation regardless of table length. It avoids result distortion caused by score accumulation or semantic dilution, thereby improving retrieval efficiency.

[0092] Among the possible approaches, the question-and-answer method for retrieving forms may also include:

[0093] The first major model is used to determine the primary relevance between candidate table data and the query question, and the secondary relevance between target table data and the query question.

[0094] Accordingly, the second major model, based at least on candidate table data or target table data, generates an answer to the query question, which may include:

[0095] Using the second major model, when the second relevance is greater than the first relevance, at least based on the target table data, an answer to the query question is generated;

[0096] The second model generates an answer to the query question based at least on the candidate table data, provided that the second relevance is less than or equal to the first relevance.

[0097] In the above technical solution, by comparing the relevance of the search results in the two stages to the query question, it is determined whether the search results in the second stage provide more valuable information than those in the first stage. If the search results in the second stage provide more valuable information, an answer to the query question is generated based on the search results of the second stage, resulting in a high-quality answer. On the other hand, if the search results in the second stage do not provide more valuable information, a fault-tolerance and rollback mechanism can be provided to revert to and use the more reliable search results from the first stage to generate an answer to the query question.

[0098] Among the possible approaches, the question-and-answer method for retrieving forms may also include:

[0099] The first major model is used to determine the confidence level of the target table data or the consistency between the candidate table data and the target table data.

[0100] Accordingly, the second major model, based at least on candidate table data, generates an answer to the query question, which may include:

[0101] The second model generates an answer to the query question based on the candidate table data when the confidence level is less than a preset threshold or when the candidate table data is inconsistent with the target table data.

[0102] The preset threshold can be preset according to the search accuracy or search requirements, and this disclosure does not limit it.

[0103] It should be understood that the subquery problem is derived from the query problem. In extreme cases, the subquery problem may contradict the query problem. In this case, the target table data retrieved in the second retrieval stage based on the subquery problem will conflict with the candidate table data retrieved in the first stage.

[0104] In the above technical solution, if the confidence of the search results in the second stage is too low, or if the search results in the second stage conflict with the search results in the first stage, a fault tolerance and rollback mechanism is provided to abandon the search results in the second stage, roll back and use the more reliable search results in the first stage to generate an answer to the query question.

[0105] Among the possible approaches, the question-and-answer method for retrieving forms may also include:

[0106] Based on the query, an additional search is performed on the table data other than the candidate table data in the table database to obtain the extended table data;

[0107] Accordingly, the second major model, based at least on candidate table data or target table data, generates an answer to the query question, which may include:

[0108] The second major model generates an answer to the query question based on the extended table data and candidate table data, or it generates an answer to the query question based on the extended table data and target table data.

[0109] It is worth noting that because different tables in an enterprise knowledge base vary in size, structure, or keyword density, when a user initiates a query, the scoring mechanism of traditional retrieval algorithms often results in a severe bias towards a few advantageous tables (e.g., tables with a large number of rows or those that highly overlap with the query keywords), while ignoring other smaller or semantically related but differently expressed tables that may contain more relevant or even more accurate answers. This leads to a narrow and biased feedback that fails to fully reflect all relevant information in the enterprise knowledge base, i.e., table data skew.

[0110] In this embodiment, based on the query question, additional low-cost fast retrieval is performed sequentially on other table data in the table database besides the candidate table data. This captures table data that was not retrieved due to table data skew, or long-tail table data that may contain key information but has a low score from a global perspective. That is, table data that initially scored low in the first stage of retrieval or was considered not very relevant to the query question, thus ensuring the comprehensiveness of the retrieval and overcoming the problem of table data skew.

[0111] In the above technical solution, an extended search task is initiated simultaneously with the first-stage retrieval. The scope of the extended search task is other table data in the table database besides the candidate table data, thereby overcoming the tendency for search results to be overly concentrated on a single document due to differences in document structure or user expression. This ensures that relevant information can be comprehensively and evenly retrieved from multiple heterogeneous tables, greatly improving the system's recall completeness. It also ensures that tables that may contain key information but were ignored by the main search path due to keyword mismatch or small size can be rediscovered.

[0112] In possible ways, generating an answer to the query question through a second major model, based at least on the target table data, may include:

[0113] The second model determines a first confidence threshold when there is information redundancy in the target table data. Based on the first confidence threshold, the first table data is filtered from the target table data, and an answer to the query question is generated based on the first table data.

[0114] The second model determines a second confidence threshold when information is scarce in the target table data. Based on the second confidence threshold, second table data is filtered from the target table data. Based on the second table data, an answer to the query question is generated. The second confidence threshold is less than the first confidence threshold.

[0115] It's worth noting that after all retrieval tasks in the second phase are completed, two extreme scenarios may occur. First, information scarcity: within a massive dataset, there might only be one potentially relevant record. Second, information redundancy: a single query might match hundreds or even thousands of relevant records. Fixed-threshold recall and ranking strategies in existing technologies cannot flexibly handle these two scenarios. It's necessary to adaptively adjust the confidence thresholds for recall and ranking in different scenarios to balance precision and recall—that is, the contradiction between information scarcity and information redundancy.

[0116] In this embodiment, after all retrieval tasks in the second stage are completed, the system enters the final result integration and generation stage. During the result integration and generation stage, based on the confidence levels of all target table data, it is determined whether the target table data contains redundant or scarce information. If the target table data contains redundant information, a high confidence threshold (e.g., confidence level of 2) is used to filter the first table data from the target table data, thereby maximizing the precision of the answer. If the target table data contains scarce information, a low confidence threshold (e.g., confidence level of 1) is used to filter the second table data from the target table data, thereby maximizing the recall of the answer and avoiding missing the only possible answer due to overly strict standards.

[0117] In the above technical solution, the confidence threshold is dynamically adjusted. A low confidence threshold is used when information is scarce to maximize the recall rate of the answer, while a high confidence threshold is used when information is redundant to maximize the precision rate. This automatically makes an optimal trade-off between precision and recall in scenarios with different information densities, achieving adaptive detection of information scarcity and redundancy. Furthermore, based on the confidence threshold, high-confidence table data is selected from the target table data as the final context (i.e., grounding) used to generate the answer, thereby achieving robust retrieval performance.

[0118] Among the possible approaches, the question-and-answer method for retrieving forms may also include:

[0119] Determine the target proportion of third table data with a confidence level greater than the third confidence threshold in the target table data;

[0120] If the target percentage is greater than or equal to the first percentage threshold, it is determined that there is information redundancy in the target table data;

[0121] If the target percentage is less than the second percentage threshold or the number of data in the third table is less than the number threshold, it is determined that the target table data has information scarcity, wherein the second percentage threshold is less than the first percentage threshold.

[0122] The first and second percentage thresholds can be preset based on the number of table data in the table database or based on the retrieval precision; this disclosure does not limit them in this regard.

[0123] For example, the confidence levels of the target table data are 0, 1, and 2, where 0 indicates that the target table data is completely irrelevant to the query, 1 indicates that the target table data is possibly relevant to the query, and 2 indicates that the target table data is highly relevant to the query. When the confidence level of the target table data is greater than 80%, it indicates that the evidence for the answer is very strong, and in this case, it is determined that the target table data contains information redundancy. When the confidence level of the target table data is less than 10%, it indicates that the evidence for generating an answer to the query is insufficient, and in this case, it is determined that the target table data contains information scarcity.

[0124] In the above technical solution, LLM is used to perform data quality assessment (i.e., Fine Rank) on the target table data obtained in the second stage of retrieval. Specifically, by analyzing the distribution density of high-confidence target table data, it can autonomously determine whether the information is currently redundant or scarce, and dynamically select to use a high-confidence threshold or a low-confidence threshold accordingly. The decision threshold is dynamically adjusted based on real-time feedback to automatically balance precision and recall, achieving performance optimization in diverse query scenarios and data environments without any manual intervention.

[0125] like Figure 2 As shown below, a complete example illustrates the retrieval question-and-answer method for tables provided in this disclosure:

[0126] I. Pre-search:

[0127] 1. Obtain the query question input by the user and optimize the query question.

[0128] 2. Based on the query question, perform the first stage of retrieval in the tabular database to obtain candidate tabular data to answer the query question.

[0129] 3. Based on the query question and the data in the Red Lotus Root Selection table, the first major model is used to perform path planning to obtain the retrieval strategy.

[0130] II. Detailed Search:

[0131] a. Search strategy corresponding to path one: Skip the second stage of search, perform extended search, obtain extended table data, and generate an answer based on candidate table data and extended table data.

[0132] b. Search strategy corresponding to path two: Perform the second stage of search, table sub-query: Based on the subquery question, search in the corresponding candidate table data to obtain multiple target table data. The target table data provides more valuable information. Perform data merging on the target table data; at the same time, perform extended search to obtain extended table data; generate the answer based on the extended table data and the target table data after data merging.

[0133] c. Search strategy corresponding to path three: Perform the second stage of search, table sub-query: Based on the subquery question, search in the corresponding candidate table data to obtain multiple target table data. If the target table data does not provide more valuable information, revert to the first stage search results; at the same time, perform extended search to obtain extended table data; generate an answer based on the candidate table data and extended table data.

[0134] In this embodiment, when the pre-search results already contain a clear answer and have high directness and data density, path one is executed, skipping the second-stage retrieval and directly generating the answer based on the pre-search results. This is suitable for simple and clear query scenarios. When the pre-search results are insufficient or divergent, or have low directness or low data density, path two is executed, performing the second-stage retrieval, triggering Table-Search and Additional-Search, executing FineRank, and fusing the results to generate the answer. This is suitable for complex, ambiguous, or query scenarios requiring deep reasoning. When the confidence of the second-stage retrieval results is low or the retrieval results from the pre-search stage conflict, path three is executed, abandoning the second-stage retrieval results, reverting to the first-stage retrieval results to generate the answer. This is suitable for scenarios where deep retrieval has introduced too much noise or generated contradictory information, requiring a revert to a more reliable baseline result.

[0135] In the above technical solution, the first-stage retrieval establishes a semantic relationship between the query question and the table database by learning the overall table data (including inter-table relationships, table names, attributes, and partial data), thereby obtaining candidate table data. After understanding the characteristics of the candidate data tables, a retrieval plan is developed in conjunction with the query question to obtain a targeted retrieval strategy. During the planning stage, a multi-dimensional evaluation framework (such as directness: whether the table data contains a direct answer; data density: whether the table data is concise; retrieval strategy: whether other strategies can be adopted) is used for scoring and planning, significantly improving the quality and reliability of LLM's retrieval planning. Simultaneously, an additional recall is performed on the complement of the pre-retrieval by expanding the retrieval, ensuring that table data underestimated in the first retrieval stage due to structural or representational differences can be reconsidered, greatly alleviating the data skew problem and improving the system's recall completeness. Furthermore, the second-stage retrieval identifies two scenarios: information redundancy and information scarcity, and adaptively adjusts the confidence threshold to ensure that recall is maximized when information is scarce and precision is maximized when information is redundant. When faced with complex and ever-changing enterprise data, it demonstrates stability and efficiency far exceeding that of fixed threshold methods.

[0136] Based on the same concept, this disclosure also provides a retrieval question-and-answer device for tables, such as... Figure 3 As shown, the table retrieval question-and-answer device 300 includes:

[0137] The response module 301 responds to the query input by the user, performs a first-stage retrieval in the tabular database based on the query, and obtains candidate tabular data to answer the query.

[0138] The first execution module 302 is configured to perform retrieval planning based on the query question and candidate table data through the first large model to obtain a retrieval strategy, wherein the retrieval strategy represents whether to perform the second stage retrieval or not.

[0139] The second execution module 303 is configured to determine the target table data for answering the query question based on the retrieval strategy.

[0140] The third execution module 304 is configured to generate an answer to the query question using the second major model, based at least on candidate table data or target table data.

[0141] In the above technical solution, a first-stage retrieval is performed in a tabular database based on the user's input query, obtaining candidate tabular data to answer the query. This associates the text in the query with the rows or columns of the candidate tabular data, achieving a deep semantic connection between the user's query and the content of the tables in the database. This reduces reliance on costly and difficult-to-maintain entity recognition, thesaurus, or rule templates. Then, a first-stage model performs retrieval planning based on the query and the candidate tabular data obtained in the first stage, resulting in a retrieval strategy. Different queries can employ different retrieval strategies, and the system can autonomously decide the optimal strategy to use subsequently. This gives the entire retrieval process task awareness and adaptability, improving its flexibility and reducing over-retrieval while ensuring the accuracy of the results. Based on the retrieval strategy, target tabular data to answer the query is determined. Different retrieval strategies can be flexibly executed to determine the target tabular data, improving its reliability. Finally, a second-stage model generates an answer to the query based at least on either the candidate tabular data or the target tabular data, thereby improving the intelligence and automation of the query answering process.

[0142] Furthermore, the candidate table data includes metadata of the table to which the candidate table data belongs. The first execution module 302 is configured to determine the subquery question corresponding to the candidate table data based on the query question and the metadata.

[0143] The candidate table data and subquery questions are input into the first main model for retrieval planning, resulting in the retrieval strategy output by the first main model.

[0144] Furthermore, the first execution module 302 is configured to populate the query question and metadata into a preset prompt word template to obtain target prompt words, wherein the target prompt words are used to prompt the third model to rewrite the query question based on the metadata;

[0145] Input the target prompts into the third model to obtain the subquery questions corresponding to the candidate table data output by the third model.

[0146] Furthermore, the third major model is used to rewrite the query problem in at least one of the following ways:

[0147] Identify colloquial expressions in the query questions and associate column names in the metadata of the candidate table data with these colloquial expressions;

[0148] Identify similar data with inconsistent formats in the query question and candidate table data, and normalize the similar data with inconsistent formats.

[0149] The query is subjected to intent identification, the intent identification result is obtained, and the query is generalized or completed based on the intent identification result.

[0150] Furthermore, the first major model is used for retrieval planning in the following manner:

[0151] Based on candidate table data and subquery questions, we determine the directness of candidate table data and the data density of candidate table data. Directness indicates whether there is data in the candidate table data that can answer the query question, and data density indicates whether there is data dilution in the candidate table data.

[0152] In cases where the candidate table data for direct results representation does not contain data that can answer the query question, and the candidate table data for data density representation suffers from semantic dilution, a retrieval strategy for generating representations to perform the second-stage retrieval is adopted.

[0153] A retrieval strategy that does not perform a second-stage retrieval is adopted when the candidate table data for direct results representation contains data that can answer the query question and the candidate table data for data density representation does not suffer from semantic dilution.

[0154] Furthermore, the second execution module 303 is configured to determine the candidate table to which the candidate table data belongs and the subquery questions corresponding to the candidate table data respectively, obtained by rewriting the query question, when performing the second stage retrieval in the retrieval strategy representation.

[0155] Parallel retrieval is performed in the candidate tables to which the corresponding candidate table data belongs based on the subquery question to obtain the target table data used to answer the query question.

[0156] Furthermore, the first execution module 304 is also configured to determine the first relevance between the candidate table data and the query question and the second relevance between the target table data and the query question through the first large model;

[0157] Accordingly, the third execution module 304 is configured to generate an answer to the query question based at least on the target table data, using the second large model, provided that the second relevance is greater than the first relevance.

[0158] The second model generates an answer to the query question based at least on the candidate table data, provided that the second relevance is less than or equal to the first relevance.

[0159] Furthermore, the first execution module 304 is also configured to determine the confidence level of the target table data or the consistency between the candidate table data and the target table data through the first large model;

[0160] Accordingly, the third execution module 304 is configured to generate an answer to the query question based on the candidate table data when the confidence level is less than a preset threshold or the candidate table data is inconsistent with the target table data, using the second large model.

[0161] Furthermore, the response module 301 is also configured to perform an extended search in the table database, excluding the candidate table data, to obtain extended table data based on the query question;

[0162] Accordingly, the third execution module 304 is configured to generate an answer to the query question based on the extended table data and candidate table data using the second major model, or to generate an answer to the query question based on the extended table data and target table data using the second major model.

[0163] Furthermore, the third execution module 304 is configured to determine a first confidence threshold in the case of information redundancy in the target table data through the second model, and to filter first table data from the target table data according to the first confidence threshold, and to generate an answer to the query question based on the first table data.

[0164] The second model determines a second confidence threshold when information is scarce in the target table data. Based on the second confidence threshold, second table data is filtered from the target table data. Based on the second table data, an answer to the query question is generated. The second confidence threshold is less than the first confidence threshold.

[0165] Furthermore, the third execution module 304 is configured to determine the target proportion of third table data with a confidence level greater than the third confidence level threshold in the target table data;

[0166] If the target percentage is greater than or equal to the first percentage threshold, it is determined that there is information redundancy in the target table data;

[0167] If the target percentage is less than the second percentage threshold or the number of data in the third table is less than the number threshold, it is determined that the target table data has information scarcity, wherein the second percentage threshold is less than the first percentage threshold.

[0168] Furthermore, the second execution module 303 is configured to determine the candidate table data as the target table data for answering the query question when the retrieval strategy characterization does not perform a second-stage retrieval.

[0169] The specific manner in which each module performs its operation in the table retrieval question-and-answer device 300 in the above embodiments has been described in detail in the embodiments related to the method, and will not be elaborated here.

[0170] Based on the same concept, embodiments of this disclosure also provide a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements any of the above-described methods for searching and answering questions for tables.

[0171] Based on the same concept, this disclosure also provides an electronic device that may include:

[0172] A storage device on which computer programs are stored;

[0173] A processing device for executing the computer program in the storage device to implement any of the above-described methods for querying and answering questions for tables.

[0174] Based on the same concept, embodiments of this disclosure also provide a computer program product, including a computer program that, when executed by a processor, implements any of the above-described methods for searching and answering questions for tables.

[0175] The following is for reference. Figure 4 This diagram illustrates a structural schematic of an electronic device 400 suitable for implementing embodiments of the present disclosure. The terminal devices in these embodiments may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0176] like Figure 4 As shown, electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from storage device 408 into random access memory (RAM) 403. RAM 403 also stores various programs and data required for the operation of electronic device 400. Processing device 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.

[0177] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 408 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic device 400 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 An electronic device 400 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0178] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 409, or installed from storage device 408, or installed from ROM 402. When the computer program is executed by processing device 401, it performs the functions defined in the methods of embodiments of this disclosure.

[0179] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0180] In some implementations, communication can be conducted using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol), and can be interconnected with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.

[0181] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0182] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: respond to a user-input query, perform a first-stage retrieval in a tabular database based on the query to obtain candidate tabular data for answering the query, wherein the candidate tabular data includes metadata of the table to which the candidate tabular data belongs; perform retrieval planning based on the query and the candidate tabular data using a first major model to obtain a retrieval strategy; determine target tabular data for answering the query based on the retrieval strategy; and generate an answer to the query using a second major model, based at least on either the candidate tabular data or the target tabular data.

[0183] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0184] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0185] The modules described in the embodiments of this disclosure can be implemented in software or hardware. The names of the modules are not, in some cases, intended to limit the functionality of the module itself.

[0186] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.

[0187] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0188] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0189] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0190] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative forms of implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which the various modules perform their operations has been described in detail in the embodiments relating to the method, and will not be elaborated upon here.

Claims

1. A retrieval question-and-answer method for tables, characterized in that, The retrieval and question-answering method for tables includes: In response to a user's input query, a first-stage retrieval is performed in a tabular database based on the query to obtain candidate tabular data for answering the query. The first major model performs a retrieval plan based on the query question and the candidate table data to obtain a retrieval strategy, wherein the retrieval strategy represents whether to perform a second-stage retrieval or not. Based on the retrieval strategy, target table data for answering the query question is determined; The second major model generates an answer to the query question based at least on the candidate table data or the target table data. The candidate table data includes metadata of the table to which the candidate table data belongs. The retrieval strategy, derived by performing retrieval planning based on the query question and the candidate table data using the first major model, includes: Based on the query question and the metadata, determine the subquery question corresponding to the candidate table data; The candidate table data and the subquery question are input into the first large model for retrieval planning, and the retrieval strategy output by the first large model is obtained. The first major model is used for retrieval planning in the following manner: Based on the candidate table data and the subquery question, the directness result and the data density of the candidate table data are determined. The directness result indicates whether the candidate table data contains data that can answer the query question, and the data density indicates whether the candidate table data is diluted. When the directness result indicates that the candidate table data does not contain data that can answer the query question, and the data density indicates that the candidate table data has semantic dilution, a retrieval strategy for generating a representation to perform the second-stage retrieval is generated. If the directness result indicates that the candidate table data contains data that can answer the query question, and the data density indicates that the candidate table data does not suffer from semantic dilution, a retrieval strategy is generated that indicates no second-stage retrieval is performed.

2. The retrieval and question-answering method for tables according to claim 1, characterized in that, The step of determining the subquery question corresponding to the candidate table data based on the query question and the metadata includes: The query question and the metadata are filled into a preset prompt word template to obtain target prompt words, wherein the target prompt words are used to prompt the third model to rewrite the query question based on the metadata; The target prompt is input into the third model to obtain the subquery question corresponding to the candidate table data output by the third model.

3. The retrieval and question-answering method for tables according to claim 2, characterized in that, The third major model is used to rewrite the query problem in at least one of the following ways: Identify colloquial expressions in the query question and associate column names in the metadata with the colloquial expressions; Identify similar data with inconsistent formats in the query question and the candidate table data, and normalize the similar data with inconsistent formats. The query question is subjected to intent recognition to obtain intent recognition results, and the query question is generalized or completed based on the intent recognition results.

4. The retrieval and question-answering method for tables according to any one of claims 1-3, characterized in that, The step of determining the target table data for answering the query question based on the retrieval strategy includes: When performing the second-stage retrieval using the retrieval strategy, the candidate table to which the candidate table data belongs and the subquery questions corresponding to the candidate table data, which are rewritten from the query question, are determined. Based on the subquery question, parallel retrieval is performed in the candidate tables to which the corresponding candidate table data belongs, to obtain the target table data used to answer the query question.

5. The retrieval question-and-answer method for tables according to claim 4, characterized in that, The question-and-answer method for table retrieval also includes: The first large model is used to determine the first relevance between the candidate table data and the query question, and the second relevance between the target table data and the query question. The step of generating an answer to the query question using a second major model, based at least on the candidate table data or the target table data, includes: Using the second major model, when the second relevance is greater than the first relevance, an answer to the query question is generated based at least on the target table data; The second major model generates an answer to the query question based at least on the candidate table data, provided that the second relevance is less than or equal to the first relevance.

6. The retrieval and question-answering method for tables according to claim 4, characterized in that, The question-and-answer method for table retrieval also includes: The confidence level of the target table data or the consistency between the candidate table data and the target table data is determined by the first large model. The step of generating an answer to the query question using a second major model, based at least on the candidate table data, includes: The second model generates an answer to the query question based on the candidate table data when the confidence level is less than a preset threshold or when the candidate table data is inconsistent with the target table data.

7. The retrieval and question-answering method for tables according to claim 4, characterized in that, The question-and-answer method for table retrieval also includes: Based on the query question, an extended search is performed on the table data in the table database, excluding the candidate table data, to obtain extended table data; The step of generating an answer to the query question using a second major model, based at least on the candidate table data or the target table data, includes: The second major model generates an answer to the query question based on the extended table data and the candidate table data, or the second major model generates an answer to the query question based on the extended table data and the target table data.

8. The retrieval and question-answering method for tables according to claim 4, characterized in that, The step of generating an answer to the query question using a second major model, based at least on the target table data, includes: In the case of information redundancy in the target table data, the second major model determines a first confidence threshold, and based on the first confidence threshold, filters first table data from the target table data, and generates an answer to the query question based on the first table data. In the case of scarce information in the target table data, the second model determines a second confidence threshold, and filters second table data from the target table data based on the second confidence threshold. Based on the second table data, an answer to the query question is generated, wherein the second confidence threshold is less than the first confidence threshold.

9. The retrieval and question-answering method for tables according to claim 8, characterized in that, The question-and-answer method for table retrieval also includes: Determine the target proportion of third table data with a confidence level greater than the third confidence threshold in the target table data; If the target proportion is greater than or equal to the first proportion threshold, it is determined that the target table data has information redundancy. If the target percentage is less than the second percentage threshold or the number of data in the third table is less than the number threshold, it is determined that the target table data has information scarcity, wherein the second percentage threshold is less than the first percentage threshold.

10. The retrieval and question-answering method for tables according to any one of claims 1-3, characterized in that, The step of determining the target table data for answering the query question based on the retrieval strategy includes: If the retrieval strategy indicates that no second-stage retrieval is performed, the candidate table data will be determined as the target table data for answering the query question.

11. A retrieval and question-answering device for tables, characterized in that, The table retrieval and question-answering device includes: The response module is configured to respond to a user-input query by performing a first-stage retrieval in a tabular database based on the query to obtain candidate tabular data for answering the query. The first execution module is configured to perform a retrieval plan based on the query question and the candidate table data using a first large model to obtain a retrieval strategy, wherein the retrieval strategy represents whether to perform a second-stage retrieval or not. The second execution module is configured to determine the target table data for answering the query question based on the retrieval strategy. The third execution module is configured to generate an answer to the query question using the second major model, based at least on the candidate table data or the target table data. The first execution module is further configured to determine the subquery question corresponding to the candidate table data based on the query question and metadata; input the candidate table data and the subquery question into a first large model for retrieval planning, and obtain the retrieval strategy output by the first large model; wherein, the first large model is used to perform retrieval planning in the following manner: based on the candidate table data and the subquery question, determine the directness result and the data density of the candidate table data, wherein the directness result indicates whether the candidate table data contains data that can answer the query question, and the data density indicates whether the candidate table data is semantically diluted; if the directness result indicates that the candidate table data does not contain data that can answer the query question, and the data density indicates that the candidate table data is semantically diluted, generate a retrieval strategy indicating that a second-stage retrieval is performed; if the directness result indicates that the candidate table data contains data that can answer the query question, and the data density indicates that the candidate table data is semantically diluted, generate a retrieval strategy indicating that a second-stage retrieval is not performed.

12. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processing device, it implements the method of any one of claims 1-10.

13. An electronic device, characterized in that, include: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the method of any one of claims 1-10.

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

Citation Information

Patent Citations

  • Retrieval method and device based on large language model and medium

    CN118277442A

  • Financial intelligent question and answer method and system based on mixed retrieval and dynamic query

    CN120256574A