Data fusion method and program product
By identifying and matching the extraction patterns of different types of tables, and performing hierarchical structure slices and recall operations on text data, the problem of insufficient accuracy and generalization of data extraction in the prior art is solved, and more efficient and accurate data fusion is achieved.
Patent Information
- Application Number
- CN202411953703.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-22
AI Technical Summary
The prior art has poor generalization and low accuracy in data extraction when processing data containing text and tables, resulting in low accuracy in large models based on answers to data extraction.
By identifying text data and table data, matching the corresponding extraction pattern according to the table type, obtaining the table extraction results; obtaining hierarchical structure information for text data, performing slicing and recall operations, matching the text extraction pattern, obtaining the text extraction results, and fusing the two.
It improves the accuracy and generalization of text and tabular data extraction, saves resource consumption, improves efficiency, ensures the accuracy of simple table extraction, and targets to improve the accuracy of complex table extraction.
Smart Images

Figure CN119862532A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of large model applications, and in particular, to a data fusion method and program product. Background Art
[0002] As the application of big model technology becomes more and more widespread, when generating answers to user queries, it is often necessary to use the relevant data in the knowledge base, documents, and extract the relevant data based on extraction technology to form the answers required by users.
[0003] In the prior art, data extraction can be done by: identifying and extracting entities based on defined rules; using model fine-tuning to infer extraction indicators, and then extracting relevant data based on the extraction indicators. However, for documents in some specific scenarios, such as document data containing text and tables, the above method has poor generalization and low data extraction accuracy, resulting in low accuracy in building answers based on data extraction for large models. Summary of the invention
[0004] The purpose of this application is to provide a data fusion method and program product, which are used to improve the generalization and accuracy of text extraction and fusion.
[0005] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0006] In a first aspect, an embodiment of the present application provides a data fusion method, including:
[0007] Identify the data to be extracted and obtain text data and table data;
[0008] Identify the table type corresponding to the table data;
[0009] According to different table types, matching corresponding table extraction modes for the table data to obtain table extraction results;
[0010] Obtaining hierarchical structure information of the text data;
[0011] Slicing the text data according to the hierarchical structure information to obtain segments to be recalled;
[0012] Performing a recall operation on the to-be-recalled fragments to obtain corresponding to-be-screened recall results;
[0013] Matching the corresponding text extraction pattern for the recall result to be screened to obtain a text extraction result;
[0014] The table extraction result is fused with the text extraction result to obtain fused data.
[0015] Optionally, the step of identifying the data to be extracted and obtaining text data and table data includes:
[0016] Parsing the data to be extracted into a hypertext markup language format to obtain table tags and non-table tags corresponding to the hypertext markup language format;
[0017] Extracting the table data in the hypertext markup language format according to the table tag;
[0018] According to the non-table tags, text data in the hypertext markup language format is extracted.
[0019] Optionally, the step of identifying the table type corresponding to the table data includes:
[0020] Input the table data into a table header monitoring model to obtain table header information corresponding to the table data;
[0021] If the table header information is a multi-column table or a row-column table, the table type of the table data is a simple table;
[0022] If the position of the header information in the table data is irregular, the table type of the table data to be extracted is a complex table.
[0023] Optionally, after the step of extracting the table data in the hypertext markup language format according to the table tag, the method further includes:
[0024] The table data of the complex table is converted into a lightweight markup language format.
[0025] Optionally, the step of matching the table data with a corresponding table extraction mode according to different table types to obtain a table extraction result includes:
[0026] If the table type is a simple table, extracting the table data according to the usage rules or matching model to obtain the table extraction result;
[0027] If the table type is a complex table, the table data is extracted according to the large model to obtain the table extraction result.
[0028] Optionally, the step of obtaining the hierarchical structure information of the text data includes:
[0029] Identifying hierarchical title information of the text data;
[0030] Each level title information and the corresponding text content are constructed into text tree structure data.
[0031] Optionally, the step of slicing the text data according to the hierarchical structure information to obtain the segments to be recalled includes:
[0032] The text tree structure data pair is segmented according to the hierarchical title information to obtain hierarchical segments, and the hierarchical segments are used as the segments to be recalled.
[0033] In a second aspect, an embodiment of the present application provides a data fusion device, including:
[0034] The recognition module is used to recognize the data to be extracted and obtain text data and table data;
[0035] A table header identification module, used to identify the table type corresponding to the table data;
[0036] A table extraction module, used for matching the table data with corresponding table extraction modes according to different table types to obtain table extraction results;
[0037] A hierarchical identification module, used to obtain hierarchical structure information of the text data;
[0038] A slicing module, used for slicing the text data according to the hierarchical structure information to obtain the segments to be recalled;
[0039] A recall module, used to perform a recall operation on the to-be-recalled fragments to obtain corresponding to-be-screened recall results;
[0040] A text extraction module, used for matching the corresponding text extraction pattern for the recall result to be screened to obtain a text extraction result;
[0041] The fusion module is used to fuse the table extraction result with the text extraction result to obtain fused data.
[0042] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0043] A memory for storing one or more programs;
[0044] processor;
[0045] When the one or more programs are executed by the processor, the method as described in any one of the first aspects above is implemented.
[0046] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method as described in any one of the above-mentioned first aspects.
[0047] In a fifth aspect, an embodiment of the present application provides a program product, which, when executed by a processor, implements a method as described in any one of the above-mentioned first aspects.
[0048] Compared with the prior art, the data fusion method and program product provided in the embodiment of the present application respectively extract information from text data and table data in combination with their information characteristics, divide the tables into different types, and select the most appropriate extraction scheme for each type of table, rather than using the same rules and models for extraction, which not only saves resource consumption and improves efficiency, but also ensures the accuracy of simple table extraction and improves the accuracy of complex table extraction in a targeted manner. When slicing text data, because the hierarchical structure information is added, the retrieval is more accurate, which can improve the accuracy of index extraction in text data.
[0049] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] 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.
[0051] Figure 1 A flow chart of a data fusion method provided by an embodiment of the present invention;
[0052] Figure 2 A flowchart of another data fusion method provided by an embodiment of the present invention;
[0053] Figure 3 A flowchart of another data fusion method provided by an embodiment of the present invention;
[0054] Figure 4 A schematic diagram of a complex table provided by an embodiment of the present invention;
[0055] Figure 5 A flowchart of another data fusion method provided by an embodiment of the present invention;
[0056] Figure 6 A flowchart of another data fusion method provided by an embodiment of the present invention;
[0057] Figure 7 A schematic diagram of a data fusion architecture provided by an embodiment of the present invention;
[0058] Figure 8 A schematic diagram of a data fusion device provided by an embodiment of the present invention;
[0059] Fig. 9 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution 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. Obviously, the described embodiments are 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 different configurations.
[0061] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0062] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0063] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0064] In the prior art, when extracting data, whether using rule extraction or model extraction, good generalization cannot be guaranteed for data containing text and tables. As a result, the fusion effect of the captured data is not accurate, further reducing the accuracy of large model data processing.
[0065] The core idea of this application is to distinguish between text data and table data to be extracted, and then for different types of table data, match the corresponding table extraction mode to extract information; first obtain the hierarchical structure information of the text data, and then slice the text data based on the hierarchical structure information to complete the information extraction for the slices. Then perform data fusion based on the extraction results of the two. Since information is extracted from text data and table data respectively in combination with their information characteristics, the tables are divided into different types, and the most appropriate extraction scheme is selected for each type of table, instead of using the same rules and models for extraction, which not only saves resource consumption and improves efficiency, but also ensures the accuracy of simple table extraction, and improves the accuracy of complex table extraction in a targeted manner. When slicing text data, because the hierarchical structure information is added, the retrieval is more accurate, which can improve the accuracy of indicator extraction in text data.
[0066] Optionally, a possible implementation of a data fusion method is provided below. Specifically, Figure 1 A flow chart of a data fusion method provided by an embodiment of the present invention is shown in FIG. Figure 1 , the method comprises:
[0067] Step 100: Identify the data to be extracted to obtain text data and table data.
[0068] Step 101: Identify the table type corresponding to the table data.
[0069] Step 102: According to different table types, the corresponding table extraction mode is matched for the table data to obtain the table extraction result.
[0070] Step 103: Obtain hierarchical structure information of the text data.
[0071] Step 104: Slice the text data according to the hierarchical structure information to obtain the segments to be recalled.
[0072] Step 105: Perform a recall operation on the to-be-recalled fragments to obtain corresponding to-be-screened recall results.
[0073] Step 106: Match the corresponding text extraction pattern for the recall result to be screened to obtain the text extraction result.
[0074] Step 107: Fuse the table extraction result with the text extraction result to obtain fused data.
[0075] The data fusion method provided by the embodiment of the present invention extracts information from text data and table data in combination with their information characteristics, divides tables into different types, and selects the most appropriate extraction scheme for each type of table, rather than using the same rule or model for extraction, thereby saving resource consumption and improving efficiency, while ensuring the accuracy of simple table extraction and specifically improving the accuracy of complex table extraction. When slicing text data, the addition of hierarchical structure information makes retrieval more accurate, which can improve the accuracy of index extraction in text data.
[0076] In a possible implementation, in order to accurately distinguish the above text data from the table data, the HyperText Markup Language (HTML) format can be used to complete the recognition. Specifically, Figure 1 On the basis of Figure 2 A flow chart of another data fusion method provided by an embodiment of the present invention is shown in FIG. Figure 2 , step 100, comprising:
[0077] Step 100 - 1 , parse the data to be extracted into HTML format, and obtain table tags and non-table tags corresponding to the HTML format.
[0078] Step 100-2: extract the table data in the Hypertext Markup Language format according to the table tag.
[0079] Step 100 - 3 : extract text data in the Hypertext Markup Language format according to non-table tags.
[0080] Specifically, through the HTML format The tags are extracted to obtain tabular data, and the non-tabular tag parts are extracted to obtain text data.
[0081] Furthermore, since there are many types of table structures in table data, in order to better extract data from table data, it is necessary to first identify the table type. Figure 1 On the basis of Figure 3 A flow chart of another data fusion method provided by an embodiment of the present invention is shown in FIG. Figure 3 , step 101, comprising:
[0082] Step 101 - 1 , input the table data into the table header monitoring model to obtain the table header information corresponding to the table data.
[0083] Step 101 - 2: If the table header information is a multi-column table or a row-column table, the table type of the table data is a simple table.
[0084] The simple table can be a multi-column table or a row-column table.
[0085] The multi-column table has no column header information and only row header information. The row header information only appears in the first n rows (usually n=1). For this type of table, you only need to match the extraction index with the field of the header information. You can directly get multiple extraction results by matching in the above way.
[0086] The row and column table is as follows: the row header information or column header information only appears in the first row or the first column. When they appear at the same time, the row and column header information corresponding to a single cell can be concatenated first and then matched with the indicator in the above manner.
[0087] Step 101 - 3 : If the position of the header information in the table data is irregular, the table type of the table data is a complex table.
[0088] Specifically, the position of the header information in the table data is irregular, which means that the position of the header information in the table is not specified, for example, in the table structure, one row corresponds to multiple columns; or the header information appears in non-first few columns or rows in the table structure. Figure 4 A schematic diagram of a complex table provided by an embodiment of the present invention, see Figure 4 , where the header information "Funding Period", "Product Expiration Date", etc. appears in the middle of the table data.
[0089] Optionally, since the large model (for example, the "qwen2-7B model" in the Qwen2 model series) has a stronger ability to extract complex tables, in order to facilitate the subsequent use of the large language model for complex tables for extraction, in a possible implementation, the table data belonging to the complex table can be first converted into a lightweight markup language format (such as markdown language). The large model has a stronger ability to understand the lightweight markup language format.
[0090] Optionally, the following is an exemplary description of possible implementations of the table extraction mode. Figure 1 On the basis of Figure 5 A flow chart of another data fusion method provided by an embodiment of the present invention is shown in FIG. Figure 5 , step 102, comprising:
[0091] Step 102-1: If the table type is a simple table, extract the table data according to the usage rules or matching model to obtain the table extraction result.
[0092] For rules, it can be an information extraction method based on predefined rules. Among them, rules can be predefined to define which cells, rows or columns contain the information to be extracted. The rules can include but are not limited to the following types: structural rules, content rules and pattern rules. Among them, structural rules: based on the layout of the table, such as "extract all the contents of the first column". Content rules: based on the content of the cell, such as "extract all rows containing 'total'". Pattern rules: based on a specific format or pattern, such as "extract all cells in date format".
[0093] The matching model is used to perform similarity matching on the fields in the table data to extract information. The matching model may include but is not limited to: string matching model, semantic matching model, hybrid matching model, machine learning model, deep learning model and customized matching model.
[0094] Among them, string matching models: models based on edit distance: such as Levenshtein distance, which is used to measure the degree of difference between two strings. Or, models based on fuzzy matching: a certain degree of error or inaccurate matching is allowed.
[0095] Semantic matching model: A model based on word vectors, such as Word2Vec and GloVe, which converts words into vectors and calculates the similarity between vectors. Alternatively, a model based on sentence vectors, such as BERT and Sentence-BERT, is used to capture the semantic information of sentences or phrases.
[0096] Hybrid matching model: combines string matching and semantic matching methods to obtain more accurate similarity assessment.
[0097] Machine Learning Models: Classification models: such as Support Vector Machine (SVM), Random Forest, etc., are used to determine whether two fields are similar. Or, Regression models: are used to predict the similarity score between two fields.
[0098] Deep learning models: Convolutional neural network (CNN): used to capture local features, suitable for text similarity matching. Or, recurrent neural network (RNN): such as LSTM, GRU, etc., used to process sequence data and capture long-distance dependencies. Or, Transformer model: such as BERT, RoBERTa, etc., capture complex semantic relationships through self-attention mechanism.
[0099] Customized matching model: A model customized according to the needs of a specific field, which may combine multiple technologies mentioned above.
[0100] Continue to see Figure 5, step 102-2, if the table type is a complex table, extract the table data according to the large model to obtain the table extraction result.
[0101] Optionally, for text data, there is a certain hierarchical relationship between the text chapters. Therefore, in order to improve the accuracy of text slicing, the hierarchical title information can be used to segment the text data. Figure 1 On the basis of Figure 6 A flow chart of another data fusion method provided by an embodiment of the present invention is shown in FIG. Figure 6 , step 103, comprising:
[0102] Step 103 - 1 : Identify the hierarchical title information of the text data.
[0103] Step 103-2: construct each level title information and corresponding text content into text tree structure data.
[0104] Accordingly, step 104 includes:
[0105] Step 104 - 1 , segment the text tree structure data pair according to the hierarchical title information to obtain hierarchical segments, and use the hierarchical segments as the segments to be recalled.
[0106] Optionally, after step 104 - 1 , the hierarchical segments may be optimized to obtain segments to be recalled. For example, the optimization includes but is not limited to length slicing, sliding windows, and / or single sentence slicing.
[0107] Optionally, in addition to the above-mentioned implementation of step 103 and step 104, there may be other implementations for segmentation, for example, for text data, segmentation is performed using length slicing and sliding windows to obtain segments to be recalled.
[0108] Furthermore, for the above step 105, a recall operation is performed on the to-be-recalled segment, so as to find the to-be-recalled result corresponding to the to-be-recalled segment in the article, file or report from which the data is to be extracted.
[0109] Specifically, the recall operation may include various forms, such as rule recall and vector recall.
[0110] Among them, rule recall, that is, recalling the to-be-recalled segments by certain keywords or certain patterns. In a possible implementation, the rule recall can be used in combination with the "level title information" involved in step 103-1 above, that is, the recall operation is completed by searching the "level title information" to obtain the recall results to be screened.
[0111] Vector recall, that is, after obtaining the above-mentioned to-be-recalled segments, construct the corresponding segment vector for the to-be-recalled segments, and construct the corresponding extracted target vector for the extracted target information. Then, based on the similarity between the two, determine the to-be-screened recall result of the recall operation.
[0112] For the above two methods, the information range of the recall is generally the data to be extracted as described above. However, in some possible implementations, it is also possible to use external knowledge bases, knowledge documents, etc. to perform recall operations to obtain recall results to be screened.
[0113] For the recall results to be screened obtained based on the above two methods, duplicate recall results to be screened, that is, recall texts, may be deduplicated based on a deduplication operation.
[0114] Furthermore, for the above step 106, the corresponding text extraction mode may be determined based on the task difficulty, machine resources, annotation resources, etc. For example, the text extraction mode may include: model extraction and rule extraction.
[0115] Among them, model extraction can choose unfine-tuned large model, fine-tuned large model, and fine-tuned extracted small model.
[0116] Specifically, the fine-tuned large model refers to a large pre-trained model, such as BERT, GPT, etc., which is used directly without any task-specific fine-tuning. Such a model usually has broad general knowledge but may not be optimized for a specific task or domain.
[0117] Fine-tuning a large model means fine-tuning a large pre-trained model to adapt it to a specific task or domain. The fine-tuning process usually involves further training the model on a dataset for a specific task and adjusting the model's weights so that the model can perform the task better. For example, the BERT model can be fine-tuned on a sentiment analysis task to make it better at judging the sentiment of a text.
[0118] Fine-tuning a small model refers to extracting a part from a large pre-trained model to form a smaller model and fine-tuning the smaller model. This practice is often used to reduce the complexity and computational requirements of the model while retaining most of the capabilities of the pre-trained model. For example, several layers can be extracted from the BERT model to form a smaller model, and then fine-tuned on a specific task.
[0119] And the "fine-tuning" described above is an effective transfer learning technique that allows the knowledge learned by the pre-trained model on a large-scale dataset to be quickly adapted to new tasks or fields.
[0120] Optionally, for step 107, the table extraction result is merged with the text extraction result, and the design idea is: first confirm whether the table extraction result is consistent with the text extraction result; then, in combination with the extraction target, the fusion result is screened in accordance with the business rules. Specifically, it involves several different situations.
[0121] Case 1: The table extraction results correspond one-to-one to the text extraction results.
[0122] If the value of a field in the table extraction result is the same as that of the field in the text extraction result, the fused data will retain the corresponding table extraction result and text extraction result.
[0123] If one of the two extraction results has a value, but the corresponding field has no value, the field with a value will be retained. Then, the business rules can be used for judgment and filtering, or the logic of other fields can be used to comprehensively determine whether to retain the "field with a value".
[0124] For a field, if the table extraction result and the text extraction result extract different values, and the field may have multiple values, you can use the feature or vector collage mechanism (i.e., concat strategy) to retain the extraction results of both. For example, the field is "income", but the income in the table corresponds to the monthly income of 12 months; while the text only has the total income of the year. At this time, you can use the "concat strategy" to collage the monthly income of 12 months into the total income of the whole year, and retain it together with the total annual income in the text.
[0125] For a field, it can only have one value. When the values of the table extraction result and the text extraction result are different, the business rules or other field logics are combined to make a comprehensive judgment and choice. For example, the value of the field "a certain fund" can only be "public offering" or "private offering". The value of "a certain fund" in the table extraction result is "public offering"; while the value in the text extraction result is "private offering". At this time, business rules or other field logic are required to confirm whether it is "public offering" or "private offering". Then ensure that the values of the table extraction result and the text extraction result are consistent.
[0126] Case 2: There is a one-to-many correspondence between the text extraction results and the table extraction results, or a many-to-many correspondence.
[0127] If the text extraction results and table extraction results are different, and there may be multiple fields, keep all of them, that is, use the above-mentioned "concat strategy".
[0128] If the text extraction results or table extraction results have selection preferences according to business requirements, you can configure the preference strategy to select the extraction results corresponding to the preference strategy in the table extraction results or text extraction results.
[0129] If there is no preference in the selection, the overlapping parts of the text extraction results and the table extraction results are retained, and the non-overlapping parts are retained based on business logic.
[0130] In order to implement each process step of the above example, a possible implementation architecture is provided below. Specifically, Figure 7 A schematic diagram of a data fusion architecture provided by an embodiment of the present invention is shown in FIG. Figure 7 The architecture includes: a parsing module 200, an identification module 201, a header monitoring model 202, a rule or matching model 203, a large model 204, a hierarchical title information identification module 205, a slicing module 206, a recall module 207, a text extraction module 208 and a fusion module 209.
[0131] The parsing module 200 is used to parse the data to be extracted into HTML format.
[0132] The identification module 201 is used to identify text data and table data based on table tags and non-table tags corresponding to the HTML format.
[0133] The header monitoring model 202 is used to obtain the header information corresponding to the table data.
[0134] As can be seen from the previous text, the header information may correspond to different table types.
[0135] For the simple table mentioned above, the rule or matching model 203 is used for extraction to obtain the table extraction result 1.
[0136] For the complex table mentioned above, extraction is performed through the large model 204 to obtain the table extraction result 2.
[0137] For text data, the hierarchical title information identification module 205 is used to identify the hierarchical title information of the text data.
[0138] As can be seen from the foregoing, the hierarchical title information identification module 205 is also used to construct each hierarchical title information and the corresponding text content into text tree structure data.
[0139] Then, the slicing module 206 segments the text tree structure data to obtain hierarchical segments, and uses the hierarchical segments as the to-be-recalled segments 1.
[0140] It should be noted that, in addition to segmenting the text tree structure data, the slicing module 206 can also segment the text data by length slicing and sliding windows to obtain the to-be-recalled segment 2.
[0141] The recall module 207 is used to perform a recall operation on the to-be-recalled segment 1 or the to-be-recalled segment 2 to obtain a recall result to be screened. The recall module 207 may include the functions of rule recall and vector recall.
[0142] The text extraction module 208 is used to match the corresponding text extraction mode for the recall result to be screened to obtain the text extraction result. The text extraction mode includes but is not limited to: model extraction and rule extraction.
[0143] Fusion module 209 is used to fuse the table extraction result with the text extraction result to obtain fused data. The table extraction result can be Figure 7 Any one or combination of the table extraction result 1 and the table extraction result 1 shown is based on the actual scenario and is not limited here.
[0144] Optionally, the present application also provides a data fusion device to perform the above-mentioned steps and corresponding technical effects. Specifically, Figure 8 A schematic diagram of a data fusion device provided by an embodiment of the present invention, see Figure 8 The data fusion device 30 includes: an identification module 301, a header identification module 302, a table extraction module 303, a level identification module 304, a slicing module 305, a recall module 306, a text extraction module 307 and a fusion module 308.
[0145] The recognition module 301 is used to recognize the data to be extracted and obtain text data and table data.
[0146] Optionally, the identification module 301 may have Figure 7 The function of the identification module 201 is shown in FIG.
[0147] The table header identification module 302 is used to identify the table type corresponding to the table data.
[0148] Optionally, the header identification module 302 may have Figure 7 The header monitors the functionality of the model 202 .
[0149] The table extraction module 303 is used to match the table data with corresponding table extraction modes according to different table types to obtain table extraction results.
[0150] Optionally, the table extraction module 303 may have Figure 7 The functions of the medium rules or matching model 203 and the large model 204.
[0151] The hierarchical identification module 304 is used to obtain hierarchical structure information of text data.
[0152] Optionally, the level identification module 304 may have Figure 7 Functions of the middle-level title information identification module 205 .
[0153] The slicing module 305 is used to slice the text data according to the hierarchical structure information to obtain the segments to be recalled.
[0154] Optionally, the slicing module 305 may have Figure 7 Function of the middle slicing module 206.
[0155] The recall module 306 is used to perform a recall operation on the recalled segments to obtain corresponding recall results to be screened.
[0156] Optionally, the recall module 306 may have Figure 7 The function of the recall module 207 is implemented.
[0157] The text extraction module 307 is used to match the corresponding text extraction pattern for the recall result to be screened to obtain the text extraction result.
[0158] Optionally, the text extraction module 307 may have Figure 7 Function of Chinese text extraction module 208.
[0159] The fusion module 308 is used to fuse the table extraction result with the text extraction result to obtain fused data.
[0160] Optionally, the fusion module 308 may have Figure 7 The function of the fusion module 209.
[0161] It should be noted that the fusion module 308 may also include Figure 7 And other functional modules in the instance to achieve corresponding functions.
[0162] The embodiment of the invention further provides an electronic device, which can execute all the steps of the above examples of the embodiment of the invention to achieve the corresponding technical effects. Specifically, Fig. 9 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, see Fig. 9 , the electronic device 50, comprises: a memory 501, a processor 500;
[0163] Memory 501, used to store one or more programs;
[0164] Processor 500;
[0165] When one or more programs are executed by the processor, when the electronic device 50 is used to execute the steps shown in the above-mentioned method examples, it can achieve each step and corresponding technical effects.
[0166] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0167] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0168] If the function is implemented in the form of a software function module 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 application can be essentially or partly embodied in the form of a program product that contributes to the prior art, and the program product is stored in a computer-readable storage medium, including a number of 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 various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.
[0169] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0170] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, and that the present application can be implemented in other specific forms without departing from the spirit or essential features of the present application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present application. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. A data fusion method, characterized in that: include: Identify the data to be extracted and obtain text data and table data; Identify the table type corresponding to the table data; According to different table types, matching corresponding table extraction modes for the table data to obtain table extraction results; Obtaining hierarchical structure information of the text data; Slicing the text data according to the hierarchical structure information to obtain segments to be recalled; Performing a recall operation on the to-be-recalled fragments to obtain corresponding to-be-screened recall results; Matching the corresponding text extraction pattern for the recall result to be screened to obtain a text extraction result; The table extraction result is fused with the text extraction result to obtain fused data.
2. The method according to claim 1, characterized in that The step of identifying the data to be extracted and obtaining text data and table data includes: Parsing the data to be extracted into a hypertext markup language format to obtain table tags and non-table tags corresponding to the hypertext markup language format; Extracting the table data in the hypertext markup language format according to the table tag; According to the non-table tags, text data in the hypertext markup language format is extracted.
3. The method according to claim 1, characterized in that The step of identifying the table type corresponding to the table data includes: Input the table data into a table header monitoring model to obtain table header information corresponding to the table data; If the table header information is a multi-column table or a row-column table, the table type of the table data is a simple table; If the position of the header information in the table data is irregular, the table type of the table data to be extracted is a complex table.
4. The method according to claim 1, characterized in that: The step of matching the table data with corresponding table extraction modes according to different table types to obtain table extraction results includes: If the table type is a simple table, extracting the table data according to the usage rules or matching model to obtain the table extraction result; If the table type is a complex table, the table data is extracted according to the large model to obtain the table extraction result.
5. The method according to claim 1, characterized in that The step of obtaining the hierarchical structure information of the text data comprises: Identifying hierarchical title information of the text data; Each level title information and the corresponding text content are constructed into text tree structure data.
6. The method according to claim 5, characterized in that The step of slicing the text data according to the hierarchical structure information to obtain the segments to be recalled includes: The text tree structure data pair is segmented according to the hierarchical title information to obtain hierarchical segments, and the hierarchical segments are used as the segments to be recalled.
7. A data fusion device, characterized in that: include: The recognition module is used to recognize the data to be extracted and obtain text data and table data; A table header identification module, used to identify the table type corresponding to the table data; A table extraction module, used for matching the table data with corresponding table extraction modes according to different table types to obtain table extraction results; A hierarchical identification module, used to obtain hierarchical structure information of the text data; A slicing module, used for slicing the text data according to the hierarchical structure information to obtain the segments to be recalled; A recall module, used to perform a recall operation on the to-be-recalled fragments to obtain corresponding to-be-screened recall results; A text extraction module, used for matching the corresponding text extraction pattern for the recall result to be screened to obtain a text extraction result; The fusion module is used to fuse the table extraction result with the text extraction result to obtain fused data.
8. An electronic device, characterized in that: include: A memory for storing one or more programs; processor; When the one or more programs are executed by the processor, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A program product, characterized in that When the program product is executed by a processor, the method according to any one of claims 1 to 6 is implemented.