Document auditing method and device, electronic equipment and storage medium
By training large language models on document layout and content separately, and combining layout annotations and text content information for review, the shortcomings of traditional document review methods in semantic understanding are solved, achieving higher review accuracy and precision.
Patent Information
- Application Number
- CN202510871898.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-10-31
AI Technical Summary
Traditional document review methods struggle to accurately understand the deep semantics and logical relationships of sentences and paragraphs, especially in low-quality images, blurry or noisy scans, resulting in low recognition accuracy and an inability to consistently output high-quality text.
A large language model is used to train document layout and content separately. The first target model identifies the document layout, and the second target model identifies the document content. The layout annotation information and text content information are combined for review. The natural language understanding ability of the large language model is used to overcome the limitations of traditional rule engines.
It improves the accuracy and precision of document review, enabling better understanding and extraction of semantic differences and complex text variations in documents, and achieving automated content understanding and structured extraction.
Smart Images

Figure CN120877317A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a document review method, apparatus, electronic device, and storage medium. Background Technology
[0002] Traditional document review primarily relies on manual inspection and rule-based automated tools. The initial solutions generally employ OCR technology, which uses optical character recognition to convert scanned copies of paper documents, PDF files, etc., into editable text content. Then, NLP is used to match the text, and the extracted text content undergoes lexical analysis, word segmentation, and syntactic structure analysis. Finally, string difference comparison algorithms (such as the Diff algorithm) are used to compare multiple versions of the document to identify additions, deletions, and modifications in the text.
[0003] However, traditional OCR plus rule engine solutions mainly focus on direct comparison of the surface text of documents, failing to fully understand the deeper semantics and logical relationships of sentences and paragraphs. This makes it difficult to accurately judge documents containing implicit semantic differences and contextual logical changes. Furthermore, the recognition accuracy of traditional OCR methods tends to decrease in scenarios such as low-quality images, blurry or noisy scans, and handwritten text, making it impossible to consistently output high-quality text. Summary of the Invention
[0004] In view of this, this application provides a document review method, apparatus, electronic device, and storage medium, which can improve the accuracy of document review.
[0005] A first aspect of this application provides a document review method, comprising: acquiring a first sample dataset and a second sample dataset, wherein the first sample dataset includes text and corresponding layout annotation information, and the second sample dataset includes the text and corresponding text content information; training a first original model based on the first sample dataset to obtain a first target model for recognizing document layout; training a second original model based on the second sample dataset to obtain a second target model for recognizing document content, wherein both the first original model and the second original model are large language models; acquiring a document to be reviewed, inputting the document to be reviewed into the first target model to obtain a first document with target layout annotation information; inputting the first document into the second target model to obtain target text content information corresponding to the document to be reviewed; and reviewing the document to be reviewed based on the target layout annotation information and the target text content information.
[0006] Compared with related technologies, the embodiments of this application have at least the following advantages: Since the first sample dataset includes text and corresponding layout annotation information, and the second sample dataset includes text and corresponding text content information, by training the first original model with the first sample dataset, a first target model for recognizing document layout can be obtained; and by training the second original model with the second sample dataset, a second target model for recognizing document content can be obtained. By inputting the document to be reviewed into the first target model and then inputting the first document with target layout annotation information into the second target model, the second target model can obtain more accurate processing results based on the target layout annotation information during the processing of the first document. This improves the accuracy of the target text content information output by the second target model, thereby improving the accuracy of reviewing the document to be reviewed based on the target text content information. Furthermore, since both the first and second original models are large language models, by utilizing the powerful capabilities of large language models in natural language understanding and generation, the limitations of traditional rule engines in handling semantic level differences and complex text variations are overcome, achieving automated content understanding and structured extraction of the document to be reviewed. This further improves the accuracy of the target layout annotation information and the target text content information, thereby further improving the accuracy of reviewing the document to be reviewed.
[0007] In one possible implementation, the method further includes: acquiring a third sample dataset, wherein the third sample dataset includes text review information corresponding to the text; training a third original model based on the third sample dataset to obtain a third target model for document review and comparison, wherein the third original model is a large language model; and reviewing the document to be reviewed based on the target layout annotation information and the target text content information, including: inputting the target layout annotation information and the target text content information into the third target model to obtain the review result of the document to be reviewed.
[0008] In one possible implementation, before inputting the target layout annotation information and the target text content information into the third target model, the method further includes: segmenting the target text content information according to the target layout annotation information to obtain N sub-text content information and sub-layout annotation information corresponding to each sub-text content information, where N is an integer greater than 1; inputting the target layout annotation information and the target text content information into the third target model to obtain the review result of the document to be reviewed includes: inputting each sub-text content information and the corresponding sub-layout annotation information into the third target model to obtain N sub-review results; inputting the N sub-review results into the third target model for aggregation processing to obtain the review result.
[0009] In one possible implementation, before inputting the target layout annotation information and the target text content information into the third target model, the method further includes: responding to an operation instruction to obtain document review rule information; the step of inputting the target layout annotation information and the target text content information into the third target model includes: inputting the target layout annotation information, the target text content information, and the document review rule information into the third target model.
[0010] In one possible implementation, before inputting the document to be reviewed into the first target model, the method further includes: converting the document to be reviewed into a format to obtain a second document with a preset format; preprocessing the second document to obtain a third document, wherein the preprocessing includes at least one of watermark removal, background noise removal, rotation correction, and page number synchronization; and inputting the document to be reviewed into the first target model includes: inputting the third document into the first target model.
[0011] In one possible implementation, the step of inputting the document to be reviewed into the first target model to obtain a first document with target layout annotation information includes: inputting the document to be reviewed into the first target model, wherein the first target model sequentially performs text layout recognition, table recognition, formula recognition, and document hierarchy recognition on the document to be reviewed to obtain the first document.
[0012] In one possible implementation, the layout annotation information includes: text annotation information, title annotation information, table annotation information, formula annotation information, and chart annotation information.
[0013] Secondly, embodiments of this application also provide a document review device, comprising: a first acquisition module, a first training module, a second training module, a second acquisition module, an input module, and a review module; the first acquisition module is used to acquire a first sample dataset and a second sample dataset, wherein the first sample dataset includes text and corresponding layout annotation information, and the second sample dataset includes the text and corresponding text content information; the first training module is used to train a first original model based on the first sample dataset to obtain a first target model for recognizing document layout; the second training module is used to train a second original model based on the second sample dataset to obtain a second target model for recognizing document content, wherein both the first original model and the second original model are large language models; the second acquisition module is used to acquire a document to be reviewed; the input module is used to input the document to be reviewed into the first target model to obtain a first document with target layout annotation information; the input module is also used to input the first document into the second target model to obtain target text content information corresponding to the document to be reviewed; the review module is used to review the document to be reviewed based on the target layout annotation information and the target text content information.
[0014] Thirdly, embodiments of this application also provide an electronic device, the electronic device including a processor and a memory, the memory being used to store instructions, and the processor being used to call the instructions in the memory, causing the electronic device to execute the document review method as described in the first aspect.
[0015] Fourthly, embodiments of this application also provide a storage medium that stores computer instructions, which, when executed on an electronic device, cause the electronic device to perform the document review method as described in the first aspect.
[0016] The technical effects achieved by the second, third, and fourth aspects mentioned above are similar to those achieved by the corresponding technical means in the first aspect, and will not be repeated here. Attached Figure Description
[0017] Figure 1 A flowchart illustrating one step of a document review method provided in an embodiment of this application.
[0018] Figure 2 A flowchart illustrating another step of the document review method provided in one embodiment of this application.
[0019] Figure 3 A functional block diagram of a document review device provided in an embodiment of this application.
[0020] Figure 4This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0021] To better understand the above-mentioned objectives, features, and advantages of this application, the application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0022] The following description sets forth many specific details to provide a full understanding of this application. The described embodiments are only some, not all, of the embodiments of this application.
[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the specification of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.
[0024] It should be further noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0025] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects, not to describe a specific order or sequence.
[0026] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0027] For ease of understanding, exemplary descriptions of some concepts related to the embodiments of this application are provided for reference.
[0028] LLM (Large Language Model): A natural language processing model based on deep learning, which has the ability to understand and generate context.
[0029] OCR (Optical Character Recognition): Used to convert text information in images into editable text.
[0030] PDF (Portable Document Format): An electronic file format used for document presentation and exchange.
[0031] SQL (Structured Query Language): Used to manage and manipulate data in relational databases.
[0032] MySQL: An open-source relational database management system used for storing and retrieving application data.
[0033] Markdown: A lightweight markup language used for formatting text and generating structured documents.
[0034] MathML (Mathematical Markup Language): Used to display mathematical formulas on web pages.
[0035] LaTeX: A text-based typesetting system widely used for writing and formatting scientific, mathematical, and engineering documents.
[0036] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating the steps of one embodiment of the document review method of this application. Depending on different requirements, the order of the steps in this flowchart can be changed, and some steps can be omitted. The document review method of this application can be applied to document review devices, but is not limited thereto, and this embodiment does not limit its application in this regard.
[0037] The specific process of this embodiment is as follows: Figure 1 As shown, it includes the following steps: Step 101: Obtain the first sample dataset and the second sample dataset.
[0038] Specifically, the first sample dataset includes text and corresponding layout annotation information, while the second sample dataset includes text and corresponding text content information.
[0039] In some embodiments, layout annotation information includes: text annotation information, title annotation information, table annotation information, formula annotation information, and chart annotation information. It is understood that this embodiment does not specifically limit the type of layout annotation information, and it can be set according to actual needs.
[0040] In some embodiments, the acquisition of the first and second sample datasets includes: collecting a large number of single-page scanned PDF images, i.e., text; annotating the scanned PDF images using tools, such as annotating text, titles, tables, formulas, and charts, to obtain layout annotation information; and recognizing the scanned PDF images using OCR to obtain text content information.
[0041] In some embodiments, the data types of the collected PDF scan images are ensured to be evenly distributed, thereby guaranteeing the subsequent model training effect.
[0042] Step 102: Train the first original model based on the first sample dataset to obtain the first target model for recognizing document layout.
[0043] Specifically, the first original model is a large language model, and this embodiment does not impose specific limitations on the model training method of the first original model.
[0044] Step 103: Train the second original model using the second sample dataset to obtain the second target model for recognizing document content.
[0045] Specifically, the second original model is a large language model, and this embodiment does not impose specific limitations on the model training method of the second original model.
[0046] Step 104: Obtain the document to be reviewed.
[0047] In some embodiments, the format of the document to be reviewed is not specifically limited. For example, the document to be reviewed can be in any format such as Word, PDF, or scanned image.
[0048] Step 105: Input the document to be reviewed into the first target model to obtain the first document with target layout annotation information.
[0049] In some embodiments, before inputting the document to be reviewed into the first target model, the document is converted into a second document with a preset format. In this embodiment, the document to be reviewed is converted into a PDF document. This approach provides a unified parsing process for various document formats, ensuring consistent processing performance of the first target model under different input data.
[0050] It is understandable that in the aforementioned first original model training process, PDF scanned images were used as sample data. Therefore, step 105 requires converting the document to be reviewed into a PDF document before inputting it into the first target model to ensure the first target model's data processing effectiveness. In practical applications, other formats of sample data can also be sampled to train the first original model, as long as the format of the document to be reviewed is converted to be consistent with the format of the sample data.
[0051] In some embodiments, the second document is further preprocessed to obtain a third document, which is then input into the first target model. Specifically, the preprocessing includes at least one of watermark removal, background noise removal, rotation correction, and page number synchronization. This method ensures that the document quality of the third document meets the recognition requirements of the first target model, thereby further ensuring the processing effect of the first target model on the data.
[0052] In some embodiments, when the document to be reviewed is input into the first target model, the first target model sequentially performs text layout recognition, table recognition, formula recognition and document hierarchy recognition on the document to be reviewed to obtain the first document.
[0053] To facilitate understanding, the following provides a detailed explanation of how the first target model in this embodiment processes the documents to be reviewed: 1. Text Layout Recognition: The first target model identifies the document layout of the document to be reviewed. It uses a deep learning-based layout analysis model (such as LayoutLM, DocParser, etc.) to extract the layout structure elements in the document to be reviewed, including but not limited to titles, paragraphs, lists, image areas, table areas, formula areas, headers and footers, etc., and establishes a preliminary layout partitioning diagram.
[0054] 2. Table Recognition: The first target model recognizes the table content of the document to be reviewed. For the table area, it detects the table boundaries, identifies the row and column relationships, restores the structure of merged cells, and extracts the table content into structured data (such as JSON or CSV format).
[0055] 3. Formula Recognition: The first target model identifies the formulas in the document to be reviewed. For formula areas, mathematical formula recognition technology is used to parse the formula image or embedded object into standardized LaTeX or MathML code, while retaining the formula's layout information to ensure accurate subsequent reconstruction.
[0056] Understandably, by introducing MathML encoding and LaTeX parsing mechanisms, it is possible to accurately extract and restore non-ordinary text content such as mathematical formulas and complex charts in documents.
[0057] 4. Document Hierarchy Recognition: The first target model identifies the document hierarchy of the document to be reviewed. Based on layout information and content features (such as font size, bolding, numbering patterns, etc.), it infers the logical hierarchy within the document and automatically builds the document outline (e.g., first-level headings, second-level headings, body content, etc.).
[0058] Step 106: Input the first document into the second target model to obtain the target text content information corresponding to the document to be reviewed.
[0059] To facilitate understanding, the following provides a detailed explanation of how the second objective model processes the first document: The second target model identifies the content of the first document. For the identified text regions, it uses natural language processing techniques (such as named entity recognition, word segmentation, and syntactic analysis) to extract the text content, marks important information units (such as names of people, places, times, and professional terms), and performs semantic understanding processing to support subsequent content comparison and review tasks.
[0060] In some embodiments, a standard-format Markdown document is generated based on the target text content information and the target layout annotation information, and saved to a MySQL database for persistent storage.
[0061] Step 107: Review the document to be reviewed based on the target layout annotation information and target text content information.
[0062] The method for reviewing documents based on target layout annotation information and target text content information is described in detail in subsequent embodiments, and will not be repeated here to avoid repetition.
[0063] Compared with related technologies, the embodiments of this application have at least the following advantages: Since the first sample dataset includes text and corresponding layout annotation information, and the second sample dataset includes text and corresponding text content information, by training the first original model with the first sample dataset, a first target model for recognizing document layout can be obtained; and by training the second original model with the second sample dataset, a second target model for recognizing document content can be obtained. By inputting the document to be reviewed into the first target model and then inputting the first document with target layout annotation information into the second target model, the second target model can obtain more accurate processing results based on the target layout annotation information during the processing of the first document. This improves the accuracy of the target text content information output by the second target model, thereby improving the accuracy of reviewing the document to be reviewed based on the target text content information. Furthermore, since both the first and second original models are large language models, by utilizing the powerful capabilities of large language models in natural language understanding and generation, the limitations of traditional rule engines in handling semantic level differences and complex text variations are overcome, achieving automated content understanding and structured extraction of the document to be reviewed. This further improves the accuracy of the target layout annotation information and the target text content information, thereby further improving the accuracy of reviewing the document to be reviewed.
[0064] Please refer to Figure 2 , Figure 2 This is a flowchart illustrating the steps of one embodiment of the document review method of this application. Depending on different requirements, the order of the steps in this flowchart can be changed, and some steps can be omitted. This document review method can be applied to the aforementioned document review apparatus, but is not limited thereto, and this embodiment of the application does not limit it in this regard.
[0065] This embodiment is a detailed description of the foregoing embodiments, mainly illustrating how to review documents to be reviewed. This method can further improve the accuracy of document review.
[0066] The specific process of this embodiment is as follows: Figure 2 As shown, it includes the following steps: Step 201: Obtain the first sample dataset, the second sample dataset, and the third sample dataset.
[0067] In some embodiments, the third sample dataset includes text review information corresponding to the text.
[0068] Specifically, the text review information in this embodiment is the review question-and-answer pair corresponding to the text. This embodiment can obtain the review question-and-answer pairs in the following ways: collect a large number of question-and-answer pairs, delete question-and-answer pairs that are irrelevant to the review, make positive modifications to the question-and-answer pairs, and score and label the question-and-answer pairs. The higher the score, the more accurate the answer. The score is between 0 and 1, thus obtaining the final review question-and-answer pairs.
[0069] Step 202: Train the first original model based on the first sample dataset to obtain the first target model for recognizing document layout.
[0070] Step 203: Train the second original model using the second sample dataset to obtain the second target model for recognizing document content.
[0071] Step 204: Train the third original model based on the third sample dataset to obtain the third target model for document review and comparison.
[0072] Specifically, the third target model is a large language model. This embodiment does not impose specific limitations on the training method of the third target model, which can be set according to actual needs.
[0073] Step 205: Obtain the document to be reviewed.
[0074] Step 206: Input the document to be reviewed into the first target model to obtain the first document with target layout annotation information.
[0075] Step 207: Input the first document into the second target model to obtain the target text content information corresponding to the document to be reviewed.
[0076] Step 207: Input the target layout annotation information and target text content information into the third target model to obtain the review result of the document to be reviewed.
[0077] In some embodiments, before inputting the target layout annotation information and target text content information into the third target model, the method further includes: segmenting the target text content information according to the target layout annotation information to obtain N sub-text content information and sub-layout annotation information corresponding to each sub-text content information, where N is an integer greater than 1; inputting the target layout annotation information and target text content information into the third target model to obtain the review result of the document to be reviewed, including: inputting each sub-text content information and its corresponding sub-layout annotation information into the third target model to obtain N sub-review results; and inputting the N sub-review results into the third target model for aggregation processing to obtain the review result. This method avoids the situation in related technologies where "long texts are difficult to process, and ordinary segmentation methods result in contextual deviations and semantic understanding biases, ultimately leading to poor document review results," further improving the reliability and accuracy of document review.
[0078] Specifically, based on the target layout annotation information, the target text content is automatically segmented according to its logical structure (such as chapters, paragraphs, and clauses), and a third-party target model is applied to each segment for local review. During the review of each segment, the corresponding review results and confidence level information are recorded, supporting fine-grained traceability and problem localization.
[0079] The review results from each segment are aggregated, and a comprehensive review result is generated by combining the confidence score and content relationships. Since the third objective model is a large language model, a large model inference mechanism can be introduced to supplement and verify the contextual relationships between segments, ensuring the accuracy and consistency of the merged result.
[0080] In some embodiments, before inputting the target layout annotation information and target text content information into the third target model, the method further includes: responding to an operation instruction to obtain document review rule information; inputting the target layout annotation information and target text content information into the third target model includes: inputting the target layout annotation information, target text content information, and document review rule information into the third target model. That is, in addition to the document review rules determined by the third target model, users can also set specific document review rules according to the actual review requirements of the document to be reviewed. The third target model can review the document to be reviewed based on its own determined document review rules and the document review rules input by the user, thereby further improving the accuracy of document review.
[0081] In other words, the third-target model can infer and generate a suitable set of review rules based on the structural features (i.e., target layout annotation information), content characteristics (i.e. target text content information), and review requirements (i.e. document review rule information) of the input document. The rules can cover multiple dimensions such as content consistency verification, semantic similarity comparison, and format standardization check, and can be dynamically adjusted according to the actual situation of the document to be reviewed.
[0082] In some embodiments, the audit results include audit conclusions, problem identification, confidence scores, and other information. The audit results can be used for manual review or for subsequent automated processing (such as automatic modification suggestions, document revision guidelines, etc.).
[0083] Compared with related technologies, the embodiments of this application have at least the following advantages: Since the first sample dataset includes text and corresponding layout annotation information, and the second sample dataset includes text and corresponding text content information, by training the first original model with the first sample dataset, a first target model for recognizing document layout can be obtained; and by training the second original model with the second sample dataset, a second target model for recognizing document content can be obtained. By inputting the document to be reviewed into the first target model and then inputting the first document with target layout annotation information into the second target model, the second target model can obtain more accurate processing results based on the target layout annotation information during the processing of the first document. This improves the accuracy of the target text content information output by the second target model, thereby improving the accuracy of reviewing the document to be reviewed based on the target text content information. Furthermore, since both the first and second original models are large language models, by utilizing the powerful capabilities of large language models in natural language understanding and generation, the limitations of traditional rule engines in handling semantic level differences and complex text variations are overcome, achieving automated content understanding and structured extraction of the document to be reviewed. This further improves the accuracy of the target layout annotation information and the target text content information, thereby further improving the accuracy of reviewing the document to be reviewed.
[0084] Based on the same idea as the document review method in the above embodiments, this application also provides a document review device that can be used to execute the above document review method. For ease of explanation, the structural schematic diagram of the document review device embodiment only shows the parts related to the embodiments of this application. Those skilled in the art will understand that the illustrated structure does not constitute a limitation on the device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0085] like Figure 3As shown, the document review device 300 includes a first acquisition module 301, a first training module 302, a second training module 303, a second acquisition module 304, an input module 305, and a review module 306. In some embodiments, the above modules can be programmable software instructions stored in memory and executable by a processor. It is understood that in other embodiments, the above modules can also be program instructions or firmware embedded in the processor.
[0086] The first acquisition module 301 is used to acquire a first sample dataset and a second sample dataset, wherein the first sample dataset includes text and corresponding layout annotation information, and the second sample dataset includes the text and corresponding text content information. The first training module 302 is used to train the first original model based on the first sample dataset to obtain a first target model for recognizing document layout. The second training module 303 is used to train the second original model based on the second sample dataset to obtain a second target model for recognizing document content, wherein both the first original model and the second original model are large language models. The second acquisition module 304 is used to acquire documents to be reviewed; The input module 305 is used to input the document to be reviewed into the first target model to obtain a first document with target layout annotation information; the input module 305 is also used to input the first document into the second target model to obtain target text content information corresponding to the document to be reviewed. The review module 306 is used to review the document to be reviewed based on the target layout annotation information and the target text content information.
[0087] Please refer to Figure 4 , Figure 4 This is a schematic diagram of an embodiment of the electronic device of this application.
[0088] The electronic device 100 includes a memory 20, a processor 30, and a computer program 40 stored in the memory 20 and executable on the processor 30. When the processor 30 executes the computer program 40, it implements the steps described in the document review method embodiments above, for example... Figure 1 Steps 101 to 107 are shown.
[0089] For example, computer program 40 can also be divided into one or more modules / units, one or more of which are stored in memory 20 and executed by processor 30. One or more modules / units can be a series of computer program instruction segments capable of performing a specific function, the instruction segments describing the execution process of computer program 40 in electronic device 100. For example, it can be divided into the first acquisition module 301, first training module 302, second training module 303, second acquisition module 304, input module 305, and review module 306 shown.
[0090] Those skilled in the art will understand that the schematic diagram is merely an example of the electronic device 100 and does not constitute a limitation on the electronic device 100. It may include more or fewer components than shown, or combine certain components, or different components. For example, the electronic device 100 may also include input / output devices, network access devices, buses, etc.
[0091] Processor 30 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors, single-chip microcomputers, or any conventional processor.
[0092] The memory 20 can be used to store computer programs 40 and / or modules / units. The processor 30 implements various functions of the electronic device 100 by running or executing the computer programs and / or modules / units stored in the memory 20 and by calling data stored in the memory 20. The memory 20 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device 100 (such as audio data), etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other non-volatile solid-state storage device.
[0093] If the modules / units integrated in the electronic device 100 are implemented as software functional units and sold or used as independent products, they can be stored in a storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The storage medium can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the storage medium can be appropriately added or removed according to the requirements of patent practice. For example, according to patent practice, the storage medium does not include electrical carrier signals and telecommunication signals.
[0094] The document review method, apparatus, electronic device, and storage medium provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A document review method, characterized in that, include: Obtain a first sample dataset and a second sample dataset, wherein the first sample dataset includes text and corresponding layout annotation information, and the second sample dataset includes the text and corresponding text content information; The first original model is trained based on the first sample dataset to obtain a first target model for recognizing document layout; the second original model is trained based on the second sample dataset to obtain a second target model for recognizing document content, wherein both the first original model and the second original model are large language models; Obtain the document to be reviewed, input the document to be reviewed into the first target model, and obtain the first document with target layout annotation information; Input the first document into the second target model to obtain the target text content information corresponding to the document to be reviewed; The document to be reviewed is reviewed based on the target layout annotation information and the target text content information.
2. The document review method according to claim 1, characterized in that, The method further includes: Obtain a third sample dataset, wherein the third sample dataset includes text review information corresponding to the text; The third original model is trained based on the third sample dataset to obtain a third target model for document review and comparison, wherein the third original model is a large language model; The step of reviewing the document to be reviewed based on the target layout annotation information and the target text content information includes: The target layout annotation information and the target text content information are input into the third target model to obtain the review result of the document to be reviewed.
3. The document review method according to claim 2, characterized in that, Before inputting the target layout annotation information and the target text content information into the third target model, the method further includes: The target text content information is segmented according to the target layout annotation information to obtain N sub-text content information and sub-layout annotation information corresponding to each sub-text content information, where N is an integer greater than 1; The step of inputting the target layout annotation information and the target text content information into the third target model to obtain the review result of the document to be reviewed includes: Each sub-text content information and its corresponding sub-layout annotation information are input into the third target model to obtain N sub-review results; The N sub-audit results are input into the third target model for aggregation processing to obtain the audit result.
4. The document review method according to claim 2, characterized in that, Before inputting the target layout annotation information and the target text content information into the third target model, the method further includes: Respond to operation instructions and obtain document review rule information; The step of inputting the target layout annotation information and the target text content information into the third target model includes: The target layout annotation information, the target text content information, and the document review rule information are input into the third target model.
5. The document review method according to claim 1, characterized in that, Before inputting the document to be reviewed into the first target model, the process also includes: The document to be reviewed is converted to a second document with a preset format. The second document is preprocessed to obtain the third document, wherein the preprocessing includes at least one of watermark removal, background noise removal, rotation correction, and page number synchronization; The step of inputting the document to be reviewed into the first target model includes: The third document is input into the first target model.
6. The document review method according to claim 1, characterized in that, The step of inputting the document to be reviewed into the first target model to obtain a first document with target layout annotation information includes: The document to be reviewed is input into the first target model, and the first target model performs text layout recognition, table recognition, formula recognition and document hierarchy recognition on the document to be reviewed in sequence to obtain the first document.
7. The document review method according to any one of claims 1 to 6, characterized in that, The layout annotation information includes: Text annotation information, title annotation information, table annotation information, formula annotation information, and chart annotation information.
8. A document review device, characterized in that, include: The system comprises a first acquisition module, a first training module, a second training module, a second acquisition module, an input module, and an approval module. The first acquisition module is used to acquire a first sample dataset and a second sample dataset, wherein the first sample dataset includes text and corresponding layout annotation information, and the second sample dataset includes the text and corresponding text content information; The first training module is used to train the first original model based on the first sample dataset to obtain a first target model for recognizing document layout; The second training module is used to train the second original model based on the second sample dataset to obtain a second target model for recognizing document content, wherein both the first original model and the second original model are large language models; The second acquisition module is used to acquire documents to be reviewed; The input module is used to input the document to be reviewed into the first target model to obtain a first document with target layout annotation information; The input module is also used to input the first document into the second target model to obtain the target text content information corresponding to the document to be reviewed; The review module is used to review the document to be reviewed based on the target layout annotation information and the target text content information.
9. An electronic device, the electronic device comprising a processor and a memory, characterized in that, The memory is used to store instructions, and the processor is used to invoke the instructions in the memory to cause the electronic device to perform the document review method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium stores computer instructions that, when executed on an electronic device, cause the electronic device to perform the document review method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Model training method and device, equipment and storage medium
CN117808074A
Intelligent document auditing method and system based on multiple rule libraries
CN119399778A
Contract auditing method, device and equipment and computer readable storage medium
CN119600634A
Document analysis method and device, medium and computer program product
CN119692330A
Cited By
Safety auditing method and device based on artificial intelligence function, medium and equipment
CN121389141A
An artificial intelligence-based functional safety auditing method, device, medium, and apparatus
CN121389141B
