Content-aware and intelligent routing document parsing method and device, equipment and medium
By employing content-aware and intelligent routing methods to dynamically match document parsing tools, the problem of reliance on human experience in existing technologies is solved. This achieves efficient, stable, and automated document parsing, adapts to document heterogeneity, lowers the technical threshold, and supports system expansion.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG FINGARD TECH CO LTD
- Filing Date
- 2026-01-06
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies rely on human experience to select parsing tools when processing multimodal unstructured documents, resulting in wasted computing resources and poor parsing performance. They are unable to adapt to document heterogeneity, lack automation and adaptability, have high technical barriers, and poor scalability.
By employing content-aware and intelligent routing methods, multi-dimensional feature vectors of documents are extracted. A preset routing decision model is then used to dynamically match the most suitable parsing tool, achieving automated selection and result integration, thus eliminating reliance on human experience.
It achieves efficient, stable, and automated document parsing, ensuring optimal parsing results for any type of document, lowering the technical threshold, and supporting the sustainable expansion of the system.
Smart Images

Figure CN121457462B_ABST
Abstract
Description
Content-aware and intelligent routing document parsing methods, devices, equipment and media Technical Field
[0001] This application relates to the fields of artificial intelligence and natural language processing technology, and more specifically, to a document parsing method, apparatus, device, and medium for content awareness and intelligent routing. Background Technology
[0002] With the increasing demand for processing unstructured documents in scenarios such as enterprise knowledge management, intelligent customer service, and academic research, how to efficiently and effectively parse documents in diverse formats has become a key challenge.
[0003] Document parsing is a core component of Retrieval-Augmented Generation (RAG) systems in building knowledge bases. Its goal is to extract structured information from multimodal unstructured documents for use by downstream tasks such as semantic retrieval and intelligent question answering.
[0004] However, in existing solutions, the selection of tools usually relies on human experience. Users need to understand the advantages and disadvantages of each tool in advance, which results in high trial and error costs. Blindly calling tools to parse documents not only leads to a waste of computing resources, but also results in poor parsing results. For mixed-type documents, it is difficult to guarantee the quality of document parsing using a single type of tool. Summary of the Invention
[0005] The purpose of this application is to address the shortcomings of the prior art by providing a content-aware and intelligent routing document parsing method to improve the efficiency, quality, and automation of document parsing.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0007] In a first aspect, embodiments of this application provide a content-aware and intelligent routing document parsing method, the method comprising:
[0008] Content awareness is performed on the document to be identified, and multi-dimensional feature vectors of each page of the document to be identified are extracted. The multi-dimensional feature vectors include at least: the format features of the document to be identified, the quality features of each page of the document, the layout features of each page of the document, and / or the element features of each page of the document.
[0009] A preset routing decision model is used to route the multi-dimensional feature vectors to determine the document parsing tool for each page of the document;
[0010] The document parsing tools for the multi-page document to be identified are statistically analyzed to obtain the parsing page number of at least one document parsing tool;
[0011] Based on the parsing page number of each document parsing tool, each document parsing tool is invoked to parse the document corresponding to the parsing page number, and a partial parsing result is obtained;
[0012] The local parsing results of the at least one document parsing tool are integrated to generate the target parsing result of the document to be identified.
[0013] Optionally, the step of performing content awareness on the document to be identified and extracting multi-dimensional feature vectors for each page of the document to be identified includes:
[0014] The format of the document to be identified is identified to determine its format characteristics;
[0015] The text content of each page of the document is analyzed to determine the quality characteristics of each page of the document;
[0016] The layout, semantic regions, and / or language distribution of each page of the document are analyzed to determine the layout and / or layout complexity of each page of the document. The layout features include the layout and / or the layout complexity.
[0017] Multiple element detectors are used to identify multiple elements in each page of the document to determine the element type features, element density features, and / or element complexity features of each page of the document. The element features include the element type features, the element density features, and / or the element complexity features.
[0018] Optionally, the step of analyzing the text content of each page of the document to determine the quality characteristics of each page includes:
[0019] The character encoding rate of each page of the document is determined based on the proportion of abnormal text in the text content of each page; and / or,
[0020] Perform coherence analysis on the text content of each page of the document to determine the coherence parameters of each page; and / or,
[0021] The clarity and / or font style of each page of the document are identified to determine the clarity parameters and / or font style information of each page of the document; the quality features include: the character garbled rate, the coherence parameter, the clarity parameter and / or the font style information.
[0022] Optionally, the preset routing decision model is: preset decision rules, which predefine document parsing tools corresponding to different feature combinations. The step of using the preset routing decision model to route the multi-dimensional feature vectors and determine the document parsing tool for each page of the document includes:
[0023] Based on the multi-dimensional feature vector of each page of the document, the document parsing tool corresponding to the feature combination with the highest matching degree is selected from the preset decision rules.
[0024] Optionally, the preset routing decision model is a pre-trained classification model. The step of using the preset routing decision model to route the multi-dimensional feature vectors and determine the document parsing tool for each page of the document includes:
[0025] The classification model is used to identify the multi-dimensional feature vectors of each page of the document, thereby determining the document parsing tool for each page of the document.
[0026] Optionally, if the confidence level of the document parsing tool determined according to the preset decision rule or the classification model is lower than a preset threshold, the step of using a preset routing decision model to route the multi-dimensional feature vector and determine the document parsing tool for each page of the document further includes:
[0027] Based on the description information of multiple document parsing tools and the multi-dimensional feature vector, document parsing prompt words are generated;
[0028] A pre-trained large language model is used to determine the document parsing tool for each page of the document based on the document parsing prompts.
[0029] Optionally, the step of calling each document parsing tool to parse the document corresponding to the parsed page number based on the parsing page number of each document parsing tool, and obtaining a partial parsing result, includes:
[0030] Establish a connection with a parsing tool server, which integrates multiple document parsing tools;
[0031] A parsing request is sent to the parsing tool server. The parsing request includes: the identifier of each document parsing tool and the parsing page number of each document parsing tool, so that the parsing tool server calls the corresponding document parsing tool to parse each page of the document and obtain a partial parsing result.
[0032] Receive the standardized partial parsing results of the multi-page document sent by the parsing tool server.
[0033] Secondly, embodiments of this application also provide a content-aware and intelligent routing document parsing device, the device comprising:
[0034] The content-aware module is used to perform content awareness on the document to be identified and extract multi-dimensional feature vectors of each page of the document to be identified. The multi-dimensional feature vectors include at least: the format features of the document to be identified, the quality features of each page of the document, the layout features of each page of the document, and / or the element features of each page of the document.
[0035] The intelligent routing module is used to route the multi-dimensional feature vector using a preset routing decision model to determine the document parsing tool for each page of the document;
[0036] The tool statistics module is used to perform statistics on the document parsing tools of the multi-page document to be identified, and obtain the parsing page number of at least one document parsing tool;
[0037] The document parsing module is used to call each document parsing tool to parse the document corresponding to the parsing page number according to the parsing page number of each document parsing tool, and obtain the parsing result;
[0038] The result integration module is used to integrate the parsing results of the at least one document parsing tool to generate the target parsing document of the document to be identified.
[0039] Optionally, the content awareness module is specifically used to identify the format of the document to be identified and determine the format features of the document to be identified; analyze the text content of each page of the document and determine the quality features of each page of the document; analyze the layout, semantic region and / or language distribution of each page of the document and determine the layout and / or layout complexity of each page of the document, wherein the layout features include the layout and / or the layout complexity; and use multiple element detectors to identify multiple elements in each page of the document and determine the element type features, element density features and / or element complexity features of each page of the document, wherein the element features include the element type features, the element density features and / or the element complexity features.
[0040] Optionally, the content awareness module is specifically configured to determine the character garbled rate of each page of the document based on the proportion of abnormal text in the text content of each page; and / or to perform coherence analysis on the text content of each page of the document to determine the coherence parameter of each page; and / or to identify the clarity and / or font style of each page of the document to determine the clarity parameter and / or font style information of each page; the quality features include: the character garbled rate, the coherence parameter, the clarity parameter, and / or the font style information.
[0041] Optionally, the preset routing decision model is: preset decision rules, which predefine document parsing tools corresponding to different feature combinations. The intelligent routing module is specifically used to select the document parsing tool corresponding to the feature combination with the highest matching degree from the preset decision rules based on the multi-dimensional feature vector of each page of the document.
[0042] Optionally, the preset routing decision model is a pre-trained classification model. The intelligent routing module is specifically used to identify the multi-dimensional feature vectors of each page of the document using the classification model, and to determine the document parsing tool for each page of the document.
[0043] Optionally, if the confidence level of the document parsing tool determined according to the preset decision rule or the classification model is lower than a preset threshold, the intelligent routing module is further configured to generate document parsing prompt words based on the description information of multiple document parsing tools and the multi-dimensional feature vector; and use a pre-trained large language model to determine the document parsing tool for each page of the document based on the document parsing prompt words.
[0044] Optionally, the document parsing module is specifically used to establish a connection with a parsing tool server, which integrates multiple document parsing tools; send a parsing request to the parsing tool server, the parsing request including: the identifier of each document parsing tool and the parsing page number of each document parsing tool, so that the parsing tool server calls the corresponding document parsing tool to parse each page of the document to obtain a partial parsing result; and receive the standardized partial parsing result of the multi-page document sent by the parsing tool server.
[0045] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the content-aware and intelligent routing document parsing method as described in any of the first aspects.
[0046] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the content-aware and intelligent routing document parsing method as described in any of the first aspects.
[0047] The beneficial effects of this application are:
[0048] The content-aware and intelligent routing document parsing method, apparatus, device, and medium provided in this application determine the multi-dimensional feature vector of each page of the document by performing content perception on the document to be identified, eliminating the dependence on human experience and solving the problems of low document parsing efficiency and high technical threshold. By routing the multi-dimensional feature vector through a routing decision model, the document parsing tool for each page of the document is determined, so as to accurately match one or more of the most suitable document parsing tools for the document to be identified, ensuring that stable and optimal parsing results can be obtained for any type of document. Attached Figure Description
[0049] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 is an architecture diagram of the document parsing system provided in an embodiment of this application;
[0051] Figure 2 is a flowchart illustrating the document parsing method provided in an embodiment of this application.
[0052] Figure 3 is a schematic diagram of the content-aware process provided in an embodiment of this application;
[0053] Figure 4 is a schematic diagram of the intelligent routing decision-making process provided in an embodiment of this application;
[0054] Figure 5 is a flowchart illustrating the document parsing method provided in an embodiment of this application.
[0055] Figure 6 is an interaction diagram between the document parsing client and the parsing tool server provided in an embodiment of this application;
[0056] Figure 7 is a schematic diagram of the document parsing device provided in an embodiment of this application;
[0057] Figure 8 is a schematic diagram of the electronic device provided in an embodiment of this application. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of this application, but not all embodiments.
[0059] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0060] Furthermore, the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Additionally, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0061] It should be noted that, where there is no conflict, the features in the embodiments of this application can be combined with each other.
[0062] The documents in the enterprise document library are highly heterogeneous, mainly in the following aspects:
[0063] 1. Multimodal document formats: including digital native portable document format (PDF), scanned image PDF, Office documents (such as doc documents, presentations (PowerPoint, PPT)), spreadsheet-intensive reports, etc. Among them, the text of digital native PDF can be directly extracted, while the text of scanned image PDF needs to be processed by optical character recognition (OCR).
[0064] 2. Multimodal document content: Documents include elements such as multi-column layout, mixed languages, complex tables, mathematical formulas, charts, and handwritten content.
[0065] 3. Tool specificity: Existing parsing technologies (such as rule-based extraction, OCR, and CV layout analysis) each have their physical limitations and application boundaries, and can only be applied to specific scenarios. No single tool can cover all document types, which means that existing parsing tools on the market (such as Marker, Nougat, Docling, etc.) can only achieve the best parsing results in specific document types and scenarios.
[0066] For the reasons mentioned above, the existing technology mainly has the following problems:
[0067] 1. Tool selection relies on human experience: Since there is no single parsing tool that can cover all types of documents, users must manually select the most suitable tool for different document types. The selection process is highly dependent on the user's experience and understanding of each parsing tool. Users need to understand the advantages and disadvantages of each tool in advance. For example, Marker is good at digital PDFs but weak at scanned documents, MinerU is good at tables and formulas but is slower, Docling can handle multiple formats but is not very effective for some complex layouts, and Nougat specializes in academic papers but is limited to PDFs. The cost of trial and error is high. Blindly calling tools to parse documents will not only waste computing resources but also result in poor parsing results.
[0068] 2. Unpredictable processing results and serious waste of resources: For unknown mixed multimodal documents, users cannot know in advance which tool will perform best. They can only run all possible parsing tools serially or in parallel and then compare the results, resulting in a huge waste of computing resources and time. Furthermore, using a single tool to process mixed documents will inevitably lead to low parsing quality of some parts of the document, making the quality of the output parsed document unstable and directly affecting the accuracy of downstream RAG question answering.
[0069] 3. Lack of adaptability: The existing solution uses a "static" pipeline for tool selection, which cannot dynamically route document parsing tools based on document characteristics to select the most suitable document parsing tool or combination of document parsing tools.
[0070] 4. High technical threshold and poor scalability: Due to the need for manual intervention and in-depth professional knowledge, it is extremely difficult to build an efficient document parsing process, making it difficult to automate. Whenever a new parsing tool appears, users need to relearn it and manually integrate it into the existing process, making it difficult for the system to be smooth, rigorous and scalable.
[0071] 5. Poor ecosystem compatibility: The output formats of various tools are not consistent (Markdown / JSON / HTML), making integration difficult and lacking a one-stop solution, resulting in high construction and maintenance costs.
[0072] In summary, the essential drawback of existing technologies lies in their adoption of a static, passive, and human-dependent document processing paradigm, which cannot cope with the challenges brought about by document heterogeneity. The entire process is not centered on "document features" but on "human selection," resulting in a situation where efficiency, quality, and automation cannot be achieved simultaneously.
[0073] Based on the problems existing in the prior art, this application aims to fundamentally overturn the static and passive paradigm and provide a solution completely different from the existing technology. The specific objectives are as follows:
[0074] 1. Achieve automation and intelligence in tool selection: By creating an "intelligent scheduling hub," it can automatically replace manual labor to complete the evaluation and selection of analytical tools, eliminating reliance on human experience, fundamentally solving the problems of low efficiency and high technical barriers, and achieving complete automation of the process.
[0075] 2. Achieve precise matching between parsing strategies and document content: Through deep content awareness technology, the system can understand the unique characteristics of each document and dynamically and accurately match one or more of the most suitable parsing tools or strategies accordingly. This ensures that any type of document can obtain stable and optimal parsing results, thereby improving the stability and reliability of the entire system's processing performance.
[0076] 3. Build a sustainable and evolving integrated platform: Design a highly scalable plug-in architecture, and define a unified tool interface so that new parsing tools can be easily integrated into the system without changing the core routing decision logic. This will make the system a future-oriented, continuously updated "one-stop" document parsing platform, and maintain its technological advancement.
[0077] The following describes the specific implementation of the content-aware and intelligent routing document parsing method provided in this application, with reference to the embodiments.
[0078] Figure 1 is an architecture diagram of the document parsing system provided in an embodiment of this application. As shown in Figure 1, the document parsing system may include: a content awareness module, an intelligent routing decision module, a tool adaptation layer, and a result integration module.
[0079] The content awareness module includes: a format recognition and basic attribute analysis unit, a content accessibility depth detection unit, a layout and structural complexity analysis unit, and an element existence detection unit. The intelligent routing decision module can provide a variety of decision-making methods, such as a rule engine, a machine learning module, and a large language reasoning model.
[0080] After the user uploads the document to be recognized, the content awareness module extracts multi-dimensional features from the document, generates a structured feature report with multi-dimensional feature vectors, and passes it to the intelligent routing decision model. The intelligent routing decision model generates decision instructions based on the multi-dimensional feature vectors and calls one or more document parsing tools through the unified interface of the tool adaptation layer. The result integration model merges, deduplicates, and unifies the format of the local parsing results of each document parsing tool, and outputs the target parsing result to the user.
[0081] Figure 2 is a flowchart illustrating the document parsing method provided in an embodiment of this application. As shown in Figure 2, the method may include:
[0082] S101. Perform content awareness on the document to be identified, and extract multi-dimensional feature vectors for each page of the document to be identified. The multi-dimensional feature vectors include at least: the format features of the document to be identified, the quality features of each page, the layout features of each page, and / or the element features of each page.
[0083] In this embodiment, the document to be identified can be a document generated based on multiple formats, multiple generation methods, multiple content structures, and multiple languages. The content awareness module receives the document to be identified uploaded by the user, splits the document to be identified into multiple pages according to page numbers, and analyzes each page of the document to be identified through each detection unit to determine the multi-dimensional feature vector of each page.
[0084] The format recognition and basic attribute analysis unit analyzes the format of the document to be recognized, determines the format features of the document to be recognized (also known as format characteristics), and obtains metadata such as the size and number of pages of the document to be recognized.
[0085] The documents to be identified are uniformly converted into PDF format. Each page of the document is analyzed by the content accessibility deep probing unit to determine the quality characteristics of each page. The quality characteristics are used to characterize the readability and / or completeness of each page of the document.
[0086] Each page of the document is rendered as an image. The layout and structural complexity analysis unit uses computer vision (CV) and document layout analysis (DLA) algorithms to analyze the layout structure of each page of the document, determine the layout features of each page of the document, and the layout features are used to characterize the layout complexity of each page of the document.
[0087] The element existence detection unit identifies elements of a preset type contained in each page of the document and determines the element characteristics of each page. Elements may include one or more of the following: tables, formulas, code, images, and charts.
[0088] The content-aware module uses feature extraction units of different dimensions to perform multi-dimensional content perception on the inner pages of the document to be identified, and outputs a structured feature vector or JSON object as a multi-dimensional feature vector for each page of the document.
[0089] S102. Use a preset routing decision model to route multi-dimensional feature vectors and determine the document parsing tool for each page of the document.
[0090] In this embodiment, the preset routing decision model is a pre-trained machine learning model or a routing rule set based on expert experience. The preset routing decision model is used to indicate the document features that multiple document parsing tools are adapted to. By inputting multi-dimensional feature vectors into the preset routing decision model, the preset routing decision model matches the multi-dimensional feature vectors of each page of the document with the document features adapted to multiple document parsing tools to determine the most suitable document parsing tool for each page of the document.
[0091] In some embodiments, if the user inputs a multi-tool parallel command, a preset routing decision model is used to match at least two most suitable document parsing tools for each page of the document, so that each page of the document can be parsed by at least two document parsing tools, thereby selecting the parsing result with better parsing effect, meeting the needs of result comparison or ensuring a higher document parsing success rate.
[0092] For example, document parsing tools include Marker, Docling, and MinerU. Marker is suitable for parsing digital PDFs such as business reports and technical documents. Docling can parse documents in multiple formats and can preserve table structure and reading order, making it suitable for parsing corporate contracts and reports. MinerU can accurately parse text, tables, formulas, and charts, making it suitable for parsing high-precision structured documents such as academic literature and financial statements.
[0093] S103. Statistically analyze the document parsing tools for multi-page documents to be identified, and obtain the parsing page number of at least one document parsing tool.
[0094] In this embodiment, after obtaining the document parsing tool for each page of the document, the document parsing tools for multiple pages of documents are summarized and statistically analyzed to determine the parsing page number of each page of the document using the same document parsing tool, so as to obtain the parsing page number of at least one document parsing tool.
[0095] In some embodiments, by statistically analyzing document parsing tools for multi-page documents, routing decision instructions are generated. A tool adaptation layer is set up between a preset routing decision model and multiple document parsing tools. The routing decision instructions are sent to the tool adaptation layer. The routing decision instructions may include: a list of tool identifiers (selected_tools) of at least one document parsing tool matched by the preset routing decision model for multiple documents, a routing strategy (routing_strategy) of at least one document parsing tool, and parsing parameters (tool_parameters) passed to each document parsing tool.
[0096] The routing strategies include: single-tool routing, multi-tool parallel routing, and hybrid routing. Single-tool routing instructs the entire document to be identified to be parsed using a single document parsing tool, suitable for documents with simple and well-defined features. Multi-tool parallel routing instructs the entire document to be identified to be parsed using at least two document parsing tools, suitable for scenarios requiring result comparison or ensuring a very high success rate. Hybrid routing instructs different document parsing tools to be used for different pages of the document to be identified, clearly demonstrating that different tools can be dynamically assigned according to page range or element type. For example, "use Tool A for pages 1-5, and Tool B for the table on page 6," accurately solving the parsing challenge of mixed documents.
[0097] The parsing parameters may include at least: the parsing page number for each document parsing tool, which indicates the document page number that each document parsing tool needs to parse.
[0098] In some embodiments, the parsing parameters may also include: parsing content type, output format, parsing strategy, etc. The parsing content type may include: whether to extract headers and footers, whether to mark page separators, etc. The output format may include: plain text, HTML format, structured JSON data, etc. The parsing strategy may be automatic, fast, or high resolution, etc.
[0099] It should be noted that the type of parsing parameters is related to the type of document parsing tool. The parsing parameters provided in this embodiment are only an example. These parsing parameters may not be included, and only the page numbers need to be parsed. The document parsing tool will use the default parsing parameters for parsing.
[0100] S104. Based on the parsing page number of each document parsing tool, call each document parsing tool to parse the document corresponding to the parsing page number and obtain the partial parsing result.
[0101] In this embodiment, a call request (callTool) is sent to each document parsing tool. The call request (callTool) contains the parsing page number. After receiving the parsing page number, each document parsing tool loads the page document corresponding to the parsing page number in the document to be identified, parses the page document corresponding to the parsing page number, and obtains the partial parsing result of each page document.
[0102] S105. Integrate the local parsing results of at least one document parsing tool to generate the target parsing result of the document to be identified.
[0103] In this embodiment, the result integration module integrates the local parsing results of at least one document parsing tool to obtain the target parsing result, thus completing the parsing of the document to be identified.
[0104] The content-aware and intelligent routing document parsing method provided in the above embodiments determines the multi-dimensional feature vector of each page of the document by performing content awareness on the document to be identified, eliminating the dependence on human experience and solving the problems of low document parsing efficiency and high technical threshold. By routing the multi-dimensional feature vector through a routing decision model, the document parsing tool for each page of the document is determined, so as to accurately match one or more of the most suitable document parsing tools for the document to be identified, ensuring that stable and optimal parsing results can be obtained for any type of document.
[0105] In one possible implementation, Figure 3 is a schematic flowchart of the content-aware process provided in an embodiment of this application. As shown in Figure 3, the process of performing content awareness on the document to be identified and extracting the multi-dimensional feature vector of each page of the document to be identified in S101 may include:
[0106] The format of the document to be identified is determined to identify its format characteristics.
[0107] This step involves format recognition and basic attribute analysis. Specifically, the format recognition and basic attribute analysis unit uses the Magic Number (MN) of the document to identify its true format and determine its format characteristics. Unlike previous methods that relied on file extensions to identify document formats, identifying document formats based on the Magic Number is more accurate.
[0108] Analyze the text content of each page of the document to determine the quality characteristics of each page.
[0109] This step involves in-depth content accessibility probing. Specifically, the documents to be identified are converted to PDF format. The in-depth content accessibility probing unit analyzes each page of the document to determine whether it is a digital PDF or an image PDF, and then determines the quality characteristics of each page based on the PDF type.
[0110] In some embodiments, by parsing the content stream of a PDF document, it is determined whether there are text objects (such as Tj and TJ operators) in the content stream, and thus whether the PDF is a digital PDF or an image PDF. The text of a digital PDF can be extracted directly, while the text of an image PDF needs to be processed by OCR.
[0111] Furthermore, for the document to be identified after being converted into a digital PDF, the completeness or coherence of each page of the document is analyzed by the content accessibility deep probing unit, and the quality characteristics of each page of the document are determined based on the completeness or coherence of each page of the document combined with the PDF type.
[0112] Analyze the layout, semantic regions, and / or language distribution of each page of the document to determine the layout and / or layout complexity of each page. The layout features include layout and / or layout complexity.
[0113] This step involves analyzing the layout and structural complexity. Specifically, after rendering each page of the document as an image, the layout of each page is identified, different semantic regions are segmented and labeled, and / or the language distribution of each page is identified to determine the language mixing ratio. Based on the layout, the number of semantic regions, nesting relationships, and / or language distribution, the layout complexity is calculated, and the layout features of each page are composed of the layout and / or layout complexity.
[0114] In some embodiments, clustering algorithms are used to analyze the bounding boxes of text lines to determine whether each page of the document is a single-column flow layout, a multi-column layout (such as an academic paper), an irregular layout (such as a promotional poster), or a table-dense layout.
[0115] In some embodiments, semantic segmentation is performed on each page of the document to determine the semantic regions of each page. The semantic regions may include headings, body paragraphs, lists, headers, footers, annotations, etc.
[0116] In some embodiments, the proportions of Chinese, English, and other foreign languages in each page of the document are statistically analyzed to determine the language distribution of each page of the document.
[0117] By using layout and structural complexity units, the layout complexity of each page of a document is transformed from a vague concept into a quantifiable routing feature. For example, documents identified as "highly complex, multi-column, containing a large number of floating texts, and a mixture of Chinese, English and other minor languages" will be routed to document parsing tools with excellent layout response capabilities, such as Marker. Documents identified as "simple single-column" will be routed to lighter and faster tools.
[0118] Multiple element detectors are used to identify multiple elements in each page of the document, and to determine the element type features, element density features and / or element complexity features of each page of the document. The element features include: element type features, element density features and / or element complexity features.
[0119] This step involves the detection of the existence of specific elements. Specifically, multiple lightweight element detectors are run in parallel to scan the content of each page of the document to identify whether the corresponding elements exist, their density, and complexity. The identification results of multiple element detectors are statistically analyzed to determine the element type characteristics, element density characteristics, and / or element complexity characteristics of each page of the document.
[0120] In some embodiments, the multiple element detectors include: a table detector, a formula detector, a code detector, and a chart / graph detector.
[0121] The table detector uses heuristic rules (such as finding wireframe structures similar to tables) or lightweight neural network models to detect table areas in each page of a document and evaluate the complexity of the tables, such as nested tables and borderless tables.
[0122] The formula detector identifies paragraphs containing special symbols such as ∑, ∫, fractions, and square roots, or uses a pre-trained mathematical model to detect display equations and inline equations.
[0123] Code detectors identify code snippets by analyzing code-specific formatting, such as monospace fonts, indentation patterns, and keywords.
[0124] The image / chart detector identifies non-photograph types such as diagrams, flowcharts, and charts, which contain key information that needs to be extracted by OCR.
[0125] For example, through element detection, the preset routing decision model can not only know that "the document contains tables", but also that "the tables are mainly concentrated on pages 5-7 and have a complex structure", thus it may make a hybrid routing decision such as "routing the entire document to tool A, but additionally routing pages 5-7 to tool B, which specializes in table processing".
[0126] The above analysis results are summarized and integrated to form a unified, structured, multi-dimensional feature vector report, usually in JSON format. This report comprehensively describes the various features of the multi-page document to be identified.
[0127] In one possible implementation, as shown in Figure 3, the process of analyzing the text content of each page of the document and determining the quality characteristics of each page may include:
[0128] The character garbled rate of each page of the document is determined based on the proportion of abnormal text in the text content of each page.
[0129] Perform coherence analysis on the text content of each page of the document to determine the coherence parameters for each page.
[0130] The clarity and / or font style of each page of the document are identified separately to determine the clarity parameters and / or font style information of each page.
[0131] Quality characteristics include: character garbled rate, coherence parameter, clarity parameter, and / or font style information.
[0132] In this embodiment, for digital PDFs, the proportion of abnormal text is determined by extracting regular text and abnormal text from the text content of each page of the document, and the character garbled rate of each page of the document is determined based on the proportion of abnormal text.
[0133] In some embodiments, the character garbled rate of each page of a document can be determined based on the proportion of uncommon or garbled characters in the text content of each page.
[0134] For digital PDFs, paragraph coherence parameters for each page of the document are determined by detecting the distribution of periods and line breaks and the semantic coherence of semantic segments.
[0135] The character garbled rate and coherence parameters quantify the reliability of directly extracting text from digital PDF documents. For example, a high garbled rate indicates that although the PDF is a digital PDF, it may use uncommon fonts, resulting in poor direct extraction and requiring routing to a document parsing tool with stronger font processing capabilities.
[0136] For digital PDFs or image PDFs, it can also identify text clarity, assess whether there are light and shadow, distortion or deformation on each page of the document, identify whether the font style of each page of the document is a standard font or handwritten, and generate quality features for each page of the document based on the PDF type, character garbling rate, coherence parameters, clarity parameters and / or font style information.
[0137] Based on the multi-dimensional feature vectors provided by the content awareness module, structured feature vectors are generated.
[0138] For example, the following is how the content-aware module performs content awareness on the document to be identified, generating a structured feature vector:
[0139] {
[0140] "document_id": "doc_12345",
[0141] "page_id": "page_1",
[0142] "basic_attributes": {# Basic attribute analysis unit
[0143] "file_type": "PDF",
[0144] "page_count": 10,
[0145] "is_encrypted": false,
[0146] "file_size_kb": 2048
[0147] },
[0148] "content_accessibility": {#Content accessibility deep detection unit}
[0149] "pdf_type": "digital",
[0150] "text_extraction_quality": {
[0151] "gibberish_score": 0.02,
[0152] "coherence_score": 0.95
[0153] }
[0154] },
[0155] "layout_complexity": {#Layout and structural complexity analysis unit}
[0156] "layout_type": "multi_column",
[0157] "has_floating_elements": true,
[0158] "complexity_score": 0.8
[0159] },
[0160] "element_detection": {# Unit for detecting the existence of specific elements}
[0161] "has_tables": true,
[0162] "table_pages": [5, 6, 7],
[0163] "table_complexity": "high",
[0164] "has_formulas": true,
[0165] "has_code_blocks": false,
[0166] "has_diagrams": true,
[0167] "diagram_pages": [6]
[0168] }
[0169] }
[0170] It should be noted that the structured feature vectors mentioned above are generated by combining the multi-dimensional feature vectors of a multi-page document to produce a feature vector report. Generating multi-dimensional feature vectors for each page of the document separately, or combining the multi-dimensional feature vectors of multiple pages of the document for output, both fall within the protection scope of this solution.
[0171] In one possible implementation, as shown in Figure 3, before performing content awareness on the document to be identified and extracting the multi-dimensional feature vector of each page of the document to be identified in step S101, the method may further include:
[0172] If the document to be identified is an encrypted document, the decryption tool will be invoked to decrypt the document based on the password entered by the user.
[0173] In this embodiment, it is detected whether the document to be identified is an encrypted document. If the document to be identified is an encrypted document, the encryption status is used as the encryption feature of the document to be identified. The preset routing decision module routes the document to be identified to a tool with decryption capability for preprocessing based on the encryption feature. After successful decryption, the content perception module performs content perception on the decrypted document to determine the multi-dimensional feature vector of each page of the document.
[0174] The document parsing method provided in the above embodiments performs lightweight feature analysis on the document to be identified through a content-aware module. Its content-aware overhead is far less than directly calling a heavyweight document recognition tool to identify the entire document, saving a significant amount of unnecessary computation, reducing CPU, GPU, and memory usage, and achieving higher processing throughput and lower unit computational cost. Through comprehensive preprocessing including format parsing, quality analysis, version layout and structure analysis, and element analysis, fuzzy document features are converted into quantifiable, structured, multi-dimensional feature vectors, thereby improving the accuracy of the intelligent routing document parsing tool and enhancing the document parsing effect.
[0175] The following describes the detailed process of intelligent routing decision-making provided in the embodiments of this application.
[0176] The intelligent routing decision module is the "intelligent scheduling hub" of the entire system. Its core responsibility is to mimic the decision-making process of an expert engineer and automatically and intelligently select the best parsing strategy based on the specific circumstances of the document. Intelligent routing decision can be divided into rule engine routing, lightweight machine learning model routing, and large language model agent routing. The specific implementation methods of each type of intelligent routing decision are explained below.
[0177] For rule engine routing, in one possible implementation, the preset routing decision model is: preset decision rules, which predefine document parsing tools corresponding to different feature combinations. The process in S102 above, which uses the preset routing decision model to route multi-dimensional feature vectors and determine the document parsing tool for each page of the document, may include:
[0178] Based on the multi-dimensional feature vectors of each page of the document, the document parsing tool corresponding to the feature combination with the highest matching degree is selected from the preset decision rules.
[0179] In this embodiment, based on the content that multiple document parsing tools are suitable for parsing, feature combinations for each document parsing tool are generated to obtain preset decision rules. The preset decision rules can be decision trees or "if-then" rule sets. Each child node of the decision tree is a feature, the leaf node is a document parsing tool, the condition (if) of the "if-then" is a feature combination, and the result (then) is a document parsing tool.
[0180] Based on the multi-dimensional feature vector of each page of the document, the document parsing tool corresponding to the feature combination with the highest matching degree is determined by matching the features of multiple feature combinations in the preset decision rules.
[0181] In some embodiments, when generating a multi-dimensional feature vector for each page of a document, the content-aware module generates the confidence score of each feature and calculates the confidence score of the matching document parsing tool based on the confidence score of the feature matched in the feature combination with the highest matching degree among the multi-dimensional feature vectors.
[0182] For example, one decision rule is:
[0183] IF (pdf_type == "digital") AND (has_complex_tables == True) AND (layout_complexity == "medium") THEN SELECT docling.
[0184] The multi-dimensional feature vector of a single page of the document to be identified is as follows:
[0185] pdf_type = "digital" (confidence level of 1);
[0186] has_complex_tables = True (confidence level is 0.7);
[0187] layout_complexity = "medium" (confidence level is 0.6).
[0188] If the feature vectors of the three dimensions mentioned above match the decision rules, the confidence of the matching document parsing tool can be determined based on the average or minimum confidence of the feature vectors of the three dimensions. If the feature vectors of the three dimensions only match some of the features in the decision rules, the confidence of the non-matching features is set to 0, and the confidence of the matching document parsing tool is determined based on the average confidence of the feature vectors of the three dimensions.
[0189] For lightweight machine learning model routing, in another possible implementation, the preset routing decision model is a pre-trained classification model. The process in S102 above, which uses the preset routing decision model to route multi-dimensional feature vectors and determine the document parsing tool for each page of the document, may include:
[0190] A classification model is used to identify the multi-dimensional feature vectors of each page of the document, thereby determining the document parsing tool for each page.
[0191] In this embodiment, a pre-trained machine learning model is used as a classification model to identify the multi-dimensional feature vectors of each page of the document, output the probability of multiple document parsing tools matching the multi-dimensional feature vectors, determine the document parsing tool with the highest probability value as the document parsing tool for each page of the document, and use the probability value as the confidence level of the document parsing tool.
[0192] For large language model agent routing, in one possible implementation, if the confidence level of the document parsing tool determined according to the preset decision rule or classification model is lower than a preset threshold, the process of S102 above, which uses the preset routing decision model to route multi-dimensional feature vectors and determine the document parsing tool for each page of document, may further include:
[0193] Based on the description information and multi-dimensional feature vectors of multiple document parsing tools, document parsing prompts are generated; a pre-trained large language model is used to determine the document parsing tool for each page of the document based on the document parsing prompts.
[0194] In this embodiment, the description information of the document parsing tool includes the document parsing tool's strengths, weaknesses, best-suited documents, not-suited documents, and other attribute information, such as output format, recognition speed, and resource usage.
[0195] Based on the description information and multi-dimensional feature vectors from multiple document parsing tools, document parsing prompts are generated. For example, the prompts could be:
[0196] You are the core decision-maker of an intelligent document processing expert system. Your task is to select one or more of the most suitable tools from the following toolkit to process the document based on its characteristics.
[0197] # Tool Library:
[0198] {Dynamically insert JSON descriptions of all tools created in the previous step here}
[0199] # Decision-making process:
[0200] Analyze the document snapshot information provided by the following users.
[0201] Reason based on the strengths and weaknesses of each tool in the tool library.
[0202] Output a JSON object that strictly follows the following format:
[0203] {
[0204] "selected_tools": ["tool_name_1", "tool_name_2", ...], / / Sorted in processing order "reasoning": "For document feature X, tool A is the optimal choice because...; however, for page region Y, tool B is needed to supplement...", / / Clear reasoning chain "confidence": 0.95 / / Confidence in this decision
[0205] }
[0206] # User query (document snapshot information):
[0207] Document type: PDF, 10 pages total
[0208] Pages 1-5: Clear, numeric text, containing a complex table.
[0209] Pages 6-7: Slightly blurry, appears to be a scanned document, containing a chart.
[0210] Pages 8-10: Clear numerical text.
[0211] Among them, the document snapshot information can be a textual description of the multi-dimensional feature vectors of a multi-page document.
[0212] The document parsing prompts are input into a pre-trained Large Language Model (LLM), which acts as an "expert decision-maker" to make decisions on the document parsing tool for multi-page documents to be identified.
[0213] For example, Figure 4 is a schematic diagram of the intelligent routing decision process provided in the embodiment of this application. As shown in Figure 4, preset decision rules or classification models perform parallel judgment on multi-dimensional features, such as judging whether the document to be identified is an image PDF, whether it contains complex tables, whether the layout complexity is greater than a preset complexity threshold, whether it contains mathematical formulas, and whether the text extraction quality is lower than a preset quality threshold, such as excessively high character garbled rate or low coherence. The multi-dimensional features of parallel judgment shown in the figure are only some examples, and the multi-dimensional features of this solution are not limited to these.
[0214] Based on the judgment results of multi-dimensional features, a routing strategy is generated by preset decision rules or classification models. This involves determining the document parsing tool and confidence level for each page of the document, determining whether the confidence level is lower than a preset confidence threshold, and if so, calling a large language model for inference. If the confidence level is higher than the preset confidence threshold, a routing strategy is directly generated and sent to the tool adaptation layer to call the document parsing tool.
[0215] The document parsing method provided in the above embodiments uses a dynamic routing strategy to route parsing tools for multi-page documents to be identified. It avoids using the same tool for every document. For example, for a document where "the first few pages are numeric text, the middle contains complex tables, and the last few pages are scanned images," the system will route it to a tool that can process numeric text (such as Marker) to efficiently process the first few pages. At the same time, it will call a tool that is good at table extraction (such as Docling) to process the table parts, and enable an OCR tool (such as Nougat) for the scanned pages. This ensures that each part of the content is processed by the tool that is best suited for it, ensuring the parsing effect of the document in most scenarios, ensuring the stability and reliability of document parsing, and improving the upper limit of the quality and the lower limit of the stability of the document parsing results.
[0216] The following describes the detailed process of calling the tool with reference to the embodiments.
[0217] In one possible implementation, Figure 5 is a flowchart of the document parsing method provided in this application embodiment. As shown in Figure 5, the process of S104, which calls each document parsing tool to parse the document corresponding to the parsing page number according to the parsing page number of each document parsing tool, and obtaining a local parsing result, may include:
[0218] S201. Establish a connection with the parsing tool server, which integrates multiple document parsing tools.
[0219] S202. Send a parsing request to the parsing tool server. The parsing request includes: the identifier of each document parsing tool and the parsing page number of each document parsing tool, so that the parsing tool server can call the corresponding document parsing tool to parse each page of the document and obtain the partial parsing result.
[0220] S203. Receive the standardized partial parsing results of the multi-page document sent by the parsing tool server.
[0221] In this embodiment, the document parsing client interacts with the document parsing server through a unified interface provided by the document parsing client. For example, Figure 6 is an interaction diagram between the document parsing client and the parsing tool server provided in this embodiment. As shown in Figure 6, the interaction process includes:
[0222] Phase 1: Connection and Initialization: A long connection (Server-Sent Events, SSE) is established between the document parsing client and the parsing tool server.
[0223] Phase 2: Obtain the list of document parsing tools: The document parsing client sends a tool list retrieval request listTools() to the parsing tool server. The parsing tool server returns a list of all available tools registered on the server, such as ["marker_tool", "marker_health_check"].
[0224] Phase 3: Tool Invocation: After receiving the instruction from the preset routing decision model, the document parsing client sends an invocation request (callTool) to the parsing tool server. The callTool request includes the tool name and parsing parameters of the document parsing tool. Upon receiving the invocation request, the parsing tool server performs protocol conversion, converting the parsing parameters and the corresponding page number of the document into native API parameters, and then invokes the corresponding document parsing tool to perform document parsing, awaiting the document parsing tool to return partial parsing results.
[0225] Phase 4: Processing and returning the target parsing results: The parsing tool server standardizes the local parsing results into a unified, structured data format. For example, it converts the local parsing results into a JSON object array containing type and text fields, and then returns the standardized results to the document parsing client through an SSE connection. After receiving the standardized local parsing results, the document parsing client integrates them through the result integration model to generate the target parsing results for the document to be identified.
[0226] The document parsing method provided in the above embodiments can encapsulate any new document parsing tool into a service that conforms to the interface standard through interaction with the parsing tool server. This service can then be called by the document parsing system. The routing decision model only needs to update the capability library of the document parsing tool. The system can smoothly connect to various parsing tools without overall reconstruction, thus maintaining the advanced nature and market competitiveness of the document parsing method in this solution.
[0227] This application integrates and encapsulates content-aware modules, diverse document parsing tools, intelligent decision-making models, unified interfaces, and results into a unified document parsing system, providing a unified API or service to the outside world. Users can obtain a one-stop document parsing service that is ready to use out of the box, powerful in function, and reliable in results, which greatly promotes the implementation and application of RAG technology in various industries.
[0228] Based on the above embodiments, the advantages of the content-aware and intelligent routing document parsing method provided in this application include:
[0229] 1. Achieved a high degree of automation and intelligence in the document parsing process: The content awareness module automatically extracts document features, replacing the step that originally required manual judgment; the intelligent routing decision module has built-in knowledge about the capabilities of various tools, replacing the "tool selection" decision-making process that originally required human experts; the user operation is simplified to the single action of "uploading the document," and all subsequent complex judgment, decision-making, and execution processes are automatically completed by the system. This greatly reduces the technical requirements for operators and saves the previously necessary and expensive expert manpower costs.
[0230] 2. Achieved parsing accuracy and system robustness surpassing any single tool: The system employs a "tailor-made" dynamic routing strategy, supporting hybrid routing (i.e., using different tools for different parts of a document). For hybrid documents, the system routes different parts to the tool most proficient in processing, ensuring that each part is handled by its most suitable tool. Therefore, in most scenarios, the system's overall parsing performance is superior to blindly using any single tool, significantly improving both the upper limit of the final output quality and the lower limit of stability.
[0231] 3. Significantly optimized computing resource utilization: By using lightweight feature analysis for prediction and routing decisions, the system avoids the waste of resources that would otherwise be caused by indiscriminately running all heavy-duty tools. The system only calls the necessary tools, or even only specific tools for the necessary parts of the document, saving a lot of unnecessary computation, reducing CPU, GPU, and memory usage, and directly shortening the end-to-end time of document processing.
[0232] 4. High scalability and ecosystem adaptability: Through a unified interface specification in the tool adaptation layer, the core logic of "routing decision" is decoupled from the "specific tool implementation." Any new parsing tool, as long as it is encapsulated according to the specification, can be immediately integrated and invoked by the system. The system can smoothly integrate with more advanced parsing tools that emerge in the future without undergoing a complete overhaul, thus continuously maintaining its technological leadership.
[0233] 5. Provides a one-stop solution: It integrates diverse tools, intelligent decision-making capabilities, unified interfaces, and results into a single system, providing a unified API or service to the outside world. Users receive a powerful, reliable, and ready-to-use one-stop document parsing service, directly addressing core industry pain points such as "complexity in tool selection," "unpredictable processing results," and "lack of one-stop solutions."
[0234] The following describes the embodiments of the device provided in this application.
[0235] Based on the above method embodiments, this application also provides a content-aware and intelligent routing document parsing device. Figure 7 is a schematic diagram of the structure of the document parsing device provided in this application embodiment. As shown in Figure 7, the device may include:
[0236] The content-aware module 301 is used to perform content awareness on the document to be identified and extract multi-dimensional feature vectors of each page of the document to be identified. The multi-dimensional feature vectors include at least: the format features of the document to be identified, the quality features of each page of the document, the layout features of each page of the document, and / or the element features of each page of the document.
[0237] The intelligent routing module 302 is used to route multi-dimensional feature vectors using a preset routing decision model to determine the document parsing tool for each page of the document;
[0238] The tool statistics module 303 is used to perform statistics on document parsing tools for multi-page documents to be identified, and to obtain the parsing page number of at least one document parsing tool;
[0239] The document parsing module 304 is used to call each document parsing tool to parse the document corresponding to the parsing page number based on the parsing page number of each document parsing tool, and obtain the parsing result;
[0240] The result integration module 305 is used to integrate the parsing results of at least one document parsing tool to generate a target parsing document of the document to be identified.
[0241] Optionally, the content-aware module 301 is specifically used to identify the format of the document to be identified and determine the format features of the document to be identified; analyze the text content of each page of the document and determine the quality features of each page of the document; analyze the layout, semantic region and / or language distribution of each page of the document and determine the layout and / or layout complexity of each page of the document, the layout features including: layout and / or layout complexity; and use multiple element detectors to identify multiple elements in each page of the document and determine the element type features, element density features and / or element complexity features of each page of the document, the element features including: element type features, element density features and / or element complexity features.
[0242] Optionally, the content-aware module 301 is specifically used to determine the character garbled rate of each page of the document based on the proportion of abnormal text in the text content of each page; and / or to perform coherence analysis on the text content of each page of the document to determine the coherence parameters of each page of the document; and / or to identify the clarity and / or font style of each page of the document to determine the clarity parameters and / or font style information of each page of the document; the quality features include: character garbled rate, coherence parameters, clarity parameters and / or font style information.
[0243] Optionally, the preset routing decision model is: preset decision rules, which predefine document parsing tools corresponding to different feature combinations. The intelligent routing module 302 is specifically used to select the document parsing tool corresponding to the feature combination with the highest matching degree from the preset decision rules based on the multi-dimensional feature vector of each page of the document.
[0244] Optionally, the preset routing decision model is a pre-trained classification model, and the intelligent routing module 302 is specifically used to identify the multi-dimensional feature vector of each page of the document using the classification model, and determine the document parsing tool for each page of the document.
[0245] Optionally, if the confidence level of the document parsing tool determined according to the preset decision rules or classification model is lower than the preset threshold, the intelligent routing module 302 is also used to generate document parsing prompt words based on the description information and multi-dimensional feature vectors of multiple document parsing tools; and to use a pre-trained large language model to determine the document parsing tool for each page of the document based on the document parsing prompt words.
[0246] Optionally, the document parsing module 304 is specifically used to establish a connection with the parsing tool server, which integrates multiple document parsing tools; send a parsing request to the parsing tool server, the parsing request including: the identifier of each document parsing tool and the parsing page number of each document parsing tool, so that the parsing tool server calls the corresponding document parsing tool to parse each page of the document and obtain a partial parsing result; and receive the standardized partial parsing result of the multi-page document sent by the parsing tool server.
[0247] The above-described device is used to execute the method provided in the foregoing embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.
[0248] These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more microprocessors, or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a system-on-a-chip (SOC).
[0249] The following describes the device embodiments provided in this application.
[0250] Figure 8 is a schematic diagram of an electronic device provided in an embodiment of this application. As shown in Figure 8, the electronic device 400 includes a processor 401, a storage medium 402, and a bus. The storage medium 402 stores program instructions executable by the processor 401. When the electronic device 400 is running, the processor 401 communicates with the storage medium 402 via the bus, and the processor 401 executes the program instructions to perform the above-described method embodiment. The specific implementation and technical effects are similar and will not be described in detail here.
[0251] Optionally, this application also provides a computer-readable storage medium storing a computer program, which is executed by a processor to perform the above-described method embodiments.
[0252] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0253] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0254] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.
[0255] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0256] 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.
Claims
1. A document parsing method with content awareness and intelligent routing, characterized in that, The method includes: performing content perception on the document to be identified, extracting multi-dimensional feature vectors for each page of the document to be identified, and generating a confidence score for each feature. The multi-dimensional feature vectors include at least: format features of the document to be identified, quality features of each page of the document, layout features of each page of the document, and / or element features of each page of the document; routing the multi-dimensional feature vectors using a preset routing decision model to determine the document parsing tool for each page of the document; statistically analyzing the document parsing tools for the multi-page documents of the document to be identified to obtain the parsing page number of at least one document parsing tool; calling each document parsing tool to parse the document corresponding to the parsing page number based on the parsing page number of each document parsing tool to obtain a local parsing result; integrating the local parsing results of the at least one document parsing tool to generate the target parsing result of the document to be identified; the step of routing the multi-dimensional feature vectors using a preset routing decision model to determine the document parsing tool for each page of the document includes: if the preset routing decision model is a preset decision rule, the preset decision rule predefines the document parsing tools corresponding to different feature combinations, and based on each page of the document... The document parsing tool is selected from the multi-dimensional feature vectors of the preset decision rules, based on the feature combination with the highest matching degree. The confidence of the matched document parsing tool is calculated based on the confidence of the features matched between the multi-dimensional feature vectors and the feature combination with the highest matching degree. Alternatively, if the preset routing decision model is a pre-trained classification model, the classification model is used to identify the multi-dimensional feature vectors of each page of the document, outputting the probability of multiple document parsing tools matching the multi-dimensional feature vectors. The document parsing tool with the highest probability value is determined, and this probability value is used as the confidence of the document parsing tool. If the confidence of the document parsing tool determined according to the preset decision rules or the classification model is higher than a preset threshold, the document parsing tool determined according to the preset decision rules or the classification model is determined as the document parsing tool for each page of the document. If the confidence of the document parsing tool determined according to the preset decision rules or the classification model is lower than a preset threshold, document parsing prompts are generated based on the description information of multiple document parsing tools and the multi-dimensional feature vectors. A pre-trained large language model is used to determine the document parsing tool for each page of the document based on the document parsing prompts.
2. The method as described in claim 1, characterized in that, The content perception process for the document to be identified, which extracts multi-dimensional feature vectors for each page of the document to be identified, includes: identifying the format of the document to be identified and determining its format features; analyzing the text content of each page of the document and determining its quality features; analyzing the layout, semantic regions, and / or language distribution of each page of the document and determining its layout and / or layout complexity, wherein the layout features include the layout and / or layout complexity; and using multiple element detectors to identify multiple elements in each page of the document and determining its element type features, element density features, and / or element complexity features, wherein the element features include the element type features, the element density features, and / or the element complexity features.
3. The method as described in claim 2, characterized in that, The step of analyzing the text content of each page of the document to determine the quality characteristics of each page includes: determining the character garbled rate of each page of the document based on the proportion of abnormal text in the text content of each page of the document; and / or, performing coherence analysis on the text content of each page of the document to determine the coherence parameter of each page of the document; and / or, identifying the clarity and / or font style of each page of the document to determine the clarity parameter and / or font style information of each page of the document; the quality characteristics include: the character garbled rate, the coherence parameter, the clarity parameter, and / or the font style information.
4. The method as described in claim 1, characterized in that, The step of calling each document parsing tool to parse the document corresponding to the parsing page number based on the parsing page number of each document parsing tool, and obtaining a partial parsing result, includes: establishing a connection with a parsing tool server, wherein the parsing tool server integrates multiple document parsing tools; sending a parsing request to the parsing tool server, wherein the parsing request includes: the identifier of each document parsing tool and the parsing page number of each document parsing tool, so that the parsing tool server calls the corresponding document parsing tool to parse each page of the document and obtain a partial parsing result; and receiving the standardized partial parsing result of the multi-page document sent by the parsing tool server.
5. A document parsing device with content awareness and intelligent routing, characterized in that, The document parsing method for content awareness and intelligent routing as described in claim 1, the apparatus comprising: a content awareness module, configured to perform content awareness on the document to be identified, extracting multi-dimensional feature vectors for each page of the document to be identified, wherein the multi-dimensional feature vectors include at least: format features of the document to be identified, quality features of each page of the document, layout features of each page of the document, and / or element features of each page of the document; an intelligent routing module, configured to route the multi-dimensional feature vectors using a preset routing decision model to determine the document parsing tool for each page of the document; a tool statistics module, configured to perform statistics on the document parsing tools for the multi-page document of the document to be identified, obtaining the parsing page number of at least one document parsing tool; a document parsing module, configured to call each document parsing tool to parse the document corresponding to the parsing page number according to the parsing page number of each document parsing tool, obtaining a partial parsing result; and a result integration module, configured to integrate the partial parsing results of the at least one document parsing tool to generate a target parsing result for the document to be identified.
6. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the content-aware and intelligent routing document parsing method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, performs the steps of the content-aware and intelligent routing document parsing method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Document analysis method, electronic equipment and storage medium
CN120124621A
Online contract analysis optimization system and method based on multi-modal AI
CN121093944A
Resume information extraction method and device, electronic equipment and storage medium
CN121233543A