Engineering document generation method and device, electronic equipment and storage medium

By performing semantic analysis and structural processing on the text information input by the user and combining it with preset document templates, engineering documents that meet user needs and industry standards are generated, which solves the problems of low efficiency and poor adaptability in existing technologies and achieves efficient and accurate document generation.

CN120706397APending Publication Date: 2025-09-26JIANGMEN POWER SUPPLY BUREAU OF GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510842933.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

In existing technologies, the generation of engineering documents relies on manual writing or traditional template filling tools, which is inefficient, prone to typos and information omissions, difficult to adapt to complex projects and changing regulations, and unable to intelligently infer and supplement key information.

Method used

Natural language processing technology is used to perform semantic analysis on the text information input by the user, generate structured information, match it with the preset document template, perform fusion processing, and generate engineering documents that meet user needs and industry standards.

Benefits of technology

It improves the efficiency and accuracy of engineering document writing, ensures that documents comply with the latest system requirements, reduces manual intervention, and improves the automation efficiency and consistency of documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120706397A_ABST
    Figure CN120706397A_ABST
Patent Text Reader

Abstract

The invention relates to the field of engineering technology management informatization, in particular to an engineering document generation method and device, electronic equipment and a storage medium, the method comprises the following steps: obtaining text information input by a user, and inputting the text information into a first model for semantic analysis to obtain document requirements; performing structured information conversion processing on the document requirements to generate structured information including title levels, chapter structures and keyword indexes; matching the document requirement with a plurality of preset document templates, and determining a target document template from the plurality of preset document templates according to a matching result; and performing fusion processing on the structured information and the target document template to generate a target engineering document corresponding to the text information. According to the invention, the efficiency and compliance of the user to compile the project document are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of engineering technology management informationization, and specifically to a method, device, electronic equipment and storage medium for generating engineering documents. Background Art

[0002] In the field of engineering construction and management, the compilation of various project documents is a crucial and time-consuming task. These documents, such as construction plans, operation schedules, and risk assessment reports, not only underpin the smooth implementation of projects but also provide crucial support for ensuring operational safety and compliance with regulations.

[0003] In related technologies, the generation of engineering documents primarily relies on manual editing or the use of traditional template-filling tools. Manual editing is not only inefficient and prone to typos and information omissions, but also has poor adaptability to complex projects and changing regulations, making it difficult to ensure that all documents fully comply with the latest institutional requirements and industry standards. While traditional template-filling tools can improve efficiency to a certain extent, their intelligence is limited. They are generally unable to dynamically adjust to subtle changes in input information, and even more difficult to intelligently infer and supplement missing key information (such as risk level and project category). Summary of the Invention

[0004] A method, device, electronic device and storage medium for generating engineering documents have been applied for, which can improve the efficiency of writing engineering documents.

[0005] In a first aspect, the present application relates to a method for generating an engineering document, comprising:

[0006] Obtain text information input by the user, input the text information into the first model for semantic analysis, and obtain document requirements; perform structured information conversion processing on the document requirements to generate structured information including title hierarchy, chapter structure and keyword index; match the document requirements with multiple preset document templates, and determine the target document template from the multiple preset document templates based on the matching results; fuse the structured information and the target document template to generate a target engineering document corresponding to the text information.

[0007] Optionally, the first model includes a first sub-model, a second sub-model and a third sub-model, and inputs the text information into the first model for semantic parsing to obtain document requirements, including: inputting the text information into the first sub-model for semantic parsing to obtain preliminary document requirements; inputting the preliminary document requirements into the second sub-model to make a compliance judgment on the preliminary document requirements; when the preliminary document requirements are judged to comply with preset rules, using the preliminary document requirements as document requirements; when the preliminary document requirements are judged to not comply with preset rules, inputting the preliminary document requirements into the third sub-model to correct the preliminary document requirements to obtain document requirements.

