Document information recall method, device, electronic device and storage medium
By extracting and describing text information for semantic text information in the table in financial documents, replacing the original table for information recall, solving the problem of low information recall in the existing technology, and realizing more efficient and accurate information extraction.
Patent Information
- Application Number
- CN202411312303.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-09-20
AI Technical Summary
The prior art ignores the consistency of context information in the document in financial documents, resulting in a low quality of information recall results, which in turn affects the accuracy of information extraction.
By parsing the document to be processed containing text and tables, the semantic text information of each cell in each table is determined, and the description text corresponding to each table is generated. The table is replaced with the description text to generate the target document and perform information recall processing. .
Through the cross -exchange of text text, the quality and accuracy of information recalls are improved, the processing process of information recall is simplified, and the efficiency of information retrieval is improved.
Smart Images

Figure CN118839678B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a document information recall method, device, electronic device and storage medium. Background Art
[0002] In the financial field, documents usually contain a large amount of complex structured and unstructured information, and this information is crucial to business operations. In order to effectively extract useful data from documents, it is first necessary to filter out the text fragments that are most likely to contain the target information from the document, and then further extract the required information from the text fragments.
[0003] Existing information extraction methods mainly include unified recall and classified recall. Unified recall refers to the unified recall of various types of information in the document, and the recall is performed after all the text is extracted. Classified recall refers to the classification and recall of specific information in the document into plain text and table categories. Finally, the recall results are summarized before the subsequent extraction process.
[0004] However, due to the complexity of information in financial documents, the above method ignores the coherence of contextual information in the document, resulting in low quality of the final information recall result, and thus low accuracy of information extraction. Summary of the invention
[0005] The purpose of this application is to provide a document information recall method, device, electronic device and storage medium to address the deficiencies in the above-mentioned prior art, so as to solve the problem that the quality of the final information recall result in the prior art is low, thereby resulting in low accuracy of information extraction.
[0006] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0007] In a first aspect, an embodiment of the present application provides a document information recall method, the method comprising:
[0008] Parsing a document to be processed containing text and tables to obtain tables in the document to be processed;
[0009] Determine the semantic text information of each cell in each table according to each row identifier, each column identifier and each cell content in each table;
[0010] Generate description text corresponding to each table according to the semantic text information of each cell in each table;
[0011] Each of the tables in the document to be processed is replaced with a description text corresponding to each of the tables to obtain a target document, and information recall processing is performed based on the target document.
[0012] In a second aspect, an embodiment of the present application provides a document information recall device, the device comprising:
[0013] A parsing module, used for parsing a document to be processed containing text and tables to obtain each table in the document to be processed;
[0014] A determination module, used to determine the semantic text information of each cell in each table according to each row identifier, each column identifier and each cell content in each table;
[0015] A generation module, used to generate description text corresponding to each table according to the semantic text information of each cell in each table;
[0016] The processing module is used to replace each of the tables in the document to be processed with a description text corresponding to each of the tables, obtain a target document, and perform information recall processing based on the target document.
[0017] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the storage medium communicate via the bus, and the processor executes the machine-readable instructions to perform the steps of the document information recall method as described in any one of the first aspects above.
[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the document information recall method as described in any one of the above-mentioned first aspects are executed.
[0019] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program code. When the computer program code is executed by a computing device, the computing device executes the steps of the document information recall method as described in any one of the first aspects above.
[0020] According to the document information recall method, device, electronic device and storage medium of the embodiment of the present application, the document to be processed containing text and tables is parsed to obtain each table in the document to be processed, and the semantic text information of each cell in each table is determined according to the row identifier, column identifier and cell content in each table, and the description text corresponding to each table is generated according to the semantic text information of each cell in each table, and then each table in the document to be processed is replaced with the description text corresponding to each table to obtain the target document, and information recall processing is performed based on the target document. According to the embodiment of the present application, for the document to be processed containing both text and tables, the table is subjected to textual description processing to generate the description text corresponding to the table, and then the table in the document to be processed is replaced with the description text corresponding to the table, that is, the table is interchanged with text and combined with the non-table text information in the document to be processed to generate the target document, which is an intermediate document, for unified information recall. Since the target document only replaces the original table with the corresponding descriptive text of the table, that is, the various information forms contained in the document to be processed are unified, the overall structure of the document to be processed will not be mechanically split and effective information will not be lost in this process, thereby improving the quality and accuracy of information recall through the cross-exchange of table and text. In addition, since the data contained in the target document has been unified into a text information form, in the information recall process, processing pure text data is simpler than the process of mixed text data of text and table, which not only simplifies the processing flow of information recall, but also makes better use of the data in the target document for efficient retrieval, thereby improving the efficiency of information recall. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 A schematic diagram of a process of a document information recall method provided in an embodiment of the present application is shown;
[0023] Figure 2 A schematic diagram of a process flow of a document parsing method provided by an embodiment of the present application is shown;
[0024] Figure 3 A schematic diagram of a flow chart of a description text generation method provided in an embodiment of the present application is shown;
[0025] Figure 4 A schematic diagram of a flow chart of an information extraction processing method provided in an embodiment of the present application is shown;
[0026] Figure 5 A schematic diagram of a process of obtaining target information provided by an embodiment of the present application is shown;
[0027] Figure 6 A schematic diagram of a process of text table exchange recall provided in an embodiment of the present application is shown;
[0028] Figure 7 A schematic diagram of the structure of a document information recall device provided in an embodiment of the present application is shown;
[0029] Figure 8 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0030] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0031] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0032] In order to enable those skilled in the art to use the contents of this application, the following implementation is provided in conjunction with a specific application scenario, "a hybrid recall method for cross-interchange of text and tables". For those skilled in the art, the general principles defined herein may be applied to other embodiments and application scenarios without departing from the spirit and scope of this application. Although this application is mainly described around a document information recall method, it should be understood that this is only an exemplary embodiment.
[0033] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0034] In addition to manually formulating rules based on document characteristics and empirical knowledge to recall effective information fragments, existing information recall methods mainly include the following two strategies: unified recall and classified recall:
[0035] Unified recall strategy: recall documents and tables uniformly, and recall after all texts are extracted. This type of method can be further divided into a model method that uses similar word frequencies or a method that uses text vectorization and then performs similar recall.
[0036] Classification recall strategy: Classify and recall the specific content in the document, usually divided into plain text and table categories, and then design recall strategies for each category. Among them, the method for recalling text content can be found in the unified recall strategy. The second category of table content, usually after table recognition, is either structured and the header information is used for text similarity or correlation filtering during recall, or similar recall is performed by directly querying the table title.
[0037] However, both of the above recall strategies tend to be more friendly to one of the states of text and table, without considering the inherent unity that tables and text are actually a form of information presentation based on text. Specifically, the former method is friendly to plain text, but ignores the structural information and hierarchical information of some tables. The latter method seems to consider different forms of information presentation separately, but ignores the coherence between the table context and artificially and mechanically separates the table and text information. The above problems will eventually lead to low-quality recall results, and some valid and key information will be lost in the recall stage, which will directly limit the success rate of subsequent information extraction.
[0038] In view of the fact that the various existing recall strategies tend to be more friendly to one of the information forms of text and table, without considering the inherent unity that tables and texts are actually a form of information presentation based on text, the embodiment of the present application provides a document information recall method, and proposes a new strategy of targeted cross-recall of text and table, which can take into account the recall of different information forms. In complex documents containing both tables and texts, a unified and non-biased recall strategy can be used to recall valid information in texts and tables. At the same time, two cross-exchanges are performed in the process of information recall and information extraction, so the recall rate is improved in the information recall link, and the problem of reduced extraction accuracy caused by generating false information is avoided.
[0039] Figure 1A schematic diagram of a document information recall method provided in an embodiment of the present application is shown. Figure 1 As shown, the method specifically comprises the following steps:
[0040] S101: parse a document to be processed that contains text and tables to obtain tables in the document to be processed.
[0041] Optionally, a structured analysis is performed on the document to be processed, various forms of information contained in the document to be processed are classified, and information such as plain text, tables, and images in the document to be processed are determined and identified, and the location of each table in the document to be processed is obtained.
[0042] Optionally, tables, texts and other visual elements in the document to be processed can be identified and extracted by computer vision algorithms (CV algorithms). For example, the table in the document to be processed can be subjected to boundary detection and cell segmentation, and the text area in the document to be processed can be separated from the table area, so as to subsequently perform structural analysis and semantic information extraction on each table in the document to be processed.
[0043] S102: Determine semantic text information of each cell in each table according to each row identifier, each column identifier and each cell content in each table.
[0044] Optionally, a table is a structured data area consisting of rows and columns, a row identifier refers to the first column in the table, containing the main information or title of the row, a column identifier refers to the first row in the table, containing the main information or title of the column, and a cell content refers to specific data in the table other than the row identifier and the column identifier, located at the intersection of the row identifier and the column identifier. The contextual meaning of each cell, that is, the semantic text information of the cell, is determined by the row identifier, the column identifier, and the cell content in the table.
[0045] Optionally, the semantic text information of a cell does not simply refer to the cell content corresponding to the cell, but uses the row identifier of the row where the cell is located and the column identifier of the column where the cell is located as restriction conditions to limit the cell content of the cell, thereby forming a complete explanation or description of the cell content of the cell.
[0046] For example, refer to the following Table 1, which is a table obtained after parsing the document to be processed. For the cell "Straight-line method" in the second row and second column of Table 1, the row in which the cell is located is marked as "Houses and Buildings", and the column in which the cell is located is marked as "Depreciation method", then the semantic text information corresponding to the cell can be expressed as: "When the category value is Houses and Buildings, the depreciation method used for residual value calculation is the straight-line method".
[0047] Table 1 Depreciation residual value calculation form
[0048]
[0049] S103 . Generate description text corresponding to each table according to the semantic text information of each cell in each table.
[0050] Optionally, the semantic text information of the cell is used to fully explain or describe the cell content, while the descriptive text corresponding to the table is used to concisely and generally summarize the content expressed by the table. On the basis of determining the semantic text information of each cell, the semantic text information of each cell in the table is spliced, and combined with auxiliary texts such as notes and summary texts about the table recorded in the document to be processed, the semantic text information of each cell is described and converted using natural language generation technology or text templates used for cross-interchange of table texts to generate descriptive texts corresponding to each table.
[0051] S104: Replace each table in the document to be processed with a description text corresponding to each table to obtain a target document, and perform information recall processing based on the target document.
[0052] Optionally, while parsing the document to be processed to obtain all tables in the document to be processed, the position of each table in the document to be processed can be obtained, and based on the position of each table in the document to be processed, each table in the document to be processed is replaced with a description text corresponding to each table, that is, cross-exchange of table texts is performed to obtain the target document.
[0053] Optionally, since the target document is a unification of documents to be processed that contain multiple information forms such as tables and texts, all tables in the documents to be processed are converted into corresponding descriptive texts, so that when information recall is performed based on the target document, the information recall is performed through a unified information form. The unified information form reduces the differences in data formats, and when the table data is converted into a descriptive text in natural language, the descriptive text often contains more contextual information related to the table, which helps to better understand the meaning of the data during information recall.
[0054] Based on this, according to the document information recall method provided by the embodiment of the present application, for the document to be processed that contains both text and table, the table is subjected to textual description processing, the description text corresponding to the table is generated, and then the table in the document to be processed is replaced with the description text corresponding to the table, that is, the table is interchanged with text and combined with the non-table text information in the document to be processed to generate the target document as an intermediate document for unified information recall. Since the target document only replaces the original table with the description text corresponding to the table, that is, the various information forms contained in the document to be processed are unified, and in this process, the overall structure of the document to be processed will not be mechanically split and the loss of effective information will not be caused, thereby improving the quality and accuracy of information recall through the cross-exchange of table text. In addition, since the data contained in the target document has been unified into a text information form, in the information recall process, the process of processing pure text data is simpler than the process of processing mixed text data of text and table, so that not only the processing flow of information recall can be simplified, but also the data in the target document can be better utilized for efficient retrieval, thereby improving the efficiency of information recall.
[0055] Figure 2 A schematic diagram of a document parsing method provided in an embodiment of the present application is shown. As a possible implementation method, refer to Figure 2 As shown, the various forms of information contained in the document to be processed are first classified to determine whether the document to be processed contains pictures. If the document to be processed does not contain pictures, the document to be processed can be directly parsed using text processing methods. If the document to be processed contains pictures, a computer vision algorithm (CV algorithm) is used to process the information in the picture.
[0056] Exemplarily, if the document to be processed is in PDF format and does not contain images, the PDF parsing tool can be used directly to extract the text and tables in the document to be processed. Specifically, the document to be processed is read, the table in the document to be processed is located, and the table is converted into a structured data format. In addition, the position information of the table needs to be processed, such as position alignment processing, that is, to keep the extracted table consistent with the position in the original document to be processed, so as to ensure that the output structured document can reflect the layout of the original document to be processed.
[0057] Exemplarily, if the document to be processed contains a picture, a computer vision algorithm is used to process the information in the picture. Specifically, the computer vision algorithm mainly includes four parts: optical character recognition (OCR), table detection, layout segmentation and content understanding. Optical character recognition is used to recognize text characters in the picture and convert them into a machine-readable text format. Table detection is used to detect whether there is a table in the picture and determine the position boundary of the table. Layout segmentation is used to divide the picture into different areas, such as titles, text, tables, etc. Content understanding is used to understand the content in the table, identify the header, rows and columns, and extract the table data. In addition, after the CV algorithm is used to perform the above processing on the document to be processed, position alignment processing is also required to ensure that the extracted table is consistent with the position in the original document to be processed, and finally output a structured document.
[0058] Based on this, complex and diverse documents to be processed are effectively converted into structured data forms to facilitate further data processing and analysis.
[0059] As a possible implementation, the above step S102 determines the semantic text information of each cell in each table according to each row identifier, each column identifier and each cell content in each table, including:
[0060] The semantic text information of the current cell is generated according to the row identifier of the row where the current cell is located, the column identifier of the column where the current cell is located, the cell content of the current cell and a preset text template, wherein the current cell is any cell in the table.
[0061] Optionally, continue to refer to Table 1 above, the row identifiers in Table 1 include categories, buildings and structures, electronic equipment, transportation vehicles and other equipment, and the column identifiers include categories, depreciation methods, depreciation periods (years), residual value rates and annual depreciation rates. In addition, in the process of parsing the documents to be processed, the following header background information related to Table 1 can also be obtained: "Fixed assets refer to tangible assets held for the production of goods, provision of services, leasing or management, with a useful life of more than one fiscal year. Fixed assets are recognized when they meet the conditions that economic benefits are likely to flow in and costs can be reliably measured. If there is a depreciation residual value calculation form, the depreciation methods reflecting different categories of equipment are shown below."
[0062] Optionally, determining the semantic text information of each cell in the table is to describe the table in text form, and specifically, the table information can be converted into text information containing its structural information through a preset text template. The preset text template is a predefined format or template for combining row identifiers, column identifiers and cell content to form an explanation or description of the cell content, that is, to generate text information with semantic meaning.
[0063] Exemplarily, continuing with the above-mentioned Table 1 with five rows and five columns as an example, it is assumed that the cells in the first row of the above Table 1 are marked as H, H1, H2, H3, and H4 in sequence, which are used to express the cell contents of each cell in the first row in sequence, that is, the "category" in Table 1 is recorded as H, the "depreciation method" is recorded as H1, the "depreciation period (years)" is recorded as H2, the "residual value rate" is recorded as H3, and the "annual depreciation rate" is recorded as H4. And the cells in the first column of the above Table 1 are marked as R, R1, R2, R3, and R4 in turn, which are used to express the cell content of each cell in the first column in turn, that is, "category" in Table 1 is marked as R, "houses and buildings" is marked as R1, "electronic equipment" is marked as R2, "transportation tools" is marked as R3, "other equipment" is marked as R4, and the remaining cells are marked as D_m_n, where m represents the row number of the cell, and n represents the column number of the cell. Then the preset text template can be: when the value of D0 is R1, when the value of condition H1 is D_1_1 and the value of condition H2 is D_1_2, the value of condition H3 is D_1_3, and the value of condition H4 is D_1_4. Among them, combined with the above Table 1, D0 specifically represents the cell "category", that is, cell H and cell R when marked according to rows and columns respectively.
[0064] Optionally, the row identifier of the row where the current cell is located is filled into the position corresponding to the row identifier in the preset text template, the column identifier of the column where the current cell is located is filled into the position corresponding to the column identifier in the preset text template, and the cell content of the current cell is filled into the position corresponding to the cell content in the preset text template to obtain the semantic text information of the current cell.
[0065] Optionally, filling refers to placing specific values (row identifier, column identifier, cell content) into corresponding placeholder positions in a preset text template, thereby generating a complete sentence describing a specific cell. It can be understood that the process of filling the row identifier of the row where the cell is located, the column identifier of the column where the cell is located, and the cell content into corresponding positions in the preset text template is similar to a fill-in-the-blank question, that is, the preset text template gives the structure of the descriptive sentence, and the specific cell information is used to complete this structure.
[0066] For example, taking the above preset text template as: when the value of D0 is R1, when the value of condition H1 is D_1_1, the value of condition H2 is D_1_2, the value of condition H3 is D_1_3, and the value of condition H4 is D_1_4, a complete statement for describing a cell can be obtained by using the preset text template and the header background information, that is, after applying the above preset text module, the information to be presented in the table can be translated into: "When calculating the depreciation of fixed assets, when the value of the category is buildings and buildings, when the value of the depreciation method is the straight-line method, and the depreciation period is 5-50 years, the residual value rate is 5.00%, and the annual depreciation rate is 1.90%-19.00%.
[0067] Exemplarily, in combination with the descriptive text structure given by the above-mentioned preset text model, the semantic text information of the following cells can also be obtained: when the category value is electronic equipment, when the depreciation scheme is satisfied by the straight-line method and the depreciation period is 3-5 years, the residual value rate is 5.00%, and the annual depreciation rate is 19.00%-31.67%. When the category value is means of transport, when the depreciation scheme is satisfied by the straight-line method and the depreciation period is 5 years, the residual value rate is 5.00%, and the annual depreciation rate is 19.00%. When the category value is other equipment, when the depreciation scheme is satisfied by the straight-line method and the depreciation period is 3-12 years, the residual value rate is 5.00%, and the annual depreciation rate is: 7.92%-31.67%".
[0068] Optionally, the preset text template can also be: "In the [row ID] row, the value of the [column ID] column is [cell content]". On this basis, according to the row ID of the row where the cell is located, the column ID of the column where the cell is located, and the cell content, the above preset text template is applied, and combined with the header background information, the semantic text information of each cell can also be obtained. Continuing with the above Table 1 as an example, for the cell "5-50", the semantic text information of the cell generated according to the above preset text template can be: "In the category value of Houses and Buildings, the value of the depreciation period (years) is 5-50". In this way, the semantic text information of all cells in the table can also be obtained by applying the above preset text template.
[0069] Based on this, the semantic text information of each cell in the table is generated by using a preset text template, a natural language description method, which avoids the standardization, uniformity and fixity of table data and enriches the contextual information of the cell content. The preset text template can be extended to more complex application scenarios including conditional statements, comparisons and contrasts, and can tolerate incomplete or inaccurate data to a certain extent, and still accurately obtain the semantic text information corresponding to each cell.
[0070] As a possible implementation method, the above-mentioned step S102 determines the semantic text information of each cell in each table based on the row identifier, column identifier and cell content in each table, and also includes: inputting the row identifier, column identifier and cell content in each table into a pre-trained language model, and generating the semantic text information of each cell in each table based on the language model.
[0071] Optionally, the language model is, for example, a GPT-3, GPT-4 or other model, which can provide a more complex natural language description by inputting the data structure and content of the table as prompts into the language model, wherein the data structure of the table is determined according to the row identifiers and column identifiers in the table, and the content refers to the content of each cell. The language model can generate and output a corresponding text description, which is used to represent the semantic text information of each cell in the table.
[0072] Exemplarily, in the process of generating semantic text information for each cell in each table based on a language model, it is mainly necessary to construct a suitable prompt through the row identifiers, column identifiers and cell contents in the table. The prompt is used to tell the language model the expected text output format, so that the language model can understand and interpret the data in each cell in the table according to the prompt and generate a meaningful text description of the data. Specifically, continuing to combine the above Table 1, according to the row and column labels and the content of each cell in the table, the following prompt can be constructed: "Please analyze and describe the meaning of each cell in the following table: The table has five rows, namely category, buildings and structures, electronic equipment, transportation vehicles and other equipment; the table has five columns, namely category, depreciation method, depreciation period (years), residual value rate and annual depreciation rate; in the table, the intersection of each row and column is a cell, and the cell contains specific data values: the cell value in the second row and second column is "straight-line method", the cell value in the second row and third column is "5-50", the cell value in the second row and fourth column is "5.00%", the cell value in the second row and fifth column is "1.90%-19.00%", and the cell value in the third row and second column is "Straight-line method", the cell value in the 3rd row and 3rd column is "3-5", the cell value in the 3rd row and 4th column is "5.00%", the cell value in the 3rd row and 5th column is "19.00%-31.67%", the cell value in the 4th row and 2nd column is "Straight-line method", the cell value in the 4th row and 3rd column is "5", the cell value in the 4th row and 4th column is "5.00%", the cell value in the 4th row and 5th column is "19.00%", the cell value in the 5th row and 2nd column is "Straight-line method", the cell value in the 5th row and 3rd column is "3-12", the cell value in the 5th row and 4th column is "5.00%", and the cell value in the 5th row and 5th column is "7.92%-31.67%"; please provide a concise semantic description for the data in each cell.
[0073] For example, the above-constructed prompt not only describes the data structure of the table, but also clarifies the task that the language model is expected to perform, that is, to provide a semantic description for the content of each cell. After the prompt is input into the language model, it can help the language model better understand the semantics and contextual information expressed by each cell in the table, and generate and output the semantic text information corresponding to each cell.
[0074] Based on this, we use the pre-trained language model to parse the information in the table and extract the semantic text information of each cell. We use the powerful natural language understanding ability of the language model to convert the data in the table into a more understandable semantic description, thereby improving the efficiency of table data processing and reducing human intervention.
[0075] Figure 3A flowchart of a description text generation method provided in an embodiment of the present application is shown. As a possible implementation method, refer to Figure 3 As shown, the above step S103 generates description texts corresponding to each table according to the semantic text information of each cell in each table, and specifically includes the following steps:
[0076] S301. According to the order of the cells in the table, the semantic text information of the cells in the table is spliced into table content text.
[0077] Optionally, for each cell in the table, after generating semantic text information describing each cell according to the above preset text template, the semantic text information of each cell is concatenated according to the order of each cell in the table to form a complete text describing the entire table content.
[0078] For example, continuing to take the above Table 1 as an example, the text of the spliced table content is: "When calculating the depreciation of fixed assets, when the value of the category is buildings and structures, when the value of the depreciation method is the straight-line method, and the depreciation period is 5-50 years, the residual value rate is 5.00%, and the annual depreciation rate is 1.90%-19.00%. When the category value is electronic equipment, when the value of the depreciation scheme is the straight-line method, and the depreciation period is 3-5 years, the residual value rate is 5. 00%, and the annual depreciation rate is 19.00%-31.67%. When the category value is transportation equipment, if the depreciation plan is the straight-line method and the depreciation period is 5 years, the residual value rate is 5.00%, and the annual depreciation rate is 19.00%. When the category value is other equipment, if the depreciation plan is the straight-line method and the depreciation period is 3-12 years, the residual value rate is 5.00%, and the annual depreciation rate is: 7.92%-31.67%".
[0079] S302: Acquire auxiliary text of a table from the document to be processed, where the auxiliary text includes at least one of the following: a table header and remark information of the table.
[0080] Optionally, auxiliary text related to the table is extracted from the document to be processed containing the table. The auxiliary text is usually located above or below the table to provide additional information about the background, purpose or explanation of the table. The auxiliary text includes but is not limited to the table header (title), note information (footnote), measurement units used to indicate the values in the table, definition information used to explain the meaning of specific terms or abbreviations in the table, and information marking the source of data.
[0081] Exemplarily, while performing structured conversion on the document to be processed and identifying the text part and table part in the document to be processed, the position of the table in the document to be processed has been determined. Based on the determination of the position of the table, the text around the table is identified. The text may be directly attached to the table, such as a title or text description above the table, or note information below the table, etc., and the identified text is then extracted as auxiliary text.
[0082] S303: Generate description text corresponding to the table according to the table content text, the auxiliary text and the pre-trained summary generation model.
[0083] Optionally, the summary generation model is a machine learning model that can generate natural language text summaries after data training, and can receive input text and output a concise and coherent summary. The summary generation model is used to summarize the table content text and auxiliary text, extract key information from the large amount of table content text and auxiliary text, that is, identify the most important data points, and present them to the user in a concise manner, so that the user can understand the content expressed in the table without viewing the entire table. It should be noted that for the summary generation model, a small model with low computational cost and fewer parameters can be selected according to actual needs, or a large model with a large number of parameters and high training complexity can be selected.
[0084] Optionally, in a preset order, the table content text and the auxiliary text are concatenated into table text, and the table text is input into a summary generation model to obtain a description text corresponding to the table.
[0085] For example, concatenation refers to connecting different text fragments together to form a new text. The table content text and the auxiliary text are concatenated into a table text, which is a coherent text containing all information related to the table, which can be a complete paragraph or multiple paragraphs, so that the summary generation model can better understand the input data and output a concise and condensed description text, which is also the natural language summary corresponding to the table.
[0086] Exemplarily, regarding the splicing order of the table content text and the auxiliary text, the auxiliary text and the table content text can be simply merged together in a preset order, and the preset order can be the auxiliary text first and the table content text second, or the table content text first and the auxiliary text second. In addition, the splicing order can be determined according to the logical relationship and display requirements between the table content text and the auxiliary text. For example, in the case where the auxiliary text includes the title or header information of the table, annotation information, and a summary description or conclusion, the table content text and the auxiliary text can be spliced into the table text in the splicing order of the title / header information, annotation information, table content text, summary description or conclusion.
[0087] Exemplarily, the summary generation model can use natural language generation technology (NLG) to understand the table text and generate a natural language summary. Specifically, the table text is input into the summary generation model, the data in the table text is read for data analysis, the data structure of the table text is understood, and key information is selected from the table text. Sentence planning is performed based on the key information, and how to use natural language to express the key information is designed. The planned sentences are converted into actual natural language text, and the description text corresponding to the table is generated and output.
[0088] For example, the header background information is included in the auxiliary text, and the header background information is continued as: "Fixed assets refer to tangible assets held for the production of goods, provision of services, leasing or management, with a useful life of more than one fiscal year. Fixed assets are recognized when they meet the conditions that economic benefits are likely to flow in and the costs can be reliably measured. If there is a depreciation residual value calculation form, the depreciation methods for different categories of equipment are shown in Table 1", and the table content text is: "When calculating the depreciation of fixed assets, when the category value is buildings and buildings, when the depreciation method value is the straight-line method and the depreciation period is 5-50 years, the residual value rate is 5.00% and the annual depreciation rate is 1.90%-19.00%. When the category value is electronic equipment, when it is full When the depreciation scheme is the straight-line method and the depreciation period is 3-5 years, the residual value rate is 5.00%, and the annual depreciation rate is 19.00%-31.67%. When the category value is transportation equipment, when the depreciation scheme is the straight-line method and the depreciation period is 5 years, the residual value rate is 5.00%, and the annual depreciation rate is 19.00%. When the category value is other equipment, when the depreciation scheme is the straight-line method and the depreciation period is 3-12 years, the residual value rate is 5.00%, and the annual depreciation rate is: 7.92%-31.67%". For example, the table content text and the auxiliary text are spliced into table text, and the table text is input into the summary generation model, and the following description text can be obtained:
[0089] In the depreciation of fixed assets, different types of assets are depreciated using the straight-line method, and the residual value rate is uniformly 5.00%. The specific depreciation is as follows:
[0090] - Houses and buildings: The depreciation period is 5-50 years, and the annual depreciation rate is 1.90%-19.00%.
[0091] - Electronic equipment: The depreciation period is 3-5 years, and the annual depreciation rate is 19.00%-31.67%.
[0092] - Transportation equipment: The depreciation period is fixed at 5 years and the annual depreciation rate is 19.00%.
[0093] - Other equipment: The depreciation period is 3-12 years, and the annual depreciation rate is 7.92%-31.67%.
[0094] The depreciation period and annual depreciation rate of various types of assets vary according to their category and useful life, but the residual value rate remains the same.
[0095] Based on this, the table content and its auxiliary text are converted into a structured table text form, and the summary generation model is used to generate the corresponding description text of the table. The description text is a summary description of the table summary information. The description text makes it easier to recall and extract information, thereby enhancing the readability and practicality of the description text.
[0096] As a possible implementation method, the above step S104 replaces each table in the document to be processed with the description text corresponding to each table to obtain the target document, including: determining the relative position information of each table according to the pixel position of each table and the table header of each table in the document to be processed; according to the relative position information of each table, inserting the description text corresponding to each table into the document to be processed to obtain the target document.
[0097] Optionally, the difference between the target document and the document to be processed is that the original document to be processed includes text and tables, while the target document converts the tables in the document to be processed into corresponding description texts and replaces the tables in the document to be processed with the description texts, while no other processing is performed on the text in the original document to be processed.
[0098] Exemplarily, after identifying all tables in the document to be processed, the pixel positions of each table and the table header in the document to be processed are determined, such as the position coordinates of the upper left corner and the lower right corner of the table, to determine the relative position information of the table, which is used to characterize the positional relationship of the table relative to other parts of the document to be processed. Based on the relative position information, it is helpful to maintain the original data layout when inserting the description text corresponding to each table into the document to be processed.
[0099] Furthermore, according to the relative position information of each table, the description text of the corresponding table is inserted into the document to be processed, ensuring that the description text corresponding to the table corresponds to the original position of the table. After the description text corresponding to all tables is correctly inserted into the document to be processed, a target document without tables but containing the description text corresponding to the tables can be obtained.
[0100] Based on this, after a series of processing on the document to be processed, the target document, an intermediate file, is obtained. The target document retains the document structure and visual effects, while presenting the table content in text form. The target document is used for subsequent information recall and information extraction, which effectively improves the accuracy of information recall and information extraction.
[0101] As a possible implementation, the above step S104 performs information recall processing based on the target document, including: performing information retrieval on the target document using a preset recall strategy to generate a text segment set.
[0102] Optionally, the preset recall strategy refers to a predefined set of rules or algorithms for information retrieval. The preset recall strategy includes any of the following: model recall strategy, rule recall strategy and hybrid recall strategy. Among them, the model recall strategy is usually based on machine learning or natural language processing models, such as information recall processing through term frequency models (TF), vector space models (VSM) or more complex deep learning models, mainly by quantifying the importance of words to identify the most relevant information in the target document to the query. The rule recall strategy is a process of information retrieval based on a series of predefined rules, which can be regular expressions, keyword lists or other logical conditions. The hybrid recall strategy refers to combining multiple recall strategies, combining the generalization ability of the model and the accuracy of the rules, to achieve better retrieval results.
[0103] For example, the word frequency model TF is a simple text analysis method. Since high-frequency words may represent the main body of the target document, information recall can be performed by measuring the frequency of occurrence of a certain word in the target document. In this recall strategy, each query word is searched in the target document and scored according to the frequency of occurrence of each query word in the target document. The higher the score, the more relevant it is to the query. The vector model VSM is an information retrieval model that represents both the target document and the query condition as vectors, with each dimension in the vector corresponding to a word, and then performs information retrieval by calculating the similarity between the query vector and the document vector.
[0104] For example, the rule recall strategy can be to define specific keyword combinations, sentence structures, or document formats, and only when the information of the target document meets the above rules will it be considered as information related to the query retrieval. For example, to retrieve all sentences containing a specific date from the target document, a rule about the specific date can be written to perform information retrieval.
[0105] Exemplarily, the hybrid recall strategy may be to first use the model recall strategy to find relevant paragraphs from the target document, and then further filter out the sentences in the paragraphs through the rule recall strategy.
[0106] It should be noted that the text fragment set includes multiple text fragments. No matter which of the above recall strategies is adopted, the ultimate goal is to extract the text fragment most relevant to the query from the target document. The text fragment can be a sentence, a paragraph, or any continuous text block in the target document that can answer the query or provide the required information.
[0107] Based on this, when the query or search conditions are defined, the above-mentioned preset recall strategy is applied to perform information retrieval on the target document, and the content in the target document is filtered using models, rules, or a combination of the two, and text fragments that meet the conditions are extracted. The text fragments are output as query results so that the text fragments can be used for subsequent information extraction processing.
[0108] Figure 4 A schematic diagram of a process flow of an information extraction method provided in an embodiment of the present application is shown. As a possible implementation method, refer to Figure 4 As shown, after performing information retrieval on the target document using the preset recall strategy to generate a text segment set, the method further includes the following steps:
[0109] S401: Filter and obtain a target text segment from a plurality of text segments included in a text segment set.
[0110] Optionally, the target text segment is a text segment containing target content, and the target content is any content in the description text corresponding to each table.
[0111] Exemplarily, the text fragment set includes multiple recalled text fragments related to the topic or retrieval. In order to avoid large model hallucination and false generation problems caused by abstract summarization, the recalled multiple text fragments are screened. If the text fragment contains any content in the descriptive text corresponding to the table, the text fragment is used as a target text fragment.
[0112] Among them, large model hallucination refers to the errors that may occur in the summary generation model when generating descriptive text, even if these errors seem reasonable but are actually not in line with the facts. The false generation problem refers to the fact that the descriptive text generated by the summary generation model does not match the actual situation.
[0113] S402: Replace the target text segment in the text segment set with a table corresponding to the target text segment to obtain a processed text segment set.
[0114] Exemplarily, for a target text segment, its text description is converted into a corresponding table, and the table is used to replace the content corresponding to the target text segment in the text segment set to obtain a processed text segment set. In other words, for the selected target text segment, the text description is replaced again with the actual table data, so as to ensure that the subsequent information extraction is still based on the most original and real data, rather than the intermediate summary description.
[0115] It should be noted that since inaccurate information or misunderstandings may be introduced in the process of generating the descriptive text corresponding to the table, by directly using the original table rather than its summary descriptive text, the illusion of a large model and errors caused by the intermediate links can be avoided, ensuring the accuracy and authenticity of the information.
[0116] S403: Perform information extraction based on the processed text segment set to obtain target information.
[0117] Optionally, information extraction processing refers to extracting relevant structured information from text fragments, which can be achieved through entity recognition, relationship extraction, etc. Since the target text fragment containing the description text corresponding to the table has been replaced with the corresponding table in the processed text fragment set, that is, the information extraction processing is still for the original table, and the target information is still obtained from the original table, rather than the intermediate summary description.
[0118] Figure 5 A schematic diagram of a target information acquisition method provided in an embodiment of the present application is shown. As a possible processing method, refer to Figure 5 As shown, the above step S403 performs information extraction based on the processed text segment set to obtain target information, which specifically includes the following steps:
[0119] S501: parse the table corresponding to the target text segment, and extract the cell content corresponding to each cell in the table corresponding to the target text segment.
[0120] Exemplarily, optical character recognition (OCR) technology and table recognition algorithms are used to identify table boundaries and cell positions corresponding to the target text fragment, and cell contents are extracted from each cell. Since the extracted cell contents may contain extra spaces, line breaks or other characters, the extracted cell contents may be cleaned to ensure that the extracted cell contents are clean and in a consistent format.
[0121] S502: Construct a key-value pair corresponding to each cell based on the cell content corresponding to each cell, the row header and the column header of the table.
[0122] Optionally, the data in the table is converted into a key-value pair (KV) description, that is, for each cell in the table, the cell content is used as the value, and the row header and column header of the row where the cell is located in the table are used as the key to construct the key-value pair corresponding to each cell.
[0123] For example, in combination with the above Table 1, for a cell whose cell content is "5-50", the key of the cell is "electronic equipment_depreciation period (years)", and the value is the cell content "5-50" of the cell. For a cell whose cell content is "1.90%-19.00%", the key of the cell is "housing and buildings_annual depreciation rate", and the value is the cell content "1.90%-19.00%" of the cell. In this way, key-value pairs corresponding to each cell can be constructed.
[0124] S503: Merge the key-value pairs corresponding to each cell and the processed text segment set to obtain a target text segment set.
[0125] Optionally, the constructed key-value pairs of all cells are merged with the processed text fragment set to create a more complete data set, that is, the key-value pairs are combined with the processed text fragment set obtained by pre-retrieval and recall to obtain a target text fragment set, which contains the tabular data and related contextual information, so as to further extract information such as entities and values based on the target text fragment set.
[0126] S504: Identify the target object from the target text segment set to obtain target information.
[0127] Exemplarily, the target object includes at least: entities and values, and the purpose of identifying the target object is to extract the target information required in the end, that is, the process of obtaining specific entity names, values, etc. in a text containing specific entity information. On this basis, information extraction is performed based on the target text segment set, that is, specific entity names, values, etc. are extracted from the target text segment set, so as to complete information recall and extraction.
[0128] Based on this, when processing text data, especially when it involves tabular data, use original data rather than processed or summarized data to ensure the accuracy and credibility of the target information finally extracted.
[0129] Figure 6 A flowchart of a text table exchange recall provided in an embodiment of the present application is shown. Figure 6As shown, the document to be processed is subjected to structural parsing to obtain a structured document, and it is determined whether the structured document contains a table. If a table exists, the table structure is described in text form using a pre-designed table description template, and the table name is extracted and saved. Although the table name usually does not contain the final information of the information extraction, the table name is an overall description of the table, which can be used to significantly improve the recall rate of some similar indicators scattered in different tables when recalling information. Among them, the textual semantic description containing the table structure information generated by the table description template must be summarized, otherwise it will lead to information redundancy, and the textual semantic description retains too much text in the table description template, and does not utilize the recall of effective information.
[0130] Furthermore, the summary generation model is used to obtain the table summary text and generate an intermediate document. Compared with the structured document obtained by structurally parsing the processed document, the table in the intermediate document has been replaced with the text description corresponding to the table. When the intermediate document is used for information recall, the text description corresponding to the table in the intermediate document is replaced back to the table, and information extraction is performed. In this process, in order to ensure the accuracy of information extraction and avoid the occurrence of false information extraction, the text description corresponding to the table in the intermediate document used for information recall needs to be replaced back to the table again to ensure that the information recall and extraction are still extracted from the original table data.
[0131] Based on this, this application aims to solve the problem of cross-information recall effects caused by lack of unified information expression when recalling tables and texts in a mixed manner. The table information in the document to be processed is first summarized in text, and then unified recall processing is performed in combination with the non-table text information in the document to be processed, so as to avoid errors in the information recall process. Moreover, in the process of information recall, it can be flexibly applied to a variety of recall strategies such as large models, small models, and rules, with a wide range of usage scenarios, and the text fragment containing any content in the descriptive text corresponding to the table is replaced again with the accurate information of the table itself, ensuring that the final information extraction process is still obtained from the original table. In addition, in the process of information recall and extraction, the overall structure of the full text of the document to be processed will not be mechanically split, avoiding the loss of effective information, thereby improving the accuracy of information recall and information extraction.
[0132] Based on the same inventive concept, a document information recall device corresponding to the document information recall method is also provided in the embodiment of the present application. Since the principle of solving the problem by the document information recall device in the embodiment of the present application is similar to the above-mentioned document information recall method in the embodiment of the present application, the implementation of the document information recall device can refer to the implementation of the document information recall method, and the repeated parts will not be repeated.
[0133] Reference Figure 7FIG. 7 is a schematic diagram of the structure of a document information recall device provided in an embodiment of the present application. The document information recall device 700 includes: a parsing module 701, a determining module 702, a generating module 703 and a processing module 704, wherein:
[0134] The parsing module 701 is used to parse the document to be processed containing text and tables to obtain the tables in the document to be processed;
[0135] A determination module 702, for determining semantic text information of each cell in each table according to each row identifier, each column identifier and each cell content in each table;
[0136] A generating module 703, for generating a description text corresponding to each table according to the semantic text information of each cell in each table;
[0137] The processing module 704 is used to replace each table in the document to be processed with the description text corresponding to each table, obtain the target document, and perform information recall processing based on the target document.
[0138] Based on this, according to the document information recall device of the embodiment of the present application, for the document to be processed that contains both text and table, the table is processed by textual description, the description text corresponding to the table is generated, and then the table in the document to be processed is replaced by the description text corresponding to the table, that is, the table is exchanged for text and combined with the non-table text information in the document to be processed to generate the target document as an intermediate document for unified information recall. Since the target document only replaces the original table with the description text corresponding to the table, that is, the various information forms contained in the document to be processed are unified, and in this process, the overall structure of the document to be processed will not be mechanically split and the loss of effective information will not be caused, thereby improving the quality and accuracy of information recall through the cross-exchange of table text. In addition, since the data contained in the target document has been unified into a text information form, in the information recall process, the process of processing pure text data is simpler than the process of processing mixed text data of text and table, which can not only simplify the processing flow of information recall, but also better utilize the data in the target document for efficient retrieval, thereby improving the efficiency of information recall.
[0139] In a possible implementation manner, the determination module 702 is specifically configured to:
[0140] The semantic text information of the current cell is generated according to the row identifier of the row where the current cell is located, the column identifier of the column where the current cell is located, the cell content of the current cell and a preset text template, wherein the current cell is any cell in the table.
[0141] In a possible implementation manner, the determination module 702 is specifically configured to:
[0142] Fill the row identifier of the row where the current cell is located into the position corresponding to the row identifier in the preset text template, fill the column identifier of the column where the current cell is located into the position corresponding to the column identifier in the preset text template, and fill the cell content of the current cell into the position corresponding to the cell content in the preset text template to obtain the semantic text information of the current cell.
[0143] In a possible implementation manner, the generating module 703 is specifically configured to:
[0144] According to the order of the cells in the table, the semantic text information of each cell in the table is spliced into the table content text;
[0145] Acquire auxiliary text of a table from the document to be processed, where the auxiliary text includes at least one of the following: a table header and remark information of the table;
[0146] Generate description text corresponding to the table based on the table content text, auxiliary text and the pre-trained summary generation model.
[0147] In a possible implementation manner, the generating module 703 is specifically configured to:
[0148] According to the preset order, the table content text and the auxiliary text are spliced into the table text;
[0149] Input the table text into the summary generation model to obtain the description text corresponding to the table.
[0150] In a possible implementation manner, the processing module 704 is specifically configured to:
[0151] Determine the relative position information of each table according to the pixel position of each table and the table header of each table in the document to be processed;
[0152] According to the relative position information of each table, the description text corresponding to each table is inserted into the document to be processed to obtain the target document.
[0153] In a possible implementation manner, the processing module 704 is specifically configured to:
[0154] The preset recall strategy is used to perform information retrieval on the target document to generate a set of text fragments. The preset recall strategy includes any one of the following: model recall strategy, rule recall strategy and hybrid recall strategy.
[0155] In a possible implementation manner, the processing module 704 is further configured to:
[0156] A target text segment is obtained by screening multiple text segments included in the text segment set, where the target text segment is a text segment containing target content, and the target content is any content in the description text corresponding to each table;
[0157] Replace the target text segment in the text segment set with the table corresponding to the target text segment to obtain a processed text segment set;
[0158] Information extraction is performed based on the processed text fragment set to obtain the target information.
[0159] In a possible implementation manner, the processing module 704 is further configured to:
[0160] Parse the table corresponding to the target text segment and extract the cell content corresponding to each cell in the table corresponding to the target text segment;
[0161] Construct key-value pairs corresponding to each cell based on the cell content corresponding to each cell, the row header and the column header of the table;
[0162] Merge the key-value pairs corresponding to each cell and the processed text fragment set to obtain a target text fragment set;
[0163] Identify a target object from a set of target text segments to obtain target information, where the target object includes at least an entity and a value.
[0164] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0165] The present application embodiment also provides an electronic device 800, such as Figure 8 As shown, it is a schematic diagram of the structure of an electronic device 800 provided in an embodiment of the present application, including: a processor 801, a memory 802, and optionally, a bus 803. The memory 802 stores machine-readable instructions executable by the processor 801. When the electronic device 800 is running, the processor 801 communicates with the memory 802 through the bus 803. When the machine-readable instructions are executed by the processor 801, the steps of the document information recall method described in any one of the above items are performed.
[0166] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the document information recall method as described in any one of the above items are executed.
[0167] An embodiment of the present application also provides a computer program product, which includes a computer program code. When the computer program code is executed by a computing device, the computing device executes the steps of the document information recall method as described in any one of the first aspects above.
[0168] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0169] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or part of the technical solution that contributes to the prior art or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk and other media that can store program code.
[0170] The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. A document information recall method, characterized in that: include: Parsing a document to be processed containing text and tables to obtain tables in the document to be processed; Determine the semantic text information of each cell in each table according to each row identifier, each column identifier and each cell content in each table; Generate description text corresponding to each table according to the semantic text information of each cell in each table; Replacing each of the tables in the document to be processed with a description text corresponding to each of the tables to obtain a target document, and performing information recall processing based on the target document; The generating of description texts corresponding to each table according to the semantic text information of each cell in each table includes: According to the order of the cells in the table, the semantic text information of each cell in the table is spliced into the table content text; Acquire auxiliary text of the table from the document to be processed, wherein the auxiliary text includes at least one of the following: a table header and remark information of the table; Generate a description text corresponding to the table according to the table content text, the auxiliary text and a pre-trained summary generation model; The step of replacing each of the tables in the to-be-processed document with a description text corresponding to each of the tables to obtain a target document includes: Determine relative position information of each of the tables according to the pixel positions of each of the tables and the table headers of each of the tables in the document to be processed; According to the relative position information of each of the tables, the description text corresponding to each of the tables is inserted into the document to be processed to obtain the target document.
2. The document information recall method according to claim 1, characterized in that: Determining the semantic text information of each cell in each table according to each row identifier, each column identifier and each cell content in each table includes: The semantic text information of the current cell is generated according to the row identifier of the row where the current cell is located, the column identifier of the column where the current cell is located, the cell content of the current cell and a preset text template, wherein the current cell is any cell in the table.
3. The document information recall method according to claim 2, characterized in that: The generating the semantic text information of the current cell according to the row identifier of the row where the current cell is located, the column identifier of the column where the current cell is located, the cell content of the current cell and a preset text template includes: Fill the row identifier of the row where the current cell is located into the position corresponding to the row identifier in the preset text template, fill the column identifier of the column where the current cell is located into the position corresponding to the column identifier in the preset text template, and fill the cell content of the current cell into the position corresponding to the cell content in the preset text template to obtain the semantic text information of the current cell.
4. The document information recall method according to claim 1, characterized in that: The step of generating a description text corresponding to the table according to the table content text, the auxiliary text, and a pre-trained summary generation model includes: According to a preset order, the table content text and the auxiliary text are spliced into a table text; The table text is input into the summary generation model to obtain a description text corresponding to the table.
5. The document information recall method according to claim 1, characterized in that: The information recall process based on the target document includes: The target document is retrieved for information using a preset recall strategy to generate a text segment set, wherein the preset recall strategy includes any one of the following: a model recall strategy, a rule recall strategy, and a mixed recall strategy.
6. The document information recall method according to claim 5, characterized in that: After performing information retrieval on the target document using a preset recall strategy to generate a text segment set, the method further includes: Filtering a target text segment from a plurality of text segments included in the text segment set, wherein the target text segment is a text segment containing target content, and the target content is any content in the description text corresponding to each of the tables; Replacing the target text segment in the text segment set with the table corresponding to the target text segment to obtain a processed text segment set; Information extraction is performed based on the processed text segment set to obtain target information.
7. The document information recall method according to claim 6, characterized in that: The information extraction process is performed based on the processed text segment set to obtain target information, including: Parsing the table corresponding to the target text segment, and extracting the cell content corresponding to each cell in the table corresponding to the target text segment; Constructing a key-value pair corresponding to each of the cells based on the cell content corresponding to each of the cells, the row header and the column header of the table; Merging the key-value pairs corresponding to each of the cells and the processed text segment set to obtain a target text segment set; A target object is identified from the target text segment set to obtain the target information, wherein the target object at least includes an entity and a value.
8. A document information recall device, characterized in that: include: A parsing module, used for parsing a document to be processed containing text and tables to obtain each table in the document to be processed; A determination module, used to determine the semantic text information of each cell in each table according to each row identifier, each column identifier and each cell content in each table; A generation module, used to generate description text corresponding to each table according to the semantic text information of each cell in each table; A processing module, used for replacing each of the tables in the document to be processed with a description text corresponding to each of the tables, obtaining a target document, and performing information recall processing based on the target document; The generating module is specifically used to splice the semantic text information of each cell in the table into the table content text according to the order of each cell in the table; Acquire auxiliary text of the table from the document to be processed, wherein the auxiliary text includes at least one of the following: a table header and remark information of the table; Generate a description text corresponding to the table according to the table content text, the auxiliary text and a pre-trained summary generation model; The processing module is specifically used to determine the relative position information of each of the tables according to the pixel positions of each of the tables and the table headers of each of the tables in the document to be processed; According to the relative position information of each of the tables, the description text corresponding to each of the tables is inserted into the document to be processed to obtain the target document.
9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor executes the machine-readable instructions to perform the steps of the document information recall method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the document information recall method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The computer program product includes computer program code. When the computer program code is executed by a computing device, the computing device executes the steps of the document information recall method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Financial document intelligent verification method, device and storage medium
CN109117479A
Document recall method and device and electronic equipment
CN117609471A