Construction behavior safety risk identification method based on knowledge graph and large language model
By embedding the construction safety accident knowledge graph into the parameter learning process of the large language model, the problem of misjudgment and misjudgment of the large language model in the identification of safety risks of construction behavior is solved, and higher recognition accuracy and reliability are achieved, suitable for construction. Popularization and application on site.
Patent Information
- Application Number
- CN202411042862.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-12-03
AI Technical Summary
The existing large language models have misjudgment and misjudgment in the identification of construction behavior safety risks, and the application of natural language processing and knowledge graph technology is difficult, which affects its popularity and reliability at the construction site.
By defining the relationship between construction safety entities and entities, a construction safety accident knowledge graph is constructed, and the embedded vector is embedded with the word embedding matrix of the large language model is matched, the parameters of the large language model are optimized, and the construction behavior safety is formed based on the knowledge graph and the large language model. Risk identification model to achieve seamless integration of knowledge graphs and text data.
It significantly improves the accuracy and reliability of identification of safety risks in construction behavior, reduces calculation overhead, allows non-professionals to use it easily, and improves the accuracy and efficiency of construction safety management.
Smart Images

Figure CN119066151A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of knowledge graphs and large language models, and in particular to a method for identifying safety risks of construction behaviors based on knowledge graphs and large language models. Background Art
[0002] With the rapid development of artificial intelligence technology, especially the application of natural language processing (NLP), knowledge graphs and large language models (LLMs) in the fields of information extraction, knowledge management and intelligent decision-making, new solutions are 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, there are still some limitations in the application of the above artificial intelligence technologies in the identification of construction behavior safety risks, including: natural language processing (NLP) and knowledge graph technologies are difficult to use, and require a certain technical background and professional knowledge to operate effectively, which affects their popularization and application in construction sites; and existing large language models (LLMs) may make misjudgments or omissions when dealing with complex scenarios in professional fields, the so-called "hallucination phenomenon", which reduces their reliability and trustworthiness, especially in the field of construction safety that requires high-precision judgment. This problem is particularly prominent. Summary of the invention
[0003] The purpose of the present invention is to provide a method for identifying construction behavior safety risks based on knowledge graph and large language model in order to improve the accuracy and reliability of large language model in identifying construction behavior safety risks in the field of construction safety.
[0004] The purpose of the present invention can be achieved by the following technical solutions:
[0005] A construction behavior safety risk identification method based on knowledge graph and large language model, the method comprises the following steps:
[0006] S1. Define construction safety entities and entity relationships based on construction behavior information, preprocess and entity annotate the construction safety accident report text based on the defined entities and entity relationships, and obtain a key knowledge entity dataset in the field of construction safety;
[0007] S2. An entity recognition model is obtained based on the training of the key knowledge entity data set, and a construction safety accident knowledge graph containing construction safety knowledge is obtained based on the entity recognition model;
[0008] S3, converting entities and entity relationships in the knowledge graph into embedding vectors, matching the embedding vectors with word embeddings of a large language model, and generating a word embedding matrix, wherein the word embedding matrix is used as an initial weight matrix of a word embedding layer in the large language model;
[0009] S4, taking the embedding vector and the training set text of the large language model as the large language model training set, inputting the training set into the large language model, and the large language model processing the input training set based on the word embedding matrix, calculating the loss function between the output of the large language model and the actual target value, wherein the loss function includes the loss of the large language model and the loss of the knowledge graph embedding vector, optimizing the parameters of the large language model based on the loss function, and obtaining a trained construction behavior safety risk identification model;
[0010] S5. Obtain an actual construction plan, input the construction plan into a construction behavior safety risk identification model, and output an identification result.
[0011] Furthermore, the number of rows of the word embedding matrix corresponds to the total number of entities and relationships 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 by the knowledge graph.
[0012] Furthermore, the embedding vector is matched with the word embedding of the large language model, specifically:
[0013] Associate the professional terms in the knowledge graph with the corresponding items in the vocabulary of the large language model, and match the embedding vector with the word embedding of the large language model based on the obtained association. The matching is specifically as follows:
[0014] Standardize the professional terms in the knowledge graph and find the corresponding vocabulary items of the standardized professional terms in the vocabulary of the large language model. If the result of the search is that there is a direct match, the embedding vector is directly input into the word as part of the embedding matrix. If the result of the search is that there is no direct match, the embedding vector is generated through context embedding or synthetic embedding, and the embedding vector is input into the word embedding matrix as part of the embedding matrix.
[0015] Furthermore, the context embedding is: generating an embedding vector using the contextual relationship of the term in the knowledge graph;
[0016] The synthetic embedding is as follows: a term is decomposed into sub-units of roots and affixes, and then these sub-units are combined 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, and the embedding consistency loss is specifically:
[0018] Where Lconsistency is the consistency loss; x represents the original construction safety accident report text or preprocessed data; represents the embedding vector obtained from the knowledge graph; f(x) is the output of the model on the original input x; is the embedding vector obtained by the model in the knowledge graph The output on ; ‖·‖2 represents the Euclidean norm, which is the square root of the sum of squares.
[0019] Furthermore, the specific steps of optimizing the parameters of the large language model based on the loss function are:
[0020] Based on the loss function, the gradient of the parameters of the large language model is calculated by the back propagation algorithm, starting from the output layer of the large language model, and reversely passed 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, and the parameters of the large language model include the parameters of the word embedding layer of the large language model.
[0021] Furthermore, 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 in", the relationship between injury type and accident cause "attributed to", the relationship between behavioral indicators and injury type "caused by", the relationship between medium and location "location association" 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] The present invention relies on knowledge embedding technology and adopts a method of embedding knowledge graphs in a large language model, that is, directly integrating the structured information of knowledge graphs (KGs) into the parameter learning process of large language models (LLMs), converting entities and relationships in the knowledge graphs into real vectors, and then embedding these real vectors that can capture the semantic connection between entities into the large language model. In this way, the large language model not only learns the intrinsic characteristics of text data during training, but also learns structured knowledge, thereby improving the understanding and reasoning ability of the large language model to knowledge. Accordingly, a construction behavior safety risk identification fusion model based on knowledge embedding technology and embedded knowledge graphs in a large language model can provide a seamless knowledge reasoning mechanism, and the potential safety risk identification of the construction plan can be performed directly in the large language model without external queries. This not only reduces the additional computational overhead, but also allows the large language model to make more in-depth use of the relationship between the knowledge graph and the text, giving full play to the powerful learning ability and natural language understanding ability of the large language model and the accuracy and interpretability of the knowledge graph, and significantly improving the identification accuracy and reliability of construction behavior safety risks. In addition, by utilizing the user-friendliness of the large language model, non-professionals can also easily use the present invention to identify and manage safety risks of construction behaviors. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 is a flow chart of the present invention;
[0028] Figure 2 These are some examples of the construction safety accident knowledge graph of the present invention;
[0029] Figure 3 This is a flow chart of the large language model training of the present invention. DETAILED DESCRIPTION
[0030] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0031] The present invention proposes a construction behavior safety risk identification method based on knowledge graph and large language model. The flowchart of the method is as follows: Figure 1As shown. First, a named entity recognition model for construction safety accidents was established through natural language processing (NLP) technology, and 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 technology, and the visual representation and storage of knowledge was realized. Finally, the knowledge embedding technology was used to directly integrate the structured information of the knowledge graph (KGs) into the parameter learning process of the large language model (LLMs), and an intelligent identification model for construction behavior safety risks based on knowledge graphs and large language models (hereinafter referred to as the CHATKGRI model) was developed. The model can perform intelligent analysis on construction plans, identify safety risks therein, and provide management recommendations. The present invention provides effective technical support for the accurate identification of construction behavior safety risks.
[0032] The specific steps of the present invention are:
[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, and obtain a key knowledge entity dataset in the field of construction safety;
[0034] S2. An entity recognition model is obtained based on the training of the key knowledge entity data set, and a construction safety accident knowledge graph containing construction safety knowledge is obtained based on the entity recognition model;
[0035] S3, converting entities and entity relationships in the knowledge graph into embedding vectors, matching the embedding vectors with word embeddings of a large language model, and generating a word embedding matrix, wherein the word embedding matrix is used as an initial weight matrix of a word embedding layer in the large language model;
[0036] S4, taking the embedding vector and the training set text of the large language model as the large language model training set, inputting the training set into the large language model, and the large language model processing the input training set based on the word embedding matrix, calculating the loss function between the output of the large language model and the actual target value, wherein the loss function includes the loss of the large language model and the loss of the knowledge graph embedding vector, optimizing the parameters of the large language model based on the loss function, and obtaining a trained construction behavior safety risk identification model;
[0037] S5. Obtain an actual construction plan, input the construction plan into a construction behavior safety risk identification model, and output an identification result.
[0038] In S1 and S2 of the present invention, firstly, the six types of key knowledge entities closely related to the safety risks of construction behavior in the construction safety accident report and the relationship between the entities are accurately defined by combining literature retrieval and expert experience; the BERT model based on Transformer in natural language processing (NLP) technology is used to deeply mine the text content of the construction safety accident report to realize the automatic extraction and classification of the above six types of key knowledge entities of construction behavior safety risks. Then, based on the above-extracted six types of key knowledge entities of construction behavior safety risks and the relationship between the six types of entities defined above, the Neo4j graph database is used as a carrier to construct a knowledge graph of construction safety accidents, and realize the 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 text structure characteristics of the collected construction accident reports and the functional requirements of the knowledge graph for construction safety risk identification, six types of construction safety entity categories are defined (as shown in Table 1), including: operational activity, behavioral indicator, injury type, 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 stage, according to the six types of construction safety entity categories defined in the previous step, the relationships between these six types of entities are defined according to the logical relationships such as cause and effect and progression (as shown in Table 2), including: the relationship between injury type and work activity "injury exists in", the relationship between injury type and accident cause "attributable to", the relationship between behavioral indicators 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 the form of CSV files to form structured data of five types of construction safety entity relationships.
[0043] Table 2 Relationships between entities in the construction safety accident field
[0044]
[0045] During the data collection stage, construction safety accident reports were widely collected and these reports were thoroughly cleaned to remove redundant and erroneous information, ensuring the quality and consistency of the data.
[0046] During the text preprocessing and dataset construction stage, natural language processing technology is used to perform word segmentation, stop word removal, part-of-speech tagging, etc. on the cleaned construction safety accident report text; then, the processed construction safety accident report text is labeled with the above six types of construction safety entities, and a key knowledge entity dataset in the field of construction safety is constructed based on this, preparing for named entity recognition and knowledge graph construction.
[0047] In the named entity recognition stage, the Bert-base-NER model based on the Transformer architecture is used. This is a pre-trained language model optimized specifically for named entity recognition tasks. The model has been fine-tuned on the CoNLL-2003 dataset and can recognize multiple types of entities, 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 in the construction safety field established in the previous step to carry out the above six types of construction safety entity recognition. After training, the Bert-base-NER model can automatically identify key entities from the construction safety accident report text, classify them, and then store the structured data of these six types of construction safety entities in the form of CSV files.
[0048] In the knowledge graph construction and visualization stage, the visualization tool Neo4j graph database was selected as the carrier. Through the LOAD CSV command in the Cypher statement, the CSV file storing the six types of construction safety entity structured data was first imported, and then the CSV file storing the five types of construction safety entity relationship structured data was imported. Through the above two steps, all the entity data extracted from the construction safety accident report text and the defined entity relationship data were imported into the Neo4j graph database, forming a construction safety accident knowledge graph containing construction safety knowledge. Figure 2 Some examples of construction safety accident knowledge graph are given.
[0049] In S3-S5, the method of embedding knowledge graphs in large language models is adopted, that is, the structured information of knowledge graphs (KGs) is directly integrated 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; secondly, the large language model after knowledge embedding is used to analyze the construction plan and identify potential safety risks; finally, the construction behavior safety risks with high reliability are output.
[0050] In the construction behavior safety risk identification stage, relying on knowledge embedding technology, the method of embedding knowledge graphs in large language models is adopted, that is, the structured information of knowledge graphs (KGs) is directly integrated into the parameter learning process of large language models (LLMs). The training process of the model is as follows: Figure 3 The core of this method is to convert entities and relations in the knowledge graph into real vectors, and then embed these real vectors that can capture the semantic connection between entities into the large language model. The specific steps are:
[0051] ① Use the BERT pre-trained model to convert entities and relations in the knowledge graph into embedding vectors that can capture the semantic information of entities and relations.
[0052] ② Associate the professional terms in the knowledge graph with the corresponding items in the vocabulary of the large language model, and match the entity and relationship embedding vectors generated by the knowledge graph in the previous step with the word embedding in the large language model. That is, the professional terms in the knowledge graph are standardized by stem extraction, lowercase conversion, etc. to ensure that they are consistent with the vocabulary format in the large language model. Next, identify the professional terms in the knowledge graph and find the corresponding vocabulary items in the vocabulary of the large language model. If there is a direct match, the word embedding in the large language model can be used directly. For those terms that do not have a direct match in the vocabulary of the large language model, some methods are needed to expand or generate the corresponding embedding vector. This can be achieved through contextual embedding (generating embedding vectors using the contextual relationship of terms in the knowledge graph) 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, the embedding vector is integrated with the parameters of the large language model.
[0053] ③ Before the training of the large language model begins, the word embedding matrix is constructed using the entity and relationship embedding vectors generated by the knowledge graph in step ① to initialize some parameters of the large language model. The number of rows in the word embedding matrix corresponds to the total number of entities and relationships in the knowledge graph, the number of columns corresponds to the dimensions of the embedding vector, and the specific elements are the entity and relationship embedding vectors generated by the knowledge graph. The word embedding matrix is used to initialize the vocabulary-related parameters in the large language model, that is, as the initial weight matrix of the word embedding layer in the large language model.
[0054] ④ Start training the large language model. During the large language model training process, the entity and relationship embedding vectors generated by 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 the large language model updates its parameters, it will take into account both the structured information from the knowledge graph and the semantic information from the training set text data. The specific process of the above optimization is:
[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 the initialized word embedding matrix (including entity and relationship 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. Its loss function includes both the loss of the large language model (such as cross entropy loss) and the loss of the knowledge graph embedding vector (such as embedding consistency loss).
[0057] The formula for consistency loss is:
[0058]
[0059] Where L consistency is the consistency loss, which measures the model's performance in processing x and This ensures that the model can make consistent predictions when processing text 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. These text data are input into the model to generate word embedding vectors, which capture the semantic information in the text;
[0061] represents the embedding vectors obtained from the knowledge graph, which represent the structured knowledge in the field of construction safety. They include entities (such as job type, injury type, etc.) and the relations between them (such as "injury exists in", "attributed to", etc.), which can be regarded as a transformed input, which is associated with the original text data x, but exists in the form of embedding vectors;
[0062] f(x) is the output of the model on the original input x; The model is based on the original input The output on . ‖·‖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 can reflect the model's prediction accuracy for the training set text.
[0063] Third, using the result of the loss function, the gradient of the large language model parameters is calculated through the back propagation algorithm. This process starts from the output layer and passes back to the input layer of the large language model to minimize the prediction error. Among them, gradient descent or its variants (such as Adam optimizer) are used to update the parameters of the large language model (including the parameters associated with the entity and relationship embedding vectors of the knowledge graph in the word embedding layer) according to the calculated gradient.
[0064] Fourth, repeat the above steps until the performance of the large language model on the validation set is no longer significantly improved, or the predetermined number of iterations is reached.
[0065] ⑤ After the above training of the large language model is completed, the large language model is further fine-tuned for the specific task of construction behavior safety risk. At this point, the entity and relationship embedding vectors generated by the knowledge graph can help the large language model better understand and process professional field texts related to construction safety accidents.
[0066] Through the above-mentioned fusion method of embedding knowledge graph in the large language model, the large language model not only learns the intrinsic characteristics of the training set text data in terms of construction safety risks during training, but also learns the construction safety professional knowledge structured by the knowledge graph, thereby improving the large language model's understanding and reasoning ability of construction safety knowledge.
[0067] The present invention utilizes natural language processing technology to efficiently extract key information such as construction safety entities from the text of construction safety accident reports, and converts it into structured data, thereby optimizing data quality and improving data availability; the construction safety accident knowledge graph constructed based on this can organize and store construction safety knowledge in a graphical manner, thereby providing a more intuitive and systematic knowledge base for the identification of construction behavior safety risks; on this basis, a fusion model of a large language model embedded in a knowledge graph based on knowledge embedding technology is used to perform intelligent analysis of construction plans, which can accurately identify potential construction behavior safety risks therein.
[0068] The present invention can automatically parse unstructured construction safety accident report text data through natural language processing technology, reduce manual intervention, and improve data processing efficiency. The construction safety accident knowledge graph constructed based on this provides a powerful knowledge support platform for construction safety management, making the storage, retrieval and application of construction safety knowledge more convenient.
[0069] At the same time, relying on knowledge embedding technology, the method of embedding knowledge graphs in large language models is adopted, that is, the structured information of knowledge graphs (KGs) is directly integrated into the parameter learning process of large language models (LLMs). The core of this method is to convert entities and relations in knowledge graphs into real vectors, and then embed these real vectors that can capture the semantic connection between entities into large language models. In this way, the large language model can not only learn the intrinsic characteristics of text data during training, but also learn structured knowledge, thereby improving the understanding and reasoning ability of the large language model for knowledge. Based on this, the construction behavior safety risk identification fusion model with knowledge graphs embedded in large language models based on knowledge embedding technology can provide a seamless knowledge reasoning mechanism, which can directly identify the potential safety risks of construction plans within the large language model without external queries. This not only reduces the additional computational overhead, but also allows the large language model to make more in-depth use of the relationship between knowledge graphs and texts, giving full play to the powerful learning ability and natural language understanding ability of the large language model and the accuracy and interpretability of the knowledge graph, and significantly improving the identification accuracy and reliability of construction behavior safety risks. In addition, by utilizing the user-friendliness of the large language model, non-professionals can also easily use the present invention to identify and manage safety risks of construction behaviors.
[0070] The present invention adopts 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, and generates a knowledge graph of construction safety accidents based on this. Then, the structured information of the knowledge graph (KGs) is directly integrated into the parameter learning process of the large language model (LLMs) through knowledge embedding technology to solve the problem of hallucination phenomenon that may be caused by the large language model, thereby constructing a construction behavior safety risk identification model based on the knowledge graph and the large language model, and realizing accurate and reliable identification of construction behavior safety risks, so as to reduce the risk of construction safety accidents and improve the safety management level of the construction industry.
[0071] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A construction behavior safety risk identification method based on knowledge graph and large language model, characterized in that: The method comprises 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, and obtain a key knowledge entity dataset in the field of construction safety; S2. An entity recognition model is obtained based on the training of the key knowledge entity data set, and a construction safety accident knowledge graph containing construction safety knowledge is obtained based on the entity recognition model; S3, converting entities and entity relationships in the knowledge graph into embedding vectors, matching the embedding vectors with word embeddings of a large language model, and generating a word embedding matrix, wherein the word embedding matrix is used as an initial weight matrix of a word embedding layer in the large language model; S4, taking the embedding vector and the training set text of the large language model as the large language model training set, inputting the training set into the large language model, and the large language model processing the input training set based on the word embedding matrix, calculating the loss function between the output of the large language model and the actual target value, wherein the loss function includes the loss of the large language model and the loss of the knowledge graph embedding vector, optimizing the parameters of the large language model based on the loss function, and obtaining a trained construction behavior safety risk identification model; S5. Obtain an actual construction plan, input the construction plan into a construction behavior safety risk identification model, and output an identification result.
2. According to claim 1, a construction behavior safety risk identification method based on knowledge graph and large language model is characterized in that: The number of rows of the word embedding matrix corresponds to the total number of entities and relationships 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 by the knowledge graph.
3. According to claim 2, a construction behavior safety risk identification method based on knowledge graph and large language model is characterized in that: Match the embedding vector with the word embedding of the large language model, specifically: Associate the professional terms in the knowledge graph with the corresponding items in the vocabulary of the large language model, and match the embedding vector with the word embedding of the large language model based on the obtained association. The matching is specifically as follows: Standardize the professional terms in the knowledge graph and find the corresponding vocabulary items of the standardized professional terms in the vocabulary of the large language model. If the result of the search is that there is a direct match, the embedding vector is directly input into the word as part of the embedding matrix. If the result of the search is that there is no direct match, the embedding vector is generated through context embedding or synthetic embedding, and the embedding vector is input into the word embedding matrix as part of the embedding matrix.
4. According to claim 3, a construction behavior safety risk identification method based on knowledge graph and large language model is characterized in that: The context embedding is to generate an embedding vector using the contextual relationship of the term in the knowledge graph; The synthetic embedding is as follows: a term is decomposed into sub-units of roots and affixes, and then these sub-units are combined to synthesize an embedding vector in a large language model.
5. According to claim 1, a construction behavior safety risk identification method based on knowledge graph and large language model is characterized in that: The loss of the knowledge graph embedding vector is the embedding consistency loss, which is specifically: Where L consistency is the consistency loss; x represents the original construction safety accident report text or preprocessed data; represents the embedding vector obtained from the knowledge graph; f(x) is the output of the model on the original input x; is the embedding vector obtained by the model in the knowledge graph The output on ; ‖·‖2 represents the Euclidean norm, which is the square root of the sum of squares.
6. According to claim 5, a construction behavior safety risk identification method based on knowledge graph and large language model is characterized in that: The specific steps of optimizing the parameters of the large language model based on the loss function are: Based on the loss function, the gradient of the parameters of the large language model is calculated by the back propagation algorithm, starting from the output layer of the large language model, and reversely passed 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, and the parameters of the large language model include the parameters of the word embedding layer of the large language model.
7. According to claim 1, a construction behavior safety risk identification method based on knowledge graph and large language model is characterized in that: The entity categories of the construction safety entity are: operation type, behavior indicator, injury type, accident location, medium and accident cause.
8. According to claim 7, a construction behavior safety risk identification method based on knowledge graph and large language model is characterized in that: The entity relationships are the relationship between injury type and work activity "injury exists in", the relationship between injury type and accident cause "attributed to", the relationship between behavioral indicators and injury type "caused by", the relationship between medium and location "location association" and the relationship between medium and work activity "included in activity".
9. The method for identifying safety risks of construction behaviors based on knowledge graph and large language model according to claim 8 is characterized in that: The preprocessing specifically includes: word segmentation, stop word removal and part-of-speech tagging.
10. According to claim 1, a construction behavior safety risk identification method based on knowledge graph and large language model is characterized in that: The entity recognition model is built based on the BERT model of Transformer.
Citation Information
Patent Citations
Security risk management and control method and system based on knowledge graph
CN117787725A
Public security risk assessment method based on knowledge graph
CN118093889A
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
Cited By
Data processing method, device and equipment
CN119848834A
A data processing method, apparatus and device
CN119848834B
Engineering quality safety digital management method integrated with large language model
CN120672082A
A digital management method for engineering quality and safety integrating a large language model
CN120672082B
Knowledge graph construction method based on semantic network
CN121525816A