[0008] Optionally, after the preliminary document requirements are judged to be non-compliant with preset rules, the method further includes: judging the non-compliance type of the preliminary document requirements; when the non-compliance type indicates abnormal text content, generating a first prompt message, the first prompt message being used to indicate the first position of the abnormal text and a correction plan for the abnormal text; when the non-compliance type indicates a lack of necessary information, generating a second prompt message, the second prompt message being used to indicate the missing information, the second position of the missing information in the text information, and supplementary information of the missing information; receiving user feedback information regarding the first prompt information and the second prompt information, and updating the preliminary document requirements based on the feedback information.

[0009] Optionally, the document requirements are subjected to structured information conversion processing to generate structured information containing title hierarchy, chapter structure and keyword index, including: parsing the semantic content and logical structure of the document requirements, and determining the hierarchical framework of the document based on the semantic content and logical structure; extracting key technical parameters from the document requirements; converting the hierarchical framework and key technical parameters into a structured data format containing predefined metadata annotations to obtain structured information, wherein the predefined metadata at least includes title hierarchy, chapter structure and keyword index.

[0010] Optionally, the document requirements are matched with multiple preset document templates, and a target document template is determined from the multiple preset document templates based on the matching results, including: extracting a first document feature of the document requirements and a second document feature of the preset document template; comparing the first document feature with the second document feature; scoring the comparison results, and selecting the preset document template with the highest-scoring comparison result as the target document template.

[0011] Optionally, the structured information and the target document template are fused to generate a target engineering document corresponding to the text information, including: obtaining the document structure, format and field layout of the target document template; integrating the structured information with the document structure, format and field layout to obtain the target engineering document.

[0012] Optionally, the training method of the first model includes: obtaining a first sample text and a standard document requirement corresponding to the first sample text; inputting the first sample text into the first preset model to obtain predicted document requirement parameters; adjusting the first preset model according to the difference between the standard document requirements and the predicted document requirement parameters to obtain a first sub-model; obtaining a second sample text and a text label corresponding to the second sample text; inputting the second sample text into the second preset model to obtain a first predicted text label; selecting a non-compliant third sample text from the second sample text according to the first predicted text label; inputting the third sample text into the third preset model to obtain a second predicted text label; adjusting the second preset model according to the difference between the text label and the second predicted text label to obtain a second sub-model; adjusting the third preset model according to the difference between the text label and the third predicted text label to obtain a third sub-model.

[0013] In a second aspect, the present application further provides a device for generating engineering documents, comprising:

[0014] A first computing module is configured to obtain text information input by a user, input the text information into a first model for semantic analysis, and obtain document requirements;

[0015] The second calculation module is used to convert the document requirements into structured information to generate structured information including title hierarchy, chapter structure and keyword index;

[0016] a third calculation module, configured to match the document requirement with a plurality of preset document templates, and determine a target document template from the plurality of preset document templates according to the matching result;

[0017] The fourth calculation module is used to fuse the structured information with the target document template to generate a target engineering document corresponding to the text information.

[0018] In a third aspect, the present application further provides an electronic device comprising: one or more processors; a memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the method for generating engineering documents as described above.

[0019] In a fourth aspect, the present application also provides a computer storage medium on which a computer program is stored, and the computer program is loaded by a processor to execute the method for generating engineering documents as described above.

[0020] The present application relates to a method, device, electronic device and storage medium for generating engineering documents. The method obtains text information input by a user, inputs the text information into a first model for semantic analysis, and converts the fuzzy information in the natural language into clear document requirements through semantic analysis, thereby improving the accuracy of document generation; at the same time, the extracted document requirements are subjected to structured information conversion processing to generate structured information including title hierarchy, chapter structure and keyword index, so that the generated document not only meets the user's needs but also has good readability and maintainability; finally, the document requirements are subjected to structured information conversion processing to generate structured information including title hierarchy, chapter structure and keyword index; the document requirements are matched with multiple preset document templates, and a target document template is determined from the multiple preset document templates according to the matching results; the structured information and the target document template are fused to generate a target engineering document corresponding to the text information, thereby improving the automation efficiency of the engineering document according to the preset document template. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the application embodiments or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments recorded in the application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0022] Figure 1 It is a flowchart of the method for generating engineering documents in the embodiment of the present application.

