Construction behavior safety risk identification method based on knowledge graph and large language model

By integrating knowledge graphs with large language models, a construction safety risk identification model is constructed, which solves the problems of insufficient identification accuracy and reliability in existing technologies, and realizes efficient and reliable identification and management of construction safety risks.

CN119066151BActive Publication Date: 2026-11-24SHANGHAI JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411042862.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2026-11-24
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

Existing technologies for identifying safety risks in construction activities suffer from challenges in natural language processing and misjudgment/missed detection by large language models, resulting in insufficient reliability and accuracy in their application at construction sites.

Method used

By integrating knowledge graphs and large language models, a construction safety risk identification model is constructed. The structured information of the knowledge graph is integrated into the parameter learning process of the large language model using knowledge embedding technology to generate a word embedding matrix. The model parameters are then optimized through a loss function to achieve intelligent analysis and risk identification of construction plans.

Benefits of technology

It improves the accuracy and reliability of large language models in identifying construction safety risks, reduces computational overhead, and provides a seamless knowledge reasoning mechanism, making it suitable for risk identification and management by non-professionals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119066151B_ABST
    Figure CN119066151B_ABST
Patent Text Reader

Abstract

This invention relates to a method for identifying construction safety risks based on knowledge graphs and a large language model, comprising the following steps: S1, acquiring a dataset of key knowledge entities in the construction safety domain; S2, constructing a construction safety accident knowledge graph containing construction safety knowledge; S3, generating a word embedding matrix, which serves as the initial weight matrix for the word embedding layer in the large language model; S4, using the embedding vectors and the training set text of the large language model together as the training set of the large language model to obtain a trained construction safety risk identification model; S5, acquiring an actual construction plan, inputting the construction plan into the construction safety risk identification model, and outputting the identification result. Compared with existing technologies, this invention has advantages such as improving the accuracy and reliability of large language models in identifying construction safety risks in the construction safety domain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of knowledge graphs and large language models, and in particular to a method for identifying safety risks in construction behavior based on knowledge graphs and large language models. Background Technology

[0002] With the rapid development of artificial intelligence (AI) technology, especially the application of technologies such as Natural Language Processing (NLP), knowledge graphs, and Large Language Models (LLMs) in information extraction, knowledge management, and intelligent decision-making, new solutions have been provided for the intelligent identification and management of construction safety risks. NLP technology can automatically extract key information from unstructured construction safety accident reports, knowledge graphs can structure and manage this information, and LLMs can provide powerful semantic understanding and reasoning capabilities. However, the application of these AI technologies in construction safety risk identification still has some limitations, including: NLP and knowledge graph technologies are difficult to learn and require a certain technical background and professional knowledge to operate effectively, which affects their widespread adoption and application on construction sites; and existing Large Language Models (LLMs) may misjudge or miss cases when dealing with complex scenarios in specialized fields, a phenomenon known as "illusion," which reduces their reliability and trustworthiness, especially in the construction safety field where high-precision judgment is required. Summary of the Invention

[0003] The purpose of this invention is to provide a method for identifying safety risks in construction behavior based on knowledge graphs and large language models in order to improve the accuracy and reliability of large language models in the field of construction safety.

[0004] The objective of this invention can be achieved through the following technical solutions:

[0005] A method for identifying safety risks in construction behavior based on knowledge graphs and large language models, comprising the following steps:

[0006] S1. Define construction safety entities and entity relationships based on construction behavior information. Preprocess and annotate the construction safety accident report text based on the defined entities and entity relationships to obtain a key knowledge entity dataset in the field of construction safety.

[0007] S2. Train an entity recognition model based on the key knowledge entity dataset, and obtain a construction safety accident knowledge graph containing construction safety knowledge based on the entity recognition model;

[0008] S3. Convert the entities and entity relationships in the knowledge graph into embedding vectors, match the embedding vectors with the word embeddings of the large language model, and generate a word embedding matrix. The word embedding matrix is ​​used as the initial weight matrix of the word embedding layer in the large language model.

