CN-121979972-A - Question and answer method and device based on table, electronic equipment and storage medium
Abstract
The disclosure provides a form-based question and answer method, a form-based question and answer device, electronic equipment and a storage medium, and belongs to the technical field of computers. The method comprises the steps of splitting any table in a knowledge database based on the semantics of the table to obtain a plurality of sub-tables, wherein the semantics of the table are used for indicating the structure and the content of the table, each sub-table comprises a table head and a part of table bodies of the table, the table bodies in different sub-tables are different, determining the table text of the plurality of sub-tables based on the plurality of sub-tables, the table text of each sub-table is used for describing the structure and the content of the sub-table through natural language, and solving the problem of a user object based on the table text of the plurality of sub-tables in the knowledge database to obtain the answer of the problem. The method can ensure that the semantic content of the form is not distorted, so that the problem of the user object can be accurately solved, and the accuracy of the problem solution is improved.
Inventors
- LIN JIANBIN
- WANG LIKAI
- CHEN FEI
- OU DIZUO
Assignees
- 北京达佳互联信息技术有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251215
Claims (13)
- 1. A form-based question-answering method, the method comprising: splitting any table in a knowledge database based on the semantics of the table to obtain a plurality of sub-tables, wherein the semantics of the table are used for indicating the structure and the content of the table, each sub-table comprises a table head and a part of table bodies of the table, and the table bodies in different sub-tables are different; Determining, based on the plurality of sub-tables, table text of the plurality of sub-tables, the table text of each sub-table being used to describe the structure and content of the sub-table in natural language; and solving the problem of the user object based on the table text of the plurality of sub-tables in the knowledge database to obtain the answer of the problem.
- 2. The form-based question-answering method according to claim 1, wherein the splitting the form based on the semantics of the form for any form in a knowledge database to obtain a plurality of sub-forms includes: for any table in the knowledge database, if the semantic indicates that the header is positioned at the top of the table, splitting any row in the header and the table body of the table into a sub-table; if the semantic indicates that the header is positioned at the left side of the table, splitting any column of the header and the table body of the table into a sub-table.
- 3. The form-based question-answering method according to claim 1, wherein the splitting the form based on the semantics of the form for any form in a knowledge database to obtain a plurality of sub-forms includes: For any table in the knowledge database, if the semantics of the table indicate that the merging cells exist in the header of the table, splitting the table to obtain the multiple sub-tables if the number of rows or the number of columns in the body of the table exceeds a preset value.
- 4. The form-based question-answering method according to claim 1, further comprising: for any table in the knowledge database, if the semantics of the table indicate that a merging cell exists in the table header of the table, determining at least one key attribute from a plurality of attributes of the table header; Determining data corresponding to the at least one key attribute from a table body of the table based on the at least one key attribute; and taking the at least one key attribute as a new header, and taking data corresponding to the at least one key attribute as a table body to obtain a sub-table of the table.
- 5. The form based question-answering method according to claim 4, wherein the key attributes include at least one of; attributes located in the first row or first column in the table; and an attribute that has a correlation with the subject of the table reaching a correlation threshold.
- 6. The form based question-answering method according to claim 1, wherein the determining, based on the plurality of sub-forms, a form text of the plurality of sub-forms comprises: For any sub-table in the plurality of sub-tables, if no merging cell exists in the table head of the sub-table, taking the attribute as a key and taking data corresponding to the attribute in the sub-table as a value for any attribute in the table head of the sub-table to obtain a key value pair; and generating a table text of the sub-table based on key value pairs corresponding to various attributes in the table head of the sub-table.
- 7. The form based question-answering method according to claim 1, wherein the determining, based on the plurality of sub-forms, a form text of the plurality of sub-forms comprises: and for any sub-table in the plurality of sub-tables, if a merging cell exists in the header of the sub-table, processing the sub-table by adopting a large language model to obtain the table text of the sub-table.
- 8. The form-based question-answering method according to claim 1, wherein the solving the problem of the user object based on the form text of the plurality of sub-forms in the knowledge database to obtain an answer to the problem comprises: Determining at least one sub-table matching the question from a plurality of sub-tables in the knowledge database based on the table text of the plurality of sub-tables in the knowledge database and the question of the user object; And processing the questions and the at least one sub-form through a question and answer model to obtain answers to the questions.
- 9. The form-based question-answering method according to claim 1, further comprising: For any table in the knowledge database, if the semantics of the table indicate that the merging cells exist in the table head of the table, if the number of rows or the number of columns in the table body of the table does not exceed a preset value, a large language model is adopted to process the table to obtain a table text of the table, and the table text is used for describing the content of the table through natural language; and solving the problem of the user object based on the table text of the table to obtain an answer to the problem.
- 10. A form-based question-answering apparatus, the apparatus comprising: the splitting unit is configured to execute any table in the knowledge database, split the table based on the semantics of the table to obtain a plurality of sub-tables, wherein the semantics of the table are used for indicating the structure and the content of the table, each sub-table comprises a table head and a part of table body of the table, and the table bodies in different sub-tables are different; A first determining unit configured to perform determining, based on the plurality of sub-tables, table text of the plurality of sub-tables, the table text of each sub-table being used to describe the structure and content of the sub-table by natural language; and the answering unit is configured to execute the answering of the questions of the user objects based on the table text of the plurality of sub-tables in the knowledge database to obtain the answers of the questions.
- 11. An electronic device, the electronic device comprising: One or more processors; A memory for storing the processor-executable program code; Wherein the processor is configured to execute the program code to implement a form-based question-answering method according to any one of claims 1 to 9.
- 12. A computer readable storage medium, wherein instructions in the computer readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the form-based question-answering method according to any one of claims 1 to 9.
- 13. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the form-based question-answering method according to any one of claims 1 to 9.
Description
Question and answer method and device based on table, electronic equipment and storage medium Technical Field The disclosure relates to the technical field of computers, and in particular relates to a form-based question answering method, a form-based question answering device, electronic equipment and a storage medium. Background With the development of computer technology, more and more users are accustomed to querying questions through a question-and-answer model. Where the question of domain-specific knowledge is queried, it is often necessary to combine the internal knowledge of the question-answer model with an external knowledge database to generate a more accurate answer. At present, firstly, matching the questions of the user with domain knowledge in knowledge data in feature vector dimension, and then, recall the questions, and inputting the recalled knowledge to a question-answer model, so that the question-answer model answers the questions of the user based on the recalled knowledge. Because the knowledge in the knowledge database is not only simple plain text, but also complex content of a form, i.e. high information content and structuring, how to process the knowledge of the form, so that the knowledge can be accurately matched and recalled finally, and the knowledge can be given to a question-answer model for answer, which is the key point of research in the field. Disclosure of Invention The invention provides a question and answer method, a question and answer device, electronic equipment and a storage medium based on a table, which can ensure that the semantic content of the table is not distorted, so that the problem of a user object can be accurately solved, and the accuracy of the problem solution is improved. The technical scheme of the present disclosure is as follows: According to an aspect of the embodiments of the present disclosure, there is provided a form-based question-answering method, including: splitting any table in a knowledge database based on the semantics of the table to obtain a plurality of sub-tables, wherein the semantics of the table are used for indicating the structure and the content of the table, each sub-table comprises a table head and a part of table bodies of the table, and the table bodies in different sub-tables are different; Determining, based on the plurality of sub-tables, table text of the plurality of sub-tables, the table text of each sub-table being used to describe the structure and content of the sub-table in natural language; and solving the problem of the user object based on the table text of the plurality of sub-tables in the knowledge database to obtain the answer of the problem. According to another aspect of the embodiments of the present disclosure, there is provided a form-based question-answering apparatus, including: the splitting unit is configured to execute any table in the knowledge database, split the table based on the semantics of the table to obtain a plurality of sub-tables, wherein the semantics of the table are used for indicating the structure and the content of the table, each sub-table comprises a table head and a part of table body of the table, and the table bodies in different sub-tables are different; A first determining unit configured to perform determining, based on the plurality of sub-tables, table text of the plurality of sub-tables, the table text of each sub-table being used to describe the structure and content of the sub-table by natural language; and the answering unit is configured to execute the answering of the questions of the user objects based on the table text of the plurality of sub-tables in the knowledge database to obtain the answers of the questions. In some embodiments, the splitting unit is configured to perform splitting any row of the header and the body of the table into one sub-table if the semantics indicate that the header is located at the top of the table, and splitting any column of the header and the body of the table into one sub-table if the semantics indicate that the header is located at the left side of the table. In some embodiments, the splitting unit is configured to perform splitting on any table in the knowledge database, where the semantics of the table indicate that there are merging cells in the header of the table, and if the number of rows or columns in the body of the table exceeds a preset value, the table is split to obtain the multiple sub-tables. In some embodiments, the apparatus further comprises: A second determining unit configured to perform, for any table in the knowledge database, determining at least one key attribute from a plurality of attributes of a header of the table in the case where there is a merging cell in the header; The splitting unit is further configured to determine data corresponding to the at least one key attribute from the table body based on the at least one key attribute, and obtain a sub-table of the table by taking the at least o