[0023] Figure 2 It is a flowchart of a method for generating engineering documents according to another embodiment of the present application.

[0024] Figure 3 This is a principle block diagram of the device for generating engineering documents according to an embodiment of the present application.

[0025] Figure 4 This is a block diagram of the internal structure principle of the electronic device according to the embodiment of the present application. DETAILED DESCRIPTION

[0026] The following describes embodiments of the present invention in more detail with reference to the accompanying drawings. While the drawings illustrate certain embodiments of the present invention, it should be understood that the present invention may be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to facilitate a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.

[0027] It should be understood that the steps described in the method embodiments of the application may be performed in a different order and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the application is not limited in this respect.

[0028] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.

[0029] It should be noted that the concepts such as "first" and "second" mentioned in the application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0030] It should be noted that the modifications of "one" and "multiple" mentioned in the application are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0031] The names of the messages or information exchanged between multiple devices in the embodiments of the present application are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0032] In the field of engineering construction and management, the compilation of various project documents is a crucial and time-consuming task. These documents, such as construction plans, operation schedules, and risk assessment reports, not only underpin the smooth implementation of projects but also provide crucial support for ensuring operational safety and compliance with regulations.

[0033] In the field of engineering construction and management, the compilation of various project documents is a crucial and time-consuming task. These documents, such as construction plans, operation schedules, and risk assessment reports, not only underpin the smooth implementation of projects but also provide crucial support for ensuring operational safety and compliance with regulations.

[0034] In related technologies, the generation of engineering documents primarily relies on manual editing or the use of traditional template-filling tools. Manual editing is not only inefficient and prone to typos and information omissions, but also has poor adaptability to complex projects and changing regulations, making it difficult to ensure that all documents fully comply with the latest institutional requirements and industry standards. While traditional template-filling tools can improve efficiency to a certain extent, their intelligence is limited. They are generally unable to dynamically adjust to subtle changes in input information, and even more difficult to intelligently infer and supplement missing key information (such as risk level and project category).

[0035] This application discloses a method, device, electronic device and storage medium for generating engineering documents, which can intelligently compile engineering documents.

[0036] like Figure 1 As shown, the method includes: including:

[0037] Step S110 , obtaining text information input by the user, inputting the text information into the first model for semantic analysis, and obtaining document requirements.

[0038] The user enters a piece of text information through the interface. This text information can be project requirements, technical specifications, or other related documents. To ensure that the text information entered by the user is accurate and complete so that the subsequent semantic analysis can effectively extract the document requirements, the text information entered by the user is input into the first model for semantic analysis. This model can use natural language processing (NLP) technology to analyze the text through deep learning algorithms to extract the core requirements and intent of the document, thereby converting vague information in natural language into clear document requirements and improving the accuracy of document generation.

[0039] Optionally, the first model in step S110 can not only perform semantic analysis on the text information, but also verify the extracted semantic content and improve the content to obtain document requirements.

[0040] For example, the text information entered by the user includes relevant information such as the project name, operation time, and operation content, but does not include the two required items: risk level and project category. When the first model recognizes that the text information does not provide risk level and project category, it infers the results based on the "Construction Risk Analysis Table for Parts and Items" and submits them to the user for confirmation.

[0041] Specifically, how the first model generates document requirements based on text information is described in the following embodiment, which will not be elaborated in this application.

[0042] Step S120 , performing structured information conversion processing on the document requirements to generate structured information including title hierarchy, chapter structure and keyword index.

[0043] By defining the logical structure of the document through structured information, the generated document not only meets user needs but also has good readability and maintainability. At the same time, the generation of structured information helps in subsequent template matching and document fusion.

[0044] Optionally, a title hierarchy is generated: 1-4 levels of titles are automatically divided according to semantic weight, such as main title, chapter, section, and subsection. The chapter structure allocates content blocks based on construction requirements to ensure logical coherence. Dynamic index construction is used to extract technical feature words to establish an inverted index, supporting subsequent template matching.

