Building model automatic compliance inspection method based on knowledge enhancement
By converting building codes into structured formats and extracting entities and events, and generating compliance inspection codes, the problem of relying on manual annotation and poor applicability in the existing technology is solved, and efficient and accurate automatic compliance inspection is achieved.
Patent Information
- Application Number
- CN202411941424.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-01
AI Technical Summary
The existing automatic compliance inspection methods rely on a large number of manual annotations and poor applicability to building codes of different professionals, making it difficult to meet the needs of the three-dimensional model design model for processing efficiency and accuracy.
Using a knowledge-enhanced approach, the building specifications are converted into structured formats by pre-training large models and BIM models, the entities and events in the specification clauses are extracted, compliance inspection codes are generated, and automatic compliance inspection is realized.
Reliance on manual processing is reduced, the efficiency and accuracy of inspections are improved, and the inspection needs can be adapted to the inspection needs of different professional building codes, which significantly reduces the demand for data annotation.
Smart Images

Figure CN119739808A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a technology in the field of neural network application, in particular to an automatic compliance checking method for building models based on knowledge enhancement. Background Art
[0002] With the continuous development of Building Information Modeling (BIM) technology, the construction engineering field has undergone a significant digital transformation, and the objects of architectural design delivery have gradually transitioned from traditional two-dimensional drawings to data-centric three-dimensional models. As a key step to ensure the high-quality delivery of architectural design drawings, compliance checks are aimed at reviewing design defects in architectural design drawings that do not comply with legal regulations, thereby reducing or avoiding building quality and safety issues caused by improper design. However, existing compliance checks mostly rely on manual verification of architectural drawings based on laws and regulations. This method is labor-intensive, inefficient, and prone to errors, and it is gradually unable to meet the requirements of new design models with three-dimensional models as the core for processing efficiency and accuracy. Summary of the invention
[0003] In view of the problems that the existing automatic compliance check needs to rely heavily on manual annotation and has poor applicability to different professional building codes, the present invention proposes an automatic compliance check method for building models based on knowledge enhancement. The method completes the transformation of multimodal building codes into computer-recognizable codes through pre-training large models and BIM models, and realizes knowledge enhancement by extracting information from building codes, thereby solving the problems that the traditional automatic compliance check method relies heavily on manual annotation and has poor applicability to different professional building codes.
[0004] The present invention is achieved through the following technical solutions:
[0005] The present invention relates to an automatic compliance checking method for building models based on knowledge enhancement. After collecting text building specifications and performing structured processing, specification clause entities and specification clause events are extracted in sequence to generate a code framework, the code framework is completed, and finally, after compliance checking, a model data set is constructed and the compliance checking result is output.
[0006] The structured processing specifically includes: preprocessing the building specifications, converting the building specifications containing multimodal information such as formulas, tables and pictures into a form containing only text information, and after manual verification, inputting the unstructured text form of the building specifications into a large language model to convert it into a structured output format with chapters as indexes and specification clauses as content, and then instructing the large language model through prompt words to correct character errors appearing in the content of the specification clauses of the structured building specifications, and storing the corrected structured building specifications in a MySQL database to form an original specification library.
[0007] The regulatory text entities are identified by using a general pre-trained large language model and zero-sample classification annotation prompt words to identify the entities contained in the regulatory texts, and the identified entities are classified according to the expert classification of entity types, thereby completing the extraction of the entities contained in the regulatory texts.
[0008] The regulatory clause event refers to: the constraints on entities and their attributes contained in the regulatory clause are defined as an event, which includes entities, attributes, conditions and values.
[0009] The standard clause event uses the extracted entity as an event trigger word to extract events related to the entity, and after returning them in a specified format, the extracted entities and events are stored in a MySQL database as a standard knowledge base.
[0010] The generated code framework refers to: using the specification clauses in the original specification library as the basic input of the large language model, using the entity and event information corresponding to the clauses in the specification knowledge base as additional knowledge to enhance the basic input, inputting the knowledge-enhanced specification clauses into the large language model, and instructing it to generate a code framework containing variable initialization, function placeholders and other contents.
[0011] The code framework completion is to complete the code framework by iteratively generating code based on the code framework generated in the code framework generation phase, and to analyze the iteratively generated code by building a parser to determine the timing of iteration termination.
[0012] The compliance check means: according to the building code to be reviewed, the set of code clauses to be checked is selected from the original code library after structured processing, and the clauses in the code clause set are read one by one, the extracted information corresponding to the clauses is retrieved from the extracted code knowledge base to enhance the knowledge of the clauses, and then the compliance check code is generated based on the knowledge-enhanced clauses, and finally the BIM model is reviewed through the compliance check code, and the non-compliant specifications and the component IDs of the non-compliant components in the model are output.
[0013] The present invention relates to a system for implementing the above method, comprising: a building specification structured processing module, a specification article information extraction module, a code generation module and a compliance checking module, wherein: the building specification structured processing module converts the building specification containing multimodal information such as formulas, tables and pictures into a form containing only text information according to the building specification information in the form of unstructured text, extracts the specification article index and the specification article content, and corrects the character errors of the conversion result to obtain a structured building specification without character errors; the specification article information extraction module extracts the structured building specification from the building specification one by one based on the structured building specification. The entity and event information in the building field contained in the code is obtained, and the entity and event information contained in the building code is obtained; the code generation module generates and iteratively completes the code framework according to the structured building code and the entity and event information extracted from the building code, and obtains the code that can be used for compliance checking; the compliance checking module constructs a BIM model that can be used to verify the validity of the generated compliance checking code according to the building code, and implements the compliance check of the constructed BIM model by integrating the generated code into the BIM software, and obtains the number of BIM models that can be correctly identified by the compliance checking code generated by this system, which is the indicator of the effectiveness of this system. Technical Effects
[0014] The present invention converts building specifications containing multimodal information such as formulas, tables and pictures into a structure containing only text information, realizes efficient conversion from unstructured to structured, and can correct character errors. At the same time, error-free and structured building specifications are formed. At the same time, zero-sample classification annotation prompt word technology is adopted, and the entities and events in the specification provisions are identified and extracted using a general pre-trained large language model. Without a large amount of labeled data, the constraint relationship in the specification provisions can be accurately captured and converted into event information that can be used for compliance inspection; compared with the prior art, the present invention realizes the specification index extraction and specification clause division without manual processing, so that the subsequent automatic compliance inspection process can be retrieved for structured data, improves the inspection completeness, and reduces the dependence of the specification processing on manual work. Without retraining and fine-tuning the general large language model, the information extraction of the specification provisions can be completed according to the inspection requirements of different professional building specifications, which significantly reduces the data annotation requirements, enhances the generalization ability of the information extraction method in the construction field to different building specifications, and improves the compliance inspection efficiency to a certain extent. The present invention significantly improves the stability and accuracy of the generated code. Generate compliance check code based on C# and Revit interface to support complex specifications and enhance the comprehensiveness of automatic compliance checks. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is the principle diagram of the present invention;
[0016] Figure 2 It is a flow chart of the present invention;
[0017] Figure 3 This is a schematic diagram of the structural treatment effect of the building specification of the present invention;
[0018] Figure 4 Schematic diagram of output effects of different steps of the embodiment of the present invention;
[0019] Figure 5 It is a model diagram of an embodiment of a BIM model data set;
[0020] Figure 6 The figure is a compliance check result diagram of the embodiment model compliance check embodiment. DETAILED DESCRIPTION
[0021] like Figure 1 and Figure 2 As shown, this embodiment relates to an automatic compliance checking method for a building model based on knowledge enhancement, comprising:
[0022] Step 1: Preprocess the specification clauses in the specification to obtain structured text architectural clauses, and automatically correct the preprocessed specification clauses to build the original specification library, including:
[0023] Step 1.1, using an OCR tool to automatically identify and extract building specifications containing multimodal content such as pictures, tables, formulas, etc. and convert the tables and formulas into Markdown codes to obtain unstructured plain text building specifications;
[0024] Step 1.2, by instructing the general large language model with a few sample prompt words including the unstructured building specifications to be processed, instructions for splitting and correcting the building specifications, and manually constructed single processing samples, the unstructured plain text building specifications processed in step 1.1 are split into the building specification information, the specification article section index, and the specification article content, and the recognition errors existing in the specification articles extracted by the OCR tool are corrected, and organized in a structured format to obtain the original specification library.
[0025] Step 2: Extract entities and events from the original specification library, including:
[0026] In step 2.1, the entity types contained in the building code are classified and examples are added. Through zero-shot prompt words and building entity classification annotations, the general large language model is instructed to extract and classify building entities through generative information extraction.
[0027] The entity classification includes: building, system, component and area, as shown in Table 1.
[0028] Table 1 Entity classification and examples Entity Classification Example architecture building, wall, residential building system Automatic fire alarm system, combustible gas detection alarm system Components Household fire detectors, fire alarm controllers area Fire control room, protection area, fire partition
[0029] In step 2.2, the constraints contained in the building code are defined as valued events. Through a few sample prompt words combined with the description of the attributes contained in the event and the example of event extraction, the large language model is instructed to extract events related to the entity using the entity extracted in step 2.1 as the trigger word for event extraction.
[0030] The attribute constraint classification includes six categories: direct attribute constraint, quantity attribute constraint, distance attribute constraint, classification attribute constraint, space attribute constraint and indirect constraint, as shown in Table 2.
[0031] Table 2 Classification and examples of attribute constraints included in events Attribute Constraint Classification Example Direct attribute constraints Length, width, height, thickness, depth, span, accuracy Quantity attribute constraints only, piece, deduction, times, total Distance attribute constraints distance, distance, separation, nearby Classification attribute constraints Class, Category Spatial class attribute constraints top, above, center, set at, in_place Indirect Constraints There are components, composition, selection, setting method, and application place
[0032] In step 2.3, precision, recall and F1-score are used as evaluation indicators for the entity extraction part, and event trigger word extraction recall (Tri-R) and event attribute extraction accuracy (Arg-P) are used as evaluation indicators for the event extraction part.
[0033] The evaluation indicators are as follows: accuracy Recall Among them: for the entity extraction part, TP (True Positive) represents the entities that are correctly extracted and classified into the correct type, FP (False Positive) represents the entities that are correctly extracted but classified into the wrong type, FN (False Negative) represents the entities that are not extracted, Precision represents the proportion of correctly extracted and correctly classified entities to the extracted entities, Recall represents the proportion of correctly extracted and correctly classified entities to the entities that should be extracted, and F1 represents a comprehensive consideration of the number of extracted entities and the extraction accuracy; for the event extraction part, Tri-R represents the proportion of correctly identified events to the events that should be identified, and Arg-P represents the proportion of attributes and attribute parameters involved in correctly identified events to the identified event attributes and parameters.
[0034] Step 3: Enhance the knowledge of the regulatory clauses through the information extraction results of step 2, and generate compliance check codes based on the knowledge-enhanced regulatory clauses, including:
[0035] Step 3.1, code framework generation: Integrate the entity and parameter information related to the assignment event extracted in step 2 into the few-sample code framework generation prompt words, instructing the large language model to generate a code skeleton including key parts such as variable initialization, function definition placeholders and logical control structures, including:
[0036] Step 3.1.1: For the semantic dependencies between the specification clauses, extract the dependencies by building a parser and output them to the large language model.
[0037] For example, "6.1.2..., shall comply with the provisions of Article 3.4.8 of this specification." For this type of regulatory clause that appears in the body of the clause and is dependent on other clauses, a parser is built to extract the clause numbers contained in the current clause and determine whether the current regulatory clause is directly dependent on other regulatory clauses based on the number of numbers; if there is a dependency relationship, the current regulatory clause and its dependent clauses are provided to the large language model together.
[0038] In step 3.1.2, the large language model is instructed to mark the target specification clause index in the generated framework code through prompt words to ensure that each constraint in the specification clause can be checked and represented.
[0039] The prompt words contain only instructions for the large language model.
[0040] Step 3.1.3, write a code frame to generate instructions including instructions for generating a code frame, the context of the instructions, and prompt words for explaining the input to more specifically instruct the large language model to generate a code frame.
[0041] The instructions for generating the code framework include: requirements for the overall generated content and requirements for the generation process;
[0042] For example: "Please convert the given building code into Revit compliance check code, please write it in C#";
[0043] Another example: "Please generate the code framework first. The framework includes the basic framework required for variable initialization, function definition and condition judgment. When generating the initialization variables, please refer to the entities and attributes extracted from the specification and the interface for Revit to obtain components and component attributes. If the variables required by the code framework cannot be directly obtained through the existing interface, please generate the function definition placeholder for obtaining the variables and the function input and output comments. For unimplemented functions, please add the <unimplemented> identifier before the function definition";
[0044] The context of the instruction refers to: using Role-Playing technology to prompt the large language model to generate content that is closer to the requirements.
[0045] For example: "You are a Revit secondary development engineer, and you are good at writing Revit compliance check codes";
[0046] The description of the input means that the content enclosed by """ is the building clause that needs to be converted, and the content enclosed by {} is the entities and events extracted from the specification clauses, where the events include entities, attributes, conditions and values.
[0047] Step 3.2, compliance code completion: further generate detailed logic and code snippets based on the code framework generated in step 3.1, and generate specific code snippets by filling in the placeholders of the previously generated function definitions to check whether they comply with the corresponding building rules, including:
[0048] Step 3.2.1, use the zero-sample prompt word technology to guide the large language model to iteratively complete the code framework generated in step 3.1, that is, to complete the instructions of the code framework, the context of the instructions, and the description of the input.
[0049] The instructions for completing the code framework refer to: requirements for overall completion and requirements for completing identifiers of unimplemented functions;
[0050] For example: "Please convert the given building code into Revit compliance check code. Please refer to the entities and events extracted from the code provisions and complete them based on the given compliance check code framework. When implementing the functions that are not implemented in the given code framework, please first confirm whether the existing variables in the code framework can meet the requirements of the defined function parameters. If not, please add the definition and acquisition logic of the required variables. If the logic of obtaining the required variables cannot be directly implemented, please add the definition of the function to obtain the variables and add the <unimplemented> identifier before the function definition";
[0051] The input description means: "The content enclosed by """ is the building clause that needs to be converted, the content enclosed by {} is the entities and events extracted from the specification clauses, where events include entities, attributes, conditions and values, and the content enclosed by """""" is the compliance check code framework, where functions and variables containing the <unimplemented> identifier are the contents that need to complete the implementation logic."
[0052] Step 3.2.2, extract all variables and functions used in the generated compliance check code by building a parser, and verify whether each variable and function has been defined and implemented to ensure the completeness of code completion and confirm the timing of termination of the iterative completion process.
[0053] In step 3.2.3, the large language model is instructed to add detailed declaration statements in the generated code through the prompt word indication, and the corresponding code snippets are annotated according to the index annotation to accurately point out which specific rule the building model violates.
[0054] The prompt words contain only instructions for the large language model.
[0055] For example: "For components that do not comply with the specification provisions, please output them through the dialog box TaskDialog. The output content must include the index of the non-compliant specification provisions and the ID of the non-compliant component. If the specification provisions do not constrain specific components, only the index of the non-compliant specification provisions will be output."
[0056] In step 3.2.4, the generated compliance check code and its reported errors are fed back to the large language model, prompting it to correct the generated code, thereby improving the operability of the generated compliance check code.
[0057] Step 4, by constructing a BIM model containing building components that meet the specifications and those that do not meet the specifications as a verification set for the compliance check code generation part, the BIM model is checked for compliance using the generated compliance check code, and the component IDs that do not meet the specifications are output.
[0058] After specific experiments, the general pre-trained large language models GPT-3.5 and GPT-4 were used, Python 3.8 was used for development, MySQL 8.0.34 was used for data persistence, the test model was built through AutodeskRevit 2020, and the generated code was integrated through RevitAdd-in Manager. By introducing specific building specifications, the compliance check code was generated after being processed by the automatic compliance check method for buildings proposed in the present invention, and the effectiveness of the method was tested with the corresponding building model in the constructed BIM model data set, specifically including:
[0059] 1) Structural processing of building specifications: Select the national standard GB 50116-2013 "Automatic Fire Alarm Design Specification" (including tables, formulas, pictures and other data) as the building specification, and perform structural processing and error correction according to step 1. The results are as follows: Figure 3 As shown, the building specifications containing multimodal information are processed into a structured text form indexed by the specifications and chapters and containing no character errors.
[0060] 2) Extraction of information from standard articles: 244 standard articles are obtained through step 1. In order to verify the effectiveness of the classification annotation (CA) prompt words proposed in the present invention in the tasks of building entity extraction and event extraction, a comparative test is conducted with the chain-of-thought (CoT) prompt words on the constructed data set. The accuracy, recall rate and F1 value are selected as the evaluation indicators of the entity extraction stage, and the effect of entity extraction on the data set is shown in Table 3; the effect of event extraction on the data set by selecting the event "trigger word" extraction recall rate and event attribute extraction accuracy is shown in Table 4. On the standard article data set, the F1 value of the classification annotation prompt words in the entity extraction task is 32.2% higher than that of the chain of thought prompt words; the Arg-P value of the classification annotation prompt words in the event extraction task is 2.2% higher than that of the chain of thought prompt words, which fully demonstrates the feasibility of using the classification annotation prompt words to extract information in the construction field.
[0061] Table 3 Entity extraction experimental results CoT CA Precision 0.342 0.631 Recall 0.420 0.713 F1 0.377 0.669
[0062] Table 4 Event extraction experimental results CoT CA Tri-R 0.839 0.844 Arg-P 0.205 0.227
[0063] 3) Compliance check code generation: First, the knowledge enhancement of the specification clauses is achieved through the information extracted in step 2 and the corresponding specification clauses in the original specification library processed in step 1. Then, the large language model is instructed by prompt words to generate a code framework containing variable initialization, function definition placeholders, and judgment logic based on the knowledge-enhanced specification clauses. Finally, the code segments are iteratively generated based on the generated code framework until the compliance check code is completed, thereby realizing the generation of the compliance check code. The specific output results of different steps are as follows: Figure 4 As shown, the output result of the specification preprocessing omits the extracted index, and the “ / / […]” in the output result of the compliance check code generation step indicates that the specific generated code is contained therein.
[0064] 4) Model compliance check: A BIM model verification set is manually constructed and the compliance check code generated in step 3 is applied to the model to perform compliance check to verify the effectiveness of this method. The verification set contains 60 models that comply with the specifications and those that do not. Among them, 20 models are positive samples that comply with the specifications, and the remaining 40 are negative samples that do not comply with the specifications.
[0065] It has been verified that the compliance check code generated by this method successfully passed 8 positive samples and identified non-compliant content in 25 negative samples. Taking a negative sample in the validation set as an example, the BIM model contains 16 smoke detectors, of which an obstacle is artificially added within 0.5 meters next to detector 2178774. Figure 5 By integrating the compliance check code generated in step 3 and checking the BIM model of this embodiment, the compliance check result is obtained. The check result is as shown in Figure 6 As shown, there is an obstacle 0.5 meters away from the detector 2178774, which does not meet the specification requirements. The inspection result identifies the non-compliant component 2178774, and does not misidentify the other compliant components, which is consistent with the settings artificially added by the inventor, proving the effectiveness of the method.
[0066] In summary, the present invention can efficiently convert building specifications containing complex formulas, tables and pictures into structured text information through structured processing technology applicable to multimodal building specifications, significantly improving the speed and accuracy of specification processing. This conversion not only reduces the need for manual verification, but also enhances the adaptability to specifications of different formats. At the same time, through the zero-sample classification annotation prompt technology, the present invention realizes the recognition of entity and event information in building specifications under the condition of low manual annotation data requirements in the standard clause entity and event extraction link. By slightly modifying the entity classification and attribute constraint classification and sample part contained in the proposed zero-sample classification annotation prompt technology, it is possible to extract information from specifications of different building professions, thereby improving the scope of applicable specifications; thirdly, the present invention generates more accurate and more readable compliance inspection code through knowledge-enhanced code framework generation technology and iterative code framework completion technology, including detailed function and annotation information, which reduces the coupling between code framework generation and code framework completion.
[0067] The above-mentioned specific implementation can be partially adjusted in different ways by those skilled in the art without departing from the principle and purpose of the present invention. The protection scope of the present invention shall be based on the claims and shall not be limited by the above-mentioned specific implementation. Each implementation scheme within its scope shall be subject to the constraints of the present invention.
Claims
1. A knowledge-enhanced automatic compliance checking method for building models, characterized in that: After collecting text building specifications and performing structured processing, the specification clause entities and specification clause events are extracted in turn to generate a code framework, and then the code framework is completed. Finally, after compliance checking, the model dataset is constructed and the compliance check results are output.
2. The method for automatic compliance checking of building models based on knowledge enhancement according to claim 1 is characterized in that: The structured processing specifically includes: preprocessing the building specifications, converting the building specifications containing multimodal information into a form containing only text information, and after manual verification, inputting the unstructured text form of the building specifications into a large language model to convert it into a structured output format with chapters as indexes and specification clauses as content, and then instructing the large language model through prompt words to correct character errors appearing in the specification clauses of the structured building specifications, and storing the corrected structured building specifications in a MySQL database to form an original specification library.
3. The automatic compliance checking method for building models based on knowledge enhancement according to claim 1 is characterized in that: The regulatory clause entities are identified by using a general pre-trained large language model and zero-sample classification annotation prompt words to identify the entities contained in the regulatory clauses, and the identified entities are classified according to the expert classification of entity types, thereby completing the extraction of the entities contained in the regulatory clauses; The regulatory clause event refers to: the constraints on entities and their attributes contained in the regulatory clause are defined as an event, which includes entities, attributes, conditions and values.
4. The automatic compliance checking method for building models based on knowledge enhancement according to claim 3 is characterized in that: The standard clause event uses the extracted entity as an event trigger word to extract events related to the entity, and after returning them in a specified format, the extracted entities and events are stored in a MySQL database as a standard knowledge base.
5. The automatic compliance checking method for building models based on knowledge enhancement according to claim 1 is characterized in that: The generated code framework refers to: using the specification clauses in the original specification library as the basic input of the large language model, using the entity and event information corresponding to the clauses in the specification knowledge base as additional knowledge to enhance the basic input, inputting the knowledge-enhanced specification clauses into the large language model, and instructing it to generate a code framework containing variable initialization, function placeholders and other contents.
6. The automatic compliance checking method for building models based on knowledge enhancement according to claim 1 is characterized in that: The code framework completion is to complete the code framework by iteratively generating code based on the code framework generated in the code framework generation phase, and to analyze the iteratively generated code by building a parser to determine the timing of iteration termination.
7. The automatic compliance checking method for building models based on knowledge enhancement according to claim 1 is characterized in that: The compliance check means: according to the building code to be reviewed, the set of code clauses to be checked is selected from the original code library after structured processing, and the clauses in the code clause set are read one by one, the extracted information corresponding to the clauses is retrieved from the extracted code knowledge base to enhance the knowledge of the clauses, and then the compliance check code is generated based on the knowledge-enhanced clauses, and finally the BIM model is reviewed through the compliance check code, and the non-compliant specifications and the component IDs of the non-compliant components in the model are output.
8. A knowledge-enhanced automatic compliance checking system for building models that implements the method described in any one of claims 1 to 7, characterized in that: include: The building specification structured processing module, the specification article information extraction module, the code generation module and the compliance check module, wherein: the building specification structured processing module converts the building specification containing multimodal information into a form containing only text information according to the building specification information in the form of unstructured text, extracts the specification article index and the specification article content, and corrects the character errors for the conversion result to obtain a structured building specification without character errors; the specification article information extraction module extracts the building field entity and event information contained in the building specification one by one based on the structured building specification to obtain the entity and event information contained in the building specification; the code generation module generates a code framework and iterates the code framework completion according to the structured building specification and the entity and event information extracted from the building specification to obtain the code that can be used for compliance checking; The compliance check module constructs a BIM model that can be used to verify the validity of the generated compliance check code according to the building specifications, and implements compliance checks on the constructed BIM model by integrating the generated code into the BIM software to obtain the number of BIM models that can be correctly identified by the compliance check code, which is an indicator of validity.
Citation Information
Patent Citations
Dangerous and large project special construction scheme intelligent examination system and implementation method
CN114781997A
Constructional engineering design semantic structured description and compliance review method and system
CN116186831A
Architectural design automatic compliance inspection method based on IFC and deep learning
CN117648852A
Intelligent code checking method and system based on DevOps
CN118819630A