[0009] S4. The embedding vectors and the training set text of the large language model are used together as the training set of the large language model. The training set is input into the large language model. The large language model processes the input training set based on the word embedding matrix and calculates the loss function between the output of the large language model and the actual target value. The loss function includes the loss of the large language model and the loss of the knowledge graph embedding vectors. The parameters of the large language model are optimized based on the loss function to obtain the trained construction behavior safety risk identification model.

[0010] S5. Obtain the actual construction plan, input the construction plan into the construction behavior safety risk identification model, and output the identification results.

[0011] Furthermore, the number of rows in the word embedding matrix corresponds to the total number of entities and relations in the knowledge graph, the number of columns corresponds to the dimension of the embedding vector, and the elements of the word embedding matrix are the embedding vectors generated from the knowledge graph.

[0012] Furthermore, the embedding vector is matched with the word embeddings of the large language model, specifically as follows:

[0013] The knowledge graph associates specialized terms with corresponding entries in the vocabulary of the large language model. Based on the obtained associations, the embedding vectors are matched with the word embeddings of the large language model. The matching process specifically involves:

[0014] The professional terms in the knowledge graph are standardized, and the corresponding vocabulary items of the standardized professional terms in the vocabulary of the large language model are found. If the search result shows that there is a direct match, the word of the embedding vector is directly used as part of the embedding matrix. If the search result shows that there is no direct match, the embedding vector is generated through context embedding or synthetic embedding, and the word of the embedding vector is embedded into the embedding matrix as part of the embedding matrix.

[0015] Furthermore, the context embedding is: generating an embedding vector by utilizing the contextual relationships of terms in the knowledge graph;

[0016] The synthetic embedding involves decomposing terms into sub-units of roots and affixes, and then combining these sub-units to synthesize an embedding vector in a large language model.

[0017] Furthermore, the loss of the knowledge graph embedding vector is the embedding consistency loss, which specifically includes:

[0018] Where Lconsistency This represents a loss of consistency; x represents the original construction safety accident report text or pre-processed data. f(x) represents the embedding vector obtained from the knowledge graph; f(x) is the model's output on the original input x. It is the embedding vector obtained by the model in the knowledge graph. The output on the above; ||·|2 represents the Euclidean norm, which is the square root of the sum of squares.

[0019] Furthermore, the specific steps for optimizing the parameters of the large language model based on the loss function are as follows:

[0020] Based on the loss function, the gradient of the parameters of the large language model is calculated using the backpropagation algorithm. Starting from the output layer of the large language model, the gradient is propagated back to the input layer of the large language model to minimize the prediction error. In the above process, gradient descent or its variants are used to update the parameters of the large language model according to the calculated gradient. The parameters of the large language model include the parameters of the word embedding layer of the large language model.

[0021] Furthermore, the entity categories of the construction safety entity are: operation type, behavior indicator, injury type, accident location, medium, and accident cause.

[0022] Furthermore, the entity relationships are the relationship between injury type and work activity "injury exists", the relationship between injury type and accident cause "attributed to", the relationship between behavioral indicator and injury type "caused", the relationship between medium and location "location associated", and the relationship between medium and work activity "included in activity".

[0023] Furthermore, the preprocessing specifically includes: word segmentation, removal of stop words, and part-of-speech tagging.

[0024] Furthermore, the entity recognition model is constructed based on the BERT model of Transformer.

[0025] Compared with the prior art, the present invention has the following beneficial effects:

[0026] This invention relies on knowledge embedding technology and employs a method of embedding knowledge graphs within large language models. This involves directly integrating the structured information of knowledge graphs (KGs) into the parameter learning process of large language models (LLMs). Entities and relations in the knowledge graph are converted into real-valued vectors, and these vectors, which capture the semantic relationships between entities, are then embedded into the large language model. In this way, the large language model learns not only the inherent features of textual data during training but also structured knowledge, thereby improving its understanding and reasoning abilities. Based on this, a construction safety risk identification fusion model based on knowledge embedding technology and embedded knowledge graphs within a large language model provides a seamless knowledge reasoning mechanism. It allows for the direct identification of potential safety risks in construction plans within the large language model without external queries. This not only reduces additional computational overhead but also allows the large language model to utilize the interrelationships between knowledge graphs and text more deeply, fully leveraging the powerful learning capabilities and natural language understanding abilities of the large language model, along with the accuracy and interpretability advantages of knowledge graphs, significantly improving the accuracy and reliability of construction safety risk identification. Furthermore, the user-friendliness of the large language model allows even non-professionals to easily use this invention to identify and manage safety risks in construction activities. Attached Figure Description

[0027] Figure 1 This is a flowchart of the present invention;

[0028] Figure 2 This is a partial example of the construction safety accident knowledge graph of the present invention;

[0029] Figure 3 This is a flowchart of the large language model training process of the present invention. Detailed Implementation

[0030] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.

[0031] This invention proposes a method for identifying safety risks in construction behavior based on knowledge graphs and large language models. The flowchart of the method is as follows: Figure 1As shown, firstly, a named entity recognition model for construction safety accidents was established using Natural Language Processing (NLP) technology. Based on this model, text mining was performed on construction safety accident reports to extract key knowledge entities. Secondly, a knowledge graph for construction safety accidents was constructed using knowledge representation and graph database technologies, enabling the visualization and storage of knowledge. Finally, knowledge embedding technology was employed to directly integrate the structured information of the knowledge graph (KGs) into the parameter learning process of Large Language Models (LLMs), developing an intelligent identification model for construction behavior safety risks based on knowledge graphs and LLMs (hereinafter referred to as the CHATKGRI model). This model can intelligently analyze construction plans, identify safety risks, and provide management suggestions. This invention provides effective technical support for the accurate identification of construction behavior safety risks.

[0032] The specific steps of this invention are as follows:

[0033] S1. Define construction safety entities and entity relationships based on construction behavior information. Preprocess and annotate the construction safety accident report text based on the defined entities and entity relationships to obtain a key knowledge entity dataset in the field of construction safety.

[0034] S2. Train an entity recognition model based on the key knowledge entity dataset, and obtain a construction safety accident knowledge graph containing construction safety knowledge based on the entity recognition model;

[0035] S3. Convert the entities and entity relationships in the knowledge graph into embedding vectors, match the embedding vectors with the word embeddings of the large language model, and generate a word embedding matrix. The word embedding matrix is ​​used as the initial weight matrix of the word embedding layer in the large language model.

[0036] S4. The embedding vectors and the training set text of the large language model are used together as the training set of the large language model. The training set is input into the large language model. The large language model processes the input training set based on the word embedding matrix and calculates the loss function between the output of the large language model and the actual target value. The loss function includes the loss of the large language model and the loss of the knowledge graph embedding vectors. The parameters of the large language model are optimized based on the loss function to obtain the trained construction behavior safety risk identification model.

[0037] S5. Obtain the actual construction plan, input the construction plan into the construction behavior safety risk identification model, and output the identification results.

[0038] In steps S1 and S2 of this invention, firstly, by combining literature retrieval and expert experience, six key knowledge entities closely related to the safety risks of construction activities in construction safety accident reports, as well as the relationships between these entities, are accurately defined. Then, using the Transformer-based BERT model in Natural Language Processing (NLP), the text content of construction safety accident reports is deeply mined to automatically extract and classify the aforementioned six types of key knowledge entities related to construction safety risks. Next, based on the extracted six types of key knowledge entities related to construction safety risks and the relationships between these six types of entities, a construction safety accident knowledge graph is constructed using the Neo4j graph database as a carrier, achieving structured storage and visual display of construction safety knowledge.

[0039] In the entity definition stage, combining literature retrieval and expert experience, and taking into account the textual structure characteristics of the collected construction accident reports, as well as the functional requirements of the knowledge graph used for construction safety risk identification, six categories of construction safety entities are defined (as shown in Table 1), including: Operational activity, Behaviorindicator, Safety accident, Location, Media, and Cause of accident.