[0045] Specifically, how to generate structured information including title hierarchy, chapter structure and keyword index is shown in the following embodiment, which will not be elaborated in this application.

[0046] Step S130 : matching the document requirement with a plurality of preset document templates, and determining a target document template from the plurality of preset document templates according to the matching result.

[0047] The preset document template library includes industry standard templates (such as relevant national construction standards) and enterprise customized templates. The preset document templates have standardized characteristics. By determining the target document template that best meets user needs from multiple preset document templates, it can meet user needs while ensuring that the generated documents comply with industry specifications or enterprise standards, thereby improving the consistency and professionalism of the documents.

[0048] Optionally, this embodiment includes three types of document templates based on different construction requirements, for example, a construction template that complies with the GB / T50927 standard, a project management template that complies with the PMBOK specification, and a risk prevention and control template that complies with the GB 50656 specification.

[0049] Optionally, this embodiment dynamically matches and generates three types of preset document templates based on the job category and system requirements, including: standard construction templates, project management templates, and risk prevention and control templates.

[0050] Specifically, how to determine the target document template from multiple preset document templates based on the matching results is described in the following embodiments, and this application will not elaborate on this.

[0051] Step S140 , fusing the structured information with the target document template to generate a target engineering document corresponding to the text information.

[0052] By embedding structured information into the corresponding locations of the template, the integrity and logic of the information are ensured. The beneficial effect of fusion processing is that it can quickly generate high-quality engineering documents, reduce manual intervention, improve work efficiency, and ultimately produce target engineering documents that meet user needs.

[0053] In one embodiment, step S140, in one embodiment, the structured information and the target document template are fused to generate a target engineering document corresponding to the text information, including: obtaining the document structure, format and field layout of the target document template; integrating the structured information and the document structure, format and field layout to obtain the target engineering document.

[0054] In this embodiment, the preset document template uses the following description document structure and interpolation rules, specifically including:

[0055] Project name: {{project_name}}

[0056] Work time: {{work_time}}

[0057] Assignment content: {{work_content}}

[0058] Engineering type: {{engineering_type}}

[0059] Risk level: {{risk_level}}

[0060] According to {{policy_source}}, each of these items should meet the following requirements:

[0061] 1.{{requirement_1}}

[0062] 2. {{requirement_2}}

[0063] In each case where the requirements are met, the structured information is filled into the preset document template to obtain the target engineering document.

[0064] Optionally, for each generated document, compliance is determined based on the embedding match between the vector representation of the institutional rules and the document content. For example, the vector representation uses Sentence-BERT encoding. After calculation, paragraphs with low matching scores will be marked and the user will be prompted to modify them, or the model will regenerate them. The matching algorithm includes:

[0065] defcheck_compliance(document_text,policy_database):

[0066] doc_embedding=encoder.encode(document_text)

[0067] policy_embeddings=encoder.encode(policy_database)

[0068] similarity_scores=cosine_similarity(doc_embedding,policy_embeddings)

[0069] flagged_sections=[policy for score,policy in zip(similarity_scores,policy_database)ifscore<0.75]

[0070] return flagged_sections

[0071] The above matching algorithm is used to indicate that paragraph reports with a matching degree lower than 0.75 will be marked.

[0072] After the generated target engineering document has been confirmed by the user, the user can manually modify it or select the "Regenerate" operation. The modified content is recycled by the system and added to the continuous learning database for future fine-tuning of the model, thereby continuously enhancing the adaptability of the regulations and styles of specific units.

[0073] In one embodiment, the dynamic template engine uses Jinja2 syntax to define document structure variables, including: multi-level nested interpolation expressions of {{header|body.section[1].subsection[2].clause}}.

[0074] For example, the following logical judgment function is used to assist reasoning:

[0075] definfer_risk_level(task_content:str)->str:

[0076] #Use the multi-classification BERT model to classify the risk level of text content

[0077] inputs=tokenizer(task_content,return_tensors="pt")

[0078] logits=model(**inputs).logits

[0079] predicted_class=torch.argmax(logits,dim=-1)

[0080] return risk_class_map[predicted_class.item()]

