Document analysis method and device, computer, storage medium and program product
By splitting and recognizing the layout of PDF documents and dynamically selecting text or image parsing models, the high cost and low efficiency problems in PDF document parsing are solved, achieving a high-efficiency balance in document parsing.
Patent Information
- Application Number
- CN202511285087.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-09
- Publication Date
- 2025-12-16
AI Technical Summary
Existing technologies suffer from high costs and low efficiency in PDF document parsing, especially when processing simple documents, where there is redundant computing power, while complex documents are parsed slowly, failing to meet high real-time requirements.
By splitting the document data to be parsed, identifying the document format type, and selecting either a text parsing or image parsing model based on the type, the optimal parsing method is dynamically selected.
It achieves efficient and low-cost parsing across different document types, balancing cost-effectiveness and performance in document parsing and improving overall parsing efficiency.
Smart Images

Figure CN121145841A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, and in particular to a document analysis method and device, a computer, a storage medium, and a program product. BACKGROUND
[0002] With the rapid development of artificial intelligence (AI) technology, document analysis has become one of the core requirements of digital applications, especially Portable Document Format (pdf) document analysis. Institutions (such as the legal industry and research institutions) need to process a large number of pdf documents such as contracts or academic papers and obtain the required data from them. At this time, the pdf documents need to be analyzed. Currently, AI-driven algorithm analysis is generally used to analyze the content of pdf documents, and this analysis method relies on Graphics Processing Unit (GPU) computing power, which has high one-time analysis cost and slow response speed, and cannot meet the high real-time requirements (such as online document analysis). For simple pdf documents (such as pure text pages), the computing power is redundant, resulting in poor document analysis performance (such as low efficiency). SUMMARY
[0003] The embodiments of the present application provide a document analysis method, device, computer, storage medium, and program product, which can improve the efficiency of document analysis.
[0004] The embodiments of the present application provide a document analysis method, device, computer, storage medium, and program product, which can improve the efficiency of document analysis. The method comprises the following steps: If the document format type of the to-be-analyzed document page is a first format type, the to-be-analyzed document page is subjected to text analysis to obtain an analyzed document page corresponding to the to-be-analyzed document page; the first format type is used to indicate that the document is composed of text data or first type data, and the first type data includes text data and image data irrelevant to the semantic of the document. If the document format type of the to-be-analyzed document page is a second format type, the to-be-analyzed document page is subjected to content recognition by using an image analysis model to obtain an analyzed document page corresponding to the to-be-analyzed document page; the second format type is a document format type other than the first format type.
[0005] The embodiments of the present application provide a document analysis device, which comprises: The layout analysis module is configured to split the to-be-analyzed document data to obtain N document data pages, and perform layout analysis on the to-be-analyzed document pages to obtain a document layout type of the to-be-analyzed document pages; the to-be-analyzed document pages are any document data pages in the N document data pages, and N is an integer greater than 1; The document analysis module is configured to, if the document layout type of the to-be-analyzed document page is a first layout type, perform text analysis on the to-be-analyzed document page to obtain an analyzed document page corresponding to the to-be-analyzed document page; the first layout type is used to indicate that the document is composed of text data or first type data, and the first type data includes text data and image data irrelevant to semantics of the document; The document analysis module is further configured to, if the document layout type of the to-be-analyzed document page is a second layout type, perform content recognition on the to-be-analyzed document page by using an image analysis model to obtain an analyzed document page corresponding to the to-be-analyzed document page; the second layout type is a document layout type other than the first layout type.
[0006] In the process of performing layout analysis on the to-be-analyzed document page to obtain the document layout type of the to-be-analyzed document page, the layout analysis module can be configured to: perform layout analysis on the to-be-analyzed document page by using a document classification model to obtain M data formats corresponding to the to-be-analyzed document page and data position information of each data format in the to-be-analyzed document page; M is a positive integer; if there is a first data format in the M data formats, determine that the document layout type of the to-be-analyzed document page is the second layout type; the second data format includes a text data format and a first type image format, and the first data format is a data format other than the second data format; the first type image format refers to an image format of data irrelevant to semantics between a document and the document; if the M data formats do not include the first data format, determine that the document layout type of the to-be-analyzed document page is the first layout type.
[0007] In the process of, if the document layout type of the to-be-analyzed document page is the second layout type, performing content recognition on the to-be-analyzed document page by using an image analysis model to obtain an analyzed document page corresponding to the to-be-analyzed document page, the document analysis module can be configured to: if the document layout type of the to-be-analyzed document page is the second layout type, divide the to-be-analyzed document page into H document subgraphs based on the data position information of the M data formats in the to-be-analyzed document page; H is a positive integer greater than or equal to M; determine image analysis models corresponding to the H document subgraphs based on data formats corresponding to the H document subgraphs; perform content recognition on the H document subgraphs by using the image analysis models corresponding to the H document subgraphs to obtain subgraph analysis data corresponding to the H document subgraphs. According to the data position information of the H document subgraphs in the to-be-parsed document page, the subgraph parsing data corresponding to the H document subgraphs is arranged respectively to obtain a parsed document page corresponding to the to-be-parsed document page.
[0008] In the process of layout analysis of the to-be-parsed document page to obtain the document layout type of the to-be-parsed document page, the layout analysis module can be used for: Converting the format of the to-be-parsed document page to obtain a document page image in an image format; Performing layout analysis on the document page image to obtain the document layout type of the to-be-parsed document page.
[0009] The layout analysis module can be used for: Splitting the to-be-parsed document data to obtain N document data pages that constitute the to-be-parsed document data, and determining each of the N document data pages as a to-be-parsed document page; Respectively constructing a document parsing unit for each of the N to-be-parsed document pages, and performing parallel layout analysis on the N to-be-parsed document pages by using the document parsing units corresponding to the N to-be-parsed document pages respectively to obtain document layout types corresponding to the N to-be-parsed document pages respectively.
[0010] The number of image analysis models is A, and A is a positive integer; the A image analysis models include a main image analysis model and A-1 auxiliary image analysis models; When the document layout type of the to-be-parsed document page is the second layout type, the document parsing module can be used for: When the document layout type of the to-be-parsed document page is the second layout type, the main image analysis model is used to identify the content of the to-be-parsed document page to obtain a preliminary parsed page; Performing content quality detection on the preliminary parsed page to obtain a quality detection result for the preliminary parsed page; If the quality detection result is a detection pass result, the preliminary parsed page is determined as the parsed document page corresponding to the to-be-parsed document page; If the quality detection result is a detection failure result, a quality abnormal area in the preliminary parsed page is obtained, a target auxiliary image analysis model corresponding to the quality abnormal area is obtained from the A-1 auxiliary image analysis models, the target auxiliary image analysis model is used to optimize the content of the quality abnormal area to obtain document optimization data, and the initial parsed page is optimized by using the document optimization data to obtain the parsed document page corresponding to the to-be-parsed document page.
[0011] The device further includes: The sample processing module is configured to acquire model detection image samples, perform content recognition on the model detection image samples respectively by using A image analysis models, and obtain sample analysis data; The quality detection module is configured to perform content quality detection on the sample analysis data respectively corresponding to the A image analysis models, and obtain model quality respectively corresponding to the A image analysis models. The model processing module is configured to determine, as a main image analysis model, an image analysis model with the maximum model quality among the A image analysis models, and determine, as auxiliary image analysis models, image analysis models other than the main image analysis model among the A image analysis models.
[0012] The device further includes: The format acquisition module is configured to acquire M data formats corresponding to the document page to be analyzed; M is a positive integer. The model selection module is configured to determine, as a main image analysis model, an image analysis model from the A image analysis models based on the distribution of data contents respectively associated with the M data formats in the document page to be analyzed. The model selection module is further configured to determine, as auxiliary image analysis models, image analysis models other than the main image analysis model among the image analysis models.
[0013] When the document page to be analyzed is of the first document format type, the document analysis module can be configured to: When the document page to be analyzed is of the first document format type, perform text analysis on the document page to be analyzed to obtain analyzed text data corresponding to the document page to be analyzed. When the document page to be analyzed includes a semantic-independent region in the first image format, the semantic-independent region in the document page to be analyzed is intercepted to obtain a semantic-independent image. The region position of the semantic-independent region in the document page to be analyzed is acquired, and the analyzed text data and the semantic-independent image are combined to form an analyzed document page corresponding to the document page to be analyzed based on the region position.
[0014] When the document page to be analyzed is of the second document format type, the document analysis module can be configured to: When the document page to be analyzed is of the second document format type, perform content recognition on the document page to be analyzed by using the image analysis model to obtain preliminary analysis data. The number of requested columns is acquired, and the number of document columns of the document page to be analyzed is acquired. If the number of document columns is the same as the number of requested columns, the preliminary analysis data is determined as the analyzed document page corresponding to the to-be-analyzed document page; If the number of document columns is different from the number of requested columns, the document column function is called based on the number of requested columns, and the preliminary analysis data is subjected to column rearrangement processing to obtain the analyzed document page. The number of columns of the analyzed document page is the number of requested columns.
[0015] The apparatus further includes: The permission detection module is configured to, in response to a document analysis request for the to-be-analyzed document data, detect a document analysis permission of a business object initiating the document analysis request. The analysis triggering module is configured to, if the business object has the document analysis permission, perform a process of splitting the to-be-analyzed document data to obtain N document data pages. The document detection module is configured to, if the business object does not have the document analysis permission, perform editable format conversion on the to-be-analyzed document data to obtain first document data, perform exception detection on the first document data to obtain exception data in the first document data, and send the first document data and the exception data to the business object.
[0016] The embodiment of the present application provides a computer device, including a processor, a memory, and an input / output interface. The processor is connected with the memory and the input / output interface, respectively. The input / output interface is configured to receive and output data. The memory is configured to store a computer program. The processor is configured to call the computer program, so that the computer device including the processor executes the document analysis method in the embodiment of the present application.
[0017] The embodiment of the present application provides a computer readable storage medium, which stores a computer program. The computer program is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the document analysis method in the embodiment of the present application.
[0018] The embodiment of the present application provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium. The processor executes the computer instructions, so that the computer device executes the method provided in various optional manners in the embodiment of the present application. In other words, the computer instructions are executed by the processor to implement the method provided in various optional manners in the embodiment of the present application.
[0019] The embodiment of the present application has the following beneficial effects: In the embodiment of the present application, the to-be-parsed document data is split to obtain N document data pages, the layout of the to-be-parsed document page is parsed to obtain the document layout type of the to-be-parsed document page, the to-be-parsed document page is any document data page in the N document data pages, and N is an integer greater than 1; if the document layout type of the to-be-parsed document page is a first layout type, the to-be-parsed document page is text parsed to obtain the parsed document page corresponding to the to-be-parsed document page; the first layout type is used to indicate that the document is composed of text data or first type data, and the first type data includes text data and image data irrelevant to the document semantics; if the document layout type of the to-be-parsed document page is a second layout type, the content of the to-be-parsed document page is identified by using an image parsing model to obtain the parsed document page corresponding to the to-be-parsed document page; and the second layout type is a document layout type other than the first layout type. In this way, when the document data to be parsed is parsed, the document parsing method can be intelligently selected based on the document layout type of the to-be-parsed document page that constitutes the to-be-parsed document data, the to-be-parsed document page is parsed, the content in the to-be-parsed document page is relatively simple (i.e., the first layout type), the text parsing method with high efficiency and low cost is used for document parsing, the content in the to-be-parsed document page is relatively complex (i.e., the second layout type), and the image parsing model with high precision is used for document parsing, thereby realizing adaptive parsing processing of the to-be-parsed document data, realizing dynamic selection of the optimal document parsing method, and balancing the cost efficiency and performance of document parsing, thereby improving the overall parsing efficiency of the document data. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0021] Figure 1 is a network interaction architecture diagram of a document parsing provided by an embodiment of the present application; Figure 2 is a document parsing scene schematic diagram provided by an embodiment of the present application; Figure 3 is another document parsing scene schematic diagram provided by an embodiment of the present application; Figure 4 is a method flowchart of a document parsing provided by an embodiment of the present application; Figure 5 is a document parallel processing scene schematic diagram provided by an embodiment of the present application; Figure 6is a method flowchart for document analysis provided by an embodiment of the present application; Figure 7 is a multi-page analysis scenario diagram provided by an embodiment of the present application; Figure 8 is a system architecture diagram for document analysis provided by an embodiment of the present application; Figure 9 is a device diagram for document analysis provided by an embodiment of the present application; Figure 10 is a structural diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0022] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0023] In the present application, the data involved in the present application will comply with the relevant provisions of laws and regulations when acquired or used.
[0024] In the embodiments of the present application, please refer to Figure 1 , Figure 1 is a network interaction architecture diagram for document analysis provided by an embodiment of the present application, as shown in Figure 1 The computer device 101 can determine a document analysis method for performing document analysis on each document data page based on the document layout type of each document data page included in the to-be-analyzed document data, perform document analysis on each document data page by using the document analysis method corresponding to the document data page, obtain the analyzed document page corresponding to each document data page, combine the analyzed document pages corresponding to each document data page respectively, obtain the target document data corresponding to the to-be-analyzed document data, and realize dynamic analysis of the document data, thereby improving the flexibility and performance of document analysis. The document analysis request can be triggered by the computer device 101 or sent by any business device (such as the business device 102a, the business device 102b, or the business device 102c), which is not limited herein. For example, the computer device 101 receives the to-be-analyzed document data sent by the business device 102a, performs document analysis on the to-be-analyzed document data, obtains the target document data, and sends the target document data to the business device 102a.
[0025] Specifically, please refer to Figure 2 , Figure 2is a document parsing scene schematic diagram provided by an embodiment of the present application. As shown in Figure 2 The computer device can split the to-be-parsed document data 201 to obtain N document data pages 202, such as a document data page 2021 and a document data page 2022, N being an integer greater than 1; perform layout analysis on a to-be-parsed document page 203 to obtain a document layout type of the to-be-parsed document page 203, the to-be-parsed document page 203 being any document data page in the N document data pages 202. If the document layout type of the to-be-parsed document page 203 is a first layout type, perform text analysis on the to-be-parsed document page 203 to obtain a parsed document page 205 corresponding to the to-be-parsed document page 203, the first layout type being used to indicate that the document is composed of text data or first type data, the first type data including text data and image data irrelevant to the semantics of the document, that is, when the document layout type of the to-be-parsed document page 203 is the first layout type, the content of the to-be-parsed document page 203 is relatively simple, and an efficient and low-cost text analysis method (which can be referred to as engineering analysis) can be used for document parsing; if the document layout type of the to-be-parsed document page 203 is a second layout type, use an image analysis model 204 to identify the content of the to-be-parsed document page 203 to obtain the parsed document page 205 corresponding to the to-be-parsed document page 203, the second layout type being a document layout type other than the first layout type, that is, when the document layout type of the to-be-parsed document page 203 is the second layout type, the content of the to-be-parsed document page 203 is relatively complex, and a high-precision image analysis model (which can be referred to as algorithm analysis) can be used for document parsing. Thus, the dynamic selection of the optimal document parsing method in the document parsing process is realized, the cost efficiency and performance of the document parsing are balanced, and the overall parsing efficiency of the document data can be improved.
[0026] The text analysis can also be referred to as engineering analysis, and the text analysis is a document parsing method based on rules and structured processing, mainly using pure text analysis, and is characterized by high speed and extremely low cost. The document parsing based on the image analysis model can also be referred to as algorithm analysis, which is a deep analysis method relying on an image analysis model and other artificial intelligence technologies, and is characterized by high precision and the ability to process complex layout document data. By identifying the document layout type of the to-be-parsed document page, the to-be-parsed document page is intelligently distributed to engineering analysis or algorithm analysis, an intelligent hybrid document parsing architecture is realized, the optimal document parsing method can be dynamically selected when the document data is parsed, and the cost and performance of the document parsing are balanced.
[0027] By intelligently distributing the to-be-parsed document page for analysis, the document parsing efficiency can be improved, especially when there are many to-be-parsed document pages, the overall efficiency of the document parsing can be greatly improved while the quality of the document parsing is ensured. For example, refer to Figure 3 ,Figure 3 is another document parsing scene schematic diagram provided by an embodiment of the present application. As shown in Figure 3 , the computer device can split the to-be-parsed document data 301 to obtain N document data pages 302, N being an integer greater than 1; the computer device can take the N document data pages as a to-be-parsed document page respectively, and the N to-be-parsed document pages can include to-be-parsed document page 3021, to-be-parsed document page 3022, to-be-parsed document page 3023, and the like. The computer device can obtain a document layout type 1 of the to-be-parsed document page 3021, the document layout type 1 being a first layout type, and then perform text parsing on the to-be-parsed document page 3021 to obtain a parsed document page 1 corresponding to the to-be-parsed document page 3021; obtain a document layout type 2 of the to-be-parsed document page 3022, the document layout type 2 being a second layout type, and then perform content recognition on the to-be-parsed document page 3022 by using an image parsing model 303 to obtain a parsed document page 2 corresponding to the to-be-parsed document page 3022; obtain a document layout type 3 of the to-be-parsed document page 3023, the document layout type 3 being a second layout type, and then perform content recognition on the to-be-parsed document page 3023 by using the image parsing model 303 to obtain a parsed document page 3 corresponding to the to-be-parsed document page 3023; and the like. The N to-be-parsed document pages corresponding to the parsed document pages are combined to obtain target document data 304 corresponding to the to-be-parsed document data 301. In this way, the dynamic optimal document parsing method selection and parsing of each document data page constituting the document data can be realized, and the parsing efficiency of the document data can be improved while ensuring the parsing quality of the document data.
[0028] It can be understood that the business device mentioned in the embodiments of the present application can also be considered as a computer device, and the computer device in the embodiments of the present application includes but is not limited to a terminal device or a server. In other words, the computer device can be a server or a terminal device, or a system composed of a server and a terminal device. Among them, the terminal device mentioned above can be an electronic device, including but not limited to a mobile phone, a tablet computer, a desktop computer, a notebook computer, a palm computer, a vehicle-mounted device, an augmented reality / virtual reality (Augmented Reality / Virtual Reality, AR / VR) device, a head-mounted display, a smart television, a wearable device, a smart speaker, a digital camera, a camera, and other mobile internet devices (mobile internet device, MID) with network access capability, or terminal devices in scenes such as trains, ships, and flights, and the like. As shown in Figure 1 , the terminal device can be a notebook computer (as shown by the business device 102b), a mobile phone (as shown by the business device 102c), or a vehicle-mounted device (as shown by the business device 102a), and the like, Figure 1The business device 102a is, for example only, a device located in the vehicle 103, and can be used to parse or display the document data 1021. The server mentioned above can be a standalone physical server, a server cluster composed of multiple physical servers, or a distributed system, and can also be a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, vehicle-road cooperation, content delivery networks (CDN), and big data and artificial intelligence platforms, etc. basic cloud computing services.
[0029] Optionally, the data involved in the embodiments of the present application can be stored in a computer device, or can be stored based on cloud storage technology or a blockchain network, which is not limited here.
[0030] Further, please refer to Figure 4 , Figure 4 is a method flowchart for document parsing provided by the embodiments of the present application. As Figure 4 shown, the document parsing process includes the following steps: Step S401, splitting the to-be-parsed document data to obtain N document data pages, and performing layout analysis on the to-be-parsed document page to obtain the document layout type of the to-be-parsed document page; the to-be-parsed document page is any document data page in the N document data pages.
[0031] In the embodiments of the present application, the computer device can obtain to-be-parsed document data, split the to-be-parsed document data, and obtain N document data pages that make up the to-be-parsed document data, N being an integer greater than 1. The to-be-parsed document data refers to fixed document data, that is, document data whose content cannot be changed and can be accurately presented across platforms, such as pdf documents, etc. Further, the computer device can perform layout analysis on the to-be-parsed document page to obtain the document layout type of the to-be-parsed document page, and the to-be-parsed document page can be any one of the N document data pages. The document layout type can be used to represent the data composition of the to-be-parsed document page; or the document layout type is used to represent the layout (such as single-column layout or multi-column layout) and data composition (i.e. the format of the data included in the to-be-parsed document page, such as text format, table format, formula format, watermark format, or second type image format, etc.) of the to-be-parsed document page. The second type image format refers to the format of the image involved in the implementation of the content of the document, for example, the format of the drawings in the patent file when the document data is a patent file, or the format of the technical implementation diagram in the scientific research document when the document data is a scientific research document.
[0032] Specifically, the document format type can be used to represent the data composition of the to-be-parsed document page. Specifically, the computer device can perform format analysis on the to-be-parsed document by using a document classification model to obtain M data formats corresponding to the to-be-parsed document page and data location information of each data format in the to-be-parsed document page; M is a positive integer. If the first data format exists in the M data formats, it indicates that the content of the to-be-parsed document page is relatively complex, and the document format type of the to-be-parsed document page can be determined as the second format type. If the first data format is not included in the M data formats, it indicates that the content of the to-be-parsed document page is relatively simple, and the document format type of the to-be-parsed document page can be determined as the first format type. By performing format classification on the to-be-parsed document page according to the data composition of the to-be-parsed document page, the simplicity of the data composition of the to-be-parsed document page is divided, and on this basis, step S402 or step S403 is executed, which can balance the accuracy and efficiency of document parsing and improve the performance of document parsing.
[0033] Alternatively, the document format type is used to represent the layout and data composition of the to-be-parsed document page. Specifically, the computer device can perform format analysis on the to-be-parsed document page by using a document classification model to obtain a document layout corresponding to the to-be-parsed document page, M data formats, and data location information of each data format in the to-be-parsed document page; M is a positive integer. The document layout is used to represent the layout mode of the to-be-parsed document page, which can be single-column layout or multi-column layout. If the first data format exists in the M data formats or the document layout is multi-column layout, it indicates that the content of the to-be-parsed document page is relatively complex, and the document format type of the to-be-parsed document page can be determined as the second format type. If the first data format is not included in the M data formats and the document layout is single-column layout, it indicates that the content of the to-be-parsed document page is relatively simple, and the document format type of the to-be-parsed document page can be determined as the first format type.
[0034] The document classification model can be considered as a multi-modal classification model, which can be used to identify format features (such as single-column, double-column, table, formula, or watermark, etc.) in a document page, and provide a basis for dynamic selection of a document parsing mode. The second data format includes a text data format and a first type image format, and the first data format is a data format other than the second data format. The first type image format refers to an image format of data that is semantically irrelevant to a document. The data semantically irrelevant to the document indicates that in the document page to which the data belongs, the data is retained or deleted, and does not have a great impact on the readability of the document page to which the data belongs. For example, a logo image exists in a document page 1, and the logo image can be considered as semantically irrelevant to the document page 1, that is, the data format of the logo image in the document page 1 is the first type image format.
[0035] The document classification model can be a trained multi-modal classification model, a model adjusted based on the trained multi-modal classification model, or a directly trained model. For example, the computer device can obtain a document data sample and a sample label of the document data sample, perform layout analysis on the document data sample using a first initial classification model to obtain a sample prediction result. The sample prediction result includes a sample data format included in the document data sample and sample position information of the sample data format in the document data sample, or the sample prediction result includes sample document layout of the document data sample, a sample data format included in the document data sample, and sample position information of the sample data format in the document data sample, which is determined by the composition of the document layout type. Further, the computer device can adjust the parameters of the first initial classification model according to the difference between the sample prediction result and the sample label to obtain the document classification model. The document data sample and the sample label of the document data sample can be artificially created, or can be intelligently generated. For example, the computer device can randomly generate a text data sample, generate a sample label and sample element data corresponding to the sample label, insert an editable sample of the sample element data corresponding to the sample label in the text data sample, convert the document format of the editable sample into a document data sample in portable document format. In this way, a document data sample including data of different data formats can be obtained, the sample comprehensiveness of the model training of the first initial classification model is realized, the model quality of the document classification model is improved, for example, inserting a table (i.e., sample element data is a table) in the text data sample can obtain an editable sample with a table as the sample label, inserting a formula (i.e., sample element data is a formula) in the text data sample can obtain an editable sample with a formula as the sample label, inserting a table and a watermark (i.e., sample element data is a table and a watermark) in the text data sample can obtain an editable sample with a table and a watermark as the sample label, etc. The computer device can convert the document format of the generated editable sample into a document data sample in portable document format. The document format of the text data sample can also be converted into a document data sample in portable document format, and the sample label of the document data sample is the first layout type. Optionally, the document data sample or the editable sample can be processed to obtain a multi-column document sample with a sample label including multi-column layout; the multi-column document sample is converted into a document data sample in portable document format.
[0036] Alternatively, the computer device can adopt a layout classification model to perform layout analysis on the to-be-analyzed document page to obtain a document layout type corresponding to the to-be-analyzed document page, where the layout classification model can be considered as a multi-modal binary classification model. The layout classification model can be a multi-modal classification model that has been trained, a model obtained by adjusting a multi-modal classification model that has been trained, or a model directly trained. For example, the computer device can obtain document data samples and sample labels of the document data samples, perform layout analysis on the document data samples by using a second initial classification model to obtain sample layout types, and adjust the second initial classification model according to the sample labels and the sample layout types to obtain the layout classification model. The document data samples and the sample labels of the document data samples can be artificially created, or can be intelligently generated. The process can refer to the generation process of the document data samples described above. In the training process of the layout classification model, the sample labels of the document data samples have two types: a first layout type and a second layout type. For example, the sample labels of the document data samples directly converted from text data samples are the first layout type. The sample labels of the document data samples including sample element data in a first data format, such as a formula format, a watermark format, or a table format, are the second layout type. The sample labels of the document data samples that have been processed by column division are the second layout type, and the like. Details are not described herein again.
[0037] Optionally, the computer device can perform format conversion on the to-be-analyzed document page to obtain a document page image in an image format, perform layout analysis on the document page image to obtain a document layout type of the to-be-analyzed document page, and specifically, a document classification model or a layout classification model can be used to perform layout analysis on the document page image to obtain the document layout type of the to-be-analyzed document page. By performing image conversion on the to-be-analyzed document page, the convenience of document analysis is improved.
[0038] Optionally, the computer device can split the to-be-parsed document data to obtain N document data pages constituting the to-be-parsed document data. Further, the computer device can sequentially determine the N document data pages as to-be-parsed document pages, perform layout parsing on the to-be-parsed document pages to obtain a document layout type of the to-be-parsed document pages, and perform step S402 or step S403 based on the document layout type of the to-be-parsed document pages. That is, the i-th document data page is determined as a to-be-parsed document page, layout parsing is performed on the to-be-parsed document page to obtain a document layout type of the to-be-parsed document page, i is a positive integer less than or equal to N; if the document layout type of the to-be-parsed document page is the first layout type, step S402 is performed; if the document layout type of the to-be-parsed document page is the second layout type, step S403 is performed. If i is N, the parsed document pages corresponding to the N document data pages are combined to obtain target document data corresponding to the to-be-parsed document data; if i is less than N, the i+1-th document data page is determined as a to-be-parsed document page, document parsing is performed on the to-be-parsed document page to obtain a parsed document page corresponding to the i+1-th document data page, until the parsed document pages corresponding to the N document data pages are obtained, and the parsed document pages corresponding to the N document data pages are combined to obtain target document data corresponding to the to-be-parsed document data.
[0039] Alternatively, the computer device can determine the N document data pages as to-be-parsed document pages. A document parsing unit is constructed for each of the N to-be-parsed document pages, and parallel layout parsing is performed on the N to-be-parsed document pages by using the document parsing units corresponding to the N to-be-parsed document pages to obtain document layout types corresponding to the N to-be-parsed document pages. The document parsing unit is a unit component for data processing. When the document parsing unit is constructed for each of the N to-be-parsed document pages, one document parsing unit can be constructed for each of the N to-be-parsed document pages, that is, N document parsing units are constructed, and each document parsing unit is associated with one to-be-parsed document page. Alternatively, the computer device can obtain network resources, construct B document parsing units based on the network resources, and associate the B document parsing units with the N to-be-parsed document pages, B being a positive integer less than or equal to N. In this case, one document parsing unit can be associated with one or more to-be-parsed document pages. The process of performing layout parsing on any to-be-parsed document page can refer to the process of performing layout parsing on the to-be-parsed document page described above, which will not be described herein. By performing parallel processing on the N to-be-parsed document pages constituting the to-be-parsed document data, the parallel document parsing capability can be improved, the throughput can be improved, and the document parsing efficiency can be accelerated.
[0040] For example, the process of performing layout parsing on the to-be-parsed document page can refer to the process of performing layout parsing on the to-be-parsed document page described above, which will not be described herein. Figure 5 , Figure 5 is a document parallel processing scene schematic diagram provided by an embodiment of the present application. As shown in Figure 5As shown, the computer device can acquire N document data pages that make up the document data 501 to be parsed, and identify all N document data pages as document pages to be parsed, such as document page 5021, document page 5022, and document page 5023. Document parsing units are constructed for each of the N document pages to be parsed. It is assumed that one document parsing unit is constructed for each document page to be parsed, such as document parsing unit 5031 for document page 5021, document parsing unit 5032 for document page 5022, and document parsing unit 5033 for document page 5023. The N document parsing units are used to perform image conversion processing on the N document pages to be parsed, obtaining document page images corresponding to the N document pages respectively. For example, document parsing unit 5031 is used for image conversion... Figure 1 1. Processing to obtain the document page image 5041 corresponding to the document page 5021 to be parsed; then, the document parsing unit 5032 is used for conversion. Figure 1 2. Processing yields document page image 5042 corresponding to document page 5022 to be parsed; document parsing unit 5033 is used for conversion. Figure 1 3. Processing yields document page image 5043 corresponding to document page 5023 to be parsed, etc. The computer device can use N document parsing units to perform layout parsing on N document page images, obtaining the document layout types corresponding to the N document pages to be parsed. Among these, the conversion... Figure 1 1. Transfer Figure 1 .2 and transfer Figure 1 The processes described in sections 2.3, 2.1, 2.2, and 2.3 are performed in parallel. The layout parsing processes indicated by labels 2.1, 2.2, and 2.3 are all performed in parallel. The labels (such as 1.1, 1.2, and 1.3, or 2.1, 2.2, and 2.3) are only used to distinguish different processing steps. Parallel processing accelerates the preprocessing steps in document parsing (i.e., the process of obtaining the document layout type), thereby improving document parsing efficiency.
[0041] Furthermore, if the document layout type of the document page to be parsed is the first layout type, then step S402 is executed; if the document layout type of the document page to be parsed is the second layout type, then step S403 is executed.
[0042] Step S402: If the document layout type of the document page to be parsed is the first layout type, then perform text parsing on the document page to be parsed to obtain the parsed document page corresponding to the document page to be parsed.
[0043] In the embodiments of the present application, the first format type is used to indicate that the document is composed of text data or first type data, or the first format type is used to indicate that the layout of the document is single-column layout, and the first format type is also used to indicate that the document is composed of text data or first type data, wherein the first type data includes text data and image data irrelevant to the semantics of the document. That is, the document page of the first format type includes structured content such as pure text or simple subgraphs, or includes single-column pure text or simple subgraphs, and the content is relatively simple and can be directly parsed. Specifically, if the document format type of the to-be-parsed document page is the first format type, text parsing is performed on the to-be-parsed document page to obtain the parsed document page corresponding to the to-be-parsed document page. The text parsing is engineering parsing, which consumes less time and has high processing efficiency.
[0044] Optionally, the text parsing can be pure text parsing, or can include pure text parsing and image interception. Specifically, if the document format type of the to-be-parsed document page is the first format type, text parsing is performed on the to-be-parsed document page to obtain parsed text data corresponding to the to-be-parsed document page. If the to-be-parsed document page includes a semantic irrelevant region in the first type image format, the semantic irrelevant region in the to-be-parsed document page is intercepted to obtain a semantic irrelevant image; the region position of the semantic irrelevant region in the to-be-parsed document page is obtained, and the parsed text data and the semantic irrelevant image are combined based on the region position to form the parsed document page corresponding to the to-be-parsed document page. If the to-be-parsed document page only includes text data, the parsed text data is determined as the parsed document page corresponding to the to-be-parsed document page.
[0045] In step S403, if the document format type of the to-be-parsed document page is the second format type, the image parsing model is used to perform content recognition on the to-be-parsed document page to obtain the parsed document page corresponding to the to-be-parsed document page.
[0046] In the embodiments of the present application, the second format type is a document format type other than the first format type. Optionally, the computer device can use the image parsing model to perform content recognition on the to-be-parsed document page to obtain a content recognition document page corresponding to the to-be-parsed document page. Further, the content recognition document page can be determined as the parsed document page corresponding to the to-be-parsed document page, or the to-be-detected document page can be subjected to image detection, if the to-be-detected document page does not include second type image data, the content recognition document page is determined as the parsed document page corresponding to the to-be-parsed document page, and if the to-be-detected document page includes second type image data, image description information of the second type image data is obtained, and the image description information is added to the content recognition document page to obtain the parsed document page corresponding to the to-be-parsed document page. The second type image data refers to an image in the second type image format.
[0047] Specifically, if the document format type of the to-be-analyzed document page is the second format type, the computer device can use an image analysis model to perform content recognition on the to-be-analyzed document page to obtain a parsed document page corresponding to the to-be-analyzed document page. The image analysis model is a model implemented by artificial intelligence technology. Alternatively, if the document format type of the to-be-analyzed document page is the second format type, the computer device can divide the to-be-analyzed document page into H document subgraphs based on the data location information of M data formats in the to-be-analyzed document page; H is a positive integer greater than or equal to M; and based on the data formats corresponding to the H document subgraphs, determine image analysis models corresponding to the H document subgraphs. The H document subgraphs are subjected to content recognition using the image analysis models corresponding to the H document subgraphs, to obtain subgraph analysis data corresponding to the H document subgraphs. The subgraph analysis data corresponding to the H document subgraphs are arranged according to the data location information of the H document subgraphs in the to-be-analyzed document page, to obtain a parsed document page corresponding to the to-be-analyzed document page.
[0048] Alternatively, the number of image analysis models is A, and A is a positive integer; the A image analysis models include a main image analysis model and A-1 auxiliary image analysis models. Specifically, if the document format type of the to-be-analyzed document page is the second format type, the computer device can use the main image analysis model to perform content recognition on the to-be-analyzed document page to obtain a preliminary parsed page; the preliminary parsed page is subjected to content quality detection to obtain a quality detection result for the preliminary parsed page. If the quality detection result is a detection pass result, the preliminary parsed page is determined as a parsed document page corresponding to the to-be-analyzed document page; if the quality detection result is a detection fail result, a quality abnormal area in the preliminary parsed page is obtained, a target auxiliary image analysis model corresponding to the quality abnormal area is obtained from the A-1 auxiliary image analysis models, the target auxiliary image analysis model is used to perform content optimization on the quality abnormal area to obtain document optimization data, and the initial parsed page is optimized using the document optimization data to obtain a parsed document page corresponding to the to-be-analyzed document page. In obtaining the target auxiliary image analysis model corresponding to the quality abnormal area from the A-1 auxiliary image analysis models, the computer device can obtain a data format corresponding to the quality abnormal area, and determine the auxiliary image analysis model of the data format corresponding to the quality abnormal area as the target auxiliary image analysis model.
[0049] In the determination of the primary and auxiliary image analysis models, the computer device can obtain model detection image samples, use A image analysis models to respectively perform content recognition on the model detection image samples, and obtain sample analysis data. The computer device can perform content quality detection on the sample analysis data respectively corresponding to the A image analysis models, and obtain model quality respectively corresponding to the A image analysis models. The image analysis model with the maximum model quality in the A image analysis models is determined as the primary image analysis model, and the image analysis models other than the primary image analysis model in the A image analysis models are determined as the auxiliary image analysis models.
[0050] Alternatively, the computer device can obtain M data formats corresponding to the document page to be analyzed, where M is a positive integer. Based on the distribution of data content respectively associated with the M data formats in the document page to be analyzed, the computer device can determine the primary image analysis model from the A image analysis models. Specifically, the computer device can determine the primary data format in the document page to be analyzed based on the distribution of data content respectively associated with the M data formats in the document page to be analyzed, where the primary data format refers to the data format with the maximum distribution among the M data formats other than the text format. The image analysis model corresponding to the primary data format is determined as the primary image analysis model. Further, the image analysis models other than the primary image analysis model in the image analysis models can be determined as the auxiliary image analysis models.
[0051] The A image analysis models can include, but are not limited to, Optical Character Recognition (OCR), Multimodal Large Language Model (MLLM), and Vision (such as LayoutLM, PaddleOCR, etc.). LayoutLM (Layout-based Language Model) is a model for document image understanding, and PaddleOCR is an OCR open source tool. Optionally, the A image analysis models and the model information of each image analysis model can be saved, as shown in Table 1: Table 1
[0052] As shown in Table 1, when the layout of the document page to be analyzed is multi-column layout, the OCR can be determined as the primary image analysis model; when the document page to be analyzed includes data of multiple modalities, the MLLM can be determined as the primary image analysis model; when the distribution of image formats in the document page to be analyzed is relatively large, the LayoutLM can be determined as the primary image analysis model, etc. Of course, the data format or layout of the data mainly analyzed by the A image analysis models can be configured by humans, and is not limited herein.
[0053] Alternatively, the image analysis model comprises a first image analysis model and a second image analysis model. Specifically, if the document format type of the to-be-analyzed document page is the second format type, the computer device can use the first image analysis model to perform content recognition on the to-be-analyzed document page to obtain first analysis data, use the second image analysis model to perform content recognition on the to-be-analyzed document page to obtain second analysis data, and combine the first analysis data and the second analysis data to obtain the analyzed document page corresponding to the to-be-analyzed document page. The first image analysis model and the second image analysis model refer to models for recognizing different aspects of content in the to-be-analyzed document page. For example, the first image analysis model is an OCR model, and the second image analysis model is an MLLM model or a Vision model. The computer device can extract text and layout information in the to-be-analyzed document page through the OCR model, perform semantic understanding and structured reconstruction on the to-be-analyzed document page through the MLLM or Vision model, and realize all-around analysis of the to-be-analyzed document page by integrating multiple image analysis models, thereby improving the accuracy of document analysis.
[0054] Optionally, the computer device can also provide a document column function. Specifically, if the document format type of the to-be-analyzed document page is the second format type, the image analysis model is used to perform content recognition on the to-be-analyzed document page to obtain preliminary analysis data. The number of requested columns is obtained, and the number of document columns of the to-be-analyzed document page is obtained. If the number of document columns is the same as the number of requested columns, the preliminary analysis data is determined as the analyzed document page corresponding to the to-be-analyzed document page. If the number of document columns is different from the number of requested columns, the document column function is called based on the number of requested columns to perform column rearrangement processing on the preliminary analysis data to obtain the analyzed document page. The number of columns of the analyzed document page is the number of requested columns.
[0055] Further, when the N document data pages respectively corresponding to the analyzed document pages are obtained, the N document data pages respectively corresponding to the analyzed document pages can be combined to obtain the target document data corresponding to the to-be-analyzed document data. The target document data can be considered as editable document data, and the content is structured data.
[0056] In this embodiment, a hybrid parsing architecture (a dual-path processing architecture combining engineering parsing and algorithmic parsing) is implemented. This architecture dynamically routes data to both the engineering parsing path and the algorithmic parsing path based on the layout type of the document page to be parsed, achieving intelligent routing decisions and a balance between cost and accuracy. This ensures document parsing accuracy while improving overall parsing efficiency. Specifically, when the content of the document page is relatively simple, engineering parsing can be performed directly, reducing parsing costs and improving efficiency. When the content is complex, precise parsing of complex layouts is performed, achieving full-scene coverage and structured output. The algorithmic parsing path handles tasks such as table reconstruction, formula extraction, and image-text association, outputting the parsed document page and ensuring parsing accuracy. By combining engineering parsing and algorithmic parsing, the overall resource consumption of document parsing is reduced, achieving low-cost, high-precision, and high-efficiency parsing of fixed document data. Optionally, when there are N document data pages, parallel parsing of all N pages can be performed to further improve parsing efficiency.
[0057] Further, please see Figure 6 , Figure 6 This is a flowchart of another document parsing method provided in an embodiment of this application. For example... Figure 6 As shown, the document parsing process includes the following steps: Step S601: Split the document data to be parsed to obtain N document data pages.
[0058] In the embodiments of this application, see [reference needed]. Figure 7 , Figure 7 This is a schematic diagram of a multi-page parsing scenario provided in an embodiment of this application, such as... Figure 7 As shown, the computer device can execute step S1, download the document data to be parsed -> step S2, divide the document data into N pages, and determine the N document data pages as the document pages to be parsed sequentially, or determine the N document data pages as the document pages to be parsed simultaneously.
[0059] Step S602: Perform layout parsing on each of the N document data pages to obtain the document layout type corresponding to each of the N document data pages.
[0060] In the embodiments of this application, this process can be referred to Figure 4 The relevant description in step S401. For example... Figure 7As shown, the computer device can perform document parsing on the N document pages to be parsed in step S3, which includes steps S31,..., and step S3N, which can be performed in parallel. Specifically, in step S3, the computer device can perform layout parsing on the N document pages to be parsed respectively to obtain the document layout types corresponding to the N document pages to be parsed respectively, and perform step S603. Wherein, the computer device can perform image conversion processing on the N document pages to be parsed respectively to obtain N document page images; and perform layout parsing on the N document page images respectively by using a layout parsing model to obtain the document layout types corresponding to the N document pages to be parsed respectively, that is, the document layout types corresponding to the N document data pages respectively, wherein the layout parsing model can include a document classification model or a layout classification model.
[0061] In step S603, based on the document layout types corresponding to the N document data pages respectively, the document parsing manner corresponding to the N document data pages respectively is determined, and the N document data pages are parsed by using the document parsing manner corresponding to the N document data pages respectively to obtain the parsed document pages corresponding to the N document data pages respectively.
[0062] In the embodiments of the present application, the process can refer to the related descriptions in steps S402 and S403. Figure 4 The document parsing manner includes engineering parsing and algorithm parsing, the engineering parsing is determined as the document parsing manner of the to-be-parsed document page with the first document layout type, and the algorithm parsing is determined as the document parsing manner of the to-be-parsed document page with the second document layout type. Further, the text of the to-be-parsed document page with the first document layout type is parsed to obtain the parsed document page of the first type to-be-parsed document page, which refers to the to-be-parsed document page with the first document layout type, and the process can refer to step S402; the image parsing model is used to identify the content of the to-be-parsed document page with the second document layout type to obtain the parsed document page of the second type to-be-parsed document page, which refers to the to-be-parsed document page with the second document layout type, and the process can refer to step S403. Through the process, the parsed document pages corresponding to the N document data pages can be obtained.
[0063] In step S604, the parsed document pages corresponding to the N document data pages respectively are combined to form the target document data of the document data to be parsed.
[0064] In the embodiments of the present application, as Figure 7As shown, the computer device can execute step S4 to merge the results. Specifically, the computer device can obtain the page positions of N document data pages in the document data to be parsed, and based on the page positions corresponding to the N document data pages, combine the parsed document pages corresponding to the N document data pages to obtain the target document data corresponding to the document data to be parsed.
[0065] Among them, see Figure 8 , Figure 8 This is a document parsing system architecture diagram provided in an embodiment of this application. For example... Figure 8 As shown, a document parsing system can include a business layer, a parsing access layer, a parsing logic layer, and atomic tools. The business layer can include one or more business modules used to receive document data to be parsed. The parsing access layer is responsible for business access, authentication, frequency control, and providing control policies. The parsing logic layer provides document parsing services, including splitting documents into multiple document data pages, document parsing, and merging results. For a detailed implementation of this parsing logic layer, please refer to [link to documentation]. Figure 4 or Figure 6The related description in the foregoing embodiments can be referred to. For example, the document parsing service can include a portable document format parsing service. The computer device can acquire the to-be-parsed document data by using the document downloading function, split the to-be-parsed document data into N document data pages by using the sub-document splitting function, perform parallel document parsing on the N document data pages by using the concurrent parsing function, and combine the N document data pages corresponding to the parsed document pages to form target document data corresponding to the to-be-parsed document data by using the result combining function. Optionally, the document parsing service can also include an editable document format parsing service, including a document downloading function, a document version format conversion function, a sub-image extraction function, and a text extraction function. The computer device can acquire second document data to be parsed by using the document downloading function. The computer device can convert the second document data into third document data in a default version format by using the version format conversion function. For example, the default version format is “docx”, and the version format of the second document data is “doc”. The version format of the third document data obtained by converting the second document data by using the version format conversion function is “docx”. The computer device can acquire image data included in the second document data by using the sub-image extraction function. The computer device can acquire text data in the second document data by using the text extraction function. Figure 8 The specific implementation of the document parsing system shown in Figure 4 or Figure 6 may be referred to the related description in the foregoing embodiments.
[0066] Optionally, the computer device can also constrain the document parsing process by using the parsing access layer. Specifically, the computer device can detect a document parsing permission of a business object initiating a document parsing request in response to the document parsing request for the to-be-parsed document data. If the business object has the document parsing permission, the process of splitting the to-be-parsed document data to obtain N document data pages is performed. The foregoing embodiments can be referred to. Figure 4 or Figure 6The relevant description is as follows: If the business object does not have document parsing permissions, the computer device can output a document parsing failure message; or, if the business object does not have document parsing permissions, the computer device can perform an editable format conversion on the document data to be parsed, obtaining first document data. Further, the first document data can be sent to the business object, or anomaly detection can be performed on the first document data to obtain abnormal data, and the first document data and abnormal data can be sent to the business object. This editable format conversion can be performed using an open-source format conversion method, which can be considered an existing document parsing method.
[0067] Optionally, the computer device can also provide a control policy, from which the upper limit of the amount of data to be parsed simultaneously can be obtained. Document parsing is performed through frequency control and the upper limit of the data amount. This upper limit of the data amount may include, but is not limited to, an upper limit on the number of documents and an upper limit on the number of pages. For example, if the control policy includes "upper limit of document data amount: 4", then the computer device can parse a maximum of 4 documents simultaneously. When new documents are acquired, they are cached until the parsing of existing documents is completed, at which point the cached new documents are parsed. For example, if the control policy includes "upper limit of page number: 10", then the computer device can perform parallel document parsing on a maximum of 10 document pages simultaneously. That is, it will simultaneously identify 10 document pages out of N document pages as the pages to be parsed, and perform the above-mentioned procedures on these 10 pages. Figure 4 The steps shown result in 10 document pages to be parsed. These 10 document data pages are then designated as document pages to be parsed. Document parsing is performed on these 10 new document pages until N document data pages are obtained, each corresponding to a parsed document page. In simpler terms, the computer device can obtain a page parsing threshold from the control policy. If N is less than or equal to the page parsing threshold, then N document data pages are simultaneously designated as document pages to be parsed, and parsing is performed on these N document pages. Figure 4 Each step in the process yields N document data pages, each corresponding to a parsed document page. These parsed document pages are then combined to form the target document data corresponding to the document data to be parsed. If N is greater than the page parsing threshold, then each time C document data pages out of the N document data pages are identified as the document pages to be parsed, and the process is executed on these C document pages. Figure 4corresponding to the N document data pages, until N document data pages respectively corresponding parsed document pages are obtained, C being a positive integer less than or equal to the page parsing quantity threshold. For example, N is 10, and the page parsing quantity threshold is 4. The computer device can simultaneously determine the first document data page to the fourth document data page as the to-be-parsed document pages, perform the steps shown in FIG. 6 on the four to-be-parsed document pages, to obtain the parsed document pages respectively corresponding to the first document data page to the fourth document data page. Figure 4 corresponding to the N document data pages, until N document data pages respectively corresponding parsed document pages are obtained, C being a positive integer less than or equal to the page parsing quantity threshold. For example, N is 10, and the page parsing quantity threshold is 4. The computer device can simultaneously determine the first document data page to the fourth document data page as the to-be-parsed document pages, perform the steps shown in FIG. 6 on the four to-be-parsed document pages, to obtain the parsed document pages respectively corresponding to the first document data page to the fourth document data page. Figure 4 corresponding to the N document data pages, until N document data pages respectively corresponding parsed document pages are obtained, C being a positive integer less than or equal to the page parsing quantity threshold. For example, N is 10, and the page parsing quantity threshold is 4. The computer device can simultaneously determine the first document data page to the fourth document data page as the to-be-parsed document pages, perform the steps shown in FIG. 6 on the four to-be-parsed document pages, to obtain the parsed document pages respectively corresponding to the first document data page to the fourth document data page. Figure 4 corresponding to the N document data pages, until N document data pages respectively corresponding parsed document pages are obtained, C being a positive integer less than or equal to the page parsing quantity threshold. For example, N is 10, and the page parsing quantity threshold is 4. The computer device can simultaneously determine the first document data page to the fourth document data page as the to-be-parsed document pages, perform the steps shown in FIG. 6 on the four to-be-parsed document pages, to obtain the parsed document pages respectively corresponding to the first document data page to the fourth document data page.
[0068] In the embodiment of the present application, the to-be-parsed document data is split to obtain N document data pages, and the layout of the to-be-parsed document page is parsed to obtain the document layout type of the to-be-parsed document page, the to-be-parsed document page being any document data page in the N document data pages, N being an integer greater than 1; if the document layout type of the to-be-parsed document page is a first layout type, the to-be-parsed document page is parsed for text to obtain the parsed document page corresponding to the to-be-parsed document page; the first layout type is used to indicate that the document is composed of text data or first type data, and the first type data includes text data and image data irrelevant to the semantics of the document; if the document layout type of the to-be-parsed document page is a second layout type, the content of the to-be-parsed document page is identified by using an image parsing model to obtain the parsed document page corresponding to the to-be-parsed document page; the second layout type is a document layout type other than the first layout type. In this way, when the to-be-parsed document data is parsed, the document parsing method can be intelligently selected based on the document layout type of the to-be-parsed document page that constitutes the to-be-parsed document data, the to-be-parsed document page is parsed, the content in the to-be-parsed document page is relatively simple (i.e., the first layout type), the text parsing method with high efficiency and low cost is used for document parsing, the content in the to-be-parsed document page is relatively complex (i.e., the second layout type), and the image parsing model with high precision is used for document parsing, thereby realizing adaptive parsing of the to-be-parsed document data, dynamically selecting the optimal document parsing method, balancing the cost efficiency and performance of document parsing, and improving the overall parsing efficiency of document data.
[0069] When the content of the document page to be parsed is simple, engineering parsing is performed, and the accuracy can reach an effect of greater than 95%; when the content of the document page to be parsed is complex, algorithm parsing is performed, and the accuracy can reach an effect of greater than 99%, achieving precision balance. And the mixed use of engineering parsing and algorithm parsing can reduce the overall parsing cost of the document by 40%-60% compared with the scheme of using AI-driven document parsing. At present, the processing speed of the engineering parsing path is about 50 milliseconds (ms) per page, and the cost is 0.1% of the algorithm parsing. The accuracy of the algorithm parsing path is greater than 95%. Among them, the document parsing experiment on the document data to be parsed can obtain the processing effect shown in Table 2 as follows: Table 2
[0070] As shown in Table 2, the engineering parsing proportion refers to the proportion of the document data page that needs to be parsed by engineering in the document data to be parsed. As can be seen from Table 2, through the mixed document parsing (i.e., the mixed use of engineering parsing and algorithm parsing) of the present application, the cost can be reduced by 32.8%-40.7%. The single-page parsing time of the two parsing methods can be seen in Table 3 as follows: Table 3
[0071] As shown in Table 3, in this experiment, the algorithm parsing includes image conversion processing (30 ms) and image parsing model-based document parsing (1200 ms) of the document data page; the engineering parsing includes image conversion processing (30 ms), layout classification (100 ms), and text parsing (50 ms) of the document data page. Through the mixed document parsing, the parsing speed of a single document data page can be improved by about 70% on average. As can be seen, the document parsing performance in the present application is improved.
[0072] Further, please refer to Figure 9 , Figure 9 is a schematic diagram of a document parsing device provided by an embodiment of the present application. The document parsing device can be a computer program (including program code, etc.) running in a computer device, for example, the document parsing device can be an application software; the device can be used to execute the corresponding steps in the method provided by the embodiments of the present application. As shown in Figure 9 , the document parsing device 900 can be used in the computer device in the embodiments corresponding to Figure 4 . Specifically, the device can include a layout parsing module 11 and a document parsing module 12.
[0073] The layout analysis module 11 is configured to split the to-be-analyzed document data to obtain N document data pages, and perform layout analysis on the to-be-analyzed document pages to obtain a document layout type of the to-be-analyzed document pages; the to-be-analyzed document pages are any document data pages in the N document data pages, and N is an integer greater than 1; The document analysis module 12 is configured to, if the document layout type of the to-be-analyzed document page is a first layout type, perform text analysis on the to-be-analyzed document page to obtain an analyzed document page corresponding to the to-be-analyzed document page; the first layout type is used to represent that the document is composed of text data or first type data, and the first type data includes text data and image data irrelevant to semantics of the document; The document analysis module 12 is further configured to, if the document layout type of the to-be-analyzed document page is a second layout type, perform content recognition on the to-be-analyzed document page by using an image analysis model to obtain an analyzed document page corresponding to the to-be-analyzed document page; the second layout type is a document layout type other than the first layout type.
[0074] In the process of performing layout analysis on the to-be-analyzed document page to obtain the document layout type of the to-be-analyzed document page, the layout analysis module 11 can be configured to: perform layout analysis on the to-be-analyzed document page by using a document classification model to obtain M data formats corresponding to the to-be-analyzed document page and data location information of each data format in the to-be-analyzed document page; M is a positive integer; if the M data formats include a first data format, determine that the document layout type of the to-be-analyzed document page is the second layout type; the second data format includes a text data format and a first type image format, and the first data format is a data format other than the second data format; the first type image format refers to an image format of data irrelevant to semantics between a document and the document; if the M data formats do not include the first data format, determine that the document layout type of the to-be-analyzed document page is the first layout type.
[0075] In the process of, if the document layout type of the to-be-analyzed document page is the second layout type, performing content recognition on the to-be-analyzed document page by using the image analysis model to obtain the analyzed document page corresponding to the to-be-analyzed document page, the document analysis module 12 can be configured to: if the document layout type of the to-be-analyzed document page is the second layout type, divide the to-be-analyzed document page into H document subgraphs based on the data location information of the M data formats in the to-be-analyzed document page; H is a positive integer greater than or equal to M; determine image analysis models corresponding to the H document subgraphs based on data formats corresponding to the H document subgraphs, respectively; The H document subgraphs are subjected to content recognition by using the H image analysis models corresponding to the H document subgraphs, to obtain subgraph analysis data corresponding to the H document subgraphs; The subgraph analysis data corresponding to the H document subgraphs is subjected to arrangement processing according to the data position information of the H document subgraphs in the document page to be analyzed, to obtain an analyzed document page corresponding to the document page to be analyzed.
[0076] When the document page to be analyzed is subjected to layout analysis to obtain the document layout type of the document page to be analyzed, the layout analysis module 11 can be configured to: convert the format of the document page to be analyzed to obtain a document page image in an image format; perform layout analysis on the document page image to obtain the document layout type of the document page to be analyzed.
[0077] The layout analysis module 11 can be configured to: split the document data to be analyzed to obtain N document data pages that make up the document data to be analyzed, and determine the N document data pages as the document pages to be analyzed; construct a document analysis unit for each of the N document pages to be analyzed, and perform parallel layout analysis on the N document pages to be analyzed by using the document analysis units corresponding to the N document pages to be analyzed, to obtain document layout types corresponding to the N document pages to be analyzed.
[0078] The number of image analysis models is A, where A is a positive integer; the A image analysis models include a main image analysis model and A-1 auxiliary image analysis models. When the document layout type of the document page to be analyzed is the second layout type, the document analysis module 12 can be configured to: When the document layout type of the document page to be analyzed is the second layout type, the document analysis module 12 can be configured to: perform content quality detection on the preliminary analysis page to obtain a quality detection result for the preliminary analysis page; When the quality detection result is a detection pass result, the preliminary analysis page is determined as the analyzed document page corresponding to the document page to be analyzed; When the quality detection result is a detection failure result, a quality abnormal area in the preliminary analysis page is obtained, a target auxiliary image analysis model corresponding to the quality abnormal area is obtained from the A-1 auxiliary image analysis models, the target auxiliary image analysis model is used to perform content optimization on the quality abnormal area to obtain document optimization data, and the initial analysis page is optimized by using the document optimization data to obtain the analyzed document page corresponding to the document page to be analyzed.
[0079] The apparatus 900 further comprises: The sample processing module 13 is configured to obtain model detection image samples, perform content recognition on the model detection image samples respectively by using A image analysis models, and obtain sample analysis data; The quality detection module 14 is configured to perform content quality detection on the sample analysis data respectively corresponding to the A image analysis models, and obtain model quality respectively corresponding to the A image analysis models; The model processing module 15 is configured to determine an image analysis model with the maximum model quality in the A image analysis models as a main image analysis model, and determine image analysis models other than the main image analysis model in the A image analysis models as auxiliary image analysis models.
[0080] The apparatus 900 further comprises: The format obtaining module 16 is configured to obtain M data formats corresponding to the to-be-analyzed document page; M is a positive integer; The model selection module 17 is configured to determine the main image analysis model from the A image analysis models based on the distribution of data contents respectively associated with the M data formats in the to-be-analyzed document page; The model selection module 17 is further configured to determine image analysis models other than the main image analysis model in the image analysis models as auxiliary image analysis models.
[0081] If the document format type of the to-be-analyzed document page is the first format type, when the document analysis module 12 is configured to perform text analysis on the to-be-analyzed document page to obtain the analyzed document page corresponding to the to-be-analyzed document page, the document analysis module 12 can be configured to: If the document format type of the to-be-analyzed document page is the first format type, perform text analysis on the to-be-analyzed document page to obtain analyzed text data corresponding to the to-be-analyzed document page; If the to-be-analyzed document page includes a semantic-independent region in the first image format, the semantic-independent region in the to-be-analyzed document page is intercepted to obtain a semantic-independent image; Obtain the region position of the semantic-independent region in the to-be-analyzed document page, and compose the analyzed text data and the semantic-independent image into the analyzed document page corresponding to the to-be-analyzed document page based on the region position.
[0082] If the document format type of the to-be-analyzed document page is the second format type, when the document analysis module 12 is configured to perform content recognition on the to-be-analyzed document page by using the image analysis model to obtain the analyzed document page corresponding to the to-be-analyzed document page, the document analysis module 12 can be configured to: If the document format type of the to-be-analyzed document page is the second format type, perform content recognition on the to-be-analyzed document page by using the image analysis model to obtain preliminary analysis data; Obtaining the number of requested columns, obtaining the number of document columns of the to-be-analyzed document page; If the number of document columns is the same as the number of requested columns, the preliminary analysis data is determined as the analyzed document page corresponding to the to-be-analyzed document page. If the number of document columns is different from the number of requested columns, the document column function is called based on the number of requested columns, the preliminary analysis data is processed by column rearrangement, and the analyzed document page is obtained; the number of columns of the analyzed document page is the number of requested columns.
[0083] The device 900 further includes: The permission detection module 18 is configured to, in response to a document analysis request for the to-be-analyzed document data, detect a document analysis permission of a business object initiating the document analysis request. The analysis triggering module 19 is configured to, if the business object has the document analysis permission, perform a process of splitting the to-be-analyzed document data to obtain N document data pages. The document detection module 20 is configured to, if the business object does not have the document analysis permission, perform editable format conversion on the to-be-analyzed document data to obtain first document data, perform abnormality detection on the first document data to obtain abnormal data in the first document data, and send the first document data and the abnormal data to the business object.
[0084] The embodiment of the present application provides a document analysis device, which can split to-be-analyzed document data to obtain N document data pages, performs layout analysis on a to-be-analyzed document page to obtain a document layout type of the to-be-analyzed document page, the to-be-analyzed document page is any document data page in the N document data pages, and N is an integer greater than 1; if the document layout type of the to-be-analyzed document page is a first layout type, performing text analysis on the to-be-analyzed document page to obtain an analyzed document page corresponding to the to-be-analyzed document page; the first layout type is used to indicate that a document is composed of text data or first type data, and the first type data includes text data and image data irrelevant to document semantics; if the document layout type of the to-be-analyzed document page is a second layout type, performing content recognition on the to-be-analyzed document page by using an image analysis model to obtain an analyzed document page corresponding to the to-be-analyzed document page; the second layout type is a document layout type other than the first layout type. In this way, when document analysis is performed on to-be-analyzed document data, a document analysis method can be intelligently selected based on a document layout type of a to-be-analyzed document page that constitutes the to-be-analyzed document data, the to-be-analyzed document page is analyzed, the content in the to-be-analyzed document page is relatively simple (that is, the first layout type), a text analysis method with high efficiency and low cost is used for document analysis, the content in the to-be-analyzed document page is relatively complex (that is, the second layout type), and a high-precision image analysis model is used for document analysis, so that adaptive analysis processing of to-be-analyzed document data is realized, dynamic selection of an optimal document analysis method is realized, and the cost efficiency and performance of document analysis are balanced, thereby improving the overall analysis efficiency of document data.
[0085] Reference Figure 10 , Figure 10 is a structural schematic diagram of a computer device provided by the embodiment of the present application. As shown in Figure 10 , the computer device in the embodiment of the present application can include one or more processors 1001, a memory 1002, and an input output interface 1003. The processor 1001, the memory 1002, and the input output interface 1003 are connected through a bus 1004. The memory 1002 is used to store a computer program, the computer program includes program instructions, the input output interface 1003 is used to receive data and output data, such as used for data interaction between the computer device and a service device; and the processor 1001 is used to execute the program instructions stored in the memory 1002.
[0086] The processor 1001 can perform the following operations: split to-be-analyzed document data to obtain N document data pages, perform layout analysis on a to-be-analyzed document page to obtain a document layout type of the to-be-analyzed document page; the to-be-analyzed document page is any document data page in the N document data pages, and N is an integer greater than 1; If the document type of the to-be-analyzed document page is the first type, the to-be-analyzed document page is subjected to text analysis to obtain an analyzed document page corresponding to the to-be-analyzed document page; the first type is used to represent that the document is composed of text data or first type data, and the first type data includes text data and image data irrelevant to semantics of the document. If the document type of the to-be-analyzed document page is the second type, the to-be-analyzed document page is subjected to content recognition by using an image analysis model to obtain an analyzed document page corresponding to the to-be-analyzed document page; the second type is a document type other than the first type.
[0087] In some possible implementation manners, the processor 1001 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, or the like. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0088] The memory 1002 can include a read-only memory and a random access memory, and provide the processor 1001 and the input output interface 1003 with instructions and data. A portion of the memory 1002 can also include a non-volatile random access memory. For example, the memory 1002 can also store device type information.
[0089] In specific implementation manners, the computer device can execute the implementation manners provided in each step of the method by using the built-in function modules, and the implementation manners provided in each step of the method can be specifically referred to, and details are not described herein. Figure 4 In specific implementation manners, the computer device can execute the implementation manners provided in each step of the method by using the built-in function modules, and the implementation manners provided in each step of the method can be specifically referred to, and details are not described herein. Figure 4 In specific implementation manners, the computer device can execute the implementation manners provided in each step of the method by using the built-in function modules, and the implementation manners provided in each step of the method can be specifically referred to, and details are not described herein.
[0090] Embodiments of the present application provide a computer device, which includes a processor, an input output interface, and a memory. The computer device acquires a computer program in the memory by using the processor, executes the computer program, and performs the implementation manners provided in each step of the method. Figure 4Each step of the method shown involves document parsing. This embodiment of the application splits the document data to be parsed into N document data pages, performs layout parsing on the document pages to be parsed to obtain the document layout type of the document page to be parsed. The document page to be parsed is any one of the N document data pages, where N is an integer greater than 1. If the document layout type of the document page to be parsed is a first layout type, then the document page to be parsed is parsed to obtain the parsed document page corresponding to the document page to be parsed. The first layout type indicates that the document consists of text data or first type data, which includes text data and image data unrelated to the document's semantics. If the document layout type of the document page to be parsed is a second layout type, then an image parsing model is used to perform content recognition on the document page to be parsed to obtain the parsed document page corresponding to the document page to be parsed. The second layout type is a document layout type other than the first layout type. This method intelligently selects a parsing method based on the document layout type of the pages to be parsed when parsing the document data. When the content of the document page is relatively simple (i.e., the first layout type), a high-efficiency and low-cost text parsing method is used; when the content is more complex (i.e., the second layout type), a high-precision image parsing model is used. This achieves adaptive parsing processing of the document data, dynamically selecting the optimal parsing method, thus balancing cost-effectiveness and performance, and improving the overall parsing efficiency of the document data.
[0091] This application also provides a computer-readable storage medium storing a computer program adapted to be loaded and executed by a processor. Figure 4 For details on the document parsing methods provided in each step, please refer to [the relevant documentation / document parsing documentation]. Figure 4 The implementation methods provided for each step are not repeated here. Furthermore, the beneficial effects of using the same method are also not repeated. For technical details not disclosed in the computer-readable storage medium embodiments involved in this application, please refer to the description of the method embodiments of this application. As an example, a computer program may be deployed to execute on a single computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed across multiple locations and interconnected via a communication network.
[0092] The computer readable storage medium can be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device, or the document parsing apparatus provided by any of the preceding embodiments. The computer readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, or the like. Further, the computer readable storage medium can include both the internal storage unit and the external storage device of the computer device. The computer readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer readable storage medium can also be used to temporarily store data that has been output or will be output.
[0093] The computer program product or the computer program includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to perform the method provided in any of the various optional manners. Figure 4 The method provided in the various optional manners can intelligently select a document parsing method based on the document layout type of the document page to be parsed that constitutes the document data to be parsed when performing document parsing on the document data to be parsed, and perform document parsing on the document page to be parsed. When the content in the document page to be parsed is relatively simple (i.e., the first layout type), a text parsing method with high efficiency and low cost is used for document parsing, and when the content in the document page to be parsed is relatively complex (i.e., the second layout type), an image parsing model with high precision is used for document parsing. Thus, adaptive parsing processing of the document data to be parsed is implemented, and dynamic selection of the optimal document parsing method is achieved, thereby balancing the cost efficiency and performance of document parsing and improving the overall parsing efficiency of the document data.
[0094] The terms "first", "second", and the like in the specification and claims of the present application and the accompanying drawings are used to distinguish different objects, and are not used to describe a specific order. In addition, the term "comprising" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units that are not listed, or can optionally include other steps or units inherent to the process, method, apparatus, product, or device.
[0095] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined target, and can be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an integral module or unit that includes the functions of the module or unit.
[0096] Those of ordinary skill in the art can be aware that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both, and the general description of each example has been described in the description for the sake of clarity and concision of the description. Whether the functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0097] The method and related apparatus provided by the embodiments of the present application are described with reference to the method flowchart and / or structural schematic diagram provided by the embodiments of the present application, and each flow and / or block of the method flowchart and / or structural schematic diagram, and the combination of the flows and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable document analysis devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable document analysis devices produce a device implemented in the flow Figure 1 The device implemented in one flow or multiple flows and / or structural schematic Figure 1 The device implemented in one flow or multiple flows and / or structural schematic Figure 1 The device implemented in one flow or multiple flows and / or structural schematic Figure 1 The device implemented in one flow or multiple flows and / or structural schematic Figure 1 The device implemented in one flow or multiple flows and / or structural schematic
[0098] The steps in the method embodiments of the application can be adjusted in sequence, combined and reduced according to actual needs.
[0099] The modules in the device embodiments of the application can be combined, divided and reduced according to actual needs.
[0100] The above only discloses the preferred embodiments of the application, and of course cannot limit the scope of the right of the application, so the equivalent changes made by the claims of the application still belong to the scope covered by the application.
Claims
1. A document parsing method characterized by, The method comprises: splitting the to-be-resolved document data to obtain N document data pages, and performing layout resolution on the to-be-resolved document page to obtain a document layout type of the to-be-resolved document page; the to-be-resolved document page is any document data page in the N document data pages, and N is an integer greater than 1; if the document layout type of the to-be-resolved document page is a first layout type, performing text resolution on the to-be-resolved document page to obtain a resolved document page corresponding to the to-be-resolved document page; the first layout type is used to indicate that a document is composed of text data or first type data, and the first type data comprises text data and image data irrelevant to semantics of the document; if the document layout type of the to-be-resolved document page is a second layout type, performing content recognition on the to-be-resolved document page by using an image resolution model to obtain a resolved document page corresponding to the to-be-resolved document page; the second layout type is a document layout type other than the first layout type.
2. The method of claim 1, wherein, The method comprises: performing layout resolution on the to-be-resolved document page by using a document classification model to obtain M data formats corresponding to the to-be-resolved document page and data position information of each data format in the to-be-resolved document page; M is a positive integer; if the M data formats comprise a first data format, determining that the document layout type of the to-be-resolved document page is the second layout type; a second data format comprises a text data format and a first type image format, and the first data format is a data format other than the second data format; the first type image format refers to an image format of data irrelevant to semantics between a document and the document; if the M data formats do not comprise the first data format, determining that the document layout type of the to-be-resolved document page is the first layout type.
3. The method of claim 2, wherein, The method comprises: if the document layout type of the to-be-resolved document page is the second layout type, dividing the to-be-resolved document page into H document subgraphs based on the data position information of the M data formats in the to-be-resolved document page; H is a positive integer greater than or equal to M; determining image resolution models corresponding to the H document subgraphs based on the data formats corresponding to the H document subgraphs; performing content recognition on the H document subgraphs by using the image resolution models corresponding to the H document subgraphs to obtain subgraph resolution data corresponding to the H document subgraphs; arranging the subgraph resolution data corresponding to the H document subgraphs according to the data position information of the H document subgraphs in the to-be-resolved document page to obtain a resolved document page corresponding to the to-be-resolved document page.
4. The method of claim 1, wherein, The method comprises: The document page to be parsed is format-converted to obtain a document page image in an image format; The document page image is layout-parsed to obtain a document layout type of the document page to be parsed.
5. The method of claim 1, wherein, The method further includes: The document data to be parsed is split to obtain N document data pages, and the document data pages to be parsed are layout-parsed to obtain a document layout type of the document page to be parsed. The document data to be parsed is split to obtain N document data pages, and the document data pages to be parsed are layout-parsed to obtain a document layout type of the document page to be parsed.
6. The method of claim 1, wherein, The N document pages to be parsed are respectively constructed with document parsing units, and the N document pages to be parsed are respectively parsed in parallel with the document parsing units corresponding to the N document pages to be parsed to obtain document layout types corresponding to the N document pages to be parsed. The number of the image parsing models is A, and A is a positive integer; the A image parsing models include a main image parsing model and A-1 auxiliary image parsing models; If the document layout type of the document page to be parsed is a second layout type, the document page to be parsed is content-identified with an image parsing model to obtain a parsed document page corresponding to the document page to be parsed, including: If the document layout type of the document page to be parsed is a second layout type, the document page to be parsed is content-identified with a main image parsing model to obtain a preliminary parsed page; The preliminary parsed page is content-quality detected to obtain a quality detection result for the preliminary parsed page; If the quality detection result is a detection pass result, the preliminary parsed page is determined as the parsed document page corresponding to the document page to be parsed; 7. The method of claim 6, wherein, If the quality detection result is a detection fail result, a quality abnormal area in the preliminary parsed page is obtained, a target auxiliary image parsing model corresponding to the quality abnormal area is obtained from the A-1 auxiliary image parsing models, the quality abnormal area is content-optimized with the target auxiliary image parsing model to obtain document optimization data, and the initial parsed page is optimized with the document optimization data to obtain the parsed document page corresponding to the document page to be parsed. The method further includes: Model detection image samples are obtained, the A image parsing models are respectively used to content-identify the model detection image samples to obtain sample parsed data; The sample parsed data corresponding to the A image parsing models is content-quality detected to obtain model qualities of the A image parsing models; 8. The method of claim 6, wherein, The image parsing model with the largest model quality in the A image parsing models is determined as the main image parsing model, and the image parsing models other than the main image parsing model in the A image parsing models are determined as auxiliary image parsing models. The method further includes: M data formats corresponding to the document page to be parsed are obtained; M is a positive integer; Based on distribution of data contents respectively associated with the M data formats in the document page to be parsed, a main image parsing model is determined from the A image parsing models. The image analysis model other than the main image analysis model in the image analysis model is determined as a secondary image analysis model.
9. The method of claim 1, wherein, If the document format type of the to-be-analyzed document page is a first format type, the to-be-analyzed document page is subjected to text analysis to obtain an analyzed document page corresponding to the to-be-analyzed document page, including: If the document format type of the to-be-analyzed document page is a first format type, the to-be-analyzed document page is subjected to text analysis to obtain an analyzed document page corresponding to the to-be-analyzed document page, including: If the to-be-analyzed document page includes a semantic-independent region in a first type of image format, the semantic-independent region in the to-be-analyzed document page is intercepted to obtain a semantic-independent image; The region position of the semantic-independent region in the to-be-analyzed document page is obtained, and the analyzed text data and the semantic-independent image are combined into an analyzed document page corresponding to the to-be-analyzed document page based on the region position.
10. The method of claim 1, wherein, If the document format type of the to-be-analyzed document page is a second format type, the to-be-analyzed document page is subjected to content recognition by using an image analysis model to obtain an analyzed document page corresponding to the to-be-analyzed document page, including: If the document format type of the to-be-analyzed document page is a second format type, the to-be-analyzed document page is subjected to content recognition by using an image analysis model to obtain preliminary analysis data; The number of requested columns is obtained, and the number of document columns of the to-be-analyzed document page is obtained; If the number of document columns is the same as the number of requested columns, the preliminary analysis data is determined as an analyzed document page corresponding to the to-be-analyzed document page; If the number of document columns is different from the number of requested columns, a document column function is called based on the number of requested columns, and the preliminary analysis data is subjected to column rearrangement processing to obtain an analyzed document page; the number of columns of the analyzed document page is the number of requested columns.
11. The method of claim 1, wherein, The method further includes: In response to a document analysis request for the to-be-analyzed document data, a document analysis permission of a business object initiating the document analysis request is detected; If the business object has the document analysis permission, the process of splitting the to-be-analyzed document data into N document data pages is performed; If the business object does not have the document analysis permission, the to-be-analyzed document data is subjected to editable format conversion to obtain first document data, the first document data is subjected to anomaly detection to obtain abnormal data in the first document data, and the first document data and the abnormal data are sent to the business object.
12. A document analysis apparatus characterized by comprising: The device includes: A format analysis module is configured to split to-be-analyzed document data into N document data pages, and perform format analysis on a to-be-analyzed document page to obtain a document format type of the to-be-analyzed document page; the to-be-analyzed document page is any document data page in the N document data pages, and N is an integer greater than 1. The document parsing module is configured to, if the document format type of the to-be-parsed document page is a first format type, perform text parsing on the to-be-parsed document page to obtain a parsed document page corresponding to the to-be-parsed document page; the first format type is used to indicate that a document is composed of text data or first type data, and the first type data includes text data and image data irrelevant to semantics of the document. The document parsing module is further configured to, if the document format type of the to-be-parsed document page is a second format type, perform content recognition on the to-be-parsed document page by using an image parsing model to obtain a parsed document page corresponding to the to-be-parsed document page; the second format type is a document format type other than the first format type.
13. A computer device, comprising: The computer device comprises a processor, a memory, and an input / output interface. The processor is connected with the memory and the input / output interface respectively, wherein the input / output interface is configured to receive and output data, the memory is configured to store a computer program, and the processor is configured to call the computer program to enable the computer device to perform the method in any one of claims 1-11.
14. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is adapted to be loaded and executed by the processor to enable the computer device having the processor to perform the method in any one of claims 1-11.
15. A computer program product comprising computer instructions, characterized in that, The computer instructions are executed by the processor to implement the method in any one of claims 1-11.