[0040] Table 1 Entity Categories in the Field of Construction Safety Accidents

[0041]

[0042] In the entity relationship definition phase, based on the six categories of construction safety entities defined in the previous step, the relationships between these six entities are defined according to logical relationships such as causality and progression (as shown in Table 2), including: the relationship between injury type and work activity "Exist in", the relationship between injury type and accident cause "Attributable to", the relationship between behavioral indicator and injury type "Cause", the relationship between medium and location "Location association", and the relationship between medium and work activity "Included in the activity". The entity relationships given in Table 2 are stored in CSV file format, forming structured data of five types of construction safety entity relationships.

[0043] Table 2. Relationships between entities in the field of construction safety accidents.

[0044]

[0045] During the data collection phase, a wide range of construction safety accident reports were collected, and these reports underwent thorough data cleaning to remove redundant and erroneous information, ensuring the quality and consistency of the data.

[0046] In the text preprocessing and dataset construction stages, natural language processing techniques are used to perform word segmentation, stop word removal, and part-of-speech tagging on the cleaned construction safety accident report text. Then, the processed construction safety accident report text is annotated with the above six types of construction safety entities, thereby constructing a key knowledge entity dataset in the field of construction safety, which prepares for named entity recognition and knowledge graph construction.

[0047] In the named entity recognition (NER) stage, the Bert-base-NER model based on the Transformer architecture is used. This is a pre-trained language model specifically optimized for named entity recognition tasks. The model has been fine-tuned on the CoNLL-2003 dataset and can recognize various entity types, including locations, organizations, people, and miscellaneous items. In this step, a transfer learning strategy is used to train the Bert-base-NER model using the key knowledge entity dataset for construction safety established in the previous step to perform the recognition of the six types of construction safety entities mentioned above. After training, the Bert-base-NER model can automatically identify key entities from construction safety accident report text, classify them, and then store the structured data of these six types of construction safety entities in CSV files.

[0048] In the knowledge graph construction and visualization phase, the Neo4j graph database was chosen as the platform. Using the LOAD CSV command in Cypher, a CSV file storing structured data for six types of construction safety entities was first imported, followed by a CSV file storing structured data for five types of construction safety entity relationships. These two steps imported all the entity data extracted from construction safety accident report texts and the defined entity relationship data into the Neo4j graph database, forming a construction safety accident knowledge graph containing construction safety knowledge. Figure 2 Some examples of knowledge graphs for construction safety accidents are provided.

[0049] In S3-S5, a method of embedding knowledge graphs within large language models is adopted. This involves directly integrating the structured information of knowledge graphs (KGs) into the parameter learning process of large language models (LLMs), thereby creating an intelligent identification technology for construction behavior safety risks based on knowledge graphs and large language models. First, relying on knowledge embedding technology, the knowledge graph is input into the large language model as knowledge embedding. Second, the large language model after knowledge embedding is used to analyze the construction plan and identify potential safety risks. Finally, highly reliable construction behavior safety risks are output.

[0050] In the construction safety risk identification phase, relying on knowledge embedding technology, a method of embedding knowledge graphs within large language models is adopted. This involves directly integrating the structured information of knowledge graphs (KGs) into the parameter learning process of large language models (LLMs). The model training process is as follows: Figure 3 As shown. The core of this method lies in converting entities and relations in the knowledge graph into real-valued vectors, and then embedding these real-valued vectors that can capture the semantic relationships between entities into a large language model. The specific steps are as follows:

[0051] ① Using the BERT pre-trained model, entities and relations in the knowledge graph are transformed into embedding vectors, which can capture the semantic information of entities and relations.