[0081] The generated document enters the user confirmation phase, where users can manually modify it or select "Regenerate." Modified content is recycled by the system and added to the continuous learning database, which is used for future fine-tuning of the model, thereby continuously enhancing its adaptability to the specific unit's regulatory style.

[0082] In the process of generating the target construction documents, compliance verification is performed, and the Sentence-BERT encoder is used to calculate the semantic similarity between the generated content and the regulations. When the matching degree is lower than the set threshold, a correction reminder is triggered.

[0083] In one embodiment, the first model includes a first sub-model, a second sub-model, and a third sub-model.

[0084] Among them, the first sub-model is a semantic model, which is used to extract semantic information from text information to obtain preliminary document requirements. The second sub-model is used to judge the preliminary document requirements. If the second sub-model judges that it is non-compliant, the third sub-model will expand or modify the preliminary document requirements to obtain the final document requirements.

[0085] Specifically, the first sub-model is used for entity recognition and relationship extraction. By extracting key fields or understanding semantics, it identifies the job name, time, content, risk points, job area, etc., and identifies preliminary document requirements. The second sub-model is used for rule nesting matching. By introducing a rule judgment module built based on a knowledge graph, for example, mapping structured information with entities and rules in the power grid system and the "Operation Risk Level Assessment Table", the second sub-model is used to evaluate preliminary documents. The third sub-model completes and infers the results of the second sub-model evaluation. For example, when some information is missing, the third sub-model performs classification reasoning based on the fine-tuned large language model combined with the existing system, and forms a visual prompt for user confirmation.

[0086] In one embodiment, if Figure 2 As shown, in step S110, the text information is input into the first model for semantic parsing to obtain document requirements, including:

[0087] Step S111: input the text information into the first sub-model for semantic analysis to obtain preliminary document requirements.

[0088] The preliminary document must include at least the following fields: project name, project time, and project content. The preliminary document must also include fields for risk level and project category. Input text information can include natural language descriptions, speech-to-speech text, or scanned document text. The system preprocesses the input text and then feeds it into the first model, which can optionally be a semantic understanding model based on Bidirectional Encoder Representations from Transformers (BERT).

[0089] The first sub-model requires the model to complete the analysis through the following sub-steps: identifying the user demand type (such as "operation time" or "operation category"); extracting key parameters (such as document type, technical field, construction requirements); and establishing logical associations between demand elements (such as "a certain work section must contain 3 experimental data").

[0090] Step S112: input the preliminary document requirements into the second sub-model to perform compliance judgment on the preliminary document requirements.

[0091] Optionally, the second sub-model can be a power grid operation knowledge graph, mapping structured data to the Operation Risk Rating Table. Optionally, a BERT-CRF joint architecture or span extraction technology from the T5 model can be used to identify specific rules and extract relationships.

[0092] Step S113: When the preliminary document requirement is determined to comply with the preset rule, the preliminary document requirement is used as the document requirement.

[0093] When the preliminary document requirements meet the results, the preliminary document requirements are directly used as the document requirements, and the document is generated according to the document requirements.

[0094] Step S114 : When the preliminary document requirement is determined to be inconsistent with the preset rules, the preliminary document requirement is input into the third sub-model to modify the preliminary document requirement to obtain the document requirement.

[0095] Specifically, non-compliance with preset rules includes: missing key information, such as missing risk level or project category, or misunderstanding of construction rules.

[0096] Specifically, when it is detected that the risk level or project category is missing, the third sub-model is activated to continue writing the construction rules.

[0097] In one specific embodiment, after receiving textual information about a bridge from a user, the first sub-model extracts the user's input intent, such as a preliminary document requirement of "Generate a high-speed power supply construction plan." The second sub-model verifies whether the preliminary document requirement complies with pre-set rules, such as whether it includes a "Safety Specifications" section. If not, the third sub-model completes the missing information, such as automatically inserting a "Bill of Materials" section.

