Long engineering document intelligent generation method and system based on reverse analysis and skill transfer
Patent Information
- Application Number
- CN202611100260.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-23
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2046-07-23
AI Technical Summary
[0005]本申请的目的在于提供一种基于逆向分析与技能迁移的长篇工程文档智能生成方法及系统,以解决现有技术在新项目证据完整但工程条件超出章节写作技能适用范围时,如何确定不能直接迁移的章节输出项,保留仍有依据的内容,并限定需要重新核验的内容范围,进而提高长篇工程文档智能生成准确性的问题
第一,本申请通过生成替代工程事实并复现章节输出项,筛选引起输出项变化的最小反事实触发集,据此确定章节写作技能的迁移失效边界;再利用正例和边界反例校正候选章节写作技能,使技能验证由仅复现示例项目扩展为同时验证适用条件变化,能够识别证据完整但写作技能不再适用的情况。
Smart Images

Figure CN122635326B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of artificial intelligence and document processing technology, and in particular to a method and system for intelligent generation of long engineering documents based on reverse analysis and skills transfer. Background Technology
[0002] Environmental impact reports, safety pre-evaluation reports, and other lengthy engineering documents are important bases for project approval, engineering review, and safety assessment. Their conclusions need to be supported by project facts, engineering parameters, calculation results, and standards and specifications.
[0003] Existing intelligent generation methods can extract chapter output items from the final example document, align the chapter output items with supporting evidence in the example references, construct chapter evidence diagrams and chapter evidence skeletons, and acquire chapter writing skills by reproducing example chapters; when generating new project documents, evidence slots are filled from the new project materials, and after the required evidence is complete and the dependencies are closed, the corresponding chapters are generated using chapter writing skills.
[0004] However, consistent reproduction of the example chapters only indicates that the writing skills are sufficient to handle the example project, and a closed chain of evidence only indicates that the necessary information for the new project has been obtained. Neither of these proves that the calculation methods, applicable standards, and conclusion rules in the example project are still applicable to the new project. For example, the reactor in the example project was evaluated as having manageable risk when the process temperature was lower and nitrogen protection facilities were installed; although the new project has provided complete information on reaction temperature, material type, and protection facility status, the conditions for the original conclusion have changed when the process temperature exceeds the evaluation threshold and equivalent protection facilities are not installed. Existing methods struggle to identify the impact of this change on calculation results, standard judgments, and conclusions in related chapters, potentially leading to the generation of definitive content lacking supporting evidence; discarding the relevant chapters entirely would result in the loss of still valid equipment descriptions and engineering facts. Summary of the Invention
[0005] The purpose of this application is to provide a method and system for intelligent generation of long engineering documents based on reverse analysis and skill transfer, in order to solve the problem of how to determine the chapter output items that cannot be directly transferred when the evidence for a new project is complete but the engineering conditions exceed the applicable scope of chapter writing skills, retain the content that still has evidence, and limit the scope of content that needs to be re-verified, thereby improving the accuracy of intelligent generation of long engineering documents.
[0006] To address the aforementioned technical problems, firstly, this application provides a method for intelligently generating long engineering documents based on reverse analysis and skills transfer, the method comprising: Obtain writing guidelines, sample reference sets, sample final documents, and new project reference sets for the target document type; By performing joint reverse analysis on the example reference set and the example final document, the migration failure boundary and slot dependency relationship are determined, and the target chapter writing skills are generated. Based on the target chapter writing skills, evidence slots are filled in the new project reference set. When the filling result triggers the migration failure boundary, the evidence slot corresponding to the triggering fact is used as the pollution starting node. Backpropagation is performed according to different relationship types in the slot dependency relationship to determine the polluted output item. Identify contamination cutoff slots along the backpropagation path, retain expression units that do not depend on contamination cutoff slots, and replace the content of contamination cutoff slots with verification placeholders to generate chapter fragments to be verified; determine the verification priority according to the relationship type and the number of associated output items of the contamination cutoff slots, and generate a verification list; For uncontaminated output items, generate deterministic chapter content. Then, according to the writing guidelines, aggregate the deterministic chapter content, the chapter fragments to be verified, and the verification list. Finally, perform document consistency arrangement processing on the aggregation results to obtain a long-form project document of the target document type.
[0007] Secondly, this application provides an intelligent generation system for long engineering documents based on reverse analysis and skills transfer, the system comprising: The acquisition module is used to acquire writing guidelines, sample reference sets, sample final documents, and new project reference sets for the target document type. The reverse analysis module is used to determine the migration failure boundary and slot dependency relationship by performing joint reverse analysis on the example reference set and the example final document, and to generate the target chapter writing skills. The backpropagation module is used to fill evidence slots in the new project reference set based on the target chapter writing skills. When the filling result triggers the migration failure boundary, the evidence slot corresponding to the triggering fact is used as the pollution starting node. Backpropagation is performed according to different relationship types in the slot dependency relationship to determine the polluted output item. The generation module is used to identify contamination cutoff slots along the backpropagation path, retain expression units that do not depend on contamination cutoff slots, and replace the content of contamination cutoff slots with verification placeholders to generate chapter fragments to be verified; the verification priority is determined according to the relationship type of contamination cutoff slots and the number of associated output items to generate a verification list. The aggregation module is used to generate deterministic chapter content from uncontaminated output items, aggregate the deterministic chapter content, the chapter fragments to be verified, and the verification list according to the writing guidelines, and perform document consistency arrangement processing on the aggregation results to obtain a long project document of the target document type.
[0008] The intelligent generation method for long engineering documents based on reverse analysis and skills transfer provided in this application has the following beneficial effects: First, this application generates alternative engineering facts and reproduces chapter output items to filter the minimum counterfactual trigger set that causes changes in output items, thereby determining the transfer failure boundary of chapter writing skills; then, it uses positive examples and boundary counterexamples to correct candidate chapter writing skills, so that skill verification is expanded from only reproducing example items to simultaneously verifying changes in applicable conditions, and can identify situations where the evidence is complete but the writing skills are no longer applicable.
[0009] Second, when a new project fact triggers the migration failure boundary, this application propagates the fact change according to the relationship of source, calculation, standard application and conclusion derivation, and only identifies the chapter output items that have changed and reached as contaminated output items, thereby avoiding the inclusion of content that has no effective dependency on the triggering fact as non-migratable.
[0010] Third, this application identifies contamination cutoff slots from the propagation path leading to the same contaminated output item, and replaces the expression content that depends on the contamination cutoff slots with only verification placeholders, thus preserving engineering facts and expression units that still have data to support them; and by forming a verification list and verification order based on the relationship type and the number of associated output items, the scope of supplementary data and verification can be narrowed.
[0011] Fourth, this application maps the content of definitive chapters, chapter fragments to be verified, and verification lists to the chapter tree, and uniformly updates the numbering, cross-references, and conclusion status. It restricts the conclusions to be verified from entering the abstract or overall conclusion as definitive conclusions, thereby reducing the risk of inapplicable conclusions entering the target document and maintaining the consistency of data, references, and conclusion status in long engineering documents, thereby improving the accuracy of intelligent generation of long engineering documents. Attached Figure Description
[0012] To more clearly illustrate the technical solutions of the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a flowchart illustrating a method for intelligently generating long engineering documents based on reverse analysis and skill transfer disclosed in this application. Figure 2 This is a flowchart illustrating the joint reverse analysis disclosed in this application; Figure 3 This is a schematic diagram of the joint reverse analysis interface disclosed in this application; Figure 4This is a schematic diagram of the counterfactual reproduction and skill verification interface disclosed in this application; Figure 5 This is a schematic diagram of the structure of a long-form engineering document intelligent generation system based on reverse analysis and skill transfer disclosed in this application. Detailed Implementation
[0014] The research and development approach of this application is as follows: First, recover the executable evidence dependencies and output generation rules from the reference materials and final documents of the example project; second, use alternative engineering facts to verify the applicability of the recovered rules; finally, when a new project exceeds this applicability, only restrict the generation of affected outputs, without discarding the content still supported by the rules in the same section. The following example illustrates this using the generation of the chapter on the fire and explosion risk of the reactor in a safety pre-evaluation report for a fine chemical construction project.
[0015] In this application, the migration failure boundary refers to a data structure consisting of alternative engineering facts, corresponding evidence slots, output item change types, and triggering conditions in the minimum counterfactual trigger set, used to determine whether new project engineering facts render the original reasoning rules of the target chapter writing skills inapplicable.
[0016] Contaminated output items refer to chapter output items whose node states change when re-executed along slot dependencies after the new project's engineering facts trigger the migration failure boundary and cannot continue to be directly generated as deterministic content; the contamination only indicates that the skill migration state has changed, and does not indicate that the original reference materials have been tampered with, damaged or distorted.
[0017] The target document type refers to the document category of the long-form engineering document to be generated, which can be an engineering design general specification, environmental impact report, safety pre-evaluation report, or occupational health assessment report. The chapter structure, data sources, standard basis, and conclusion organization of different target document types are carried out by the corresponding writing guidelines and example projects. The same processing chain is used for joint reverse analysis, target chapter writing skills generation, new project skills execution, and document consistency arrangement, thereby externalizing the differences in document types into configurable inputs.
[0018] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] Figure 1 This is a flowchart illustrating a method for intelligently generating long engineering documents based on reverse analysis and skills transfer, as disclosed in this application. Figure 1As shown, the method includes: S11. Obtain writing guidelines, sample reference sets, sample final documents, and new project reference sets for the target document type.
[0020] The target document type is the category of the long-form engineering document to be generated; the writing guide is a file that records the chapter structure and key points of writing this type of document; the example reference set is the collection of project materials on which the example final document is based; the example final document is a document of the same type that has been completed and meets the preset quality requirements; the new project reference set is the collection of project materials corresponding to the document to be generated.
[0021] In practical implementation, this application performs structured processing on each document, generating a file identifier, version identifier, and content hash value for each document. It also parses the table of contents, heading levels, body paragraphs, tables, figure titles, and specification clause identifiers to form a document structure index that can be accessed according to file identifiers and document locations. For scanned documents, layout analysis and text recognition are performed first; for engineering drawings, equipment numbers, pipeline numbers, and drawing numbers are written into the document structure index.
[0022] In this embodiment, the guidelines define chapters such as "Overview," "Project Overview," "Identification and Analysis of Hazardous Factors," "Evaluation Unit Division," "Qualitative and Quantitative Evaluation," "Recommendations for Safety Countermeasures," and "Evaluation Conclusions." The example reference set includes project approval documents, feasibility study reports, site layout plans, process flow diagrams, equipment lists, material safety data, safety facility design documents, and applicable standards and specifications.
[0023] For example, the main contents of each document are shown in Table 1: Table 1. Main Contents for Each Data Category
[0024] Step S11 yields a data structure index carrying file identifiers, version identifiers, and document locations, enabling subsequent data extracted from each document to trace back to the original document location and avoiding the retention of only text fragments out of context.
[0025] S12. By performing joint reverse analysis on the example reference set and the example final document, the migration failure boundary and slot dependency relationship are determined, and the target chapter writing skills are generated.
[0026] In this step, the joint reverse analysis is an analysis process that targets the chapter output items in the example final document while tracing the supporting evidence and processing relationships in the example references; the migration failure boundary is the engineering fact triggering condition that makes the original chapter generation rules no longer directly applicable to the new project; the slot dependency relationship is the directed processing relationship between evidence slots, intermediate inference nodes, and chapter output items; the target chapter writing skill is a set of executable rules that includes evidence slots, execution order, inference processing rules, migration failure boundaries, and chapter description rules.
[0027] In specific implementation, this application uses the data structure index obtained in step S11 as the access entry point, calls the joint reverse analysis process described in the second embodiment, outputs the target chapter writing skill record stored according to chapter task units, and associates the skill record with the target document type identifier, chapter number, and example data version identifier. Through step S12, the project-specific text in the example document is converted into chapter writing skills with evidence sources, execution order, and applicable boundaries, so that the generation of subsequent new projects does not depend on simply hollowing out or directly applying the example text.
[0028] S13. Based on the target chapter writing skills, fill the evidence slots in the new project reference set. When the filling result triggers the migration failure boundary, take the evidence slot corresponding to the triggering fact as the pollution starting node, perform back propagation according to different relationship types in the slot dependency relationship, and determine the polluted output item.
[0029] In this step, the evidence slot is the data location in the target chapter writing skills that awaits the value of new project evidence; the triggering fact is the new project engineering fact that meets the triggering conditions in the migration failure boundary.
[0030] As an optional implementation, backpropagation includes the following process: Step 131: Map the new project engineering facts that meet the triggering conditions in the migration failure boundary to the corresponding evidence slots, and mark the mapped evidence slots as the contamination start nodes.
[0031] In this step, the mapping matches the new project project facts referenced by the migration failure boundary triggering conditions with the slot descriptor based on the project object, attribute fields, data type, and unit of measurement.
[0032] In practice, this application retrieves the migration failure boundary and its minimum counterfactual trigger set from the target chapter writing skills, and retrieves the corresponding engineering facts from the new project evidence slot filling results. After all triggering conditions in the minimum counterfactual trigger set are simultaneously met, the slot descriptor is matched according to the engineering object and attribute fields, the numerical values are normalized in terms of measurement units, and the evidence slots corresponding to each triggering fact are written into the pollution initiation node marker. The marker records the evidence slot identifier, the triggering fact, and the data source location, forming the results shown in Table 2.
[0033] Table 2. Results of Pollution Initiation Node Marking
[0034] Table 2 records the triggering facts, corresponding evidence slots, and contamination initiation node markers processed in step 131, excluding other evidence slots that are not involved in the current migration failure boundary or are only used for subsequent propagation processing. In this embodiment, the temperature triggering range is determined by step S125 through the reproduction of alternative engineering facts; when the value of sT falls within the temperature triggering range and the value of sN is in a failed or unconfigured state, the combined triggering condition is met, and therefore sT and sN are marked as contamination initiation nodes for step 132 to traverse the slot dependencies.
[0035] Step 132: Traverse the slot dependency relationship from the pollution initiation node in the opposite direction to the supporting evidence traced by the chapter output items during the joint reverse analysis.
[0036] In this step, the opposite direction is the generation direction from the evidence slot to the intermediate reasoning node and the chapter output item; traversing the slot dependency relationship is the process of determining the successor node based on the outgoing edge of the current node and visiting them in sequence.
[0037] In practical implementation, this application writes the pollution initiation node into a processing queue, reads its successor nodes according to slot dependencies, and sorts the successor nodes according to the skill execution sequence in the target chapter writing skills. For each node retrieved, the predecessor node identifier, connection edge type, and the input evidence slot identifier read during the current relationship processing are recorded. The input evidence slot is recorded as the input node for the corresponding relationship processing node in the backpropagation path. Nodes that have already been processed and whose input state has not changed are not re-enqueued.
[0038] Step 133: When the calculation relationship is passed, the intermediate results dependent on the pollution initiation node are recalculated; when the normative application relationship is passed, the application status of the corresponding normative clause is reassessed; when the conclusion derivation relationship is passed, the conclusion triggering condition is reassessed, and the propagation continues when the intermediate results, application status, or conclusion triggering results change.
[0039] In this step, the intermediate result is the node value obtained by the calculation operator from the value of the evidence slot; the applicable status is the mark indicating whether the standard clause is applicable or not applicable to the current combination of engineering facts; the conclusion trigger result is the status value of whether the conclusion trigger condition is met or not.
[0040] In practical implementation, this application calls the corresponding processing operator according to the connection edge type, and compares the newly obtained node state with the example execution state; if the states are the same, the current branch is terminated; if the states are different, the node state is updated and the successor node of that node is added to the queue to be processed. The node state update during the propagation process can be expressed as equation (1): (1) in, Indicates the successor node The state of change relative to the example execution result; Indicates the current node; This indicates the successor node determined by the slot dependency relationship; Indicates the type of relationship between the current node and its successor node; This indicates source comparison, recalculation, norm application judgment, or conclusion judgment operations corresponding to the relation type; This indicates the values of other filled slots required to execute the successor node.
[0041] Step 134: Record the nodes and connecting edges that lead from the pollution initiation node to the chapter output item, forming a back propagation path, and determine the chapter output item reached by the back propagation path as the polluted output item.
[0042] In this step, the backpropagation path is a directed path that sequentially records the pollution starting node, the intermediate inference node whose state has changed, the connecting edge, and the chapter output item; the pollution refers to a change in the skill migration state, not to the original reference material being tampered with or damaged.
[0043] In practical implementation, this application traces back from the chapter output item reached through the reverse propagation path along the predecessor record to the pollution initiation node, sequentially writing the node identifier, connection edge type, input evidence slot read by relation processing, pre-change state, and post-change state, and identifying chapter output items with complete backtracking paths as polluted output items. Since propagation continues only when the intermediate result, applicable state, or conclusion trigger result described in step 133 changes, the complete backtracking path also records the basis for the output item being affected by the triggering fact.
[0044] For the path sCalc-R101 reaches O4 via C1, O6, and C2, record the changes in calculation parameters, calculation results, and the applicable status of the standard; for the path sProtect-R101 reaches O4 via C3, O5, and C2, record the protection effectiveness judgment and its impact on the applicable status of the evaluation rules; for the path sRule-R101 reaches O4 via C2, record the re-judgment results of the standard provisions and applicable conditions. The resulting propagation paths include at least: sCalc-R101→C1→O6, and sCalc-R101→C1→O6→C2→O4; sProtect-R101→C3→O5, and sProtect-R101→C3→O5→C2→O4; sRule-R101→C2→O4.
[0045] Through steps 131 to 134, slot dependencies are used to determine successor nodes, processing order, relationship processing operations, and propagation termination positions, so that dependency branches with unchanged states stop propagating in a timely manner, and limit the chapter output items that need to be reprocessed to the range with complete propagation paths.
[0046] S14. Identify contamination cutoff slots along the back propagation path, retain expression units that do not depend on contamination cutoff slots, and replace the content of contamination cutoff slots with verification placeholders to generate chapter fragments to be verified; determine the verification priority according to the relationship type of contamination cutoff slots and the number of associated output items, and generate a verification list.
[0047] In this step, the contamination cutoff slot is an evidence slot that can cut off the propagation path to the same contaminated output item and is used to limit the scope of the content to be verified; the expression unit is the smallest chapter content unit divided according to the functions of facts, calculations, normative judgments or conclusions; the verification placeholder is a structured mark that replaces the content to be verified and records the slot identifier, engineering object, attribute fields and required evidence type; the verification priority is used to determine the verification processing order.
[0048] As an optional implementation, the step of generating the chapter fragment to be verified can be achieved through the following process: Step 141: Group the back propagation paths according to the contaminated output items, and extract evidence slots with data source locations or data types to be supplemented from each back propagation path.
[0049] In this step, the data source location refers to the file identifier and document location of the evidence slot value in the original data; the data type to be supplemented refers to the file category or data category that needs to be supplemented when the current evidence is insufficient. In specific implementation, this application groups the back propagation paths according to the contaminated output item identifier, traverses each path and extracts the evidence slots with data source locations or data types to be supplemented. Slots with stable source locations are marked as traceable fact slots, and slots that record data types to be supplemented are marked as slots to be verified.
[0050] In this embodiment, sRule-R101, sProtect-R101, and sCalc-R101 are all evidence slots generated in step S124 and incorporated into the chapter evidence graph. When forming the backpropagation path in step 134, the three slots, their corresponding intermediate inference nodes, and chapter output items are recorded as path nodes according to the slot dependency relationship determined in Table 4.
[0051] When new project data cannot meet the execution conditions for judging the applicability of standards, the effectiveness of protection, or the calculation of parameters, the slot records of sRule-R101, sProtect-R101, and sCalc-R101 respectively include supplementary data types such as standard clauses and explanations of applicable conditions, safety facility design documents and control indicators, process calculation sheets, and material property parameters. Step 141 extracts these three slots as candidate evidence slots, rather than adding new evidence slots during the pollution cutoff stage.
[0052] Step 142: Select the set of slots that intersects all backpropagation paths of the same contaminated output item and has the fewest number of evidence slots as the contaminated cutoff slots.
[0053] In this step, "intersecting with all backpropagation paths" means that the selected set of slots contains at least one slot on every path leading to the same contaminated output item; the minimum number of slots is used to limit the number of entry points to be verified. This application first uses the slots to be verified to form a set of candidate evidence slots. When the set cannot cover all propagation paths, a backtrackable fact slot is added. For the contaminated output item o, the contaminated cutoff slot set is determined according to equation (2).
[0054] (2) in, Indicates contaminated output items The corresponding set of pollution cutoff slots; Indicates arrival at contaminated output item The set of candidate evidence slots in the propagation path; This represents the number of evidence slots contained in the candidate slot set C; Indicates arrival at contaminated output item The complete set of backpropagation paths; Represents any path in the set of backpropagation paths; This indicates that the candidate slot set C intersects with each propagation path.
[0055] When solving equation (2), this application establishes a path-slot association matrix with the backpropagation path as the row and the candidate evidence slot as the column; when the candidate evidence slot is located on the corresponding path, the matrix element is set to 1, otherwise it is set to 0. This application enumerates the candidate slot combinations from the fewest to the most slots, and retains a combination that covers at least one value of 1 in each row; when a feasible combination is obtained for the first time, the number of slots is stopped from increasing, and the total number of connection edges from the slot to the contaminated output item is used as the secondary sorting condition for the same number of combinations to obtain the contaminated truncated slot set.
[0056] In the path-slot correlation matrix of this embodiment, sRule-R101 is located in the path related to the applicable status of the specification, sProtect-R101 is located in the path related to the protection effectiveness, and sCalc-R101 is located in the path related to the parameter calculation. For each contaminated output item, step 142 calculates the set with the fewest intersecting slots on all back propagation paths leading to that output item; after merging and deduplicating the sets obtained for each contaminated output item, this embodiment obtains a contaminated cutoff slot set composed of the above three slots.
[0057] Step 143: Divide the chapter content corresponding to the contaminated output item into expression units according to the chapter description rules.
[0058] In this step, the fact expression unit records engineering facts, the calculation expression unit records the calculation process or results, the standard judgment expression unit records the judgment of the applicability of the provisions, and the conclusion expression unit records the evaluation conclusion. In specific implementation, this application divides the chapter content according to the punctuation at the end of sentences, the boundaries of table cells, and the boundaries of standard references, reads the chapter output item identifier, and traverses backward from the output item along the chapter evidence diagram to the evidence slot. The slot identifier traversed is written into the dependency field of the corresponding expression unit, thereby establishing the mapping relationship between the expression unit and the evidence slot.
[0059] Step 144: Retain the expression units that do not reference the pollution cutoff slot, and replace the engineering facts, standard application results or conclusions that reference the pollution cutoff slot with verification placeholders. The verification placeholders record the slot identifier, the engineering object to be verified, the attribute fields and the required evidence type.
[0060] In practical implementation, this application queries the dependency fields of each expression unit and retains expression units that do not contain pollution cutoff slot identifiers. For expression units that reference pollution cutoff slots, the engineering facts, standard application results, or conclusions that reference the pollution cutoff slots are replaced with verification placeholders, and a placeholder identifier is generated for each verification placeholder. The corresponding pollution cutoff slot and the entry node for re-executing the skill sequence are recorded. Other content in the expression unit that does not reference pollution cutoff slots and has a stable source is retained.
[0061] Step 145: Combine the retained expression units and the verification placeholders according to the original expression order to generate the chapter fragment to be verified.
[0062] In this step, the original expression order is the order of expression units recorded in the chapter description rules. In specific implementation, this application uses the expression unit number as the key to merge the retained expression units and verification placeholders in sequence, and inherits the normative reference position and paragraph level in the original chapter to obtain the chapter fragment to be verified. For example, factual expressions such as equipment numbers and material names that do not depend on the pollution cutoff tank are retained; normative application results, protection effectiveness statements, calculation results, and conclusion statements that reference sRule-R101, sProtect-R101, or sCalc-R101 are replaced with verification placeholders that record the corresponding tank identifier and the required evidence type.
[0063] As an optional implementation method, the steps for generating the verification checklist are as follows: Step 146: Determine the connection edge type from each contamination cutoff slot to the contaminated output item, and count the number of associated output items associated with each contamination cutoff slot.
[0064] In this step, the connection edge type is the relationship category that directly supports the path from the contaminated cutoff slot to the contaminated output item; the number of associated output items is the number of different chapter output items that can be reached from this slot along the state change path. In specific implementation, this application traverses the subsequent paths of each contaminated cutoff slot, records the direct support relationship type when first reaching each contaminated output item, and counts duplicates according to the output item identifier.
[0065] Step 147: Set the pollution cutoff slots of conclusive output items associated with normative application relationships or conclusion derivation relationships to the first verification level, set the pollution cutoff slots of numerical output items associated with calculation relationships to the second verification level, and set the pollution cutoff slots of referenced output items associated with source relationships to the third verification level.
[0066] In this step, the first verification level corresponds to matters that may change the applicable status of the standard or the category of the conclusion; the second verification level corresponds to matters that may change the calculation results; and the third verification level corresponds to matters where the source of the reference needs to be confirmed. In specific implementation, this application reads the connection edge type and output item type recorded in step 146 and writes them into the verification level field according to the preset correspondence; when the same slot is associated with multiple output items through multiple relationships, the highest verification level is taken.
[0067] Step 148: Within the same verification level, determine the verification order according to the number of associated contaminated output items in descending order.
[0068] In this step, the verification order is the processing order of each pollution cutoff tank within the same verification level. In specific implementation, this application first arranges them in descending order according to the number of associated output items; if the numbers are the same, they are then arranged in ascending order according to the number of the shortest connecting edges from the tank to the conclusive output item. The verification priority within the same verification level is calculated according to formula (3).
[0069] (3) in, Indicates the pollution cut-off tank position Verification priority value; Indicates slot The level value for the corresponding relationship type is 3 for normative application or conclusion derivation relationship, 2 for calculation relationship, and 1 for source relationship; This indicates the maximum number of contaminated output items that can be associated with a slot in the current verification list; Indicates the pollution cut-off tank position The actual number of contaminated output items associated. The larger the calculation result of equation (3), the higher the verification order of the corresponding contaminated cutoff slot; the relationship type level takes precedence over the number of associated output items in the sorting.
[0070] Step 149: Generate a verification list according to the verification order. The verification list records the pollution cutoff slot identifier, engineering object, attribute field, triggering fact, required evidence type, related chapter output item and corresponding verification placeholder.
[0071] In this step, the verification checklist is a structured collection of verification items arranged in the verification order. In specific implementation, this application establishes a checklist record for each pollution cutoff tank, writing in the tank identifier, engineering object, attribute fields, triggering facts, required evidence type, related chapter output items, and verification placeholder identifiers, and uses the placeholder identifiers to establish a two-way reference between the checklist record and the chapter fragment to be verified.
[0072] Table 3 Verification Checklist
[0073] In Table 3, O4, O5, and O6 correspond to the applicability conclusions of the risk assessment rules, the effectiveness conclusions of the inerting protection measures, and the calculation results of reaction temperature-related parameters as defined in Table 4, respectively. sProtect-R101 is associated with both O5 and O4 formed by O5, therefore it takes precedence over sRule-R101, which is associated with only O4, in the first verification level. sCalc-R101 is associated with both the numerical output item O6 and the conclusion-type output item O4 that references O6, therefore it is included in the second verification level. The number of associated output items is counted after deduplication according to different output item identifiers. The level and order are determined by steps 146 to 148. The slot identifier, engineering object, attribute field, triggering fact, required evidence type, associated output item, and verification placeholder all come from the verification list record established in step 149. The verification placeholder identifier is used to establish the reference relationship between the table record and the section fragment to be verified generated in step 145.
[0074] Through steps 141 to 149, this application can select a small number of traceable verification entry points on the propagation path, retain valid expression units that do not depend on the entry points, and prioritize the processing of verification items that may change the application results of the specification or the conclusions of multiple chapters, thereby avoiding the need to rewrite the entire chapter due to local migration failure.
[0075] S15. Generate deterministic chapter content for uncontaminated output items, aggregate the deterministic chapter content, the chapter fragments to be verified, and the verification list according to the writing guidelines, and perform document consistency arrangement processing on the aggregation results to obtain a long project document of the target document type.
[0076] In this step, the content of the deterministic chapter is formed by taking the values of the uncontaminated output items and the evidence slots with source records, and forming the content according to the skill execution sequence and chapter description rules in the target chapter writing skills; the document consistency arrangement process is the process of performing chapter position mapping, number generation, cross-reference update, conclusion status control, and terminology and unit of measurement uniformity on the aggregated results.
[0077] As an optional implementation method, the document consistency orchestration process is as follows: Step 151: Establish a chapter tree for the target document based on the chapter number, chapter level, and writing points in the writing guidelines, and map the definitive chapter content and the chapter fragments to be verified to the corresponding chapter nodes respectively.
[0078] In this step, a chapter node is a node in the chapter tree that records the chapter number, level, writing points, and allowed output item types. Content mapping is the process of associating established, deterministic chapter content or chapter fragments to be verified with chapter nodes based on the chapter task unit identifier. In specific implementation, this application establishes chapter nodes and the parent-child relationships between nodes according to the parent-child hierarchy of titles in the writing guidelines. Then, it reads the chapter task unit identifiers carried by the deterministic chapter content and the chapter fragments to be verified, and writes them into the chapter node content list with the same identifier. Content that cannot match chapter nodes is entered into an exception record and is not included in this aggregation.
[0079] Step 152: Write the deterministic chapter content and the chapter fragment to be verified in the traversal order of the chapter tree, set the verification list after the corresponding chapter or in the document verification appendix, and establish the reference relationship between the chapter fragment to be verified and the verification list according to the slot identifier of the verification placeholder.
[0080] In this step, the chapter tree traversal order is determined by the chapter number and the parent-child hierarchy, and the reference relationship is a bidirectional positioning relationship established between the verification placeholder and the verification list record based on the slot identifier. In specific implementation, this application writes the content of each node according to the pre-order traversal result of the chapter tree, writes the verification list after the corresponding chapter or in the verification appendix, and writes the same slot identifier for the placeholder and the list record, so that the placeholder can locate the verification item, and the verification item can trace back to the associated output item and the original data location.
[0081] Step 153: Assign document object identifiers to the titles, figures, tables, normative references, verification placeholders, and chapter conclusions in the aggregation results, regenerate the numbers according to the chapter tree, and update the cross-references based on the document object identifiers.
[0082] In this step, the document object identifier is a stable identifier assigned to titles, figures, tables, specification references, verification placeholders, and chapter conclusions; cross-references are relationships where a source points to a referenced object through the document object identifier. In practice, this application traverses the chapter tree to generate display numbers for various objects and updates the reference fields based on the document object identifier; when the number changes, the same object is located and the display number is rewritten, without directly replacing the original number string.
[0083] Step 154: Mark the chapter conclusions that reference the verification placeholders as conclusions to be verified, restrict the conclusions to be verified to be written as definitive conclusions in the abstract or overall conclusion, and unify the terminology, units of measurement and conclusion levels of the remaining chapter conclusions to obtain a long engineering document of the target document type.
[0084] In practice, this application checks whether the verification placeholder is reached along the citation relationships of the chapter conclusions. If it is reached, it is written to a pending verification state and the conclusion is prohibited from entering the abstract or overall conclusion. If it is not reached, the certainty state is retained, and terminology dictionary replacement and unit conversion are performed on the certainty content. After supplementing the evidence, this application fills the new evidence into the corresponding evidence slot, only re-executing the skill execution sequence associated with that slot, and updating the corresponding chapter output items, conclusion status, and cross-references. Through steps 151 to 154, the consistency between chapter content, verification checklist, and cross-references can be maintained, and conclusions with incomplete evidence can be prevented from entering the abstract or overall conclusion in a certainty state.
[0085] As a simplified example of Embodiment 1, the process temperature of the reactor R-101 in the new project falls within the temperature trigger range determined in step S125, and the inerting protection state is not configured. This application marks the process temperature tank sT and the inerting protection state tank sN as contamination initiation nodes. After propagation along the tank-level dependency relationship, the applicable status of the risk assessment rules, the effectiveness of protective measures, related calculation results, and their associated conclusions reached through the reverse propagation path are determined as contaminated output items. Output items not on the propagation path, such as equipment number, material name, and construction scale, still generate deterministic chapter content.
[0086] For the contaminated output items, this application does not follow the conclusions of the example project, nor does it delete the entire chapter. Instead, following the entire backpropagation path of each contaminated output item, it selects the standard application basis slot sRule-R101, the protection effectiveness slot sProtect-R101, and the calculation parameter slot sCalc-R101 as contamination cutoff slots, respectively. The standard application results, protection effectiveness statements, calculation results, and conclusion statements referencing these slots are replaced with verification placeholders, and a verification list is generated. Thus, the report can retain engineering facts that do not rely on the contamination cutoff slots and are supported by existing evidence, while preventing conclusions to be verified from entering the summary or overall conclusion. This demonstrates the inventive point of locating the scope of impact and partially isolating uncertain content when skill transfer fails.
[0087] Example 2: Joint reverse analysis is a fundamental step in this application to transform the writing experience from the example project into transferable chapter writing skills. Its purpose is not to reuse the text of the final example document, but to recover the source of information, processing relationships, applicable conditions, and conclusion formation path from the chapter outputs and example references. Inaccurate joint reverse analysis can lead to mismatches between chapter outputs and supporting evidence, project-specific facts being mistakenly identified as fixed rules, missing slot dependencies, or shifts in migration failure boundaries. This can result in new projects using the example conclusions despite changed engineering conditions, or incorrectly marking previously valid content as pending verification. Therefore, to ensure that the generated rules can both reproduce the example chapters and identify migration failures under new project conditions, this application designs a joint reverse analysis process that sequentially executes chapter output location, supporting evidence tracing, chapter evidence graph construction, evidence slot abstraction, counterfactual reproduction, and positive and negative example verification.
[0088] This embodiment elaborates on step S12; the explanations of other steps are the same as in Embodiment 1. See also... Figure 2 Step S12 includes S121 to S126: S121. Based on the chapter hierarchy and key points of the writing guidelines, extract chapter output items from the example final document.
[0089] In this step, the chapter task unit is the content scope governed by the same chapter title and corresponding to the same writing goal; the chapter output item is the fact, numerical value, standard judgment or evaluation conclusion that needs to be generated by writing skills within the content scope; the output item location tuple is a location record composed of project object, attribute field, unit of measurement, standard identifier and document location.
[0090] When dividing the chapter task units, this application reads the chapter number, heading level, and key points of writing from the writing guidelines to form a chapter definition record, and reads the heading paragraphs with chapter numbers or heading styles from the sample final document; it matches the heading paragraphs with the same chapter number and heading level with the chapter definition record, and uses the content from the current matching heading paragraph to the next same-level or superior heading paragraph as the chapter task unit. This application further segments the content according to sentence punctuation, table row and column boundaries, and standard clause identifiers, and marks sentences containing conclusion predicates, evaluation predicates, or standard compliance predicates, as well as table items that simultaneously contain parameter names, values, and units of measurement, as chapter output items.
[0091] After completing the division of chapter task units, this embodiment determines the chapter task unit corresponding to the risk analysis of reactor fire and explosion in the chapter "Identification and Analysis of Hazardous and Harmful Factors" as the target chapter task unit, and performs subsequent joint reverse analysis on the task unit; the determination is only used to limit the processing scope of this embodiment and does not change the structure of other chapter task units in the writing guide.
[0092] The output locator tuple can be represented as equation (4).
[0093] (4) in, Indicates chapter output items The location tuple; Indicates the name of the project object; Represents an attribute field; Indicates the unit of measurement; Indicates the identification of standard clauses; This indicates the position of the chapter output item in the final sample document.
[0094] S122. Generate a location tuple corresponding to the chapter output item based on the engineering object, attribute field, and specification identifier of the chapter output item, and use the location tuple to obtain supporting evidence from the example reference set.
[0095] In this step, supporting evidence refers to the data content that can support the corresponding chapter's output items through sources, calculations, standard application, or conclusion derivation relationships, including project facts, engineering parameters, standard clauses, and intermediate judgment content.
[0096] In practice, this application first uses the name of the engineering object and attribute fields to retrieve candidate data fragments, then normalizes and matches the numerical values and units of measurement, and locates the standard clauses according to the standard identifier; for conclusive output items that cannot be found directly in the data, it continues to retrieve their calculation operands, standard application premises and intermediate judgment content.
[0097] Taking the hazard identification section as an example, this application identifies hazardous chemicals based on the process flow diagram and bill of materials, extracts the hazard categories and physicochemical properties of materials based on the hazardous chemical catalog, material safety data and standards and specifications, and determines the intermediate reasoning content based on process temperature, process pressure and abnormal operating conditions such as leakage, cooling failure, over-temperature or over-pressure.
[0098] S123. Using the chapter output items as result nodes and the supporting evidence as evidence nodes, and using the relationships between nodes in terms of source, calculation, standard application, and conclusion derivation as connecting edges, construct a chapter evidence graph.
[0099] In this step, the chapter evidence diagram is a graph data structure with evidence nodes, intermediate reasoning nodes, and result nodes as nodes, and the processing relationships between nodes as directed connection edges; the source relationship represents the direct reference of field values, the calculation relationship represents the relationship from operands to calculation results, the standard application relationship represents the relationship from engineering facts to the applicable status of clauses, and the conclusion derivation relationship represents the relationship from intermediate judgments to evaluation conclusions.
[0100] The connection edge type is determined based on the processing records from supporting evidence to the chapter output item: when the field values of the supporting evidence are directly written into the output item, it is set as a source relationship; when the output item value is calculated using the supporting evidence as an operand, it is set as a calculation relationship; when the output item references a standard provision and the supporting evidence is used to satisfy the premise of the provision's application, it is set as a standard application relationship; when the supporting evidence first forms an intermediate judgment, and then the intermediate judgment triggers an evaluation opinion or conclusion, it is set as a conclusion derivation relationship. Each connection edge record includes a start point identifier, an end point identifier, a relationship type, and a corresponding processing operation.
[0101] Table 4 shows some evidence diagram nodes in the example target section.
[0102] Table 4 shows partial results of the chapter evidence diagram constructed in steps S123. O4 represents the conclusion on the applicability of the risk assessment rules, O5 represents the conclusion on the effectiveness of the inerting protection measures, and O6 represents the calculation results of reaction temperature-related parameters. O5 and O6 are both chapter output items that need to be written into the target chapter and also serve as inputs to the standard applicability judgment node C2, jointly supporting O4.
[0103] In the evidence diagram described in the chapter, sCalc-R101 reaches O6 via C1, and further reaches O4 via C2; sProtect-R101 reaches O5 via C3, and further reaches O4 via C2; sRule-R101 directly reaches O4 via C2. Thus, the three evidence slots are located in the propagation paths corresponding to parameter calculation, protection validity judgment, and norm applicability judgment, respectively.
[0104] S124. Generate slot descriptors and slot constraints. The project-specific evidence nodes that retain the function of connecting edges after being replaced with slot descriptors are identified as evidence slots. The slot dependency relationship is determined based on the connecting edges.
[0105] In this step, the project-specific evidence node is an evidence node whose value changes with the specific project; the slot descriptor is used to identify the type of engineering object, attribute field, data type, and evidence purpose that should be obtained in the new project; the slot constraint is used to limit the range, type, unit of measurement, source type, and applicable standard conditions of the values that can be filled in the evidence slot.
[0106] When determining whether the function of a connecting edge is maintained, this application performs verification edge by edge according to the connecting edge type: For source relationships, it verifies whether the engineering object category and attribute fields in the slot descriptor can locate the same type of data field; for calculation relationships, it verifies whether the data type and unit of measurement can be used as the corresponding calculation operands; for standard application relationships, it verifies whether the standard application conditions can be mapped to the clause application condition field; for conclusion derivation relationships, it verifies whether the allowed category or value range can enter the corresponding conclusion triggering condition. Only when all outgoing edges of a project-specific evidence node pass the verification is it converted into an evidence slot; otherwise, the node is retained as a fixed evidence node or a fixed inference node.
[0107] In addition to the process temperature slot sT and the inerting protection status slot sN, this embodiment also generates the following slots based on the applicable standards, evidence of the effectiveness of protective measures, and calculation parameters required by the chapter output items: the applicable standards slot sRule-R101, the protection effectiveness slot sProtect-R101, and the calculation parameter slot sCalc-R101. Specifically, the applicable standards slot sRule-R101 records the applicable standard clauses, applicable conditions, and corresponding data locations for reactor R-101; the protection effectiveness slot sProtect-R101 records the design documents, control indicators, and effectiveness proof of the inerting protection facilities; and the calculation parameter slot sCalc-R101 records the material property parameters and process calculation parameters related to the reaction temperature.
[0108] The aforementioned slots, together with the process temperature slot (sT) and the inerting protection state slot (sN), constitute the evidence slot set for the target chapter writing skills. Each evidence slot has corresponding supporting evidence in the example project; when transferring the target chapter writing skills to a new project, if the corresponding evidence cannot meet the execution conditions for judging the applicability of the standard, the effectiveness of protection, or the parameter calculation, the corresponding slot will be marked as a slot to be verified, and the type of supplementary data required will be recorded.
[0109] When determining slot dependencies, this application retains the connection direction from the evidence slot to the intermediate inference node, and then from the intermediate inference node to the chapter output item, and associates the processing operations and execution conditions recorded by the connection edge with the corresponding dependency relationship, so that the chapter output item can be reproduced in the subsequent connection direction.
[0110] The allowable range of reaction temperature tank sT is determined jointly based on the design range, material property data and applicable specification conditions in the example process specification, and does not adopt a fixed numerical range across projects; the allowable categories of inerting protection state tank sN include active, inactive and not configured.
[0111] like Figure 3As shown, the joint reverse analysis interface includes a chapter output area, a supporting evidence area, and a slot abstract result area. The chapter output area displays the evaluation conclusion O4 extracted from the final example document and its output item location tuples. After selecting O4, the supporting evidence area displays the process temperature, flammable materials, and inerting protection evidence traced from the example reference set according to the location tuples, and marks the corresponding data positions. The slot abstract result area displays the process temperature slot sT and inerting protection status slot sN formed by the project-specific evidence nodes, as well as the slot dependency relationship of the slots reaching O4 through the parameter calculation node C1 and the specification application node C2.
[0112] Figure 3 This diagram illustrates the core dependency path consisting of sT, sN, C1, C2, and O4. The complete chapter evidence diagram also includes sRule-R101, sProtect-R101, sCalc-R101, C3, O5, and O6 as shown in Table 4; [The text abruptly ends here, likely due to an incomplete sentence or missing information.] Figure 3 The nodes expanded within the framework are stored using the same data structure and participate in subsequent backpropagation and contamination truncation slot identification. Only when the connection edge verification passes will the interface mark the corresponding node as an evidence slot allowed for migration.
[0113] S125. Generate alternative engineering facts and reproduce chapter output items based on the slot constraints. Determine the minimum counterfactual trigger set based on the alternative engineering facts that cause changes in the reproduced chapter output items. Determine the migration failure boundary based on the trigger conditions corresponding to the minimum counterfactual trigger set.
[0114] In this step, the alternative engineering facts are test facts constructed according to slot constraints and used to replace the example values; chapter output item reproduction is the process of re-executing the inference processing rules along the slot dependency to obtain the chapter output items; the minimum counterfactual trigger set is the minimum combination of facts in which the target change type disappears after deleting any of the alternative engineering facts; the inference processing rules are the data extraction, parameter calculation, specification application judgment or conclusion triggering operations corresponding to the connecting edges.
[0115] The alternative project facts include the project object, attribute fields, and alternative values, which can be expressed as Equation (5).
[0116] (5) in, Indicates the first An alternative project fact; This represents the engineering object corresponding to the alternative engineering fact; The attribute field that represents the fact of the alternative project; This represents an alternative value that satisfies the slot constraint.
[0117] As one possible implementation, S125 includes the following process: Step a1: Based on the data type, value range, allowed categories, and standard application conditions in the slot constraints, generate alternative engineering facts containing engineering objects, attribute fields, and alternative values. Step a2: Fill the alternative engineering facts into the corresponding evidence slots and reproduce the chapter output items according to the slot dependency relationships. Step a3: When the reproduced chapter output items change, starting from the evidence slot corresponding to the alternative engineering fact that caused the change, trace along the calculation relationship, standard application relationship, and conclusion derivation relationship in the slot dependency relationships to the changed chapter output item to determine the corresponding change type. Step a4: Based on the change type, determine the minimum counterfactual trigger set containing the fewest alternative engineering facts and with the shortest dependency path, and determine the trigger condition corresponding to the minimum counterfactual trigger set as the migration failure boundary.
[0118] In an optional embodiment, the output item change type includes a deterministic change type of evidence closure and a migration uncertainty type; the deterministic change type includes numerical change, change of norm application result, and change of conclusion category; the migration uncertainty type includes no applicable processing rules, indeterminate norm application status, and inability to close the supporting path of the chapter output item; the migration failure boundary is determined only based on the alternative engineering facts that generate the migration uncertainty type.
[0119] Specifically, the process for determining the minimum counterfactual trigger set includes the following steps: Step a41: Based on the type of change in the output item, determine the combination of alternative engineering facts that cause the same type of change as the candidate trigger set; Step a42: Delete the alternative engineering facts from the candidate trigger set and reproduce the chapter output item again. Determine the candidate trigger set from which the change type no longer appears after deleting any alternative engineering fact as the target trigger set; Step a43: Select the set with the fewest alternative engineering facts from the target trigger set. When the number of alternative engineering facts is the same, select the set with the fewest total number of connecting edges between the corresponding evidence slot and the changed chapter output item as the minimum counterfactual trigger set.
[0120] Table 5 shows the reproduction results of the alternative engineering facts: R-1 to R-3 record the chapter output items and change types after the alternative engineering facts are filled in; R-4 and R-5 record the reproduction results after deleting the alternative engineering facts from R-3 item by item, used to verify that the two alternative engineering facts in R-3 together constitute the target trigger set. Table 5 contains... This is the normal process temperature recorded in the example process specification. and These are representative values from different candidate temperature ranges divided according to slot constraints; these representative values are only used for counterfactual reproduction and are not used as fixed high-temperature or low-temperature thresholds across projects.
[0121] Table 5. Results of Factual Reproduction of Alternative Projects
[0122] For the output item change type t, the minimum counterfactual trigger set is determined according to equation (6), first comparing the number of alternative engineering facts, and then comparing the total number of connection edges from the evidence slot to the output item.
[0123] (6) in, Indicates the type of change The corresponding minimum counterfactual trigger set; This represents the set of target trigger sets that have been verified through item-by-item deletion. Indicates trigger set The number of alternative engineering facts included; Indicates trigger set Corresponding evidence slot to change output item The total number of connecting edges; This represents the chapter output item whose type t has changed.
[0124] This application divides the candidate range of reaction temperature tank positions based on material property data and applicable specification conditions, and determines the temperature trigger range that will cause changes in the applicable state of the rules by reproducing the output items. The corresponding migration failure boundary can be expressed as equation (7).
[0125] (7) in, This indicates the transfer failure boundary of the target chapter writing skills; This indicates the process temperature of reactor R-101 in the new project, in degrees Celsius. This indicates the temperature trigger range determined by the factual reproduction of the alternative engineering and constrained by material property data and specification conditions. This indicates the inerting protection status of reactor R-101 in the new project.
[0126] In this application, the migration failure boundary is boundary judgment data formed by the triggering conditions, evidence slots and output item change types corresponding to the minimum counterfactual trigger set, used to determine whether the new project engineering facts cause the original reasoning rules in the current chapter writing skills to lose direct applicability.
[0127] S126. Generate target chapter writing skills based on slot dependencies, migration failure boundaries, inference processing rules, and chapter description rules. The chapter description rules are the expression order, standardized citation locations, and conclusion organization methods retained from the example final document.
[0128] As one possible implementation, S126 includes the following process: Step b1: Sort the evidence slots, intermediate inference nodes, and chapter output items according to the slot dependency relationship to obtain the skill execution sequence. Step b2: Form positive examples by combining the evidence slot values and corresponding chapter output items from the example project; form boundary negative examples by combining the minimum counterfactual trigger set in the migration failure boundary and the corresponding output item change type. Step b3: Replace the project-specific expressions in the final example document with evidence slot references, preserving the expression order, standardized reference positions, and conclusion organization methods to obtain the chapter expression rules.
[0129] Step b4: Using a counterexample-guided inductive synthesis algorithm, candidate chapter writing skills are generated based on the skill execution sequence, inference processing rules, and chapter description rules. These candidate chapter writing skills are then executed using the positive examples and boundary counterexamples. Specifically, during generation, processing operators determined by the type of their incoming edges are assembled for each intermediate inference node according to the skill execution sequence: source relations are assembled with field extraction or reference operators; calculation relations are assembled with calculation operators in example processing records; normative application relations are assembled with clause application condition judgment operators; and conclusion derivation relations are assembled with conclusion trigger condition judgment operators. Then, the evidence slot references in the chapter description rules are bound to the corresponding output items to form executable candidate rule records.
[0130] Step b5: When the positive example reproduction result is inconsistent with the corresponding chapter output item, or the boundary counterexample does not produce the corresponding output item change type, locate the first intermediate inference node where the expected result and the reproduction result diverge along the slot dependency relationship. Based on the relationship type connecting the intermediate inference nodes, correct the corresponding calculation operation, standard application conditions, conclusion triggering conditions, or evidence slot references, and regenerate the candidate chapter writing skill. Step b6: When each positive example reproduces the corresponding chapter output item and each boundary counterexample produces the corresponding output item change type, determine the current candidate chapter writing skill as the target chapter writing skill.
[0131] When executing the inductive synthesis algorithm guided by counterexamples, this application first establishes candidate rule records from the processing operations and execution conditions recorded in each connecting edge of the chapter evidence graph, and filters out processing operators or condition combinations that do not match the current node input according to the project object category, attribute field, data type, unit of measurement, and relation type. Then, the positive example value is filled into the corresponding evidence slot and the candidate skill is executed. Next, the minimum counterfactual trigger set in the boundary counterexamples is filled into the corresponding evidence slot and the candidate skill is executed again. The intermediate node states, chapter output items, and output item change types obtained from the two executions are compared with the expected results, and the intermediate inference node where the first difference occurs along the skill execution sequence, the input value of that node, the actual state, and the expected state are recorded.
[0132] If a positive example cannot reproduce the example output item or a boundary negative example does not produce the expected change type, then locate the first divergent intermediate reasoning node along the slot dependency relationship, and modify the calculation operation, normative application conditions, conclusion triggering conditions, or evidence slot reference according to the relationship type.
[0133] Specifically, this application adds new constraints by combining the aforementioned input values and expected states, deletes processing operators or execution condition combinations that cannot produce the expected state under the input values from the candidate rule record, and then selects the corresponding calculation operation, normative application conditions, conclusion triggering conditions or evidence slot references from the remaining combinations according to the connection edge type of the divergence node, so as to update the candidate chapter writing skills.
[0134] When both positive examples and boundary negative examples meet the expected results, the current candidate chapter writing skill is determined as the target chapter writing skill; when there is still a discrepancy after the number of corrections reaches the maximum number K set according to the number of correctable nodes and computing resources, the candidate skill is marked as a non-transferable skill and its entry into the new project generation stage is terminated.
[0135] Skills transfer refers to applying the target chapter writing skills identified in the aforementioned process to the reference set of a new project, and then re-executing the skill execution sequence after replacing the sample project values with the engineering facts of the new project, rather than directly converting the final sample document into a new project document.
[0136] like Figure 4 As shown, the counterfactual reproduction and skill verification interface includes an alternative engineering fact area, a chapter output item reproduction area, and a boundary and skill verification area. The alternative engineering fact area displays the alternative engineering fact f1 when the process temperature enters the trigger range and the alternative engineering fact f2 when inertization protection is not configured. The chapter output item reproduction area displays the reproduction results where the output item remains unchanged when f1 or f2 is entered alone, becomes pending re-evaluation when both f1 and f2 are entered simultaneously, and returns to its original state after deleting either fact from the combination. The boundary and skill verification area determines {f1, f2} as the minimum counterfactual trigger set, forming the corresponding migration failure boundary, and displays the verification status of the candidate chapter writing skill against the example positive example and the boundary negative example. When both types of verification pass, the interface marks the candidate chapter writing skill as the target chapter writing skill.
[0137] This application, through S121 to S126, is able to determine the response boundaries of the generation rules to changes in engineering facts while maintaining the reproducibility of the example chapter, so that the writing skills of the target chapter simultaneously include sources, reasoning order, applicable conditions, output rules and expression rules, rather than a fixed template formed by simply cutting out the content of the example document.
[0138] Figure 5 This is a schematic diagram of the structure of a long-form engineering document intelligent generation system based on reverse analysis and skill transfer disclosed in this application, with reference to... Figure 5 The system may include: Module 51 is used to obtain writing guidelines, sample reference sets, sample final documents, and new project reference sets for the target document type.
[0139] The reverse analysis module 52 is used to determine the migration failure boundary and slot dependency relationship by performing joint reverse analysis on the example reference set and the example final document, and to generate the target chapter writing skills.
[0140] The backpropagation module 53 is used to fill evidence slots in the new project reference set according to the target chapter writing skills. When the filling result triggers the migration failure boundary, the evidence slot corresponding to the triggering fact is used as the pollution starting node, and backpropagation is performed according to different relationship types in the slot dependency relationship to determine the polluted output item.
[0141] The generation module 54 is used to identify contamination truncated slots along the back propagation path, retain expression units that do not depend on contamination truncated slots, and replace the content of contamination truncated slots with verification placeholders to generate chapter fragments to be verified; and determine the verification priority according to the relationship type of contamination truncated slots and the number of associated output items to generate a verification list.
[0142] The aggregation module 55 is used to generate deterministic chapter content from uncontaminated output items, aggregate the deterministic chapter content, the chapter fragments to be verified, and the verification list according to the writing guidelines, and perform document consistency arrangement processing on the aggregation results to obtain a long project document of the target document type.
[0143] The intelligent generation system for long engineering documents based on reverse analysis and skill transfer in this application is used to implement the aforementioned intelligent generation method for long engineering documents based on reverse analysis and skill transfer. Therefore, the specific implementation of the intelligent generation system for long engineering documents based on reverse analysis and skill transfer can be found in the embodiment section of the intelligent generation method for long engineering documents based on reverse analysis and skill transfer above. The specific implementation can be referred to the description of the corresponding embodiments, and will not be repeated here.
[0144] It should be noted that, for those skilled in the art, several improvements and modifications can be made to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.
Claims
1. A method for intelligently generating long engineering documents based on reverse analysis and skill transfer, characterized in that, include: Obtain writing guidelines, sample reference sets, sample final documents, and new project reference sets for the target document type; By performing joint reverse analysis on the example reference set and the example final document, the migration failure boundary and slot dependency relationship are determined, and the target chapter writing skills are generated. Based on the target chapter writing skills, evidence slots are filled in the new project reference set. When the filling result triggers the migration failure boundary, the evidence slot corresponding to the triggering fact is used as the pollution starting node. Backpropagation is performed according to different relationship types in the slot dependency relationship to determine the polluted output item. Identify contamination cutoff slots along the backpropagation path, retain expression units that do not depend on contamination cutoff slots, and replace the content of contamination cutoff slots with verification placeholders to generate chapter fragments to be verified. Determine the verification priority based on the relationship type of the pollution interception tank and the number of associated output items, and generate a verification checklist; For uncontaminated output items, generate deterministic chapter content, aggregate the deterministic chapter content, the chapter fragments to be verified, and the verification list according to the writing guidelines, and perform document consistency arrangement processing on the aggregation results to obtain a long project document of the target document type; The process involves joint reverse analysis of the example reference set and the example final document to determine migration failure boundaries and slot dependencies, and to generate target chapter writing skills, including: Based on the chapter hierarchy and key points of the writing guidelines, extract chapter output items from the example final document; Based on the project object, attribute fields, and specification identifier of the chapter output item, generate the location tuple corresponding to the chapter output item, and use the location tuple to obtain supporting evidence from the example reference set; A chapter evidence graph is constructed using the chapter output items as result nodes, the supporting evidence as evidence nodes, and the relationships between nodes in terms of source, calculation, standard application, and conclusion derivation as connecting edges. Generate slot descriptors and slot constraints. Project-specific evidence nodes that retain the function of connecting edges after being replaced with slot descriptors are identified as evidence slots. Slot dependencies are determined based on connecting edges. Based on the slot constraints, alternative engineering facts are generated and chapter output items are reproduced. Based on the alternative engineering facts that cause changes in the reproduced chapter output items, a minimum counterfactual trigger set is determined, and the migration failure boundary is determined based on the triggering conditions corresponding to the minimum counterfactual trigger set. Generate target chapter writing skills based on slot dependencies, migration failure boundaries, inference processing rules, and chapter description rules; The process of generating alternative engineering facts based on the slot constraints and reproducing chapter output items, determining a minimum counterfactual trigger set based on the alternative engineering facts that cause changes in the reproduced chapter output items, and determining the migration failure boundary based on the triggering conditions corresponding to the minimum counterfactual trigger set includes: Based on the data type, value range, allowed category, and applicable standard conditions in the slot constraints, generate alternative project facts containing project objects, attribute fields, and alternative values; Fill the alternative engineering facts into the corresponding evidence slots, and reproduce the chapter output items according to the slot dependency relationship; When the reproduced chapter output item changes, starting from the evidence slot corresponding to the alternative engineering fact that caused the change, the changes are traced along the calculation relationship, standard application relationship and conclusion derivation relationship in the slot dependency relationship to the chapter output item that changed, so as to determine the corresponding change type. Based on the change type, determine the minimum counterfactual trigger set that contains the fewest alternative engineering facts and has the shortest dependency path, and determine the trigger condition corresponding to the minimum counterfactual trigger set as the migration failure boundary; The process involves using the evidence slot corresponding to the triggering fact as the pollution initiation node, performing backpropagation according to different relationship types in the slot dependency relationship, and determining the polluted output item, including: Map the new project engineering facts that meet the triggering conditions in the migration failure boundary to the corresponding evidence slots, and mark the mapped evidence slots as the contamination start nodes; Following the opposite direction of tracing supporting evidence from the chapter output items during joint reverse analysis, the slot dependencies are traversed from the pollution initiation node. When a calculation relationship is passed, the intermediate results dependent on the pollution initiation node are recalculated; when a normative application relationship is passed, the application status of the corresponding normative clause is reassessed; when a conclusion derivation relationship is passed, the conclusion triggering condition is reassessed, and propagation continues when the intermediate results, application status, or conclusion triggering results change. Record the nodes and connecting edges that lead from the pollution initiation node to the chapter output item, forming a backpropagation path, and determine the chapter output item reached by the backpropagation path as the polluted output item.
2. The method according to claim 1, characterized in that, The process of determining the minimum counterfactual trigger set containing the fewest alternative engineering facts and the shortest dependency path based on the change type includes: Based on the type of change in the output items, combinations of alternative engineering facts that cause the same type of change are identified as candidate trigger sets; Remove alternative engineering facts from the candidate trigger set and reproduce the chapter output items again. Determine the candidate trigger set from which the change type no longer appears after deleting any alternative engineering fact as the target trigger set. Select the set with the fewest alternative engineering facts from the target trigger set, and when the number of alternative engineering facts is the same, select the set with the fewest total number of connecting edges between the corresponding evidence slot and the changed chapter output item as the minimum counterfactual trigger set.
3. The method according to claim 1, characterized in that, The generation of target chapter writing skills based on slot dependencies, migration failure boundaries, inference processing rules, and chapter description rules includes: The evidence slots, intermediate reasoning nodes, and chapter output items are sorted according to the slot dependency relationship to obtain the skill execution sequence; The evidence slot values and corresponding chapter output items in the example project are used to form positive examples, and the minimum counterfactual trigger set in the migration failure boundary and the corresponding output item change type are used to form boundary counterexamples. Replace the project-specific expressions in the final document of the example with evidence slot references, while preserving the order of expression, the standardized reference positions, and the organization of conclusions, to obtain the chapter expression rules; A counterexample-guided inductive synthesis algorithm is used to generate candidate chapter writing skills based on the skill execution sequence, reasoning processing rules, and chapter description rules, and to execute the candidate chapter writing skills using the positive examples and boundary counterexamples respectively. When the positive example reproduction result is inconsistent with the corresponding chapter output item, or the boundary negative example does not produce the corresponding output item change type, locate the first intermediate inference node where the expected result and the reproduction result diverge along the slot dependency relationship, and correct the corresponding calculation operation, standard application conditions, conclusion triggering conditions or evidence slot reference according to the relationship type connecting the intermediate inference node, and regenerate the candidate chapter writing skills. When each positive example reproduces the corresponding chapter output item and each boundary negative example produces the corresponding output item change type, the current candidate chapter writing skill is determined as the target chapter writing skill.
4. The method according to claim 1, characterized in that, The process involves identifying contamination truncated slots along the backpropagation path, retaining expression units that do not depend on the contamination truncated slots, and replacing the content of the contamination truncated slots with verification placeholders to generate a section fragment to be verified, including: The back propagation paths are grouped according to the contaminated output items, and evidence slots with data source locations or data to be supplemented are extracted from each back propagation path. Select the set of slots that intersects with all backpropagation paths of the same contaminated output item and has the fewest number of evidence slots as the contamination cutoff slots. According to the chapter description rules, the chapter content corresponding to the contaminated output items is divided into expression units; Retain the expression units that do not reference the pollution cutoff slots, and replace the engineering facts, standard application results or conclusions that reference the pollution cutoff slots with verification placeholders. The verification placeholders record the slot identifier, the engineering object to be verified, the attribute fields and the required evidence type. The original expression units and the verification placeholders are combined according to the original expression order to generate the chapter fragment to be verified.
5. The method according to claim 1, characterized in that, The verification priority is determined according to the relationship type of the pollution interception slot and the number of associated output items, and a verification checklist is generated, including: Determine the connection edge type from each pollution cutoff slot to the polluted output item, and count the number of associated output items associated with each pollution cutoff slot; Pollution cutoff slots associated with conclusive output items through normative application relationships or conclusion derivation relationships are set to the first verification level; pollution cutoff slots associated with numerical output items through calculation relationships are set to the second verification level; and pollution cutoff slots associated with referenced output items through source relationships are set to the third verification level. Within the same verification level, the verification order is determined according to the number of associated contaminated outputs in descending order; A verification list is generated according to the verification order. The verification list records the pollution cutoff slot identifier, engineering object, attribute field, triggering fact, required evidence type, related chapter output item and corresponding verification placeholder.
6. The method according to claim 1, characterized in that, Following the writing guidelines, the content of the deterministic chapters, the chapter fragments to be verified, and the verification list are aggregated. The aggregated results are then processed for document consistency, resulting in a long-form project document of the target document type, including: Establish a chapter tree for the target document based on the chapter number, chapter level, and key points of writing in the writing guidelines, and map the definitive chapter content and the chapter fragments to be verified to the corresponding chapter nodes respectively; Write the deterministic chapter content and the chapter fragment to be verified in the traversal order of the chapter tree, set the verification list after the corresponding chapter or in the document verification appendix, and establish the reference relationship between the chapter fragment to be verified and the verification list according to the slot identifier of the verification placeholder. Assign document object identifiers to titles, figures, tables, normative references, verification placeholders, and chapter conclusions in the aggregation results, regenerate the numbering based on the chapter tree, and update cross-references based on the document object identifiers; The chapter conclusions that reference the verification placeholders are marked as conclusions to be verified. These conclusions are restricted from being written as definitive conclusions in the abstract or overall conclusion. The terminology, units of measurement, and conclusion levels of the remaining chapter conclusions are standardized to obtain a long engineering document of the target document type.
7. A long-form engineering document intelligent generation system based on reverse analysis and skills transfer, characterized in that, The method for intelligently generating long engineering documents based on reverse analysis and skill transfer as described in any one of claims 1 to 6 includes: The acquisition module is used to acquire writing guidelines, sample reference sets, sample final documents, and new project reference sets for the target document type. The reverse analysis module is used to determine the migration failure boundary and slot dependency relationship by performing joint reverse analysis on the example reference set and the example final document, and to generate the target chapter writing skills. The backpropagation module is used to fill evidence slots in the new project reference set based on the target chapter writing skills. When the filling result triggers the migration failure boundary, the evidence slot corresponding to the triggering fact is used as the pollution starting node. Backpropagation is performed according to different relationship types in the slot dependency relationship to determine the polluted output item. The generation module is used to identify contamination cutoff slots along the backpropagation path, retain expression units that do not depend on contamination cutoff slots, and replace the content of contamination cutoff slots with verification placeholders to generate chapter fragments to be verified; the verification priority is determined according to the relationship type of contamination cutoff slots and the number of associated output items to generate a verification list. The aggregation module is used to generate deterministic chapter content from uncontaminated output items, aggregate the deterministic chapter content, the chapter fragments to be verified, and the verification list according to the writing guidelines, and perform document consistency arrangement processing on the aggregation results to obtain a long project document of the target document type.
Citation Information
Patent Citations
Intelligent bidding document compiling method, system and equipment based on large language model
CN121303087A
Power grid document high-precision comparison and compliance verification method based on cross-domain semantic modeling
CN121724021A