[0052] ② Associate the specialized terms in the knowledge graph with their corresponding entries in the vocabulary of the large language model. Based on this, match the entity and relation embedding vectors generated from the knowledge graph in the previous step with the word embeddings in the large language model. This involves standardizing the specialized terms in the knowledge graph through stemming, lowercase conversion, etc., to ensure consistency with the vocabulary format in the large language model. Next, identify the specialized terms in the knowledge graph and search for corresponding vocabulary entries in the vocabulary of the large language model. If a direct match exists, the word embeddings in the large language model can be used directly. For terms that do not have a direct match in the large language model vocabulary, methods are needed to expand or generate corresponding embedding vectors. This can be achieved through contextual embedding (using the contextual relationships of terms in the knowledge graph to generate embedding vectors) or synthetic embedding (decomposing terms into sub-units such as roots and affixes, and then combining these sub-units to synthesize the embedding vector in the large language model). Finally, integrate the embedding vectors with the parameters of the large language model.

[0053] ③ Before training the large language model begins, a word embedding matrix is ​​constructed using the entity and relation embedding vectors generated from the knowledge graph in step ① to initialize a portion of the parameters of the large language model. The number of rows in this word embedding matrix corresponds to the total number of entities and relations in the knowledge graph, and the number of columns corresponds to the dimension of the embedding vectors. The specific elements are the entity and relation embedding vectors generated from the knowledge graph. This word embedding matrix is ​​used to initialize the vocabulary-related parameters in the large language model, serving as the initial weight matrix for the word embedding layer.

[0054] ④ Begin training the large language model. During the training process, the entity and relation embedding vectors generated from the knowledge graph in step ① are used together with the training set text data of the large language model for model parameter optimization. This means that when updating its parameters, the large language model will simultaneously consider the structured information from the knowledge graph and the semantic information from the training set text data. The specific optimization process described above is as follows:

[0055] First, the training set text data is input into the large language model, and the output of the large language model is calculated through the forward propagation algorithm. At this stage, the large language model uses an initialized word embedding matrix (including entity and relation embedding vectors from the knowledge graph) to process the input text.

[0056] Second, the loss is calculated based on the output of the large language model and the actual target value. The loss function includes both the loss of the large language model (such as cross-entropy loss) and the loss of the knowledge graph embedding vectors (such as embedding consistency loss).

[0057] The formula for consistency loss is:

[0058]

[0059] Where L consistency It is the consistency loss, which measures the model's performance in handling x and This ensures consistency in output across different timeframes. It guarantees that the model can maintain consistent predictions when processing textual data and structured knowledge.

[0060] x represents the original construction safety accident report text or preprocessed data, which is part of the large language model training set. This text data is input into the model to generate word embedding vectors, which capture the semantic information in the text.

[0061] These represent embedding vectors derived from the knowledge graph, which represent structured knowledge in the field of construction safety. They include entities (such as job type, injury type, etc.) and the relationships between them (such as "the injury exists", "attributed to", etc.), and can be regarded as a transformed input that is associated with the original text data x, but exists in the form of embedding vectors;

[0062] f(x) is the model's output on the original input x; The model is based on the original input. The output is given by f(x). ‖·‖2 represents the Euclidean norm, which is the square root of the sum of squares; the loss function calculates the difference between the model output f(x) and the actual target value, which reflects the model's prediction accuracy for the training set text.

[0063] Third, using the results of this loss function, the gradients of the large language model parameters are calculated via backpropagation. This process starts from the output layer and propagates backwards to the input layer of the large language model to minimize the prediction error. Gradient descent or its variants (such as the Adam optimizer) are used to update the parameters of the large language model (including parameters in the word embedding layer associated with entity and relation embedding vectors of the knowledge graph) based on the calculated gradients.

[0064] Fourth, repeat the above steps until the performance of the large language model on the validation set no longer improves significantly, or until the predetermined number of iterations is reached.

[0065] ⑤ After the above training of the large language model is completed, further fine-tuning of the large language model is carried out for the specific task of construction safety risk. At this time, the entity and relation embedding vectors generated by the knowledge graph can help the large language model better understand and process professional domain texts related to construction safety accidents.

