A document parsing method and system based on size model cooperation and a readable storage medium
By using a collaborative architecture of large and small models, the adaptability and efficiency issues in parsing complex document layouts are resolved, achieving high-precision, low-cost automated document parsing and structured output.
Patent Information
- Application Number
- CN202610318737.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-16
- Publication Date
- 2026-06-30
AI Technical Summary
Existing document parsing technologies suffer from poor adaptability, inconsistent parsing results with human reading habits, lack of unified semantic understanding capabilities, high computational costs, and difficulties in engineering implementation when dealing with complex document formats.
It adopts a collaborative architecture of small and large models. The lightweight small model is used for layout awareness and element sorting, while the large model is used for high-level semantic understanding, so as to realize the automatic parsing and structured output of documents.
It improves parsing accuracy, reduces system computational costs and complexity, ensures that parsing results conform to human reading logic, and provides high-quality structured data.
Smart Images

Figure CN122313504A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of intelligent document processing and artificial intelligence technology, specifically to a document parsing method, system, and readable storage medium based on size model collaboration. Background Technology
[0002] With the continuous advancement of digitalization, a large number of documents exist in unstructured or weakly structured formats such as PDFs, and are widely used in scenarios such as scientific research papers, patent documents, technical reports, and financial statements. These documents are usually characterized by complex layouts, diverse content types, and frequent page breaks, which poses significant challenges to the automatic parsing, structured understanding, and information extraction of document content.
[0003] Existing document parsing technologies mostly rely on rule engines, traditional OCR technologies, or single models for processing, which often have the following shortcomings: 1. It has poor adaptability to complex layouts (such as multi-column layouts, mixed text and image formulas, etc.); 2. The reading order is difficult to accurately recover, resulting in analysis results that are inconsistent with human reading habits; 3. Different page elements (text, tables, formulas, images, etc.) are usually treated in a fragmented manner, lacking a unified semantic understanding ability; 4. In large-scale document processing scenarios, a single large model solution has high computational cost, low response efficiency, and is difficult to implement in engineering.
[0004] Furthermore, some published patents have attempted to address the problem of complex document parsing. For example, CN121415423A describes an interactive document parsing scheme that uses multiple dedicated small models for layout detection and OCR recognition of different elements. Finally, a large language model is called to integrate and verify the OCR results. However, the main role of the large model remains in the post-processing and verification stage, failing to deeply participate in the joint modeling of the overall document structure and semantics. Errors in the preceding stages may be amplified in subsequent processing, making it difficult for the large model to perform structural error correction at the source. Moreover, the reliance on various OCR-specific small models limits the system's generalization ability and increases the overall complexity of the system.
[0005] In summary, whether it's the traditional multi-small-model pipeline approach, the end-to-end approach relying entirely on a single large model, or the collaborative approach that primarily uses multi-small-model pipelines with the large model as an auxiliary post-processing module, none of these methods can simultaneously achieve accuracy, efficiency, and engineering feasibility in complex document parsing tasks. Therefore, there is an urgent need to explore a collaborative document parsing method that integrates the efficient perception capabilities of small models with the strong semantic understanding capabilities of large models, significantly reducing system computational costs and engineering complexity while ensuring parsing quality. Summary of the Invention
[0006] The purpose of this invention is to provide a document parsing method based on the collaboration of large and small models. By reasonably splitting and coordinating the document layout perception task and the content semantic understanding task, the advantages of each model are brought into play, so as to realize the automatic parsing, reading order restoration, content recognition and directory structure reconstruction of complex PDF documents, thereby outputting high-quality structured document data.
[0007] According to a first aspect of the technical solution of the present invention, a document parsing method based on size model collaboration is provided, comprising the following steps: Obtain the page image of the document to be parsed; The page image is input into a first model to detect and locate the regions and categories of each page element, and output the position information and category labels of each page element; Based on the position information and category tags of the page elements, the page elements are sorted to generate a page element sequence that conforms to human reading habits; The image slices of each page element after sorting are input into a second model, and content recognition is performed according to their categories, and the structured recognition results are output. Based on the structured recognition results, final structured data containing document structure and content is generated.
[0008] Furthermore, the first model is a layout analysis mini-model, which is built based on an object detection framework and fine-tuned using a document image dataset. It can identify various layout elements, including titles, body paragraphs, tables, images, and formulas.
[0009] Furthermore, the object detection framework is a YOLO series model, and the dataset used for fine-tuning includes complex document images with multi-column layout, cross-page layout, and mixed text and image layout.
[0010] Furthermore, the step of sorting the page elements is implemented through a reading order prediction model, which is built based on a layout understanding model. The input information includes the bounding box coordinates, category labels, and global layout features of each page element, and the output is a sequence of page element indexes sorted according to reading logic.
[0011] Furthermore, the layout understanding model is a LayoutLM series model.
[0012] Furthermore, the second model is a multimodal large model, which is a visual-language joint model fine-tuned by the document parsing task, capable of performing differentiated content recognition tasks based on the category of page elements.
[0013] Fine-tuning: refers to the secondary training of some or all parameters of a pre-trained model using a domain-specific dataset, to better adapt the model to the characteristics of the target task and improve its performance in specific scenarios. In the technical solution of this invention, fine-tuning includes: The layout analysis model is trained using a document image dataset containing various layout elements (such as titles, body text, tables, images, formulas, etc.) to enhance its ability to detect and classify complex document layouts. For multimodal large models, annotated datasets containing various types of document elements such as text, tables, formulas, and charts are used for training, combined with task instructions, so that they have the ability to perform differential recognition tasks based on element categories.
[0014] Furthermore, the multimodal large model outputs Markdown-formatted text content for text-type elements, HTML-formatted table structures for table-type elements, LaTeX-formatted expressions for formula-type elements, and JSON-formatted key information or natural language descriptions for chart-type elements.
[0015] Furthermore: The identification of table-type elements further includes: identifying cell structure, merging cells, the correspondence between table headers and data bodies, and outputting an HTML table containing complete structure and content; The identification of formula elements further includes: identifying inline formulas and cross-line formulas, and outputting expressions that conform to LaTeX syntax for chemical formulas and mathematical expressions; The identification of chart elements further includes: for structured charts, identifying the chart type, data series, axis labels, and values and outputting JSON; for unstructured images, outputting descriptive natural language.
[0016] Furthermore, it also includes a directory reconstruction step: inputting the text content, position information, and page number information of heading elements into a large language model that supports long contexts. The large language model predicts the hierarchical relationship of each heading based on the semantic association between headings and page layout features, and generates a document directory structure.
[0017] Furthermore, in the directory reconstruction step, the input information also includes the font, font size, and style features of the title. The large language model predicts the title level based on the above features and establishes an association index between the directory structure and the main text content to achieve accurate positioning and tracing of the title.
[0018] Furthermore, the step of obtaining the page image of the document to be parsed includes: performing pagination processing on the PDF document, performing image processing on the scanned PDF, and rendering the electronic PDF to generate a high-fidelity page image.
[0019] Furthermore, prior to the layout analysis step, the page image is preprocessed, including one or more of image enhancement, tilt correction, and resolution normalization.
[0020] Furthermore, the second model employs a parallel processing mechanism during the recognition process, assembling images of multiple page elements into batches and performing inference simultaneously based on the task instructions corresponding to each element category.
[0021] Furthermore, the final structured data is output in JSON, XML, or Markdown format, containing the document's metadata, the type and content of each page element, the reading order, and the hierarchical relationship between them.
[0022] Furthermore, the method is applicable to complex documents containing multi-column layouts, cross-page tables, mixed text and graphics, and nested formulas, including research papers, patent documents, technical reports, and financial statements.
[0023] According to a second aspect of the present invention, a document parsing system based on size-model collaboration is provided, the system comprising: a processor and a memory for storing executable instructions; wherein the processor is configured to execute the executable instructions to perform the document parsing method based on size-model collaboration as described in any of the preceding aspects.
[0024] According to a third aspect of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored thereon, and when the computer program is executed by a processor, it implements the document parsing method based on size model collaboration as described in any of the preceding aspects.
[0025] The beneficial effects of this invention are: Compared with the prior art, the present invention has the following significant advantages: This invention abandons the extreme approach of traditional solutions that rely entirely on a single large model or multiple dedicated small models, and innovatively adopts a collaborative architecture of large and small models. Lightweight small models (for layout analysis and reading order prediction) efficiently complete document layout awareness and element sorting, while the high-level semantic understanding task is handled by the large model. This division of labor not only fully leverages the rapid response capability of small models in local feature extraction but also fully utilizes the powerful advantages of large models in global semantic modeling. Compared with existing technologies that rely on multiple dedicated OCR small models (such as text OCR, table OCR, and formula OCR) processed in series and then validated by a large model, this invention significantly reduces the overall system computational cost, reduces inter-module communication overhead, and avoids the error accumulation and latency problems caused by multiple model concatenation, significantly improving processing efficiency and engineering feasibility.
[0026] This invention uses a small layout analysis model to accurately detect and classify page elements, and combines this with a reading order prediction model to intelligently reorder complex layouts such as multi-column, cross-page, and mixed text and image layouts, enabling the parsing results to accurately restore the original reading logic of the document. Compared to traditional parsing methods that rely on fixed rules or templates, this invention's fine-tuning of the small model gives it the ability to generalize to various complex layouts; compared to methods that rely solely on end-to-end processing by a large model, this invention uses the small model to perceive elements first, avoiding element omissions or misalignments caused by the large model's insufficient capture of layout details. Therefore, this invention demonstrates higher parsing accuracy for complex documents such as multi-column papers, technical reports, and financial statements.
[0027] This invention introduces a reading order prediction module based on layout understanding models (such as LayoutLM). This module not only considers the coordinate positions of elements but also integrates category semantics and global layout features, enabling it to intelligently identify the correct reading order in scenarios such as multi-column layouts and nested text and images. This contrasts sharply with existing technologies that rely solely on simple coordinate sorting (such as from top left to bottom right) or on guessing the order using subsequent large models. It effectively avoids semantic breaks caused by incorrect ordering, ensuring that subsequent content recognition and table of contents reconstruction are based on logically correct element sequences, significantly improving the human readability of the structured output.
[0028] This invention unifies the content recognition task of all layout elements (text, tables, formulas, charts) into a single, finely tuned multimodal large model, achieving joint modeling and unified recognition across content types. Compared to existing solutions that deploy multiple dedicated recognition models (such as text OCR, table recognition models, formula recognition models, etc.), this significantly reduces the number of models and system complexity, eliminating interface adaptation and data format conversion issues between multiple models. Furthermore, the multimodal large model can utilize both visual and semantic information, exhibiting stronger understanding capabilities when handling mixed text and image layouts, complex tables, and nested formulas, resulting in more accurate recognition results. It can also directly output structured formats (such as Markdown, HTML, LaTeX, JSON), eliminating cumbersome post-processing steps.
[0029] After element recognition, this invention further performs semantic inference on the heading hierarchy through a directory reconstruction module, generating a complete document directory structure. It then associates the recognized content with the directory, forming final structured data containing hierarchical relationships, element content, and logical order. This output format (such as JSON / XML / Markdown) can directly serve upper-level applications such as document retrieval, knowledge extraction, and intelligent question answering. Compared to existing technologies that only output flat text blocks or simple tags, the structured data provided by this invention preserves the original logical structure of the document, providing a high-quality data foundation for building knowledge bases and training semantic models, significantly improving the performance and reliability of downstream tasks.
[0030] In summary, this invention, through its innovative architecture of collaborative large and small models, significantly reduces system complexity and computational cost while ensuring high parsing accuracy. It solves the problems of error accumulation and efficiency bottlenecks caused by multi-model concatenation in existing technologies, providing an efficient, robust, and practical solution for the automated parsing of complex documents. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0032] Figure 1 A flowchart of a document parsing method based on a size model collaboration according to an embodiment of the present invention is shown.
[0033] Figure 2 A schematic diagram illustrating page layout analysis and reading order prediction according to an embodiment of the present invention is shown.
[0034] Figure 3 A schematic diagram illustrating content recognition of layout elements according to an embodiment of the present invention is shown.
[0035] Figure 4 A schematic diagram of catalog reconstruction according to an embodiment of the present invention is shown.
[0036] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0037] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0038] The terms "first," "second," etc., used in this disclosure are for distinguishing similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented, for example, in orders other than those illustrated or described herein.
[0039] Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, such that a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or apparatus.
[0040] Multiple, including two or more.
[0041] And / or, it should be understood that, for the purposes of this disclosure, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0042] The technical solution of this invention first provides a document parsing method based on size model collaboration, including the following steps: Obtain the page image of the document to be parsed; The page image is input into a first model to detect and locate the regions and categories of each page element, and output the position information and category labels of each page element; Based on the position information and category tags of the page elements, the page elements are sorted to generate a page element sequence that conforms to human reading habits; The image slices of each page element after sorting are input into a second model, and content recognition is performed according to their categories, and the structured recognition results are output. Based on the structured recognition results, final structured data containing document structure and content is generated.
[0043] In a preferred embodiment, the first model is a layout analysis mini-model, which is built based on an object detection framework and fine-tuned using a document image dataset, and is capable of recognizing various layout elements including titles, body paragraphs, tables, images, and formulas.
[0044] In a preferred embodiment, the object detection framework is a YOLO series model, and the dataset used for fine-tuning includes complex document images with multi-column layout, cross-page layout, and mixed text and images.
[0045] In a preferred embodiment, the step of sorting the page elements is implemented by a reading order prediction model. The reading order prediction model is built based on a layout understanding model. The input information includes the bounding box coordinates, category labels, and global layout features of each page element. The output is a sequence of page element indexes sorted according to reading logic.
[0046] In a preferred embodiment, the layout understanding model is a LayoutLM series model.
[0047] In a preferred embodiment, the second model is a multimodal large model, which is a visual-language joint model fine-tuned by the document parsing task, capable of performing differentiated content recognition tasks based on the category of page elements.
[0048] In a preferred embodiment, the multimodal large model outputs Markdown-formatted text content for text-type elements, HTML-formatted table structures for table-type elements, LaTeX-formatted expressions for formula-type elements, and JSON-formatted key information or natural language descriptions for chart-type elements.
[0049] In a preferred embodiment: The identification of table-type elements further includes: identifying cell structure, merging cells, the correspondence between table headers and data bodies, and outputting an HTML table containing complete structure and content; The identification of formula elements further includes: identifying inline formulas and cross-line formulas, and outputting expressions that conform to LaTeX syntax for chemical formulas and mathematical expressions; The identification of chart elements further includes: for structured charts, identifying the chart type, data series, axis labels, and values and outputting JSON; for unstructured images, outputting descriptive natural language.
[0050] In a preferred embodiment, the method further includes a directory reconstruction step: inputting the text content, location information, and page number information of heading elements into a large language model that supports long contexts, wherein the large language model predicts the hierarchical relationship of each heading based on the semantic association between headings and page layout features, and generates a document directory structure.
[0051] In a preferred embodiment, the input information in the directory reconstruction step also includes the font, size, and style features of the title. The large language model predicts the title level based on the above features and establishes an association index between the directory structure and the main text content to achieve accurate positioning and tracing of the title.
[0052] In a preferred embodiment, the step of obtaining the page image of the document to be parsed includes: performing pagination on the PDF document, performing image processing on the scanned PDF, and rendering the electronic PDF to generate a high-fidelity page image.
[0053] In a preferred embodiment, the page image is preprocessed prior to the layout analysis step, the preprocessing including one or more of image enhancement, tilt correction, and resolution normalization.
[0054] In a preferred embodiment, the second model employs a parallel processing mechanism during the recognition process, assembling images of multiple layout elements into batches and performing inference simultaneously based on the task instructions corresponding to each element category.
[0055] In a preferred embodiment, the final structured data is output in JSON, XML, or Markdown format, and includes the document's metadata, the type and content of each page element, the reading order, and the hierarchical relationship between them.
[0056] In a preferred embodiment, the method is applicable to complex documents containing multi-column layouts, cross-page tables, mixed text and graphics, and nested formulas, including research papers, patent documents, technical reports, and financial statements.
[0057] The present invention also provides a document parsing system based on size-model collaboration, the system comprising: a processor and a memory for storing executable instructions; wherein the processor is configured to execute the executable instructions to perform the document parsing method based on size-model collaboration as described in any of the above aspects.
[0058] The present invention also provides a computer-readable storage medium, wherein a computer program is stored thereon, and when the computer program is executed by a processor, it implements the document parsing method based on size model collaboration as described in any of the above aspects.
[0059] This embodiment proposes a document parsing method that combines large and small models, and its overall process is as follows: Figure 1 As shown, it mainly includes the following steps and modules.
[0060] (a) Document Input and Page Image Generation Module The PDF document to be parsed is taken as input, paginated, and each page is converted into a corresponding page image, providing a unified data format for subsequent vision-based layout analysis.
[0061] (II) Page Layout Analysis Module The layout analysis module is used to detect and locate the regions and categories of various layout elements in document page images.
[0062] This module uses a small model fine-tuned from a document image dataset for processing. The small model is built on an object detection framework (such as the YOLO series models) and can output the bounding box coordinates and category information of each page element. The page elements include at least titles, body paragraphs, tables, images, formulas, etc.
[0063] This module allows for precise perception of the overall layout and structure of a document. For example... Figure 2As shown, the upper left corner of each coordinate frame displays the element category and detection score for that region.
[0064] (III) Reading Order Prediction Module The reading order prediction module is used to reorder multiple page elements output by the page layout analysis module to restore the content order that conforms to human reading habits.
[0065] This module is built on a layout understanding model (such as the LayoutLM series of models). The input includes the spatial coordinate information and category information of each page element, and the output is a sorted sequence of page elements.
[0066] This module effectively solves the reading order problem in complex scenarios such as multi-column layouts and cross-regional layouts. For example... Figure 2 The number shown in the upper right corner of each coordinate frame indicates the reading order of that element.
[0067] (iv) Page Layout Element Content Recognition Module The layout element content recognition module is used to recognize the content of each sorted layout element slice.
[0068] This module is based on a multimodal large model, which is based on joint modeling of vision and text, and fine-tuned for document parsing tasks.
[0069] Depending on the category of the layout elements, the recognition task can be further subdivided into: Text recognition task: Output text in Markdown format; Table structure and content recognition task: Output HTML format tables that can represent various complex tables; Formula recognition task: Output formula expressions in LaTeX format to accurately reconstruct formulas, chemical formulas, and other related scenarios; Chart Comprehension Task: For structured charts such as pie charts and bar charts, output key information in JSON format; for unstructured charts, output descriptive language.
[0070] The aforementioned different types of recognition tasks are all completed by a unified multimodal large model, thereby achieving unified semantic understanding across modalities and types. Compared to solutions using multiple small OCR models, this approach unifies the recognition task of all elements into a single large model, while eliminating cumbersome post-processing steps and directly outputting the specified format. For example... Figure 3 As shown, different types of tasks can be paired with corresponding task instructions for parallel processing.
[0071] (v) Directory Reconstruction Module The directory reconstruction module is used to predict the hierarchy and model the structure of heading elements in a document.
[0072] This module is built upon a large language model that supports long contexts. The input is a list of headings arranged in reading order, along with their corresponding position information, text content, and page numbers. The large language model predicts the hierarchical relationships between headings based on semantic relationships and layout features, thus reconstructing the complete document directory structure. For example... Figure 4 As shown, each heading element is rendered in Markdown format according to its predicted level. The heading elements can be further extracted into an outline of unstructured input, thereby enabling the location and tracing of table of contents elements.
[0073] (vi) Structured data output module The processing results of each module are integrated to generate structured data containing document hierarchy, paragraph content, table structure and semantic information, and output in a predetermined format for downstream applications to use.
[0074] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0075] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0076] Through the above description of the embodiments, those skilled in the art can clearly understand that the above implementation methods can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0077] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other modifications under the guidance of the present invention without departing from the spirit and scope of the claims. All of these modifications are within the protection scope of the present invention.
Claims
1. A document parsing method based on size model collaboration, characterized in that, Includes the following steps: Obtain the page image of the document to be parsed; The page image is input into a first model to detect and locate the regions and categories of each page element, and output the position information and category labels of each page element; Based on the position information and category tags of the page elements, the page elements are sorted to generate a page element sequence that conforms to human reading habits; The image slices of each page element after sorting are input into a second model, and content recognition is performed according to their categories, and the structured recognition results are output. Based on the structured recognition results, final structured data containing document structure and content is generated.
2. The method according to claim 1, characterized in that, The first model is a layout analysis mini-model, which is built on an object detection framework and fine-tuned with a document image dataset. It can identify various layout elements, including titles, body paragraphs, tables, images, and formulas.
3. The method according to claim 2, characterized in that, The object detection framework is the YOLO series model, and the dataset used for fine-tuning includes complex document images with multi-column layout, cross-page layout, and mixed text and images.
4. The method according to claim 1, characterized in that, The step of sorting the page elements is implemented by a reading order prediction model. The reading order prediction model is built based on the layout understanding model. The input information includes the bounding box coordinates, category labels and global layout features of each page element. The output is a sequence of page element indexes sorted according to reading logic. The layout understanding model mentioned above is the LayoutLM series model.
5. The method according to claim 1, characterized in that, The second model is a multimodal large model, which is a visual-language joint model fine-tuned by the document parsing task, capable of performing differentiated content recognition tasks based on the category of page elements.
6. The method according to claim 5, characterized in that, The multimodal large model outputs Markdown-formatted text content for text-type elements, HTML-formatted table structures for table-type elements, LaTeX-formatted expressions for formula-type elements, and JSON-formatted key information or natural language descriptions for chart-type elements.
7. The method according to claim 6, characterized in that, The recognition of table-type elements further includes: recognizing cell structure, merged cells, the correspondence between table headers and data bodies, and outputting an HTML table containing complete structure and content; the recognition of formula-type elements further includes: recognizing inline formulas and cross-line formulas, and outputting expressions conforming to LaTeX syntax for chemical formulas and mathematical expressions; the recognition of chart-type elements further includes: recognizing chart type, data series, axis labels and values for structured charts and outputting JSON, and outputting descriptive natural language for unstructured images.
8. The method according to claim 1, characterized in that, It also includes a table of contents reconstruction step: inputting the text content, position information and page number information of heading elements into a large language model that supports long contexts. The large language model predicts the hierarchical relationship of each heading based on the semantic relationship between headings and page layout features, and generates a document table of contents structure.
9. The method according to claim 8, characterized in that, In the directory reconstruction step, the input information also includes the font, font size, and style features of the title. The large language model predicts the title level based on the above features and establishes an association index between the directory structure and the main text content to achieve accurate positioning and tracing of the title.
10. The method according to claim 1, characterized in that, The steps for obtaining the page image of the document to be parsed include: performing pagination on the PDF document, performing image processing on the scanned PDF, and rendering the electronic PDF to generate a high-fidelity page image.
11. The method according to claim 1, characterized in that, Before the layout analysis step, the page image is preprocessed, including one or more of image enhancement, tilt correction, and resolution normalization.
12. The method according to claim 1, characterized in that, The second model employs a parallel processing mechanism during the recognition process, assembling images of multiple page elements into batches and performing inference simultaneously based on the task instructions corresponding to each element category.
13. The method according to claim 1, characterized in that, The final structured data is output in JSON, XML, or Markdown format, and includes the document's metadata, the type and content of each page element, the reading order, and the hierarchical relationship between them.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 13.
15. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 12.
Citation Information
Patent Citations
Interactive big and small model collaborative public service complex document analysis method and device
CN121415423A
