Intelligent document generation method and system based on double-engine cooperative mechanism
By adopting an intelligent document generation method based on a dual-engine collaborative mechanism, and combining semantic understanding and enhanced generation technology, the problems of low document generation efficiency and low proofreading accuracy are solved. This method achieves efficient generation of document content and multi-dimensional error correction, and is suitable for government and corporate document writing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHONGYUAN COMPUTING POWER TECHNOLOGY DEVELOPMENT CO LTD
- Filing Date
- 2025-07-05
- Publication Date
- 2026-07-03
Smart Images

Figure CN122334263A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language generation technology, specifically to an intelligent document generation method based on a dual-engine collaborative mechanism. Background Technology
[0002] Official documents are an important vehicle for governments and state-owned enterprises to release information, convey decisions, and guide work. Traditionally, official document drafting relies mainly on manual operation. Drafters need to have extensive knowledge of official document writing, professional knowledge in related fields, and a precise grasp of official document format standards. However, due to differences in the writing skills, logical thinking abilities, and understanding of policies and regulations among different drafters, it is difficult to unify standards in terms of the accuracy, standardization, rigor, completeness, and logic of official documents.
[0003] Deep learning-based natural language generation models (such as the GPT series and BERT) have achieved breakthroughs in general text generation, but they exhibit significant adaptability deficiencies in official document generation scenarios. First, these models lack the ability to deeply model the unique writing logic of official documents, often resulting in structural errors such as misplaced clause citations and overstepping authority boundaries. Second, a semantic gap exists between the model training data and policy texts, leading to insufficient relevance of policy clauses in the generated content. Finally, existing models lack factual knowledge verification mechanisms, easily producing hard errors such as misspelled institution names and mismatched ownership relationships. In the document review and proofreading stage, existing technologies use keyword matching retrieval, but this technology struggles to handle complex semantic scenarios; in cross-departmental joint documents, a single keyword may trigger multiple conflicting clauses. Furthermore, it cannot identify changes in the validity of clauses in policy update scenarios. Finally, the lack of a closed-loop feedback mechanism between generation and proofreading prevents error correction from feeding back into model optimization. Summary of the Invention
[0004] This invention provides an intelligent document generation method and system based on a dual-engine collaborative mechanism to solve the technical problems of low efficiency, long proofreading time, and low accuracy of proofreading results in existing document generation methods.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: Design an intelligent document generation method based on a dual-engine collaborative mechanism, including the following steps: S1: Pre-construction of databases: Pre-construction of auxiliary databases for document generation and proofreading, such as document template database, reference database, document knowledge graph, and format rule database, to provide rich, standardized, and secure document resources; S2: Document Requirement Input: User submits and generates requirements; S3: Draft document generation: The intelligent document generation engine analyzes user needs and generates draft documents. S4: Enhanced Search Review and Proofreading: The enhanced search review engine performs semantic vector retrieval and knowledge graph retrieval on the initial draft of official documents to obtain relevant data from policy databases and document databases; S5: Draft Revision of Official Documents: Based on the search results, the draft is revised to correct descriptive errors and verify factual errors, which helps to improve the content and quality of the official documents. S6: Document Output: Utilize format fixing to ensure that the format does not change during the output process, and complete the output of official documents in multiple formats.
[0006] Furthermore, the method for constructing the document template library in S1 is as follows: S1A1: Establish a three-dimensional classification framework based on document type (such as notice, report, approval), institutional level (such as ministerial level, provincial level, municipal level), and business area (such as finance, environmental protection, civil affairs), and adopt a tree-like coding structure (such as "GOV-NOTICE-FIN-001" to represent the template for government finance notices); S1A2: Automatically extracts template frameworks from historical official documents using natural language processing technology, identifies fixed fields (such as titles and document numbers) and variable fields (such as policy basis and responsible entities) in the template, and marks field constraints (such as "organization name" needing to be associated with knowledge graph entities); S1A3: Utilizes a template version traceability system to record template revision history (e.g., "2023 version of the Administrative Penalty Decision Letter adapted to the new Administrative Penalty Law"), triggers template iteration through the policy update monitoring module, and sets up a multi-level review process (preliminary review - compliance verification - final review) to ensure the template's authority; Furthermore, the method for constructing the reference library in S1 is as follows: S1B1: Integrate the policy and regulation database (including laws, administrative regulations, and departmental rules), the institutional ownership database (including the three-fixed plan and institutional reform documents), and the historical document database (including successful cases and typical error cases), and unify the data format through OCR and structured parsing technology; S1B2: Utilize named entity recognition technology to extract core elements (such as responsible parties, applicable conditions, and scope of effect) from policy clauses, and construct a metadata tagging system of "policy-clause-case" to support multi-dimensional retrieval (such as by level of effectiveness, publication time, and related matters).
[0007] S1B3: Embeds a policy timeliness verification module, automatically marks the status of clauses (valid / repealed / revised), and establishes a cross-policy citation relationship graph (such as automatically associating the revision basis document when a clause is partially repealed by a subsequent policy).
[0008] Furthermore, the method for constructing the document knowledge graph in S1 is as follows: S1C1: Defines the ontology model for official documents, including core categories such as organizational entities (name, level, function), legal entities (clauses, validity, related matters), and process nodes (approval links, authority thresholds). It extracts entity relationships from unstructured text (such as "XX Bureau belongs to XX Department") through graph neural networks (GNN). S1C2: Embeds semantic vector representations in knowledge graphs to support similarity reasoning (such as semantic equivalence judgment between "environmental impact assessment" and "environmental impact assessment approval"). S1C3: Injects logical rules (such as "Department A's authority does not include matter B"), and supports conflict detection (such as warning of functional overreach). S1C4: Capture events such as institutional reforms and policy revisions in real time, update graph nodes through incremental learning, and trigger synchronous adjustments to associated templates and rules (e.g., automatically freeze access permissions for related templates after a department is abolished).
[0009] Furthermore, the method for constructing the format rule base in S1 is as follows: S1D1: Based on the national standard "Format of Official Documents of Party and Government Organs" (GB / T 9704-2012), the document format is decomposed into three major modules: header, body, and footer, and the field-level constraints are refined (such as the year of the "document number" should be marked with hexagonal brackets "〔〕"). S1D2: Constructs a mapping relationship between format rules and business scenarios (such as "upward documents need to reserve a space for leader's signature"), and supports automatic adjustment of layout based on generated content to avoid manual secondary typesetting.
[0010] Furthermore, the intelligent document generation engine method in S3 includes two modules: semantic understanding and enhanced generation, as detailed below: S3A1: Semantic Understanding Module: Uses pre-trained language models (such as ERNIE, ChatGLM) to parse user input and identify document type and core elements (such as issuing unit, subject matter, and policy basis). S3A2: Enhanced Generation Module: Generates initial drafts based on the Transformer architecture, dynamically optimizes the generation strategy through a policy network, and the reward function includes scores for format standardization, terminology accuracy, and logical coherence. Furthermore, the enhanced retrieval verification engine in S4 includes three modules: semantic vector retrieval, knowledge graph retrieval, and composite verification, as detailed below: S4A1: Semantic Vector Retrieval Module: Encodes the initial draft of official documents into semantic vectors, retrieves similar clauses and cases from the policy database and historical database, and marks expression deviations; S4A2: Knowledge Graph Retrieval Module: Based on a domain knowledge graph (including organizational hierarchy, policy relationships, and business process rules), it verifies factual content (such as "Does the Municipal Development and Reform Commission have the authority to approve XX project") through graph traversal algorithms. S4A3: Composite Proofing Module: Combines semantic search and graph search results to generate correction suggestions (such as replacing policy terms and supplementing necessary attachments and processes). Furthermore, in step S5, a multi-dimensional review and verification process is conducted, as follows: S5A1: The semantic vector retrieval module compares the initial draft with the original text in the policy database, marking inconsistent or ambiguous terms. S5A2: Use the knowledge graph retrieval module to verify the organizational relationships, policy applicability, and business process compliance in the initial draft; S5A3: If the search results conflict with the initial draft (e.g., the policy has been repealed), the generation engine will be automatically triggered to regenerate the relevant paragraphs.
[0011] A second aspect of the present invention is to provide a machine-readable storage medium storing instructions that cause a machine to execute the above-described intelligent document generation method based on a dual-engine collaborative mechanism.
[0012] A third aspect of the present invention is to provide an artificial intelligence-based document generation system, comprising: The memory is configured to store instructions; and The processor is configured to retrieve the instructions from the memory and, when executing the instructions, to implement the aforementioned intelligent document generation method based on a dual-engine collaborative mechanism. Compared with the prior art, the beneficial technical effects of the present invention are as follows: In this invention, the intelligent document generation engine generates initial drafts of official documents based on semantic understanding and reinforcement learning technologies. The enhanced retrieval and verification engine then corrects descriptive and factual errors in the generated content through semantic vector retrieval, knowledge graph retrieval, and policy database matching. By utilizing the dynamic collaboration of the two engines, the intelligent document generation engine and the enhanced retrieval and verification engine can interact in real time, breaking through the lag of the traditional pipeline-style generation-proofreading model. By combining semantic generation, policy database retrieval, and knowledge graph reasoning technologies, it achieves efficient generation of document content and multi-dimensional error correction, significantly improving the accuracy and compliance of document processing. This meets the timeliness and accuracy requirements of various future scenarios and is applicable to government and corporate document writing. Attached Figure Description
[0013] Figure 1 This is a general flowchart of an embodiment of the present invention.
[0014] Figure 2This is a schematic diagram of the dual-engine collaborative mechanism in an embodiment of the present invention. Detailed Implementation
[0015] The specific embodiments of the present invention will be described below with reference to the accompanying drawings and examples. However, the following examples are only used to illustrate the present invention in detail and do not limit the scope of the present invention in any way.
[0016] Example 1: An intelligent document generation method based on a dual-engine collaborative mechanism, see [link to example]. Figure 1 and Figure 2 The system mainly includes six modules: database pre-construction, document requirement input, document draft generation, enhanced retrieval, review and proofreading, document draft revision, and document output. Taking the generation of the "Application Notice for High-tech Enterprise Certification in XX City" as an example, the specific steps are as follows: Step 1: Pre-construction of the database: Pre-construction of auxiliary databases for document generation and proofreading, such as document template library, reference material library, document knowledge graph, and format rule library, to provide rich, standardized, and secure document resources; First, a document template library was built in advance. The templates of various high-tech enterprise certification application notices were classified and organized using a three-dimensional classification framework based on document type, organizational level, and business field. The document templates were named using a tree-like coding structure and marked with key information such as applicable scenarios and release time. Collect historical official documents, and use natural language processing technology to automatically extract template frameworks from them, identify fixed and variable fields in the templates, and mark field constraints; for example, distinguish templates for different situations such as adjustments to application conditions and changes in application procedures, and build an official document template library; The template version traceability module records the template revision history, the policy update monitoring module triggers template iteration, and a multi-level review process is set up to ensure the template's authority.
[0017] Secondly, a reference database is constructed in advance, integrating national and local policy and regulatory databases related to the certification of high-tech enterprises (including policy documents and laws and regulations), such as the "Administrative Measures for the Certification of High-tech Enterprises" and the "Guidelines for the Certification of High-tech Enterprises in XX City," etc., and unifying the data format through OCR and structured parsing technologies. Core elements from policy clauses are extracted to construct a metadata tagging system of "policy-clause-case" to support multi-dimensional retrieval. A policy timeliness verification module is embedded to automatically mark the status of clauses (valid / repealed / revised), and a cross-policy citation relationship graph is established (e.g., when a clause is partially repealed by a subsequent policy, the revision basis document is automatically associated).
[0018] Then, a knowledge graph of official documents is constructed in advance, defining an ontology model of the official document domain, including core categories such as institutional entities (name, level, function), legal entities (clauses, validity, related matters), and process nodes (approval links, authority thresholds). The core concepts, processes, and policies related to the certification of high-tech enterprises (such as "high-tech enterprise certification conditions," "application process," "review standards," and "preferential policies") are used as nodes. Relationships (such as the inclusion relationship between "high-tech enterprise certification conditions" and specific conditions such as "R&D expenditure ratio" and "number of scientific and technological personnel," and the sequential relationship between "application process" and steps such as "submission of materials," "preliminary review," and "expert review") are used to connect the nodes. Graph neural networks (GNNs) are used to extract entity relationships (such as "XX Bureau belongs to XX Ministry") from unstructured text to build the knowledge graph.
[0019] Semantic vector representations are embedded in the knowledge graph to support similarity reasoning (such as determining the semantic equivalence between "environmental impact assessment" and "environmental impact assessment approval"). Logical rules are injected (such as "Department A's authority does not include matter B") to support conflict detection (such as early warning of overstepping authority). Events such as institutional reforms and policy revisions are captured in real time, and graph nodes are updated through incremental learning, triggering synchronous adjustments to associated templates and rules (such as automatically freezing access to related templates after a department is abolished).
[0020] Finally, the format rule library is constructed in advance. Based on the national official document format standards and the common format requirements of the application notice for high-tech enterprise certification, the format of each part, such as the title (font is Songti No. 2, bold), the body text (using Fangsong No. 3 font, paragraph spacing is a fixed value of 28 points, etc.), and the signature (company name, date format specifications), is defined to form the format rule library.
[0021] Step 2: Input of document requirements: The writer submits the document generation requirements on the interactive interface.
[0022] (1) The writer clearly inputs the requirements in the interactive interface: "Draft a notice of recognition of high-tech enterprises, based on the 'Regulations on Promoting Science and Technology Innovation in XX City'".
[0023] (2) Provide a detailed description of the key information to be covered in the notice, such as the approximate time frame for recognition and the types of enterprises targeted.
[0024] Step 3: Generating the first draft of the official document: The intelligent document generation engine analyzes the user's needs and generates the first draft of the official document.
[0025] like Figure 2 As shown, the specific steps are as follows: First, after receiving the request, the intelligent document generation engine calls the enhanced document semantic understanding module (such as ERNIE, ChatGLM) to analyze the request and identify the document type and core elements (such as the issuing unit, the subject matter, and the policy basis). Secondly, the relevant document template for the high-tech enterprise certification notice is retrieved from the document template library by pulling document templates; Then, using text retrieval vectors, the thematic content fragments of official documents are extracted from the reference database; Then, a knowledge graph retrieval strategy is used to retrieve structured document knowledge elements from the document knowledge graph; Finally, the document generation enhancement module is invoked. Based on the Tansformer architecture, it dynamically optimizes the generation strategy and reward function (scores for format conformity, terminology accuracy, and logical coherence) through a policy network, embedding standard formats and basic policy terminology to generate a draft document. The intelligent document generation engine's reinforcement learning policy network uses policy matching degree and format conformity scores as reward signals, updating network parameters through the PPO algorithm.
[0026] Step 4: Enhanced Search Review and Proofreading: The enhanced search review engine performs semantic vector retrieval and knowledge graph retrieval on the initial draft of the official document, retrieving relevant data from policy databases and document repositories. For example... Figure 2 As shown, the specific steps are as follows: First, the enhanced search and proofreading engine receives the initial draft of the official document, calls the semantic vector retrieval module, encodes the initial draft of the official document into semantic vectors in segments, and retrieves similar clauses and cases from databases such as policy databases and historical databases, and marks the expression deviations.
[0027] (1) The semantic vector retrieval module compares the wording of the “identification criteria” in the initial draft with the original text of the “XX City Science and Technology Innovation Promotion Regulations” word by word; (2) After discovering the differences in expression, select the accurate terms from the standardized terminology database and mark and modify them.
[0028] Secondly, the semantic content is compared with the audio content in the reference database, and the semantic content comparison results are fed back to the enhanced retrieval verification engine.
[0029] Finally, the knowledge graph verification and official document knowledge graph verification were used to verify the organizational relationships, policy applicability, and business process compliance in the initial draft, and the knowledge graph verification results were fed back to the enhanced search review engine.
[0030] (1) Using knowledge graph retrieval, the review engine sorts out the organizational structure and business process information related to the certification of high-tech enterprises.
[0031] (2) If an error is found, it will be automatically corrected. For example, the approval unit in the initial draft can be changed from "Municipal Development and Reform Commission" to "Municipal Science and Technology Bureau" and automatically corrected in the initial draft.
[0032] (3) Feed back the knowledge graph verification results to the enhanced retrieval verification engine.
[0033] The semantic vector retrieval module of the enhanced retrieval review engine adopts a contrastive learning model to map policy library texts and draft paragraphs to the same vector space, and determines expression deviations through similarity thresholds.
[0034] Step 5: Draft revision: Based on the search results, the draft is revised to correct descriptive errors and verify factual errors, which helps to improve the content and quality of the document.
[0035] First, by combining the results of semantic retrieval and graph retrieval, correction suggestions are generated (such as replacing policy terminology and supplementing necessary attachments and processes).
[0036] Then, the document format is corrected using the format rule library, and the result of the document format correction is fed back to the enhanced search and review engine.
[0037] Finally, the enhanced retrieval and verification engine feeds back the proofread results to the intelligent document generation engine, and adjusts the strategy network weights through reinforcement learning to improve the accuracy of subsequent generation.
[0038] The knowledge graph retrieval module uses entity alignment technology to match the organization names and policy clauses in the initial draft with graph nodes, and verifies the legality of business processes based on path reasoning.
[0039] Step 6: Document Output: After the revised notice is confirmed by the drafter, it is output in multiple formats, and the network parameters for the engine update strategy are generated at the same time.
[0040] First, the revised notification, after being confirmed by the drafter, can be exported to various formats such as Word and PDF. It also supports importing templates from external sources, enhancing the system's flexibility and compatibility.
[0041] Then, the intelligent document generation engine collects data during the generation and review process, such as user requirement type, number of modifications, and modification type, updates strategy network parameters, optimizes algorithm models, and improves the accuracy and efficiency of generating similar documents.
[0042] The present invention has been described in detail above with reference to the accompanying drawings and embodiments. However, those skilled in the art will understand that, without departing from the spirit of the present invention, various specific parameters in the above embodiments can be changed to form multiple specific embodiments, all of which are common variations of the present invention, and will not be described in detail here.
Claims
1. An intelligent document generation method based on a dual-engine collaborative mechanism, characterized in that, Includes the following steps: S1: Pre-construction of database: Pre-construction of databases to assist in the generation and proofreading of official documents, providing rich, standardized and secure official document resources. The database includes an official document template library, a reference library, an official document knowledge graph, and a format rule library. S2: Document Request Input: Submit document generation request; S3: Initial Draft Generation of Official Documents: The intelligent official document generation engine analyzes the user requirements in S2 and generates an initial draft of the official document. S4: Enhanced Search Review and Proofreading: The enhanced search review engine performs semantic vector retrieval and knowledge graph retrieval on the initial draft of the official document to obtain related data from the database in S1; S5: Draft Revision: Based on the search results in S4, the draft is revised to correct descriptive errors and verify factual errors, which helps to improve the content and quality of the document. S6: Document Output: Utilize format solidification to ensure that the format does not change during the output process, and complete the output of official documents in multiple formats.
2. The method of claim 1, wherein the method further comprises: The construction of the official document template library in step S1 includes: S1A1: Establishing a three-dimensional classification framework based on document type, organizational level, and business domain, and naming official document templates using a tree-like coding structure; S1A2: Collect historical documents, automatically extract template frames from historical documents using natural language processing technology, identify fixed and variable fields in the template, and annotate field constraints; S1A3: Utilizes the template version traceability module to record the template revision history, triggers template iteration through the policy update monitoring module, and sets up a multi-level review process to ensure the template's authority. 3.The intelligent document generation method based on dual-engine collaborative mechanism according to claim 1, characterized in that, The construction of the reference database in step S1 includes: S1B1: Integrating the policy and regulation database, the institutional ownership database, and the historical document database, and unifying the data format through OCR and structured parsing technology; S1B2: Utilize named entity recognition to extract core elements from policy clauses and construct a metadata tagging system of "policy-clause-case" to support multi-dimensional retrieval; S1B3: Embeds a policy timeliness verification module, automatically marks the status of clauses, and establishes a cross-policy citation relationship graph.
4. The method for intelligent document generation based on dual engine collaborative mechanism according to claim 1, characterized in that, The construction of the document knowledge graph in step S1 includes: S1C1: Defines the ontology model of official documents, including institutional entities, legal entities, and process nodes, and extracts entity relationships from unstructured text through graph neural networks (GNNs). S1C2: Embedding semantic vector representations in knowledge graphs to support similarity reasoning; S1C3: Inject logical rules to support conflict detection; S1C4: Captures events such as institutional reforms and policy revisions in real time, updates graph nodes through incremental learning, and triggers synchronous adjustments to associated templates and rules.
5. The method for intelligent document generation based on dual engine collaborative mechanism according to claim 1, characterized in that, The construction of the format rule base in step S1 includes: S1D1: Based on the national standard for official document format, the official document format is broken down into three major modules: header, body, and footer, with detailed field-level constraints; S1D2: Constructs a mapping relationship between formatting rules and business scenarios, and automatically adjusts the layout based on the generated content to avoid manual secondary typesetting.
6. The method for intelligent document generation based on dual engine collaborative mechanism according to claim 1, characterized in that, The intelligent document generation engine in step S3 includes: S3A1: Semantic Understanding Module: Uses a pre-trained language model to parse user input and identify document types and core elements; S3A2: Enhanced Generation Module: Generates initial drafts based on the Transformer architecture and dynamically optimizes the generation strategy through a policy network. The reward function includes scores for format standardization, terminology accuracy, and logical coherence.
7. The method for intelligent document generation based on dual engine collaborative mechanism according to claim 1, characterized in that, The enhanced retrieval and review engine in step S4 includes: S4A1: Semantic vector retrieval module: segments the initial draft of the official document into semantic vectors, retrieves similar clauses and cases from the official document template library, and marks expression deviations; S4A2: Knowledge Graph Retrieval Module: Based on official document knowledge graphs, factual content is verified through graph traversal algorithms; S4A3: Composite Proofreading Module: Combines semantic retrieval and graph retrieval results to generate correction suggestions.
8. The method for intelligent document generation based on dual engine collaborative mechanism according to claim 1, characterized in that, In step S5, the review and proofreading are carried out in a multi-dimensional way, including: S5A1: comparing the draft with the original text in the reference database through semantic vector retrieval, and marking inconsistent terms or ambiguous expressions. S5A2: Use knowledge graph retrieval to verify the organizational relationships, policy applicability, and business process compliance in the initial draft; S5A3: If the search results conflict with the initial draft, the generation engine will be automatically triggered to regenerate the relevant paragraphs.
9. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores instructions for causing the machine to execute the intelligent document generation method based on a dual-engine collaborative mechanism according to any one of claims 1 to 8.
10. An artificial intelligence-based document generation system, characterized in that, include: The memory is configured to store instructions; as well as The processor is configured to retrieve the instructions from the memory and, when executing the instructions, to implement the intelligent document generation method based on a dual-engine collaborative mechanism according to any one of claims 1 to 8.