[0066] By incorporating knowledge graphs into the large language model, the large language model not only learns the inherent characteristics of construction safety risks in the training set text data during training, but also learns the structured construction safety professional knowledge of the knowledge graph, thereby improving the large language model's understanding and reasoning ability regarding construction safety knowledge.

[0067] This invention utilizes natural language processing technology to efficiently extract key information such as construction safety entities from construction safety accident reports and transform it into structured data, optimizing data quality and improving data usability. Based on this, a construction safety accident knowledge graph is constructed, which can organize and store construction safety knowledge in a graphical manner, thus providing a more intuitive and systematic knowledge base for identifying safety risks in construction activities. Building upon this, a fusion model using a large language model embedded with the knowledge graph, based on knowledge embedding technology, is employed to intelligently analyze construction plans, accurately identifying potential safety risks in construction activities.

[0068] This invention uses natural language processing technology to automatically parse unstructured construction safety accident report text data, reducing manual intervention and improving data processing efficiency. Based on this, a construction safety accident knowledge graph is constructed, providing a powerful knowledge support platform for construction safety management, making the storage, retrieval, and application of construction safety knowledge more convenient.

[0069] Simultaneously, relying on knowledge embedding technology, a method of embedding knowledge graphs within large language models is adopted, directly integrating the structured information of knowledge graphs (KGs) into the parameter learning process of large language models (LLMs). The core of this method lies in converting entities and relations in the knowledge graph into real-valued vectors, and then embedding these real-valued vectors that capture the semantic relationships between entities into the large language model. In this way, the large language model not only learns the inherent features of text data during training but also learns structured knowledge, thereby improving its understanding and reasoning abilities. Based on this, a construction safety risk identification fusion model based on knowledge embedding technology and embedded knowledge graphs within a large language model can provide a seamless knowledge reasoning mechanism, directly identifying potential safety risks of construction schemes within the large language model without external queries. This not only reduces additional computational overhead but also allows the large language model to utilize the interrelationships between knowledge graphs and text more deeply, fully leveraging the powerful learning capabilities and natural language understanding abilities of the large language model, along with the accuracy and interpretability advantages of knowledge graphs, significantly improving the accuracy and reliability of construction safety risk identification. Furthermore, the user-friendliness of the large language model allows even non-professionals to easily use this invention to identify and manage safety risks in construction activities.

[0070] This invention employs Natural Language Processing (NLP) technology to extract objective data such as descriptions of unsafe behaviors, causes, and consequences of accidents from construction safety accident reports. Based on this, a construction safety accident knowledge graph is generated. Then, through knowledge embedding technology, the structured information of the knowledge graph (KGs) is directly integrated into the parameter learning process of Large Language Models (LLMs), solving the illusion problem that large language models may produce. This leads to the construction of a construction behavior safety risk identification model based on knowledge graphs and large language models, enabling accurate and reliable identification of construction behavior safety risks, thereby reducing the risk of construction safety accidents and improving the safety management level of the construction industry.

[0071] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.

Claims

1. A method for identifying safety risks in construction behavior based on knowledge graphs and large language models, characterized in that, The method includes the following steps: S1. Define construction safety entities and entity relationships based on construction behavior information. Preprocess and annotate the construction safety accident report text based on the defined entities and entity relationships to obtain a key knowledge entity dataset in the field of construction safety. S2. Train an entity recognition model based on the key knowledge entity dataset, and obtain a construction safety accident knowledge graph containing construction safety knowledge based on the entity recognition model; S3. Convert the entities and entity relationships in the knowledge graph into embedding vectors, match the embedding vectors with the word embeddings of the large language model, and generate a word embedding matrix. The word embedding matrix is ​​used as the initial weight matrix of the word embedding layer in the large language model. S4. The embedding vectors and the training set text of the large language model are used together as the training set of the large language model. The training set is input into the large language model. The large language model processes the input training set based on the word embedding matrix and calculates the loss function between the output of the large language model and the actual target value. The loss function includes the loss of the large language model and the loss of the knowledge graph embedding vectors. The parameters of the large language model are optimized based on the loss function to obtain the trained construction behavior safety risk identification model. S5. Obtain the actual construction plan, input the construction plan into the construction behavior safety risk identification model, and output the identification results.

