Table processing method and device, storage medium and product
By generating structured information and merging strategies for tables using a pre-defined large model, the problem of identifying and merging cross-page tables in traditional technologies is solved, enabling accurate identification and merging of complex tables and improving data integrity and continuity.
Patent Information
- Application Number
- CN202511780306.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-02-27
AI Technical Summary
Traditional table recognition technologies cannot handle tables that span multiple pages, leading to damage to data integrity and continuity. Furthermore, they rely on the clarity of the table and are difficult to accurately identify the content and structure of complex tables.
The system generates structured information in tables using a pre-set large model. It then uses content recognition, cross-page recognition, and table merging prompts to generate row and column similarity, semantic similarity, and value range similarity. Finally, it calculates the table merging score and determines the merging strategy.
It improves the accuracy of recognizing and merging cross-page tables, ensures the accuracy of table content and structure, and reduces the need for manual correction.
Smart Images

Figure CN121580994A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of table processing technology, and in particular to a table processing method, apparatus, storage medium and product. Background Technology
[0002] Currently, extracting tabular data from various documents mainly relies on rule-based traditional image processing techniques and document intelligent analysis models built with deep learning. In industries such as finance and scientific research, processing complex tables is a common challenge. These tables often contain multi-level headers, merged cells spanning rows and columns, and other complex structures. However, existing technologies treat each page as an independent unit, failing to recognize and reconstruct tables fragmented by page breaks. This not only disrupts data integrity and continuity but also requires significant manpower for manual post-processing and correction. Furthermore, rule-based traditional image processing techniques heavily depend on clear table outlines, resulting in poor performance in recognizing complex tables and difficulty in accurately determining cell merging relationships.
[0003] In summary, traditional table recognition and processing methods rely on the clarity of the table and cannot handle tables spanning multiple pages, making it difficult to accurately identify and merge the content and structure of complex tables.
[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main purpose of this application is to provide a table processing method, device, storage medium and product, which aims to solve the technical problem that traditional technologies cannot accurately identify and merge the content and structure of complex tables.
[0006] To achieve the above objectives, this application proposes a table processing method, which includes: The table file to be processed and the content recognition prompt words are input into the preset large model. The content recognition prompt words guide the preset large model to generate the table structure information of the table file to be processed. The table structure information and cross-page recognition prompts are input into the preset large model. The cross-page recognition prompts guide the preset large model to generate row and column similarity, semantic similarity and value range similarity. The row and column similarity, semantic similarity, value range similarity, and table merging prompts are input into the preset large model. The table merging prompts guide the preset large model to generate a table merging score, and the merging strategy for the table file to be processed is determined based on the table merging score.
[0007] Optionally, the table file to be processed includes a table image and table text, the preset large model includes a content recognition submodule, and the step of inputting the table file to be processed and content recognition prompts into the preset large model, and guiding the preset large model to recognize the table structure information of the table file to be processed through the content recognition prompts includes: The table image is preprocessed, and the preprocessed table image and table text are input into the content recognition submodule to obtain the initial table structure information; Input the initial table structure information and the content recognition prompts into the preset large model; The content recognition prompts guide the preset large model to perform semantic correction processing on the initial table structured information, thereby obtaining the table structured information.
[0008] Optionally, the preset large model further includes a cross-page recognition submodule. The step of inputting the table structured information and cross-page recognition prompts into the preset large model, and guiding the preset large model to generate row-column similarity, semantic similarity, and value range similarity through the cross-page recognition prompts includes: The structured information of the table is input into the cross-page recognition submodule for matrix transformation to obtain structured information in a preset format; The structured information in the preset format and the cross-page recognition prompts are input into the preset large model; The cross-page recognition prompts guide the preset large model to calculate the similarity of the structured information of adjacent page tables in a preset format, thereby obtaining the row and column similarity, the semantic similarity, and the value range similarity.
[0009] Optionally, the step of inputting the row-column similarity, the semantic similarity, the value range similarity, and the table merging prompt words into the preset large model, and guiding the preset large model to generate a table merging score through the table merging prompt words, includes: The table pairs to be merged are determined based on the row and column similarity, the semantic similarity, and the value range similarity. The structural similarity index, header duplication index, and content relevance index of the tables to be merged are calculated based on multi-dimensional indicators. The table merging score of the tables to be merged is calculated based on the preset weight index, the structural similarity index, the header repetition index, and the content relevance index.
[0010] Optionally, the step of calculating the structural similarity index, header duplication index, and content relevance index of the table pairs to be merged based on multi-dimensional indicators includes: The structural similarity index of the table pairs to be merged is obtained by weighting the row and column similarity with structural indices. The semantic similarity is weighted by the header duplication index to obtain the header duplication index of the table pair to be merged; The content relevance index of the table pairs to be merged is obtained by weighting the value range similarity with content relevance indicators.
[0011] Optionally, the step of determining the merging strategy for the table file to be processed based on the table merging score includes: The priority and conflict level of the table file to be processed are determined based on the table merging score, the preset priority threshold, and the preset conflict threshold. The merging strategy for the table files to be processed is determined based on the priority and the conflict level.
[0012] Optionally, before the step of inputting the table file to be processed and content recognition prompts into a preset large model, and guiding the preset large model to generate the table structure information of the table file to be processed through the content recognition prompts, the method further includes: Construct an image-text dataset, and iteratively train a pre-trained large model based on the image-text dataset to obtain an initial large model; Construct a multi-task dataset and multi-task structured prompts, and fine-tune the initial large model using the multi-task dataset and multi-task structured prompts to obtain a preset large model.
[0013] In addition, to achieve the above objectives, this application also proposes an electronic device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the table processing method as described above.
[0014] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and which, when executed by a processor, implements the steps of the table processing method described above.
[0015] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the table processing method described above.
[0016] One or more technical solutions proposed in this application have at least the following technical effects: In this embodiment, the table file to be processed and content recognition prompts are input into a preset large model. The content recognition prompts guide the preset large model to generate the table structure information of the table file to be processed. The table structure information and page crossing recognition prompts are input into the preset large model. The page crossing recognition prompts guide the preset large model to generate row-column similarity, semantic similarity, and value range similarity. The row-column similarity, semantic similarity, value range similarity, and table merging prompts are input into the preset large model. The table merging prompts guide the preset large model to generate a table merging score, and the merging strategy of the table file to be processed is determined based on the table merging score. That is, in this embodiment, the table file to be processed is accurately identified through the preset large model to obtain the table structure and table content. The structured information of the tables on each page is input into a preset large model to obtain the multi-dimensional similarity of the tables on adjacent pages. The merging score of cross-page tables is obtained based on the row and column similarity, semantic similarity, and value range similarity of adjacent tables. The merging score and the preset merging threshold are used to determine whether merging is necessary, thereby improving the accuracy of cross-page table recognition and merging. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating the first embodiment of the form processing method of this application; Figure 2 This is a schematic diagram of the cross-page recognition process provided in an embodiment of this application; Figure 3 A schematic diagram of the architecture of a table processing method provided in an embodiment of this application; Figure 4 This is a flowchart illustrating the second embodiment of the form processing method of this application; Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the table processing method in the embodiments of this application.
[0020] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0021] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0022] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0023] The main solution of this application embodiment is as follows: input the table file to be processed and content recognition prompts into a preset large model, and guide the preset large model to generate the table structure information of the table file to be processed through the content recognition prompts; input the table structure information and page crossing recognition prompts into the preset large model, and guide the preset large model to generate row and column similarity, semantic similarity and value range similarity through the page crossing recognition prompts; input the row and column similarity, semantic similarity, value range similarity and table merging prompts into the preset large model, guide the preset large model to generate table merging score through the table merging prompts, and determine the merging strategy of the table file to be processed based on the table merging score.
[0024] Currently, extracting tabular data from various documents mainly relies on rule-based traditional image processing techniques and document intelligent analysis models built with deep learning. In industries such as finance and scientific research, processing complex tables is a common challenge. These tables often contain multi-level headers, merged cells spanning rows and columns, and other complex structures. However, existing technologies treat each page as an independent unit, failing to recognize and reconstruct tables fragmented by page breaks. This not only disrupts data integrity and continuity but also requires significant manpower for manual post-processing and correction. Furthermore, rule-based traditional image processing techniques heavily depend on clear table outlines, resulting in poor performance in recognizing complex tables and difficulty in accurately determining cell merging relationships.
[0025] In summary, traditional table recognition and processing methods rely on the clarity of the table and cannot handle tables spanning multiple pages, making it difficult to accurately identify and merge the content and structure of complex tables.
[0026] This application provides a solution in which the table file to be processed and content recognition prompts are input into a preset large model. The content recognition prompts guide the preset large model to generate the table structure information of the table file to be processed. The table structure information and cross-page recognition prompts are input into the preset large model. The cross-page recognition prompts guide the preset large model to generate row-column similarity, semantic similarity, and value range similarity. The row-column similarity, semantic similarity, value range similarity, and table merging prompts are input into the preset large model. The table merging prompts guide the preset large model to generate a table merging score, and the merging strategy of the table file to be processed is determined based on the table merging score. That is, in this application embodiment, the table file to be processed is accurately identified by the preset large model to obtain the table structure and table content. The table structure information of each page is input into the preset large model to obtain the multi-dimensional similarity of the tables on adjacent pages. The merging score of the cross-page table is obtained based on the row-column similarity, semantic similarity, and value range similarity of the adjacent tables. The merging score and a preset merging threshold determine whether merging is necessary, thereby improving the merging accuracy of cross-page tables.
[0027] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, personal computer, mobile phone, etc., or an electronic device capable of realizing the above functions.
[0028] Based on this, the embodiments of this application provide a table processing method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the form processing method of this application.
[0029] In this embodiment, the table processing method includes steps S10 to S30: Step S10: Input the table file to be processed and the content recognition prompt words into the preset large model, and guide the preset large model to generate the table structure information of the table file to be processed through the content recognition prompt words; It should be noted that the pre-built large model achieves accurate recognition of table language, orientation, and structure by collecting and processing a large amount of table training data. The pre-built large model identifies the structured information of unstructured tables in the files to be processed, including basic table identifiers, table structure information, table content information, and table style information. Content recognition prompts are the instruction text guiding the pre-built large model to perform content recognition.
[0030] In one feasible implementation, the table file to be processed includes a table image and table text, and the preset large model includes a content recognition submodule. The steps of inputting the table file to be processed and content recognition prompts into the preset large model, and guiding the preset large model to recognize the table structure information of the table file to be processed through the content recognition prompts, include: The table image is preprocessed, and the preprocessed table image and table text are input into the content recognition submodule to obtain the initial table structure information; Input the initial table structure information and content recognition prompts into the preset large model; By using content recognition prompts to guide a pre-defined large model to perform semantic correction on the initial table structured information, the table structured information is obtained.
[0031] It should be noted that the table recognition submodule is used to extract the initial table structure information. Since this initial table structure information often contains content recognition errors due to semantic understanding biases, semantic correction processing is necessary. The pre-set large model, after general training, possesses cross-modal visual-text understanding capabilities and can integrate multiple types of information for semantic-level correction and optimization. Semantic correction prompts within the content recognition prompts can correct the initial structure information, outputting more accurate table structure information. Preprocessing includes operations such as denoising, rotation correction, enhancing sharpness, and cropping table regions to improve table recognition accuracy.
[0032] For example, if the initial structured information misidentifies "operating revenue" as "operating income," a pre-defined large model can correct this by guiding users through content recognition prompts to correct the text errors in the cells. Preprocessing the table image improves the recognition accuracy of the pre-defined large model, and accurate correction by the model enhances the output quality of the structured information. Furthermore, the content recognition prompts can be flexibly adjusted according to user needs, improving user experience and model adaptability.
[0033] Step S20: Input the table structured information and cross-page recognition prompts into the preset large model, and guide the preset large model to generate row and column similarity, semantic similarity and value range similarity through the cross-page recognition prompts; It should be noted that the core task of the pre-defined large model, which identifies prompts across pages, is multi-dimensional similarity calculation, including row and column similarity, semantic similarity, and value range similarity. Row and column similarity is calculated by comparing the number of cells in the last row of the previous page's table with the number of cells in the first row of the next page's table. Semantic similarity is calculated by extracting the header text from both tables. Value range similarity is calculated by the pre-defined large model based on the numerical columns identified in the two tables.
[0034] In one feasible implementation, refer to Figure 2 , Figure 2 This is a schematic diagram of the cross-page recognition process provided in the embodiments of this application. The preset large model also includes a cross-page recognition submodule. The steps of inputting the table structured information and cross-page recognition prompts into the preset large model, and guiding the preset large model to generate row and column similarity, semantic similarity, and value range similarity through the cross-page recognition prompts include steps S21 to S23: Step S21: Input the table structured information into the cross-page recognition submodule for matrix transformation to obtain structured information in a preset format; Step S22: Input the pre-formatted structured information and cross-page recognition prompts into the pre-formatted large model; Step S23: Guide the preset large model to perform similarity calculation on the structured information of the tables on adjacent pages in a preset format by using cross-page recognition prompts to obtain row and column similarity, semantic similarity and value range similarity.
[0035] It should be noted that the cross-page recognition submodule is used to convert the structured information of the table into a preset format that can be efficiently calculated by the preset large model, providing a standardized data foundation for similarity calculation. The matrix transformation is used to convert the structured information of the table, such as the row and column structure and cell content, into a structured matrix of uniform dimensions, realizing the normalization of heterogeneous features. That is, it uses special symbols to represent the information representing the cross-row and cross-column cell structure in the preset tokenized information, thereby improving the recognition speed of the preset large model.
[0036] For example, special symbols are represented by a fixed special mark used in each additional cell. Specific special marks include... <left> 、 <up>and <lu> , <left>Used to indicate that the cell extends to the left. <up>Used to indicate that the cell extends upwards. <lu>Used to represent a cell extending to the left and above. As shown in Table 1, it is an example of a table spanning rows in actual application.
[0037] Table 1 Table spanning rows
[0038] It can be understood that, compared with the original HTML (HyperText Markup Language, HyperText Markup Language) representation structure, after representation using special symbols, the number of cells in each row is consistent, the expression is more intuitive, and the recognition accuracy of the preset large model for the cross-page table is improved.
[0039] In step S30, the row-column similarity, semantic similarity, value range similarity, and table merging prompt word are input into the preset large model, the table merging prompt word is used to guide the preset large model to generate a table merging score, and a merging strategy of the table file to be processed is determined based on the table merging score.
[0040] It should be noted that the table merging prompt word is an instruction for guiding the preset large model to formulate a merging strategy, and clearly specifies the merging requirements, rules, and optimization direction. The table merging score is a comprehensive score calculated by the preset large model based on the row-column similarity, semantic similarity, and value range similarity, and is used to determine whether the cross-page table needs to be merged. The higher the score, the higher the necessity of merging the cross-page table.
[0041] For example, referring to Figure 3 An architecture schematic diagram of a table processing method provided by the embodiment of the present application is shown. In the pre-processing stage, the special symbols in the table are standardized to reduce model recognition interference. The preset large model is trained based on the pre-processed table data to have multi-modal understanding capabilities of visual features, layout information, and text semantics. In the use stage, the input table document file or image is converted into a format that can be processed by the model. The structured information of the table is extracted by the preset large model, and the cross-page table is accurately determined. If it is a cross-page table, it is merged into a complete table. The special symbols replaced in the recognition process are restored to ensure that the table content is consistent with the original scene. The accurate recognition of table images to structured data is realized, and the success rate of merging complex tables is improved.
[0042] In a feasible implementation, the step of inputting the row-column similarity, semantic similarity, value range similarity, and table merging prompt word into the preset large model to guide the preset large model to generate a table merging score includes: determining a table pair to be merged based on the row-column similarity, semantic similarity, and value range similarity; calculating a structure similarity index, a table header repeatability index, and a content correlation index of the table pair to be merged based on multi-dimensional indexes; The table merging score of the to-be-merged table is calculated based on the preset weight index and the structure similarity index, the table header repeatability index and the content correlation index.
[0043] It should be noted that the to-be-merged table pair is a combination of adjacent page tables determined to have cross-page association potential after preliminary screening based on row-column similarity, semantic similarity and value range similarity. The multi-dimensional index is the three core indexes for evaluating the association strength of the to-be-merged table pair. The preset weight index is used to balance the influence of various indexes on the merging strategy.
[0044] In a feasible implementation, the step of calculating the structure similarity index, the table header repeatability index and the content correlation index of the to-be-merged table pair based on the multi-dimensional index includes: The structure similarity index of the to-be-merged table pair is calculated by weighting the structure index of the row-column similarity; The table header repeatability index of the to-be-merged table pair is calculated by weighting the table header repeatability index of the semantic similarity; The content correlation index of the to-be-merged table pair is calculated by weighting the content correlation index of the value range similarity.
[0045] For example, the multi-dimensional index includes the structure similarity index, the table header repeatability index, the content correlation index and the format consistency index, wherein the format consistency index is directly output by comparing the style features of font, color and border through a preset large model.
[0046] The process of calculating the structure similarity index of the to-be-merged table pair by weighting the structure index of the row-column similarity is as follows:
[0047] wherein, is 0.6, is 0.4, is the row structure similarity, which represents the comparison of the number of cells, width distribution and content type of the last row of the previous table and the first row of the next table, and the calculation formula is:
[0048] wherein, N1 and N2 are the number of cells in the two rows, is the column alignment similarity, which is used to analyze the consistency of column width proportion, and the calculation formula is:
[0049] wherein, W1 and W2 are column width vectors.
[0050] The process of calculating the table header repeatability index of the to-be-merged table pair by weighting the table header repeatability index of the semantic similarity is as follows:
[0051] in, It is 0.4. The value is 0.6, and `exact_match_ratio` is the exact match ratio, used to calculate the proportion of text in the header cells that are exactly matched. For semantic similarity.
[0052] The process of calculating the content relevance index of the tables to be merged by weighting the value range similarity using content relevance indicators is as follows:
[0053] Among them, data_type_consistency is used to analyze the data type matching degree of the corresponding columns. The calculation formula is as follows:
[0054] value_range_similarity is a value range similarity property used to compare the similarity of the distribution of the value ranges of numerical columns. Its formula is as follows:
[0055] semantic_coherence represents semantic coherence, with ε=0.3, ζ=0.3, and η=0.4.
[0056] The process for obtaining the format consistency index is as follows:
[0057] By comparing the font, color, border, and other style features of the tables to be merged using a pre-set large model, the similarity is directly output.
[0058] For example, the formula for calculating the combined score of tables is as follows:
[0059] Among them, w1, w2, w3, and w4 are user-preset weight indicators. As a structural similarity index, For the header repeatability indicator, As a content relevance indicator, This is a format consistency metric. By differentiating the weights of these metrics, we can indicate the relative importance of different indicators in judging and merging cross-page tables. Understandably, in the table merging process, structural continuity is the most important, followed by header redundancy, then content relevance, and finally format consistency. Through a dual approach of coarse-grained screening and multi-dimensional fine-grained scoring, combined with the semantic understanding capabilities of a pre-set large model, a merging strategy is derived. This avoids merging errors caused by single-dimensional judgments and resolves structural conflicts and format inconsistencies through semantic-level strategy optimization, thereby improving the accuracy of merging cross-page tables.
[0060] In one feasible implementation, the step of determining the merging strategy for the table files to be processed based on the table merging score includes: The priority and conflict level of the table files to be processed are determined based on the table merging score, the preset priority threshold, and the preset conflict threshold. Determine the merging strategy for pending table files based on priority and conflict level.
[0061] It should be noted that the preset priority threshold is a quantitative standard for classifying the priority of table merging, used to clarify the urgency of the merge, and can be divided into high-priority threshold, medium-priority threshold, and low-priority threshold. The preset conflict threshold is a quantitative standard for determining the severity of merge conflicts, used to identify potential merge risks, and can be divided into no-conflict threshold, minor-conflict threshold, and severe-conflict threshold. Priority refers to the processing level of the table pairs to be merged in the pending table files, and conflict level refers to the risk level of the table pairs to be merged. The merge strategy is the final execution plan derived from the priority and conflict level, including the merge decision, execution method, and conflict handling rules.
[0062] For example, the table merging score is determined to be 0.94, the preset high-priority threshold is greater than 0.8, the preset medium-priority threshold is 0.6-0.8, the preset low-priority threshold is less than 0.6, the preset no-conflict threshold is greater than 0.7, the preset minor-conflict threshold is 0.6-0.7, and the preset severe-conflict threshold is less than 0.6. The table file to be processed is determined to have a high priority and a no-conflict level, and automatic merging is directly executed.
[0063] Reference Figure 4 This is a flowchart illustrating the second embodiment based on the first embodiment of this application. Content in this embodiment that is the same as or similar to the above embodiments can be referred to the above description and will not be repeated hereafter. Before the step of inputting the table file to be processed and content recognition prompts into the preset large model, and guiding the preset large model to generate the table structure information of the table file to be processed through the content recognition prompts, steps A10 to A20 are also included: Step A10: Construct an image-text dataset, and iteratively train the pre-trained large model based on the image-text dataset to obtain the initial large model; Step A20: Construct a multi-task dataset and multi-task structured prompts. Based on the multi-task dataset and multi-task structured prompts, fine-tune the initial large model using multi-task methods to obtain a preset large model.
[0064] It should be noted that the training of the pre-trained large model is divided into general pre-training and domain fine-tuning. The image-text dataset includes image-text pairing data. The pre-trained large model is a general-purpose model with basic multimodal understanding capabilities. Through iterative training on the image-text dataset, it initially masters the ability to extract table-related features and understand semantics. The multi-task dataset includes labeled data for multiple sub-tasks, such as row and column similarity calculation datasets, semantic similarity determination datasets, merge score prediction datasets, and merge strategy generation datasets. The multi-task structured prompts are standardized instruction texts customized for each sub-task. The pre-trained large model is the final dedicated model output after multi-task fine-tuning. Through multi-task collaborative learning, end-to-end processing efficiency is improved.
[0065] This application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the table processing method in Embodiment 1 above.
[0066] The following is for reference. Figure 5 The diagram illustrates a structural schematic of an electronic device suitable for implementing embodiments of this application. The electronic devices in these embodiments may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0067] like Figure 5 As shown, the electronic device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the electronic device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. While electronic devices with various systems are shown in the figures, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0068] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0069] The electronic device provided in this application employs the table processing method described in the above embodiments, aiming to solve the technical problem that traditional technologies cannot accurately identify and merge the content and structure of complex tables. Compared with the prior art, the beneficial effects of the electronic device provided in this application are the same as those of the table processing method provided in the above embodiments, and other technical features of this electronic device are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.
[0070] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0071] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0072] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the table processing method in the above embodiments.
[0073] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0074] The aforementioned computer-readable storage medium may be included in an electronic device or may exist independently without being assembled into an electronic device.
[0075] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by an electronic device, cause the electronic device to: input the table file to be processed into a table content recognition sub-model to obtain the table structure information of each page number; input the table structure information of each page number into a table cross-page recognition sub-model to obtain the preset tokenized information of the cross-page table; and input the preset tokenized information of the cross-page table into a table merging sub-model to obtain the target merged table.
[0076] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0077] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0078] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0079] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described table processing method. It aims to solve the technical problem that conventional technologies cannot accurately identify and merge the content and structure of complex tables. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the table processing method provided in the above embodiments, and will not be repeated here.
[0080] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the table processing method described above.
[0081] The computer program product provided in this application aims to solve the technical problem that traditional technologies cannot accurately identify and merge the content and structure of complex tables. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the table processing method provided in the above embodiments, and will not be repeated here.
[0082] The above are only some embodiments of this application and do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.< / lu> < / up> < / left> < / lu> < / up> < / left>
Claims
1. A table processing method, characterized in that, The table processing method includes: The table file to be processed and the content recognition prompt words are input into the preset large model. The content recognition prompt words guide the preset large model to generate the table structure information of the table file to be processed. The table structure information and cross-page recognition prompts are input into the preset large model. The cross-page recognition prompts guide the preset large model to generate row and column similarity, semantic similarity and value range similarity. The row and column similarity, semantic similarity, value range similarity, and table merging prompts are input into the preset large model. The table merging prompts guide the preset large model to generate a table merging score, and the merging strategy for the table file to be processed is determined based on the table merging score.
2. The table processing method as described in claim 1, characterized in that, The table file to be processed includes a table image and table text. The preset large model includes a content recognition submodule. The step of inputting the table file to be processed and content recognition prompts into the preset large model, and guiding the preset large model to recognize the table structure information of the table file to be processed through the content recognition prompts, includes: The table image is preprocessed, and the preprocessed table image and table text are input into the content recognition submodule to obtain the initial table structure information; Input the initial table structure information and the content recognition prompts into the preset large model; The content recognition prompts guide the preset large model to perform semantic correction processing on the initial table structured information, thereby obtaining the table structured information.
3. The table processing method as described in claim 1, characterized in that, The preset large model also includes a cross-page recognition submodule. The step of inputting the table structured information and cross-page recognition prompts into the preset large model, and guiding the preset large model to generate row and column similarity, semantic similarity, and value range similarity through the cross-page recognition prompts includes: The structured information of the table is input into the cross-page recognition submodule for matrix transformation to obtain structured information in a preset format; The structured information in the preset format and the cross-page recognition prompts are input into the preset large model; The cross-page recognition prompts guide the preset large model to calculate the similarity of the structured information of adjacent page tables in a preset format, thereby obtaining the row and column similarity, the semantic similarity, and the value range similarity.
4. The table processing method as described in claim 1, characterized in that, The step of inputting the row-column similarity, the semantic similarity, the value range similarity, and the table merging prompts into the preset large model, and guiding the preset large model to generate a table merging score through the table merging prompts, includes: The table pairs to be merged are determined based on the row and column similarity, the semantic similarity, and the value range similarity. The structural similarity index, header duplication index, and content relevance index of the tables to be merged are calculated based on multi-dimensional indicators. The table merging score of the tables to be merged is calculated based on the preset weight index, the structural similarity index, the header repetition index, and the content relevance index.
5. The table processing method as described in claim 4, characterized in that, The steps for calculating the structural similarity index, header duplication index, and content relevance index of the table pairs to be merged based on multi-dimensional indicators include: The structural similarity index of the table pairs to be merged is obtained by weighting the row and column similarity with structural indices. The semantic similarity is weighted by the header duplication index to obtain the header duplication index of the table pair to be merged; The content relevance index of the table pairs to be merged is obtained by weighting the value range similarity with content relevance indicators.
6. The table processing method as described in claim 1, characterized in that, The step of determining the merging strategy for the table file to be processed based on the table merging score includes: The priority and conflict level of the table file to be processed are determined based on the table merging score, the preset priority threshold, and the preset conflict threshold. The merging strategy for the table files to be processed is determined based on the priority and the conflict level.
7. The table processing method as described in claim 1, characterized in that, Before the step of inputting the table file to be processed and content recognition prompts into a preset large model, and guiding the preset large model to generate the table structure information of the table file to be processed through the content recognition prompts, the method further includes: Construct an image-text dataset, and iteratively train a pre-trained large model based on the image-text dataset to obtain an initial large model; Construct a multi-task dataset and multi-task structured prompts, and fine-tune the initial large model using the multi-task dataset and multi-task structured prompts to obtain a preset large model.
8. An electronic device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the table processing method as described in any one of claims 1 to 7.
9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the table processing method as described in any one of claims 1 to 7.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the table processing method as described in any one of claims 1 to 7.