[0098] In one embodiment, step S112, after the preliminary document requirements are judged to be non-compliant with preset rules, further includes: judging the non-compliance type of the preliminary document requirements; when the non-compliance type indicates abnormal text content, generating a first prompt information, the first prompt information is used to indicate the first position of the abnormal text and a correction plan for the abnormal text; when the non-compliance type indicates a lack of necessary information, generating a second prompt information, the second prompt information is used to indicate the missing information, the second position of the missing information in the text information, and supplementary information of the missing information; receiving user feedback information regarding the first prompt information and the second prompt information, and updating the preliminary document requirements based on the feedback information.

[0099] The second sub-model identifies content anomalies (e.g., incorrect terminology) or missing information (e.g., missing "construction steps") to verify the type of non-compliance with the preliminary document requirements. The first prompt locates the anomalous text and recommends corrections, such as correcting "concrete" to "concrete." The second prompt marks the location of the missing information (e.g., inserting "load calculation table" in paragraph 3). User feedback integration: Receives user-confirmed or modified information and updates the document requirements.

[0100] This embodiment accurately locates the error type to avoid user confusion caused by vague prompts, and dynamically binds the feedback information with the document requirements through the feedback information after user confirmation to ensure consistency of the corrected data.

[0101] In one embodiment, step S120 converts the document requirements into structured information to generate structured information including title hierarchy, chapter structure, and keyword index, including: parsing the semantic content and logical structure of the document requirements, and determining the hierarchical framework of the document based on the semantic content and logical structure; extracting key technical parameters from the document requirements; converting the hierarchical framework and key technical parameters into a structured data format including predefined metadata annotations to obtain structured information, wherein the predefined metadata includes at least title hierarchy, chapter structure, and keyword index.

[0102] Optionally, a hierarchical framework generation method includes extracting a logical structure through dependency parsing, such as "background → plan → implementation." Key technical parameter extraction methods include extracting numerical parameters based on regular expressions, such as "bearing capacity ≥ 200kN." Metadata annotation methods include converting the framework and parameters into XML or JSON format, annotating the heading hierarchy (H1-H3), chapter numbering, and keyword indexing.

[0103] This embodiment supports automatic mapping of template fields by structuring data, avoids manual typesetting, and adds keyword indexes to accelerate subsequent retrieval and version management.

[0104] In one embodiment, step S130 matches the document requirements with multiple preset document templates, and determines a target document template from the multiple preset document templates based on the matching results, including: extracting a first document feature of the document requirements and a second document feature of the preset document template; comparing the first document feature with the second document feature; scoring the comparison results, and selecting the preset document template with the highest comparison result as the target document template.

[0105] Specifically, it includes: obtaining the vectorized representation of the preset compliance rules; obtaining the embedded representation of the target engineering document model content; the matching degree between the vectorized representation of the compliance rules and the embedded representation of the target engineering document model content; and selecting the engineering document with the highest matching degree as the target preset document template.

[0106] Furthermore, the preset document template library includes industry standard templates (such as GB / T 1.1-2020) and enterprise customized templates. The matching process includes: mapping user requirements and template metadata (applicable fields, structural features) to the same vector space; first coarse screening through the classifier, and then fine screening through similarity calculation; when the scores of multiple templates are close, the templates that have been used most recently or have high user ratings are given priority; record user feedback on the matching results, and continuously optimize the template feature weights.

[0107] In one embodiment, a training method for a first model includes: obtaining a first sample text and a standard document requirement corresponding to the first sample text; inputting the first sample text into a first preset model to obtain a predicted document requirement parameter; adjusting the first preset model according to the difference between the standard document requirement and the predicted document requirement parameter to obtain a first sub-model; obtaining a second sample text and a text label corresponding to the second sample text; inputting the second sample text into a second preset model to obtain a first predicted text label; selecting a non-compliant third sample text from the second sample text according to the first predicted text label; inputting the third sample text into a third preset model to obtain a second predicted text label; adjusting the second preset model according to the difference between the text label and the second predicted text label to obtain a second sub-model; adjusting the third preset model according to the difference between the text label and the third predicted text label to obtain a third sub-model.