2. The method for identifying construction behavior safety risks based on knowledge graphs and large language models according to claim 1, characterized in that, The number of rows in the word embedding matrix corresponds to the total number of entities and relations in the knowledge graph, and the number of columns corresponds to the dimension of the embedding vector. The elements of the word embedding matrix are the embedding vectors generated from the knowledge graph.

3. The method for identifying construction behavior safety risks based on knowledge graphs and large language models according to claim 2, characterized in that, The embedding vector is matched with the word embeddings of the large language model, specifically as follows: The knowledge graph associates specialized terms with corresponding entries in the vocabulary of the large language model. Based on the obtained associations, the embedding vectors are matched with the word embeddings of the large language model. The matching process specifically involves: The professional terms in the knowledge graph are standardized, and the corresponding vocabulary items of the standardized professional terms in the vocabulary of the large language model are found. If the search result shows that there is a direct match, the word of the embedding vector is directly used as part of the embedding matrix. If the search result shows that there is no direct match, the embedding vector is generated through context embedding or synthetic embedding, and the word of the embedding vector is embedded into the embedding matrix as part of the embedding matrix.

4. The method for identifying construction behavior safety risks based on knowledge graphs and large language models according to claim 3, characterized in that, The context embedding is: generating embedding vectors by utilizing the contextual relationships of terms in the knowledge graph; The synthetic embedding involves decomposing terms into sub-units of roots and affixes, and then combining these sub-units to synthesize an embedding vector in a large language model.

5. The method for identifying construction behavior safety risks based on knowledge graphs and large language models according to claim 1, characterized in that, The loss of the knowledge graph embedding vector is the embedding consistency loss, which specifically includes: Where L consistency This represents a loss of consistency; x represents the original construction safety accident report text or pre-processed data. f(x) represents the embedding vector obtained from the knowledge graph; f(x) is the model's output on the original input x. It is the embedding vector obtained by the model in the knowledge graph. The output on the above; ||·|2 represents the Euclidean norm, which is the square root of the sum of squares.

6. The method for identifying construction behavior safety risks based on knowledge graphs and large language models according to claim 5, characterized in that, The specific steps for optimizing the parameters of a large language model based on a loss function are as follows: Based on the loss function, the gradient of the parameters of the large language model is calculated using the backpropagation algorithm. Starting from the output layer of the large language model, the gradient is propagated back to the input layer of the large language model to minimize the prediction error. In the above process, gradient descent or its variants are used to update the parameters of the large language model according to the calculated gradient. The parameters of the large language model include the parameters of the word embedding layer of the large language model.

7. The method for identifying construction behavior safety risks based on knowledge graphs and large language models according to claim 1, characterized in that, The entity categories of the construction safety entities are: operation type, behavior indicator, injury type, accident location, medium, and accident cause.

8. The method for identifying construction behavior safety risks based on knowledge graphs and large language models according to claim 7, characterized in that, The entity relationships are: the relationship between injury type and work activity "injury exists", the relationship between injury type and accident cause "attributed to", the relationship between behavioral indicator and injury type "caused", the relationship between medium and location "location associated", and the relationship between medium and work activity "included in activity".

9. The method for identifying safety risks in construction behavior based on knowledge graphs and large language models according to claim 8, characterized in that, The preprocessing specifically includes word segmentation, stop word removal, and part-of-speech tagging.

10. The method for identifying construction behavior safety risks based on knowledge graphs and large language models according to claim 1, characterized in that, The entity recognition model is built based on the BERT model of Transformer.

Citation Information

Patent Citations

  • Construction risk detection method and system based on BIM and knowledge graph

    CN118134258A

  • Bridge field construction scheme examination method based on large model and knowledge graph

    CN118411016A