Question answering method and device based on table, electronic equipment and storage medium
By splitting tables in the knowledge database into sub-tables and generating accurate table text, the problem of inaccurate table information matching is solved, thereby improving the accuracy and efficiency of the question-answering model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
- Filing Date
- 2025-12-15
- Publication Date
- 2026-05-05
AI Technical Summary
Existing technologies struggle to effectively process tabular information in knowledge databases, causing question-answering models to fail to accurately match and recall structured tabular content, thus affecting the accuracy of question answers.
By splitting the table based on semantics, multiple sub-tables are generated. Each sub-table contains a header and part of the table body. The large language model or key-value pair processing is used to generate accurate table text so that the question-answering model can provide answers.
Ensuring that the semantics of the table are not distorted improves the accuracy of question answers, simplifies the table content, facilitates subsequent processing and understanding, and enhances the question-answering model's answering capabilities.
Smart Images

Figure CN121979972A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a table-based question-and-answer method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the development of computer technology, more and more users are accustomed to using question-answering models to query questions. When querying questions about specific domains, it is often necessary to combine the internal knowledge of the question-answering model with external knowledge databases to generate more accurate answers.
[0003] Currently, the user's question is first matched with domain knowledge in the knowledge data along the feature vector dimension. If a highly similar knowledge is found, it is recalled and the recalled knowledge is input into the question answering model, allowing the question answering model to answer the user's question based on the recalled knowledge.
[0004] Since knowledge databases contain not only simple plain text, but also complex, structured content such as tables with high information content, how to properly process such knowledge in tables so that it can be accurately matched and recalled, and then fed to the question-answering model for answers, is a key research focus in this field. Summary of the Invention
[0005] This disclosure provides a table-based question-answering method, apparatus, electronic device, and storage medium that ensures the semantic content of the table is not distorted, thereby enabling accurate answers to user questions and improving the accuracy of question-answering. The technical solution of this disclosure is as follows: According to one aspect of the embodiments of this disclosure, a table-based question-and-answer method is provided, comprising: For any table in the knowledge database, based on the semantics of the table, the table is split into multiple sub-tables. The semantics of the table are used to indicate the structure and content of the table. Each sub-table contains the table header and part of the table body. The table bodies in different sub-tables are different. Based on the multiple sub-tables, the table text of the multiple sub-tables is determined, and the table text of each sub-table is used to describe the structure and content of the sub-table in natural language; Based on the table text of multiple sub-tables in the knowledge database, the user's question is answered to obtain the answer to the question.
[0006] According to another aspect of the embodiments of this disclosure, a table-based question-and-answer device is provided, comprising: The splitting unit is configured to split any table in the knowledge database into multiple sub-tables based on the semantics of the table. The semantics of the table are used to indicate the structure and content of the table. Each sub-table contains the table header and part of the table body. The table bodies in different sub-tables are different. The first determining unit is configured to perform an operation based on the plurality of sub-tables to determine the table text of the plurality of sub-tables, wherein the table text of each sub-table is used to describe the structure and content of the sub-table in natural language; The answering unit is configured to execute table text based on multiple sub-tables in the knowledge database to answer the user's question and obtain the answer to the question.
[0007] In some embodiments, the splitting unit is configured to, for any table in the knowledge database, split any row in the table header and the table body into a sub-table if the semantics indicate that the table header is at the top of the table; and split any column in the table header and the table body into a sub-table if the semantics indicate that the table header is at the left of the table.
[0008] In some embodiments, the splitting unit is configured to split any table in the knowledge database into multiple sub-tables if the number of rows or columns in the body of the table exceeds a preset value, provided that the semantic indication of the table indicates that there are merged cells in the table header.
[0009] In some embodiments, the apparatus further includes: The second determining unit is configured to determine at least one key attribute from multiple attributes of the table header if there are merged cells in the table header of any table in the knowledge database. The splitting unit is further configured to perform the following: based on the at least one key attribute, determine the data corresponding to the at least one key attribute from the body of the table; use the at least one key attribute as a new table header, and use the data corresponding to the at least one key attribute as the table body to obtain a sub-table of the table.
[0010] In some embodiments, the key attribute includes at least one of the following; The attributes located in the first row or first column of the table; The attribute whose relevance to the topic of the table reaches a relevant threshold.
[0011] In some embodiments, the first determining unit is configured to perform the following: for any of the plurality of sub-tables, if the header of the sub-table does not have merged cells, then for any attribute in the header of the sub-table, use the attribute as a key and the data corresponding to the attribute in the sub-table as a value to obtain a key-value pair; and generate the table text of the sub-table based on the key-value pairs corresponding to each attribute in the header of the sub-table.
[0012] In some embodiments, the first determining unit is configured to perform processing on any of the plurality of sub-tables, if there are merged cells in the header of the sub-table, using a large language model to obtain the table text of the sub-table.
[0013] In some embodiments, the answering unit is configured to perform the following: based on the table text of multiple sub-tables in the knowledge database and the question of the user object, determine at least one sub-table that matches the question from the multiple sub-tables in the knowledge database; and process the question and the at least one sub-table through a question-answering model to obtain the answer to the question.
[0014] In some embodiments, the first determining unit is further configured to, for any table in the knowledge database, if the semantic indication of the table indicates that there are merged cells in the table header, and if the number of rows or columns in the table body does not exceed a preset value, then process the table using a large language model to obtain the table text of the table, the table text being used to describe the content of the table using natural language. The answering unit is further configured to execute table text based on the table to answer the user object's question and obtain the answer to the question.
[0015] According to another aspect of the embodiments of this disclosure, an electronic device is provided, the electronic device comprising: One or more processors; Memory used to store the executable program code of the processor; The processor is configured to execute the program code to implement the table-based question-and-answer method described above.
[0016] According to another aspect of the present disclosure, a computer-readable storage medium is provided that, when program code in the computer-readable storage medium is executed by a processor of an electronic device, enables the electronic device to perform the table-based question-and-answer method described above.
[0017] According to another aspect of the present disclosure, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the above-described table-based question-and-answer method.
[0018] The solution provided in this disclosure allows for the semantic splitting of each table in a knowledge database. Each resulting sub-table contains the header and part of the body of the original table. Since each sub-table has the header of the original table, it accurately reflects the specific meaning of the data or content in each cell of the corresponding part of the body. This ensures that the text of each sub-table accurately describes the specific meaning of the data or content in each cell of the body, conforming to the semantic content of the original table before splitting. This prevents the semantic content of the original table from being distorted. Furthermore, the content of the split sub-tables is smaller, resulting in a smaller amount of data in the corresponding table text. This facilitates the full reception and processing of all the content of the sub-tables and accurate understanding during problem-solving. Consequently, it enables accurate answers to user questions based on the text of multiple sub-tables, improving the accuracy of problem-solving.
[0019] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0021] Figure 1 This is a schematic diagram illustrating an implementation environment of a table-based question-and-answer method according to an exemplary embodiment.
[0022] Figure 2 This is a flowchart illustrating a table-based question-and-answer method according to an exemplary embodiment.
[0023] Figure 3 This is a flowchart illustrating another table-based question-and-answer method according to an exemplary embodiment.
[0024] Figure 4 This is a schematic diagram illustrating an embodiment of obtaining table text.
[0025] Figure 5 This is a schematic diagram illustrating an example of answering a user question, according to an exemplary embodiment.
[0026] Figure 6 This is a block diagram illustrating a table-based question-and-answer device according to an exemplary embodiment.
[0027] Figure 7 This is a block diagram illustrating a terminal according to an exemplary embodiment.
[0028] Figure 8 This is a block diagram illustrating a server according to an exemplary embodiment. Detailed Implementation
[0029] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0030] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0031] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this disclosure are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the various knowledge, tables, and user-related questions in the knowledge database involved in this disclosure were obtained with full authorization.
[0032] The table-based question-answering method provided in this disclosure can be executed by a computer device. In some embodiments, the computer device is a terminal or a server. The following description, using a computer device as a server as an example, first introduces the implementation environment of the table-based question-answering method provided in this disclosure. Figure 1 This is a schematic diagram illustrating an implementation environment for a table-based question-and-answer method according to an exemplary embodiment. See also Figure 1 The implementation environment specifically includes: terminal 101 and server 102. Terminal 101 and server 102 can be connected directly or indirectly through wired or wireless communication, and this disclosure does not impose any limitations.
[0033] In some embodiments, terminal 101 is at least one of devices such as a smartphone, smartwatch, desktop computer, laptop, MP3 player, MP4 player, and laptop computer. An application is installed and running on terminal 101. This application may be a smart assistant, browser, social application, or multimedia application, etc., and this disclosure does not limit this. Illustratively, terminal 101 is a terminal used by a user. The user can log in to the application through terminal 101 to obtain the services provided by the application. For example, the user can input their query question in the application, and then terminal 101 sends the question to server 102, which answers the question using a database model. Then, server 102 returns the answer to terminal 101, which displays the answer to the user.
[0034] Terminal 101 generally refers to one of a plurality of terminals; this embodiment uses terminal 101 as an example. Those skilled in the art will understand that the number of terminals can be more or less. For example, there may be several terminals, or dozens or hundreds of terminals, or even more. This disclosure does not limit the number of terminals or the type of device.
[0035] In some embodiments, server 102 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), big data, and artificial intelligence platforms. Server 102 is used to provide background services for applications that support intelligent question answering. In some embodiments, server 102 undertakes the main computing work, and terminal 101 undertakes the secondary computing work; or, server 102 undertakes the secondary computing work, and terminal 101 undertakes the main computing work; or, server 102 and terminal 101 collaborate on computing using a distributed computing architecture.
[0036] Figure 2 This is a flowchart illustrating a table-based question-and-answer method according to an exemplary embodiment, see [link to flowchart]. Figure 2 This table-based question-answering method is applied to a server and includes the following steps: In step 201, for any table in the knowledge database, the server splits the table into multiple sub-tables based on the table's semantics. The semantics of the table are used to indicate the structure and content of the table. Each sub-table contains a table header and part of the table body, and the table bodies in different sub-tables are different.
[0037] In this embodiment of the disclosure, a knowledge database refers to a database that stores knowledge in a structured or semi-structured manner and supports querying and retrieval. The knowledge database contains tables for storing knowledge. These tables can be standalone table files or tables contained within other files (such as text files, image files, etc.). This embodiment of the disclosure does not limit the source of the tables.
[0038] For any table in the knowledge data path, the server can perform semantic recognition on the table to obtain its structure and content. Then, based on the table's structure and content, the server splits the table into multiple sub-tables. Each table includes a header and a body. The header is the beginning of the table, used to categorize the properties of the data, and typically contains multiple attributes (or categories / entries). The body is the main part of the table below the header and above the bottom line, containing the specific data or text content corresponding to each attribute in the header. After splitting the table, each sub-table includes the header and a portion of the body of the original table. This portion of the body may include at least one row or at least one column of data, which is not limited in this embodiment. The bodies of different sub-tables are different, and the bodies of multiple sub-tables constitute the entire body of the original table. After splitting the table, each sub-table has a header and a portion of the body, clearly reflecting the specific semantics of the data in that portion of the body.
[0039] In step 202, the server determines the table text of multiple sub-tables based on multiple sub-tables. The table text of each sub-table is used to describe the structure and content of the sub-table in natural language.
[0040] In this embodiment of the disclosure, for any one of the multiple sub-tables, the server performs parsing and transformation processes on the sub-table to obtain semantically rich plain text content, i.e., the table text of that sub-table. The focus of this table text is not on preserving the original visual format, but on conveying the complete information and semantics carried by the table. The table text can be used as a knowledge unit (Chunk) in a RAG (Retrieval-Augmented Generation) system, and is semantically meaningful text content designed to be effectively understood and utilized by retrieval systems and question-answering models.
[0041] In step 203, the server answers the user's question based on the table text of multiple sub-tables in the knowledge database.
[0042] In this embodiment of the disclosure, in response to a user's query request for a question, the server can match the user's question with the table text of multiple sub-tables in the knowledge database to determine the table text that matches the question. Then, the server inputs the user's question and the matching table into the question-answering model, thereby outputting the answer to the question.
[0043] This disclosure provides a table-based question-answering method. For each table in a knowledge database, the method can split the table based on its semantics. Each sub-table obtained from the splitting contains the header and part of the body of the original table. Since each sub-table has the header of the original table, each sub-table can accurately reflect the specific meaning of the data or content in each cell of the corresponding part of the body. This ensures that the table text of each determined sub-table can accurately describe the specific meaning of the data or content in each cell of the body, conforming to the semantic content of the original table before splitting. This ensures that the semantic content of the original table is not distorted. Furthermore, the content of the split sub-tables is smaller, resulting in a smaller amount of data in the corresponding table text. This facilitates the full reception and processing of all the content of the sub-tables and accurate understanding during question answering. Consequently, the method can accurately answer the user's question based on the table text of multiple sub-tables, improving the accuracy of question answering.
[0044] In some embodiments, for any table in the knowledge database, the table is split based on its semantics to obtain multiple sub-tables, including: For any table in the knowledge database, if the semantic indicator indicates that the table header is at the top of the table, then any row in the table header and the table body will be split into a sub-table. If the semantic indicator is located on the left side of the table, then any column in the header or the body of the table will be split into a sub-table.
[0045] The solution provided in this disclosure, for each table, splits any row in the header and body into a sub-table when the header is at the top of the table, and splits any column in the header and body into a sub-table when the header is at the left side of the table. That is, it splits a row or column of content in the header and body into a sub-table, so that each sub-table can accurately reflect the specific meaning of the content in each cell of the corresponding body, ensuring that the semantics of the table before and after splitting are not distorted, and improving the accuracy of subsequent problem-solving.
[0046] In some embodiments, for any table in the knowledge database, the table is split based on its semantics to obtain multiple sub-tables, including: For any table in the knowledge database, if the number of rows or columns in the table body exceeds a preset value, and there are merged cells in the table header as indicated by the table's semantics, the table will be split into multiple sub-tables.
[0047] The solution provided in this disclosure indicates that the table content is relatively complex when there are merged cells in the table header. If the number of rows or columns in the table body exceeds a preset value, it indicates that the table content is long. In this case, the table is split into multiple sub-tables, which simplifies the content of a single table. Each sub-table contains a header, which facilitates the full reception and processing of all the content of the sub-tables and accurate understanding, thereby improving the accuracy of subsequent problem-solving.
[0048] In some embodiments, the method further includes: For any table in the knowledge database, if the semantics of the table indicate that there are merged cells in the table header, then at least one key attribute is determined from the multiple attributes of the table header. Based on at least one key attribute, determine the data corresponding to at least one key attribute from the body of the table; Create a sub-table by using at least one key attribute as the new table header and the data corresponding to at least one key attribute as the table body.
[0049] The solution provided in this disclosure indicates that the table content is relatively complex when there are merged cells in the table header. In the process of splitting such complex tables, at least one key attribute can be determined from the multiple attributes of the table header, and the at least one key attribute and its corresponding data can be split into a sub-table. This simplifies the content of a single table and also ensures the integrity of key information in the table, making it easier to fully receive and process all the content of the sub-table and understand it accurately, thereby improving the accuracy of subsequent problem-solving.
[0050] In some embodiments, the key attributes include at least one of the following; The attributes located in the first row or first column of the table; The attribute whose relevance to the topic of the table reaches a relevant threshold.
[0051] The solution provided in this disclosure, when there are merged cells in the table header, indicates that there are likely multiple levels of attributes in the header. The attributes located in the first row or first column of the table are usually first-level attributes, representing the main classification. In this case, the attributes located in the first row or first column of the table are used as key attributes; or, attributes that are highly relevant to the topic of the table are used as key attributes. Both of these methods can ensure the integrity of key information in the tables before and after splitting, making it easier to fully receive and process all the content of the sub-tables and to accurately understand them, thereby improving the accuracy of subsequent problem-solving.
[0052] In some embodiments, determining the table text of multiple sub-tables based on multiple sub-tables includes: For any subtable among multiple subtables, if there are no merged cells in the header of the subtable, then for any attribute in the header of the subtable, use the attribute as the key and the data corresponding to the attribute in the subtable as the value to obtain a key-value pair. The table text of the subtable is generated based on the key-value pairs corresponding to each attribute in the subtable header.
[0053] The solution provided in this embodiment indicates that the content of the sub-table is relatively simple when there are no merged cells in the header. The attributes in the header and the data (or content) in the body are in one-to-one correspondence. In this case, the attributes are used as keys, and the corresponding data is used as values to obtain key-value pairs. Then, based on the key-value pairs corresponding to each attribute in the header, the table text of the sub-table is generated. This ensures that the table text accurately and clearly describes the specific meaning (i.e., attributes) of the data or content in each cell of the table body, conforming to the semantic content of the original table before splitting. This prevents the semantic content of the original table from being distorted, facilitating the subsequent full reception and processing of all the content of the sub-table and accurate understanding. Consequently, it enables accurate answers to user questions based on the table text of multiple sub-tables, improving the accuracy of question answering.
[0054] In some embodiments, determining the table text of multiple sub-tables based on multiple sub-tables includes: For any subtable among multiple subtables, if there are merged cells in the header of the subtable, the large language model is used to process the subtable to obtain the subtable text.
[0055] The solution provided in this disclosure, when there are merged cells in the header of a sub-table, indicates that the content of the sub-table is relatively complex. The attributes in the header and the data (or content) in the body may be in a one-to-many or many-to-one relationship. In this case, a large language model is used to process the sub-table to obtain the sub-table text. That is, the large language model's ability to understand tables is used to determine the sub-table text, so that the table text can accurately and clearly describe the specific meaning (i.e., attributes) of the data or content in each cell of the body, conforming to the semantic content of the original table before splitting. This ensures that the semantic content of the original table is not distorted, making it easier to fully receive and process all the content of the sub-table and accurately understand it. In turn, it can accurately answer the user's questions based on the table text of multiple sub-tables, improving the accuracy of question answering.
[0056] In some embodiments, the answer to a user's question is obtained based on the table text of multiple sub-tables in a knowledge database, including: Based on the table text of multiple sub-tables in the knowledge database and the user object's question, determine at least one sub-table that matches the question from the multiple sub-tables in the knowledge database; The question-and-answer model processes the question and at least one sub-table to obtain the answer to the question.
[0057] The solution provided in this embodiment matches the text of multiple sub-tables in a knowledge database with the user's question. Since each table text accurately describes the specific meaning of the data or content in each cell of the table body, it conforms to the semantic content of the original table before splitting, ensuring that the semantic content of the original table is not distorted. This allows for a more accurate identification of at least one sub-table that matches the question. Then, the question and the at least one sub-table itself are processed by a question-answering model, enabling the model to fully receive and process all the content of the sub-table and accurately understand it, thereby outputting an accurate answer to the question and improving the accuracy of the question answering.
[0058] In some embodiments, the method further includes: For any table in the knowledge database, if there are merged cells in the table header as indicated by the semantics of the table, and the number of rows or columns in the table body does not exceed a preset value, then the table is processed using a large language model to obtain the table text, which is used to describe the content of the table using natural language. Based on the table text, the system answers the user's questions.
[0059] The solution provided in this disclosure indicates that the content of the sub-table is relatively complex when there are merged cells in the table header. If the number of rows or columns in the table body exceeds a preset value, it indicates that the content of the table is relatively short. In this case, a large language model may be used to process the table directly to obtain the table text. That is, the table text is determined by using the large language model's ability to understand the table, so that the table text can accurately and clearly describe the specific meaning (i.e., attributes) of the data or content in each cell of the table body. This allows for accurate answers to user questions based on the table text, improving the accuracy of question answering. Furthermore, it eliminates the need to split the table, simplifying the operation and improving the efficiency of obtaining the table text.
[0060] The above Figure 2 The diagram shown is merely the basic process of this disclosure. The following section will further elaborate on the solution provided in this disclosure based on a specific implementation method. Figure 3 This is a flowchart illustrating another table-based question-and-answer method according to an exemplary embodiment. Taking an electronic device provided as a server as an example, see [link to example]. Figure 3 This table-based question-and-answer method includes: In step 301, for any table in the knowledge database, the server splits the table into multiple sub-tables based on the table's semantics. The semantics of the table are used to indicate the structure and content of the table. Each sub-table contains a table header and part of the table body, and the table bodies in different sub-tables are different.
[0061] In this embodiment of the disclosure, for any table in the knowledge base, the server can perform semantic recognition on the table to obtain its semantic features, which are used to identify the structure and content of the table. Then, based on the semantic features, the server splits the table into multiple sub-tables. Each sub-table includes the header and part of the body of the original table before splitting. This part of the body refers to at least one row or column of data (or specific content) in the table before splitting. The bodies of different sub-tables are different; that is, the data in different sub-tables are not entirely the same. The bodies of multiple sub-tables constitute the entire body of the original table. After table splitting, each sub-table has a header and part of the body, which clearly reflects the specific semantics of the data in that part of the body.
[0062] In some embodiments, for any table in the knowledge database, if the semantic indication of the table header contains merged cells, and the number of rows or columns in the table body exceeds a preset value, the server splits the table into multiple sub-tables. Specifically, if the table header is at the top of the table and merged cells exist, and the number of rows in the table body exceeds a preset value, the server splits at least one row from the header and body into a sub-table. If the table header is on the left side of the table and merged cells exist, and the number of columns in the table body exceeds a preset value, the server splits at least one column from the header and body into a sub-table. This preset value can be any value, and this embodiment of the disclosure does not limit it.
[0063] In other embodiments, for any table in the knowledge database, if the semantic indication of the table header contains merged cells, and the number of rows or columns in the table body does not exceed a preset value, the server does not split the table. Instead, it treats the table the same as the aforementioned sub-tables and processes it accordingly. See step 302 for details, which will not be repeated here. The solution provided in this disclosure indicates that the presence of merged cells in the table header signifies a complex table content. If the number of rows or columns in the table body exceeds a preset value, it indicates a long table content. In this case, splitting the table into multiple sub-tables simplifies the content of a single table. Each sub-table contains a header, facilitating the full reception and processing of all sub-table content and accurate understanding, thereby improving the accuracy of subsequent problem-solving.
[0064] In other embodiments, for any table in the knowledge database, if the semantic indication of the table indicates that there are no merged cells in the table header, the server can also split the table into multiple sub-tables. Specifically, if the table header is at the top of the table and there are no merged cells, and the number of rows in the table body exceeds a preset value, the server will split at least one row from the header and the table body into a sub-table. If the table header is on the left side of the table and there are no merged cells, and the number of columns in the table body exceeds a preset value, the server will split at least one column from the header and the table body into a sub-table. This preset value can be any value, and this embodiment of the disclosure does not limit it.
[0065] Optionally, for any table in the knowledge database, if the semantic indicator header is located at the top of the table, the server splits any row in the header and body of the table into a sub-table. If the semantic indicator header is located on the left side of the table, the server splits any column in the header and body of the table into a sub-table. The solution provided in this disclosure, for each table, splits any row in the header and body into a sub-table when the header is at the top of the table, and splits any column in the header and body into a sub-table when the header is on the left side of the table. That is, it splits a row or column of content in the header and body of the table into a sub-table, ensuring that each sub-table accurately reflects the specific meaning of the content in each cell of the corresponding body, guaranteeing that the semantics of the table before and after splitting are not distorted, and improving the accuracy of subsequent problem-solving.
[0066] The table headers in the aforementioned tables typically contain multiple attributes (or categories / entries). During table splitting, some attributes and their corresponding data can be selected from these attributes to create sub-tables. Correspondingly, for any table in the knowledge database, if the table's semantics indicate the presence of merged cells in the header, the server determines at least one key attribute from the multiple attributes in the header. Then, based on this key attribute, the server determines the data corresponding to that key attribute from the table body. The server then uses the key attribute as the new header and the corresponding data as the table body, resulting in a sub-table. The solution provided in this disclosure, where merged cells exist in the table header, indicates a complex table content. In splitting such complex tables, at least one key attribute can be determined from the multiple attributes in the header, and this key attribute and its corresponding data can be split into a sub-table. This simplifies the content of a single table while ensuring the integrity of key information within the table. This facilitates the full reception and processing of all sub-table content and accurate understanding, thereby improving the accuracy of subsequent problem-solving.
[0067] This disclosure does not limit the key attributes. In some embodiments, the key attributes may include at least one of the following: First, the attribute located in the first row or first column of the table. Second, the attribute whose relevance to the topic of the table reaches a relevant threshold. Third, the attribute specified by the management object of the knowledge database or the object providing the table. The relevance between the attribute and the table topic can be calculated along the feature vector dimension, which is not limited in this embodiment. The solution provided in this disclosure, when there are merged cells in the table header, indicates that there are likely multiple levels of attributes in the header. The attribute located in the first row or first column of the table is usually a first-level attribute, representing the main classification. In this case, the attribute located in the first row or first column is used as the key attribute; or, the attribute with strong relevance to the topic of the table is used as the key attribute. Both of these methods ensure the integrity of key information in the table before and after splitting, facilitating the full reception and processing of all content of the sub-tables and accurate understanding, thereby improving the accuracy of subsequent problem-solving.
[0068] In step 302, the server determines the table text of multiple sub-tables based on multiple sub-tables. The table text of each sub-table is used to describe the structure and content of the sub-table in natural language.
[0069] In this embodiment of the disclosure, for any one of the multiple sub-tables, the server parses the sub-table to obtain its table text, so as to describe the structure and content of the sub-table using natural language. That is, the server can convert the visual features (visual structure and visual content) of the table into textual logical features (logical structure and logical content), that is, to describe the structure and content of the sub-table logically using natural language.
[0070] Since each sub-table has the header of the original table, each sub-table can accurately reflect the specific meaning of the data or content in each cell of the corresponding part of the table body. This ensures that the table text of each sub-table can accurately describe the specific meaning of the data or content in each cell of the table body, conforming to the semantic content of the original table before splitting, and ensuring that the semantic content of the original table is not distorted.
[0071] In some embodiments, for any sub-table among multiple sub-tables, if there are no merged cells in the sub-table's header, the server, for any attribute in the sub-table's header, uses the attribute as the key and the corresponding data in the sub-table as the value to obtain a key-value pair. Then, the server generates the sub-table's table text based on the key-value pairs corresponding to each attribute in the sub-table's header. That is, for sub-tables that do not have merged cells in their headers (or tables that do not need to be split), the table text of this table includes multiple key-value pairs, where the key in each key-value pair represents an attribute, and the value in each key-value pair represents the specific data (or content) corresponding to the attribute.
[0072] The solution provided in this embodiment indicates that the content of the sub-table is relatively simple when there are no merged cells in the header. The attributes in the header and the data (or content) in the body are in one-to-one correspondence. In this case, the attributes are used as keys, and the corresponding data is used as values to obtain key-value pairs. Then, based on the key-value pairs corresponding to each attribute in the header, the table text of the sub-table is generated. This ensures that the table text accurately and clearly describes the specific meaning (i.e., attributes) of the data or content in each cell of the table body, conforming to the semantic content of the original table before splitting. This prevents the semantic content of the original table from being distorted, facilitating the subsequent full reception and processing of all the content of the sub-table and accurate understanding. Consequently, it enables accurate answers to user questions based on the table text of multiple sub-tables, improving the accuracy of question answering.
[0073] For example, the table is Table 1 below.
[0074]
[0075] Table 1 The parsed table text using the method described in this solution is as follows: 1. Framework task amount (ten thousand yuan): 80,000+; Framework rebate ratio for Category I: 10.5%; Framework rebate ratio for Category II with a growth rate >= 5%: 11%; 2. Framework task amount (ten thousand yuan): [65,000-80,000), Framework return ratio for Category I: 9.5%, Framework return ratio for Category II with a growth rate >= 5%: 10%; 3. Framework task amount (ten thousand yuan): [50,000-65,000), framework return ratio Category I: 8.5%, framework return ratio Category II growth rate >= 5%: 9%.
[0076] The table text obtained using the relevant technology is as follows: Framework task amount (ten thousand yuan) Frame return ratio - Category I Frame return ratio Example - Category II growth rate ≥ 5% 80000+ 10.5% 11.0% [65000-80000) 9.5% 10.0% [50000-65000) 8.5% 9.0% .
[0077] Compared to the table text obtained using this solution, the related technologies contain numerous tags reflecting table format (such as HTML), such as "table" (representing the entire table), "tr" (representing table rows), and "td" (representing the specific content within a cell). This table text, after subsequent vectorization, lacks semantic depth. Since user queries are typically semantic, this leads to the omission of crucial table content, making it impossible to answer user questions. In contrast, the table text obtained using this solution describes the specific content of the table using natural language. It accurately and clearly describes the specific meaning (i.e., attributes) of the data or content in each cell of the table body, ensuring the integrity and undistorted semantic content of the original table. This facilitates the full reception and processing of all content from sub-tables for accurate understanding, enabling accurate answers to user questions based on the table text of multiple sub-tables, thus improving the accuracy of question answering.
[0078] In other embodiments, for any sub-table among multiple sub-tables, if there are merged cells in the header of the sub-table, the server processes the sub-table using a large language model to obtain the table text of the sub-table. This large language model can be a large language model used to answer questions (i.e., a question-answering model), or it can be any other additional large language model. The architecture of the large language model is not limited in the embodiments of this disclosure. The solution provided in this disclosure, when there are merged cells in the header of a sub-table, indicates that the content of the sub-table is relatively complex. The attributes in the header and the data (or content) in the body may be in a one-to-many or many-to-one relationship. In this case, a large language model is used to process the sub-table to obtain the sub-table text. That is, the large language model's ability to understand tables is used to determine the sub-table text, so that the table text can accurately and clearly describe the specific meaning (i.e., attributes) of the data or content in each cell of the body, conforming to the semantic content of the original table before splitting. This ensures that the semantic content of the original table is not distorted, making it easier to fully receive and process all the content of the sub-table and accurately understand it. In turn, it can accurately answer the user's questions based on the table text of multiple sub-tables, improving the accuracy of question answering.
[0079] In other embodiments, for any table in the knowledge database, if the semantic indication of the table header contains merged cells, and the number of rows or columns in the table body does not exceed a preset value, the server does not split the table. Instead, it directly processes the table using a large language model to obtain the table text. The table text is used to describe the content of the table using natural language. Then, the server answers the user's question based on the table text, obtaining the answer to the question. The solution provided by this disclosure indicates that if the header of a sub-table contains merged cells, it means that the content of the sub-table is relatively complex. If the number of rows or columns in the table body exceeds a preset value, it means that the content of the table is relatively short. In this case, the large language model may be directly used to process the table to obtain the table text. That is, the table text is determined by utilizing the understanding ability of the large language model, so that the table text can accurately and clearly describe the specific meaning (i.e., attributes) of the data or content in each cell of the table body. This allows for accurate answers to the user's question based on the table text, improving the accuracy of the question answering. Furthermore, it eliminates the need to split the table, simplifying the operation and improving the efficiency of obtaining the table text.
[0080] In step 303, the server determines at least one sub-table that matches the question from the multiple sub-tables in the knowledge database, based on the table text of multiple sub-tables in the knowledge database and the question of the user object.
[0081] In this embodiment of the disclosure, the server can use the table text of multiple sub-tables in the knowledge database and the table text of tables that do not need to be split as knowledge units (Chunks) in the RAG system, which are semantic text contents designed to be effectively understood and utilized by the retrieval system and question-answering model. Specifically, the server can extract features from the table files of each table, converting the table text into feature vectors for storage, so that in subsequent question-answering processes, tables related to the question can be retrieved along the vector dimension to provide an answer.
[0082] For example, Figure 4 This is a schematic diagram illustrating an embodiment of obtaining table text. See also: Figure 4 For tables in HTML or Markdown format, the server can extract at least one key attribute and its corresponding data (or content) to split the table into N sub-tables. Each sub-table includes a body and a header. Then, the server uses a large language model to summarize the content of each sub-table, obtaining the table text for each sub-table. Finally, the server extracts features from each table text and stores them as vectors.
[0083] Then, in response to a user's query request regarding a question, the server extracts features from the question to obtain its feature vector. The server then matches this feature vector with the feature vectors of various table texts to determine the table texts that match the question, and consequently, the tables that match the question.
[0084] In step 304, the server processes the question and at least one sub-table using a question-and-answer model to obtain the answer to the question.
[0085] In this embodiment, the question-answering model can be a large language model of any structure, and this embodiment does not limit it. The server can input a question and at least one sub-table matching the question into the question-answering model, and then process the question and at least one sub-table through the question-answering model to output the answer to the question. The solution provided in this embodiment matches the table text of multiple sub-tables in the knowledge database with the user's question. Since each table text can accurately describe the specific meaning of the data or content in each cell of the table body, it conforms to the semantic content of the original table before splitting, ensuring that the semantic content of the original table is not distorted. This allows for a more accurate finding of at least one sub-table matching the question. Then, the question and at least one sub-table itself are processed by the question-answering model, which allows the question-answering model to fully receive and process all the content of the sub-table and accurately understand it, thereby outputting an accurate answer to the question and improving the accuracy of question answering.
[0086] For example, Figure 5 This is a schematic diagram illustrating an example of answering a user question, according to an exemplary embodiment. See also... Figure 5 The server extracts features from the user's question, obtaining a feature vector for the question. Then, the server matches this feature vector with the feature vectors of various texts in the knowledge database. Besides feature vectors for table text, the knowledge database also contains feature vectors for other forms of knowledge, such as image knowledge text and audio knowledge text. After identifying the text that matches the question, if that text describes the knowledge in the table, the original table format can be obtained and input into the question-answering model to answer the question, thus obtaining the answer.
[0087] This disclosure provides a table-based question-answering method. For each table in a knowledge database, the method can split the table based on its semantics. Each sub-table obtained from the splitting contains the header and part of the body of the original table. Since each sub-table has the header of the original table, each sub-table can accurately reflect the specific meaning of the data or content in each cell of the corresponding part of the body. This ensures that the table text of each determined sub-table can accurately describe the specific meaning of the data or content in each cell of the body, conforming to the semantic content of the original table before splitting. This ensures that the semantic content of the original table is not distorted. Furthermore, the content of the split sub-tables is smaller, resulting in a smaller amount of data in the corresponding table text. This facilitates the full reception and processing of all the content of the sub-tables and accurate understanding during question answering. Consequently, the method can accurately answer the user's question based on the table text of multiple sub-tables, improving the accuracy of question answering.
[0088] All of the above-mentioned optional technical solutions can be combined in any way to form optional embodiments of this disclosure, and will not be described in detail here.
[0089] Figure 6 This is a block diagram illustrating a table-based question-and-answer device according to an exemplary embodiment. See also Figure 6 The table-based question-and-answer device includes a splitting unit 601, a first determining unit 602, and an answering unit 603.
[0090] The splitting unit 601 is configured to split any table in the knowledge database based on the table's semantics to obtain multiple sub-tables. The semantics of the table are used to indicate the structure and content of the table. Each sub-table contains a table header and part of the table body. The table bodies in different sub-tables are different. The first determining unit 602 is configured to perform a determination of the table text of multiple sub-tables based on multiple sub-tables, wherein the table text of each sub-table is used to describe the structure and content of the sub-table in natural language; Answer unit 603 is configured to execute table text based on multiple sub-tables in the knowledge database to answer the user's question and obtain the answer to the question.
[0091] In some embodiments, the splitting unit 601 is configured to perform the following operations for any table in the knowledge database: if the semantic indicator header is located at the top of the table, then split any row in the header and the body of the table into a sub-table; if the semantic indicator header is located at the left side of the table, then split any column in the header and the body of the table into a sub-table.
[0092] In some embodiments, the splitting unit 601 is configured to split any table in the knowledge database into multiple sub-tables if the number of rows or columns in the table body exceeds a preset value, provided that there are merged cells in the table header as indicated by the table's semantics.
[0093] In some embodiments, the apparatus further includes: The second determining unit is configured to determine at least one key attribute from multiple attributes of the table header if there are merged cells in the table header of any table in the knowledge database. Splitting unit 601 is also configured to perform the following: based on at least one key attribute, determine the data corresponding to at least one key attribute from the body of the table; use at least one key attribute as the new table header, and use the data corresponding to at least one key attribute as the table body to obtain a sub-table of the table.
[0094] In some embodiments, the key attributes include at least one of the following; The attribute located in the first row or first column of the table; The attribute whose relevance to the topic of the table reaches a relevant threshold.
[0095] In some embodiments, the first determining unit 602 is configured to perform the following: for any one of the multiple subtables, if the header of the subtable does not have merged cells, then for any attribute in the header of the subtable, use the attribute as the key and the data corresponding to the attribute in the subtable as the value to obtain a key-value pair; and generate the table text of the subtable based on the key-value pairs corresponding to each attribute in the header of the subtable.
[0096] In some embodiments, the first determining unit 602 is configured to perform processing on any of the multiple subtables, if there are merged cells in the header of the subtable, using a large language model to obtain the table text of the subtable.
[0097] In some embodiments, the answering unit 603 is configured to perform a question based on table text and user object from multiple sub-tables in a knowledge database, determine at least one sub-table that matches the question from the multiple sub-tables in the knowledge database, and process the question and at least one sub-table through a question-answering model to obtain the answer to the question.
[0098] In some embodiments, the first determining unit 602 is further configured to perform the following for any table in the knowledge database: if the number of rows or columns in the table body does not exceed a preset value, and the table is processed using a large language model to obtain the table text, which is used to describe the content of the table in natural language. The solution unit 603 is also configured to execute table-based text to answer the user object's question and obtain the answer to the question.
[0099] It should be noted that the table-based question-answering device provided in the above embodiments is only illustrated by the division of the above functional units when answering user questions. In practical applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the electronic device can be divided into different functional units to complete all or part of the functions described above. In addition, the table-based question-answering device and the table-based question-answering method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0100] This disclosure provides a table-based question-answering device. For each table in a knowledge database, it can be split based on the semantics of the table. Each sub-table obtained by splitting has the header and part of the body of the original table. Since each sub-table has the header of the original table, each sub-table can accurately reflect the specific meaning of the data or content in each cell of the corresponding part of the body. This ensures that the table text of each determined sub-table can accurately describe the specific meaning of the data or content in each cell of the body, conforming to the semantic content of the original table before splitting. This ensures that the semantic content of the original table is not distorted. Furthermore, the content of the split sub-tables is smaller, resulting in a smaller amount of data in the corresponding table text. This facilitates the full reception and processing of all the content of the sub-tables and accurate understanding during question answering. As a result, it can accurately answer the user's question based on the table text of multiple sub-tables, improving the accuracy of question answering.
[0101] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0102] When an electronic device is provided as a terminal, Figure 7 This is a block diagram illustrating a terminal 700 according to an exemplary embodiment. The terminal... Figure 7A structural block diagram of a terminal 700 provided in an exemplary embodiment of this disclosure is shown. The terminal 700 may be a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. The terminal 700 may also be referred to as a user device, portable terminal, laptop terminal, desktop terminal, or other names.
[0103] Typically, terminal 700 includes a processor 701 and a memory 702.
[0104] Processor 701 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 701 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 701 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 701 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 701 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0105] Memory 702 may include one or more computer-readable storage media, which may be non-transitory. Memory 702 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in memory 702 are used to store at least one computer program, which is executed by processor 701 to implement the table-based question-and-answer method provided in the method embodiments of this application.
[0106] In some embodiments, the terminal 700 may also optionally include a peripheral device interface 703 and at least one peripheral device. The processor 701, memory 702, and peripheral device interface 703 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 703 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 704, a display screen 705, a camera assembly 706, an audio circuit 707, and a power supply 708.
[0107] Peripheral device interface 703 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 701 and memory 702. In some embodiments, processor 701, memory 702 and peripheral device interface 703 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 701, memory 702 and peripheral device interface 703 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0108] The radio frequency (RF) circuit 704 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 704 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 704 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. In some embodiments, the RF circuit 704 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 704 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 704 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0109] Display screen 705 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 705 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 701 for processing. In this case, display screen 705 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 705, disposed on the front panel of terminal 700; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal 700 or in a folded design; in other embodiments, display screen 705 may be a flexible display screen, disposed on a curved or folded surface of terminal 700. Furthermore, display screen 705 may be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. Display screen 705 may be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light-Emitting Diode).
[0110] The camera assembly 706 is used to acquire images or videos. In some embodiments, the camera assembly 706 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 706 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash is a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.
[0111] The audio circuit 707 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to the processor 701 for processing, or input to the radio frequency circuit 704 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each located at a different part of the terminal 700. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert the electrical signals from the processor 701 or the radio frequency circuit 704 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 707 may also include a headphone jack.
[0112] Power supply 708 is used to power the various components in terminal 700. Power supply 708 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 708 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, while a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0113] Those skilled in the art will understand that Figure 7 The structure shown does not constitute a limitation on terminal 700, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0114] When electronic devices are provided as servers, Figure 8 This is a block diagram illustrating a server 800 according to an exemplary embodiment. The server 800 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 801 and one or more memories 802. The memory 802 stores at least one line of program code, which is loaded and executed by the processor 801 to implement the table-based question-and-answer method provided in the various method embodiments described above. Of course, the server may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server 800 may also include other components for implementing device functions, which will not be elaborated here.
[0115] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 702 or memory 802 including instructions, which can be executed by the processor 701 of the terminal 700 or the processor 801 of the server 800 to complete the table-based question-and-answer method described above. Optionally, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device, etc.
[0116] A computer program product includes a computer program / instructions that, when executed by a processor, implement the table-based question-and-answer method described above.
[0117] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0118] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A table-based question-and-answer method, characterized in that, The method includes: For any table in the knowledge database, based on the semantics of the table, the table is split into multiple sub-tables. The semantics of the table are used to indicate the structure and content of the table. Each sub-table contains the table header and part of the table body. The table bodies in different sub-tables are different. Based on the multiple sub-tables, the table text of the multiple sub-tables is determined, and the table text of each sub-table is used to describe the structure and content of the sub-table in natural language; Based on the table text of multiple sub-tables in the knowledge database, the user's question is answered to obtain the answer to the question.
2. The table-based question-and-answer method according to claim 1, characterized in that, For any table in the knowledge database, based on the semantics of the table, the table is split into multiple sub-tables, including: For any table in the knowledge database, if the semantics indicate that the table header is at the top of the table, then any row in the table header and the table body is split into a sub-table. If the semantic indication indicates that the table header is located on the left side of the table, then any column in the table header and the table body will be split into a sub-table.
3. The table-based question-and-answer method according to claim 1, characterized in that, For any table in the knowledge database, based on the semantics of the table, the table is split into multiple sub-tables, including: For any table in the knowledge database, if the semantic indication of the table indicates that there are merged cells in the table header, and the number of rows or columns in the table body exceeds a preset value, then the table is split to obtain the multiple sub-tables.
4. The table-based question-and-answer method according to claim 1, characterized in that, The method further includes: For any table in the knowledge database, if the semantics of the table indicate that there are merged cells in the table header, then at least one key attribute is determined from the multiple attributes of the table header. Based on the at least one key attribute, determine the data corresponding to the at least one key attribute from the body of the table; By using the at least one key attribute as the new table header and the data corresponding to the at least one key attribute as the table body, a sub-table of the table is obtained.
5. The table-based question-and-answer method according to claim 4, characterized in that, The key attributes include at least one of the following; The attributes located in the first row or first column of the table; The attribute whose relevance to the topic of the table reaches a relevant threshold.
6. The table-based question-and-answer method according to claim 1, characterized in that, The step of determining the table text of the multiple sub-tables based on the multiple sub-tables includes: For any of the multiple sub-tables, if there are no merged cells in the header of the sub-table, then for any attribute in the header of the sub-table, the attribute is used as the key and the data corresponding to the attribute in the sub-table is used as the value to obtain a key-value pair. The table text of the sub-table is generated based on the key-value pairs corresponding to each attribute in the header of the sub-table.
7. The table-based question-and-answer method according to claim 1, characterized in that, The step of determining the table text of the multiple sub-tables based on the multiple sub-tables includes: For any of the multiple sub-tables, if there are merged cells in the header of the sub-table, the large language model is used to process the sub-table to obtain the table text of the sub-table.
8. The table-based question-and-answer method according to claim 1, characterized in that, The method of answering user questions based on table text from multiple sub-tables in the knowledge database, to obtain answers to the questions, includes: Based on the table text of multiple sub-tables in the knowledge database and the question of the user object, at least one sub-table that matches the question is determined from the multiple sub-tables in the knowledge database; The question and at least one sub-table are processed using a question-and-answer model to obtain the answer to the question.
9. The table-based question-and-answer method according to claim 1, characterized in that, The method further includes: For any table in the knowledge database, if the semantic indication of the table indicates that there are merged cells in the table header, and if the number of rows or columns in the table body does not exceed a preset value, then the table is processed using a large language model to obtain the table text, which is used to describe the content of the table using natural language. Based on the table text, the user's question is answered to obtain the answer to the question.
10. A table-based question-and-answer device, characterized in that, The device includes: The splitting unit is configured to split any table in the knowledge database into multiple sub-tables based on the semantics of the table. The semantics of the table are used to indicate the structure and content of the table. Each sub-table contains the table header and part of the table body. The table bodies in different sub-tables are different. The first determining unit is configured to perform an operation based on the plurality of sub-tables to determine the table text of the plurality of sub-tables, wherein the table text of each sub-table is used to describe the structure and content of the sub-table in natural language; The answering unit is configured to execute table text based on multiple sub-tables in the knowledge database to answer the user's question and obtain the answer to the question.
11. An electronic device, characterized in that, The electronic device includes: One or more processors; Memory used to store the executable program code of the processor; The processor is configured to execute the program code to implement the table-based question-and-answer method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is enabled to perform the table-based question-and-answer method as described in any one of claims 1 to 9.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the table-based question-and-answer method according to any one of claims 1 to 9.