[0108] In this embodiment, the first sub-model is a semantic parsing model, optionally a Transformer-based encoder-decoder architecture, responsible for extracting key semantics from textual information and generating preliminary document requirements, such as technical specification items for power grid projects. The second sub-model is a compliance determination model, which uses a classifier to determine whether preliminary document requirements comply with power grid industry standards. The third sub-model is a correction generation model, which uses the conditional generation model to correct or expand non-compliant preliminary requirements to generate compliant document requirements.

[0109] In this embodiment, the training process includes a first training process and a second training process. The first training process is used to perform independent training on the first sub-model, and the second training process is used to perform adversarial training on the second sub-model and the third sub-model.

[0110] Specifically, the first training process includes: obtaining a first sample text and the corresponding standard document requirements; inputting the first sample text into a first preset model to obtain predicted document requirement parameters; and adjusting the first preset model based on the difference between the standard document requirements and the predicted document requirement parameters. The first sample text is a power grid project document containing standard document requirements, such as "Capacity design shall comply with Article 1 of the construction standard." The first training process uses a cross-entropy loss function to supervise the generation task. This accurately captures the semantics of power grid terminology and outputs structured requirements to facilitate subsequent compliance checks.

[0111] Specifically, the second training process includes joint training between the second and third sub-models. The second sample text includes both compliant and non-compliant samples, and the non-compliant samples are labeled. The second sub-model is trained to determine the compliance of the second sample text, while the third sub-model is trained only on the non-compliant third sample text within the second sample text. The third sub-model inputs the initial requirements and the compliance error type, and outputs the corrected requirements. The second sub-model serves as the discriminator, and the third sub-model serves as the generator, improving the correction quality through the GAN framework.

[0112] like Figure 3 As shown, the second aspect provides a device for generating an engineering document, comprising:

[0113] The first calculation module 310 is used to obtain text information input by the user, input the text information into the first model for semantic analysis, and obtain document requirements.

[0114] The second calculation module 320 is used to perform structured information conversion processing on the document requirements to generate structured information including title hierarchy, chapter structure and keyword index.

[0115] The third calculation module 330 is configured to match the document requirement with a plurality of preset document templates, and determine a target document template from the plurality of preset document templates according to the matching result.

[0116] The fourth calculation module 340 is used to fuse the structured information with the target document template to generate a target engineering document corresponding to the text information.

[0117] Please refer to Figure 4 , Figure 4 This is a schematic diagram of an embodiment of an electronic device of the present application.

[0118] The electronic device 100 includes a memory 20, a processor 30, and a computer program 40 stored in the memory 20 and executable on the processor 30. When the processor 30 executes the computer program 40, the steps of the above-mentioned method for generating engineering documents are implemented.

[0119] For example, the computer program 40 may also be divided into one or more modules / units, which are stored in the memory 20 and executed by the processor 30. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 40 in the electronic device 100.

[0120] Those skilled in the art will appreciate that the schematic diagram is merely an example of the electronic device 100 and does not limit the electronic device 100. The electronic device 100 may include more or fewer components than shown, or a combination of certain components, or different components. For example, the electronic device 100 may also include input and output devices, network access devices, buses, etc. The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, a single-chip microcomputer, or the processor 30 may also be any conventional processor, etc.

[0121] The memory 20 can be used to store computer programs 40 and / or modules / units. The processor 30 implements various functions of the electronic device 100 by running or executing the computer programs and / or modules / units stored in the memory 20 and accessing data stored in the memory 20. The memory 20 may mainly include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area may store data (such as audio data) generated based on the use of the electronic device 100. In addition, the memory 20 may include high-speed random access memory and non-volatile memory, such as a hard disk, internal memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device.

[0122] If the module / unit integrated in the electronic device 100 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

Claims

1. A method for generating an engineering document, characterized in that: include: Obtaining text information input by a user, inputting the text information into a first model for semantic parsing, and obtaining document requirements; The document requirements are subjected to structured information conversion processing to generate structured information including title hierarchy, chapter structure and keyword index; Matching the document requirement with a plurality of preset document templates, and determining a target document template from the plurality of preset document templates according to the matching result; The structured information and the target document template are fused to generate a target engineering document corresponding to the text information.

2. The method according to claim 1, characterized in that The first model includes a first sub-model, a second sub-model, and a third sub-model. Inputting the text information into the first model for semantic parsing to obtain document requirements includes: Inputting the text information into the first sub-model for semantic parsing to obtain preliminary document requirements; inputting the preliminary document requirements into the second sub-model to perform compliance judgment on the preliminary document requirements; When the preliminary document requirement is determined to comply with a preset rule, the preliminary document requirement is used as the document requirement; When the preliminary document requirement is determined to be inconsistent with the preset rule, the preliminary document requirement is input into the third sub-model to modify the preliminary document requirement to obtain the document requirement.

3. The method according to claim 2, characterized in that After the preliminary document requirement is determined not to comply with the preset rules, the method further includes: Determine the type of non-compliance with the preliminary documentation requirements; When the non-compliant type indicates that the text content is abnormal, generating first prompt information, the first prompt information is used to indicate a first position of the abnormal text and a correction solution for the abnormal text; When the non-compliance type indicates a lack of necessary information, generating second prompt information, the second prompt information being used to indicate the missing information, the second position of the missing information in the text information, and supplementary information of the missing information; Receive user feedback information regarding the first prompt information and the second prompt information, and update the preliminary document requirement according to the feedback information.

4. The method according to claim 1, wherein The document requirement is subjected to structured information conversion processing to generate structured information including title hierarchy, chapter structure and keyword index, including: Parsing the semantic content and logical structure required by the document, and determining a hierarchical framework of the document based on the semantic content and the logical structure; Extract key technical parameters from the document requirements; The hierarchical framework and the key technical parameters are converted into a structured data format containing predefined metadata annotations to obtain the structured information, wherein the predefined metadata at least includes the title hierarchy, the chapter structure and the keyword index.

5. The method according to claim 1, wherein The step of matching the document requirement with a plurality of preset document templates and determining a target document template from the plurality of preset document templates according to the matching result includes: Extracting a first document feature of the document requirement and a second document feature of the preset document template; comparing the first document feature and the second document feature; The comparison results are scored, and the preset document template with the highest comparison result score is selected as the target document template.

6. The method according to claim 1, characterized in that The fusing of the structured information and the target document template to generate a target engineering document corresponding to the text information includes: Obtaining the document structure, format, and field layout of the target document template; The structured information is integrated with the document structure, format and field layout to obtain the target engineering document.

7. The method according to claim 2, characterized in that The training method of the first model comprises: Obtaining a first sample text and standard document requirements corresponding to the first sample text; Inputting the first sample text into the first preset model to obtain the required parameters for predicting the document; Adjusting the first preset model according to the difference between the standard document requirement and the predicted document requirement parameters to obtain the first sub-model; Obtaining a second sample text and a text label corresponding to the second sample text; Inputting the second sample text into a second preset model to obtain a first predicted text label; Selecting a non-compliant third sample text from the second sample text according to the first predicted text label; Inputting the third sample text into a third preset model to obtain a second predicted text label; Adjust the second preset model according to the difference between the text label and the second predicted text label to obtain the second sub-model; The third preset model is adjusted according to the difference between the text label and the third predicted text label to obtain the third sub-model.

8. A device for generating engineering documents, characterized in that: include: A first computing module is configured to obtain text information input by a user, input the text information into a first model for semantic parsing, and obtain document requirements; A second calculation module is used to perform structured information conversion processing on the document requirements to generate structured information including title hierarchy, chapter structure and keyword index; a third calculation module, configured to match the document requirement with a plurality of preset document templates, and determine a target document template from the plurality of preset document templates according to the matching result; The fourth calculation module is used to fuse the structured information with the target document template to generate a target engineering document corresponding to the text information.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the method for generating an engineering document according to any one of claims 1 to 7.

10. A computer storage medium, characterized in that A computer program is stored thereon, and the computer program is loaded by a processor to execute the method for generating engineering documents according to any one of claims 1 to 7.