An intelligent recommendation method for security hazard management measures
Patent Information
- Application Number
- CN202411050679.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2044-08-01
AI Technical Summary
[0004]解决安全隐患治理措施主要由项目管理人员或邀请专家依据行业标准规范,结合项目实际制定而成,治理措施的有效性依赖于人员经验,制定效率相对较低的问题
[0061] 1) This invention addresses the problem that the formulation of safety hazard mitigation measures by project managers or invited experts based on industry standards and specifications and in combination with the actual situation of the project is highly subjective and inefficient. It constructs a safety hazard knowledge graph and, based on this, utilizes the semantic extraction advantages of deep learning to build a Sentence-BERT network model for semantic matching of construction hazards, making construction safety management more intelligent and efficient.
Smart Images

Figure CN119179858B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent construction technology, specifically to an intelligent recommendation method for safety hazard mitigation measures. Background Technology
[0002] Construction, as an effective means of developing and utilizing water resources, occupies an important position in the renewable energy sector. However, it is characterized by high difficulty and danger. Accurate and scientific measures to eliminate hidden dangers are crucial for improving construction safety management and reducing casualties. Currently, safety hazard mitigation measures are mainly formulated by project managers or invited experts based on industry standards and specifications, combined with the specific project requirements. The effectiveness of these measures relies heavily on personnel experience, resulting in relatively low formulation efficiency. Therefore, utilizing knowledge graphs combined with computer semantic matching technology to quickly recommend historical hazard records corresponding to target hazards, drawing lessons from these historical incidents, and rapidly developing effective hazard mitigation measures is of great significance for improving construction safety management.
[0003] Discovering potential hazards similar to the target hazard from massive amounts of historical hazard texts is no easy task, requiring a deep understanding of the text's semantic information. Natural Language Processing (NLP), an important research method in computer science, uses models such as Word2vec or BERT to transform words into vectors, providing an effective means for further extracting sentence-level semantic information and semantic matching. With the continuous development of computer technology, deep learning models based on pre-trained models have shown good results in semantic matching, providing technical support for hazard matching. Furthermore, knowledge graphs, through their graph structure, intuitively display information, clearly representing entities and their relationships, which helps in understanding and analyzing complex data, facilitating the extraction of information related to remediation measures from historical hazards. Summary of the Invention
[0004] The measures for addressing safety hazards are primarily formulated by project managers or invited experts based on industry standards and specifications, combined with the actual project situation. The effectiveness of these measures relies heavily on personnel experience, resulting in relatively low formulation efficiency. This invention provides an intelligent recommendation method for safety hazard mitigation measures. This method constructs a safety hazard knowledge graph, and based on this, leverages the semantic extraction advantages of deep learning to build a Sentence-BERT network model for semantic matching of construction hazards. It extracts deep semantic features of the target hazard and historical hazards and performs intelligent recommendations for historically similar hazards. Cypher statements are used to retrieve hazard mitigation measures, aiming to provide a reference for formulating current hazard mitigation measures.
[0005] The technical solution adopted in this invention is as follows:
[0006] A smart recommendation method for safety hazard mitigation measures includes the following steps:
[0007] Step 1: Collect safety hazard records at the construction site. The safety hazard records should include the time and location of discovery, rectification requirements, and deadline.
[0008] Step 2: Text preprocessing:
[0009] The safety hazard record data collected in step 1 is cleaned to remove data that is incomplete or lacks rectification requirements. Based on the discovery time of the hazards, 2 / 3 of the total number of hazards discovered earlier is selected as the historical hazard set, and 1 / 3 of the total number of hazards discovered later is selected as the target hazard set.
[0010] Step 3: Construction of a safety hazard map:
[0011] Using a structured set of historical hazards as the data source, we extract hazard entities, attributes, and relationships with hazard issues as the core, construct a hazard knowledge graph, and store it in the neo4j graph database.
[0012] Step 4: Organizing the semantic matching dataset:
[0013] The system queries historical hazard data for hazards similar to the target hazard. Text pairs between the target hazard and similar hazards are defined as the positive sample set, while text pairs between the target hazard and dissimilar historical hazards are defined as the negative sample set. The sample sets are then randomly shuffled and divided into training, validation, and test sets in a 7:1.5:1.5 ratio.
[0014] Step 5: Model Building
[0015] Construct a Sentence-BERT network model for semantic matching of construction hazards, and train it by inputting it into the training set in step 4;
[0016] Step 6: Model Testing
[0017] Adjust the parameters of the Sentence-BERT network model in step 5 based on the training results, input the test set in step 4 into the trained Sentence-BERT network model, and output the historical similarity hazard result that is most similar to the target hazard.
[0018] Step 7: Model Validation
[0019] The validation set from step 4 is input into the Sentence-BERT network model trained in step 6. Based on the labels corresponding to the positive and negative sample sets, evaluation metrics such as accuracy and precision are calculated. The validation set is then used to display the intelligent recommendation results for similar hazards.
[0020] Step 8: Visualization:
[0021] The Sentence-BERT network model trained in step 6 is invoked to retrieve hazard data similar to the target hazard from the historical hazard set, and the Cypher statement used in step 3 to construct the hazard knowledge graph is used to query the entity content related to hazard management in the historical hazard data.
[0022] Step 3 includes the following steps:
[0023] S301: Using Python tools and manual correction, 191,070 entities were extracted, including 9 categories such as inspection date, location of potential hazards, problem of potential hazards, and requirements for rectification of potential hazards.
[0024] S302: A template-based relation extraction method is used to extract 7 types of relations, including hazard-time, hazard-type, hazard-location, hazard-measure, hazard-time limit, hazard-unit, and unit-execution, totaling 148,610 relations;
[0025] S303: In the knowledge storage process, Neo4j graph database is selected to store construction hazard knowledge, and Cypher tool is used to query entity content and construct a construction hazard knowledge graph.
[0026] S304: In the process of intelligently recommending similar historical hazards based on the target hazard, if the target hazard has never occurred before, it is necessary to store the target hazard in the historical hazards to update the hazard knowledge graph, thereby improving the generalization ability of the graph.
[0027] In step 5, the Sentence-BERT network model includes an input layer, a BERT model layer, a pooling layer, and an output layer.
[0028] At the input layer, the text of safety hazards and the corresponding historical similar hazard texts are input into the BERT model layer and transformed into word embedding vectors.
[0029] Specifically, such as Figure 5As shown, taking "insufficient safety distance between acetylene cylinder and oxygen cylinder" as an example, after the BERT model processes the sentence by removing stop words and word segmentation, the sentence becomes "acetylene cylinder / oxygen cylinder / safety distance / insufficient", and the words are presented in the form of vectors: "The word vector corresponding to acetylene cylinder is (-0.38691133 0.71248794...-0.01407175)", "The word vector corresponding to oxygen cylinder is (-0.1483857 0.22868624...0.22028413)", "The word vector corresponding to safety distance is (0.10901136-0.24216454...0.50504297)", and "The word vector corresponding to insufficient is (-0.22338304 -0.343628...-0.01832486)".
[0030] The pooling layer performs average pooling on the output of the BERT model layer, compressing the representation of the entire sentence into a fixed-dimensional vector.
[0031] Specifically, after average pooling, the sentence vector corresponding to insufficient safe distance between the acetylene cylinder and the oxygen cylinder is the average of the corresponding parts of the word vector, and the final vector is (-0.16241717 0.08884541...0.1732326225).
[0032] After passing through the output layer, the cosine similarity between the target hidden danger and the sentence vectors x and y of historical similar hidden dangers is calculated. The specific formula is shown in Equation (8). The semantic similarity between the two sentence vectors is expressed by calculating the cosine similarity Cosine_Similarity(x,y).
[0033]
[0034] The Sentence-BERT network model has a Siamese network structure. X1 and X2 serve as two inputs to the Siamese neural network, which are respectively fed into a neural network model with the same weight W for encoding and mapping, generating vector representations in a new space. Specific operations are as follows: Figure 4 As shown, through this operation, two sentences are processed by a BERT model with the same weights, resulting in two sentence vectors.
[0035] Cosine similarity is used to calculate the loss function to optimize the model's performance on semantic similarity tasks, thereby achieving the effect of "minimizing the distance between similar sentence pairs and maximizing the distance between dissimilar sentence pairs." Specifically:
[0036] During training, as model performance improves, the loss value gradually decreases. As the loss value decreases, the Cosine_Similarity value of two similar texts (positive samples) gradually increases, while the Cosine_Similarity value of two dissimilar texts (negative samples) gradually decreases, causing |l i -Cosine_Similarity(x i ,y i The value of | gradually decreases, thereby achieving the effect of "minimizing the distance between similar sentence pairs and maximizing the distance between dissimilar sentence pairs".
[0037]
[0038] In the formula, m is the size of the training set, and l i Let be the label value corresponding to the i-th text pair, where 1 is the label for positive samples and 0 is the label for negative samples.
[0039] The input layer includes the following steps:
[0040] S5021: Input the data in character form, where each character contains word feature information, paragraph feature information, and positional feature information. The paragraph feature information distinguishes the text paragraph in which the character belongs, while the positional feature information describes the specific location of the character within the text, thus differentiating the role of the same character in different contexts.
[0041] S5022: Using word feature information and a Transformer mechanism, each character in the input text is converted into a fixed-dimensional vector. The specific operation is as follows: Figure 5 As shown, taking "insufficient safe distance between acetylene cylinder and oxygen cylinder" as an example, after the BERT model processes the sentence by removing stop words and word segmentation, the sentence becomes "acetylene cylinder / oxygen cylinder / safety distance / insufficient". The words are then presented in vector form: "The word vector corresponding to acetylene cylinder is (-0.38691133 0.71248794...-0.01407175)", "The word vector corresponding to oxygen cylinder is (-0.1483857 0.22868624...0.22028413)", "The word vector corresponding to safe distance is (0.10901136 -0.24216454...0.50504297)", and "The word vector corresponding to insufficient is (-0.22338304-0.343628...-0.01832486)".
[0042] In step 6, the parameters of the Sentence-BERT network model are mainly set to 4 groups, the initial learning rate is 0.0005, the optimization algorithm is Adam algorithm, the number of iterations (epochs) is 50, and the batch_size is set to 16.
[0043] Step 7 includes:
[0044] S701: During the training phase, the similarity scores of the problematic text pairs are calculated using four semantic similarity evaluation methods: Manhattan distance, Euclidean distance, dot product similarity, and cosine similarity. The correlation between the semantic similarity of the text pairs and the labels is measured by the Pearson coefficient (P) and Spearman coefficient (S) between these scores and the actual labels, and this correlation is used as an evaluation metric for model performance.
[0045]
[0046]
[0047] In the formula, Y i Let m be the similarity score of the i-th text pair; m be the size of the training set; l i For the i-th text pair, the label for a positive sample is 1, and the label for a negative sample is 0. Let be the mean similarity score of m text pairs; Let P be the mean of the labels of m text pairs; rank(a) is the rank of vector a; P and S both range from [-1, 1]. When P and S are 0, it means that the two selected samples are not related. The closer the value is to 1, the stronger the positive correlation between the two samples. The closer the value is to -1, the stronger the negative correlation between the two samples.
[0048] For two vectors A = (A1, A2, ..., A3) in m sets of vectors, n ) and B = (B1, B2, ..., B n The Manhattan distance similarity is:
[0049]
[0050] For two vectors A = (A1, A2, ..., A3) in m sets of vectors, n ) and B = (B1, B2, ..., B n The Euclidean distance similarity is:
[0051]
[0052] For two vectors A = (A1, A2, ..., A3) in m sets of vectors, n ) and B = (B1, B2, ..., B n The dot product similarity is:
[0053]
[0054] For two vectors A = (A1, A2, ..., A3) in m sets of vectors, n ) and B = (B1, B2, ..., B n The cosine similarity is:
[0055]
[0056] Four semantic similarities—Manhattan distance, Euclidean distance, Dot product similarity, and Cosine similarity—were calculated, and their values were used as Y. i Substituting equations (1) and (2), we can obtain the Pearson coefficient P and Spearman value S of the model under four different calculation methods.
[0057] S702: During the testing phase, calculate accuracy, precision, recall, and F1 score to evaluate the model's ability to identify target hazards and historically similar hazards.
[0058]
[0059] In the formula, TP represents a true positive, indicating a positive sample that was correctly identified; FN represents a false negative, indicating a positive sample that was incorrectly identified; FP represents a false positive, indicating a negative sample that was incorrectly identified; and TN represents a true negative, indicating a negative sample that was correctly identified.
[0060] The present invention provides an intelligent recommendation method for safety hazard mitigation measures, with the following technical effects:
[0061] 1) This invention addresses the problem that the formulation of safety hazard mitigation measures by project managers or invited experts based on industry standards and specifications and in combination with the actual situation of the project is highly subjective and inefficient. It constructs a safety hazard knowledge graph and, based on this, utilizes the semantic extraction advantages of deep learning to build a Sentence-BERT network model for semantic matching of construction hazards, making construction safety management more intelligent and efficient.
[0062] 2) This invention considers the semantic similarity between historical hazards and target hazards. It realizes intelligent recommendation of historically similar hazards through the Sentence-BERT network model for semantic matching of construction hazards, and uses Cypher statements of knowledge graph to retrieve the corresponding treatment measures of the historical hazards, and uses them as a reference for formulating treatment measures for target hazards, demonstrating good engineering value.
[0063] 3) The significance of this invention lies in its effective promotion of efficient handling of safety hazards, providing a solid guarantee for construction safety. It also considers the subsequent alignment of construction safety hazards with standard and specification clauses to address situations where target hazards have never occurred before, thereby improving the comprehensiveness and accuracy of safety hazard management. Attached Figure Description
[0064] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0065] Figure 1 This is an entity-relationship diagram (ER diagram) for construction safety hazards.
[0066] Figure 2 A knowledge graph of construction safety hazards (partial).
[0067] Figure 3 The structure diagram of the Sentence-BERT network for semantic matching of construction hazards.
[0068] Figure 4 This is a diagram of a twin network structure.
[0069] Figure 5 This is a diagram of the BERT model structure.
[0070] Figure 6 Pearson and Spearman values under different measurement methods.
[0071] Figure 7 This is a chart showing the search results for remediation measures for similar historical hazards. Detailed Implementation
[0072] An intelligent recommendation method for safety hazard mitigation measures is proposed. This method collects textual data on hazards accumulated during construction, uses Python to extract entities and relationships from the semi-structured hazard data, constructs a safety hazard knowledge graph, and imports it into the Neo4j graph database for storage. A Sentence-BERT model for semantic matching of construction hazards is built to learn the deep semantic features of the target hazard and historical hazards, recommending historical safety hazards most similar to the target hazard. Cypher queries from the knowledge graph are then used to retrieve the corresponding mitigation measures for each historical safety hazard. The experimental results of three text semantic matching models are compared and analyzed. Based on semantic similarity, historical hazards most similar to the current hazard are recommended, and their mitigation measures are retrieved. The results are then visualized using the knowledge graph, aiming to provide a reference for formulating current hazard mitigation measures.
[0073] like Figures 1 to 7 As shown, an intelligent recommendation method for safety hazard mitigation measures includes the following steps:
[0074] S1: A total of 32,221 safety hazard records were collected at the construction site. The hazard records include the time and location of discovery, rectification requirements, and deadlines.
[0075] S2: Data cleaning: After removing incomplete data and missing rectification requirements from the hazard records, a total of 31,845 valid hazard records were obtained. Based on chronological order, the 21,230 hazards discovered earlier were selected as the historical hazard dataset, and the 10,615 hazards discovered later were selected as the target hazard dataset.
[0076] S3: Safety Hazard Graph Construction: Using a structured set of historical hazards as the data source, extracting hazard entities, attributes, and relationships with hazard issues as the core, constructing a hazard knowledge graph, and storing it in the neo4j graph database;
[0077] S4: Semantic Matching Dataset Organization: Query hidden dangers similar to the target hidden danger data in the historical hidden danger set, and define the text pairs formed by the target hidden danger and similar hidden dangers as the positive sample set, while the text pairs formed by the target hidden danger and dissimilar historical hidden dangers as the negative sample set. Randomly shuffle the sample sets and divide them into training set, validation set, and test set in a 7:1.5:1.5 ratio.
[0078] S5: Construct a Sentence-BERT network model for semantic matching of construction hazards, and train it by inputting hazard text pairs from the training set;
[0079] S6: Adjust model parameters: Use cosine similarity to measure the similarity between the target hidden danger and the historical hidden danger, and output the similarity score between the hidden danger texts. Specifically, calculate the similarity score between the two text vectors using formula (8).
[0080] S7: Calculate the Pearson and Spearman coefficients to evaluate model performance. Use evaluation metrics such as accuracy and precision to compare and analyze the effectiveness of the models used.
[0081] S8: Call the trained model to retrieve hazard data similar to the target hazard from the historical hazard set, and use the Cypher statement of the knowledge graph to query the entity content related to hazard management in the historical hazard data.
[0082] In step S1, the collected construction safety hazard texts originate from safety inspection records during the construction of a hydropower station. After data cleaning and dataset partitioning, using the historical hazard dataset, and taking the hazard problem as the core entity, a construction safety hazard entity-relationship diagram (ER diagram) is established by defining the construction safety hazard entity, entity attributes, and relationships between different types of entities. The specific framework is as follows: Figure 1 As shown.
[0083] according to Figure 1 The structure shown, using Python tools and manual correction, extracted 191,070 entities across 9 categories, including inspection date, location of the hazard, hazard issue, and rectification requirements. A template-based relation extraction method was used to extract 148,610 relations across 7 categories: hazard-time, hazard-type, hazard-location, hazard-measure, hazard-deadline, hazard-unit, and unit-execution. The Neo4j graph database was used to store construction hazard knowledge, constructing a construction hazard knowledge graph with entities as nodes and entity relations as edges. Figure 2 It displays 2000 of the nodes.
[0084] In step S5, the constructed Sentence-BERT network model for semantic matching of construction hazards can accurately recommend historical hazards similar to the target hazard. For example... Figure 3 As shown, the Sentence-BERT model is a Siamese network structure, which includes an input layer, a BERT model layer, a pooling layer, and an output layer.
[0085] The Sentence-BERT model employs the concept of Siamese networks for training, with the following structure: Figure 4 As shown, X1 and X2, as two inputs to the Siamese neural network, are fed into a neural network model with the same weights W for encoding and mapping, generating vector representations in a new space. The similarity between the two inputs is evaluated by calculating the loss function Loss. The loss function minimizes the distance between similar sentence pairs and maximizes the distance between dissimilar sentence pairs.
[0086]
[0087] In the formula, m is the size of the training set, and l i Let be the label value corresponding to the i-th text pair, where 1 is the label for positive samples and 0 is the label for negative samples.
[0088] In the input layer, the text of safety hazards and the corresponding historical texts of similar hazards are input into the BERT model layer. The BERT model structure is as follows: Figure 5 As shown, each character contains word feature information, paragraph feature information, and positional feature information. The paragraph feature information distinguishes the text paragraph in which the character belongs, while the positional feature information describes the character's specific location within the text, thus differentiating the role of the same character in different contexts. Each character in the input text is converted into a fixed-dimensional vector using word feature information. The Transformer mechanism is then used to extract text features from the input text, generating a security vulnerability text vector.
[0089] The pooling layer performs average pooling on the BERT output, compressing the entire sentence representation into a fixed-dimensional vector. Then, after passing through the output layer, the cosine similarity (Cosine_Similarity(x,y)) between the target hazard and the sentence vectors x and y of historically similar hazards is calculated, as shown in Equation (8).
[0090] In step S6, the model parameters are mainly set to 4 sets of experiments, with an initial learning rate of 0.0005, the Adam algorithm is used for optimization, the number of iterations (epochs) is 50, and the batch size is set to 16.
[0091] like Figure 6 As shown, in step S7, the Pearson and Spearman coefficients are calculated using the Manhattan Distance, Euclidean Distance, Dot Product Similarity, and Cosine Similarity methods.
[0092]
[0093] In the formula, P and S both take values in the range of [-1, 1]. When the Pearson and Spearman values are 0, it indicates that the two selected samples are not related. The closer the values are to 1, the stronger the positive correlation between the two samples. The closer the values are to -1, the stronger the negative correlation between the two samples.
[0094] Comparative analysis of BERT, Word2vec-DSSM and BERT-DSSM models was conducted. During the testing phase, accuracy, precision, recall and F1 score were calculated to evaluate the model's ability to identify target hazards and historically similar hazards.
[0095]
[0096] In the formula, TP represents a true positive (positive sample that is correctly identified); FN represents a false negative (positive sample that is incorrectly identified); FP represents a false positive (negative sample that is incorrectly identified); and TN represents a true negative (negative sample that is correctly identified). The identification results are shown in Table 1.
[0097] Table 1 Comparison of test performance of different models
[0098]
[0099] As shown in Table 1, the Sentence-BERT model outperforms the BERT, Word2vec-DSSM and BERT-DSSM models in identifying target hazards and historically similar hazards. Its accuracy and other evaluation indicators are all above 95%, which can effectively capture the semantic information of safety hazards.
[0100] In step S8, the trained model is invoked to conduct an intelligent recommendation experiment for historically similar potential hazards based on the target safety hazard.
[0101] 150 target hazard texts were randomly selected from the test set sample. 3124 historical hazard texts were compiled and used as the recall text set for a test recommending similar historical hazard. The results showed that 138 out of the 150 target hazard texts were accurately recommended to their corresponding similar historical hazard, achieving a recommendation accuracy of 92%. To visually illustrate the recommendation effect, the recommendation results for some target hazard texts are presented in Table 2.
[0102] Table 2 shows the recommended results for historical hidden dangers.
[0103]
[0104]
[0105] Taking the example of "Oxygen cylinders and acetylene cylinders are mixed at the entrance of the No. 4 curtain grouting tunnel on the left bank at K0+10, failing to meet the required safe distance, posing a safety hazard," semantic recommendation yields the historical hazard "Oxygen cylinders and acetylene cylinders are not placed at a safe distance, posing an explosion hazard." Using the Cypher statement, entering "MATCH((n:'hazard issue'{name:“Oxygen cylinders and acetylene cylinders are not placed at a safe distance, posing an explosion hazard.”}))RETURN nLIMIT 25" into the neo4j database yields the following search results: Figure 7 As shown.
[0106] Depend on Figure 7 It is evident that resolving this hazard requires safety personnel to store oxygen cylinders and acetylene cylinders separately at a safe distance of more than 5 meters, and to ensure that the cylinders are placed away from direct sunlight. This hazard must be rectified and implemented within one day. Therefore, the intelligent recommendation method for construction safety hazards can effectively assist in the formulation of remediation measures for the target hazard.
Claims
1. An intelligent recommendation method for safety hazard mitigation measures, characterized in that... Includes the following steps: Step 1: Collect safety hazard records at the construction site. The safety hazard records should include the time and location of discovery, rectification requirements, and deadline. Step 2: Clean the safety hazard record data collected in Step 1, removing data that is incomplete or lacks rectification requirements; Based on the discovery time of the hazards, 2 / 3 of the total number of hazards discovered earlier are selected as the historical hazard set, and 1 / 3 of the total number of hazards discovered later are selected as the target hazard set. Step 3: Using the historical set of potential hazards as the data source, extract the entities, attributes, and relationships of potential hazards with the problem as the core, construct a knowledge graph of potential hazards, and store it in the neo4j graph database; Step 4: Query the historical hidden danger data to find hidden dangers that are similar to the target hidden danger data, and define the text pairs formed by the target hidden danger and similar hidden dangers as the positive sample set, while the text pairs formed by the target hidden danger and dissimilar historical hidden dangers as the negative sample set; divide the sample set into training set, validation set and test set according to a certain ratio; Step 5: Construct a Sentence-BERT network model for semantic matching of construction hazards, and train it by inputting the training set from Step 4; Step 6: Adjust the parameters of the Sentence-BERT network model in Step 5 based on the training results, input the test set in Step 4 into the trained Sentence-BERT network model, and output the historical similarity hazard result that is most similar to the target hazard. Step 7: Input the validation set from Step 4 into the Sentence-BERT network model trained in Step 6, and calculate the accuracy and precision evaluation metrics based on the labels corresponding to the positive and negative sample sets. Use the validation set to display the intelligent recommendation results for similar hidden dangers. Step 8: Call the Sentence-BERT network model trained in Step 6, retrieve hazard data similar to the target hazard from the historical hazard set, and use the Cypher statement of the hazard knowledge graph constructed in Step 3 to query the entity content related to hazard management in the historical hazard data. In step 5, the Sentence-BERT network model includes an input layer, a BERT model layer, a pooling layer, and an output layer. At the input layer, the text of safety hazards and the corresponding historical similar hazard texts are input into the BERT model layer and transformed into word embedding vectors; The pooling layer performs average pooling on the output of the BERT model layer, compressing the representation of the entire sentence into a fixed-dimensional vector. After passing through the output layer, the sentence vectors of the target hidden danger and historically similar hidden dangers are calculated. x and y The cosine similarity is calculated using the formula shown in equation (8). Cosine Similarity(x,y) To express the semantic similarity between the two; (8); The Sentence-BERT network model has a Siamese network structure. X1 and X2 As two inputs to the Siamese neural network, each input has the same weight. W Encoding and mapping are performed in the neural network model to generate vector representations in the new space; The loss function, calculated using cosine similarity, is used to optimize the model's performance on semantic similarity tasks, thereby achieving the effect of "minimizing the distance between similar sentence pairs and maximizing the distance between dissimilar sentence pairs".
2. The intelligent recommendation method for safety hazard mitigation measures according to claim 1, characterized in that: Step 3 includes the following steps: S301: Using Python tools and manual correction, extract 9 types of entities including inspection date, location of potential hazards, problem of potential hazard, and requirements for rectification of potential hazard; S302: A template-based relationship extraction method is adopted to extract seven types of relationships, including hazard-time, hazard-type, hazard-location, hazard-measure, hazard-time limit, hazard-unit, and unit-execution. S303: In the knowledge storage process, Neo4j graph database is selected to store construction hazard knowledge, and Cypher tool is used to query entity content and construct a construction hazard knowledge graph. S304: In the process of intelligently recommending similar historical hazards based on the target hazard, if the target hazard has never occurred before, it is necessary to store the target hazard in the historical hazards to update the hazard knowledge graph.
3. The intelligent recommendation method for safety hazard mitigation measures according to claim 1, characterized in that: During training, as the model's performance improves, Loss The value will gradually decrease; while Loss During the process of value reduction, two similar texts Cosine_Similarity As the value gradually increases, the two dissimilar texts... Cosine_Similarity The value gradually decreases, making The value gradually decreases, thereby achieving the effect of "minimizing the distance between similar sentence pairs and maximizing the distance between dissimilar sentence pairs"; (7); In the formula, m The size of the training set. l i For the first i Each text pair corresponds to a label value, with a positive sample label being 1 and a negative sample label being 0.
4. The intelligent recommendation method for safety hazard mitigation measures according to claim 1, characterized in that: The input layer includes the following steps: S5021: Input the data in character form. Each character contains word feature information, paragraph feature information, and position feature information. The paragraph feature information is used to distinguish the text paragraph in which the character is located, while the position feature information describes the specific position of the character in the text, so as to distinguish the role of the same character in different contexts. S5022: Using word feature information via the Transformer mechanism, each character in the input text is converted into a fixed-dimensional vector.
5. The intelligent recommendation method for safety hazard mitigation measures according to claim 1, characterized in that: Step 7 includes: During the training phase, calculating the similarity scores of the potential hazard text pairs under four semantic similarity evaluation methods: Manhattan distance, Euclidean distance, Dot product similarity, and Cosine similarity; using the Pearson coefficient P and Spearman coefficient S between the score and the actual label to measure the correlation between the semantic similarity of the text pair and the label, and using it as an evaluation metric for model performance. (1); (2); In the formula, Y i For the first i Similarity scores for each text pair; m The size of the training set; l i For the first i For each text pair, the label for a positive sample is 1, and the label for a negative sample is 0. for m The mean similarity of text pairs; for m The average of the labels for each text pair; rank( a ) is a vector a rank; P and S The values are all in the range of [-1, 1]. P and S A value of 0 indicates that the two selected samples are not related. The closer the value is to 1, the stronger the positive correlation between the two samples. The closer the value is to -1, the stronger the negative correlation between the two samples. for m Two vectors in a group vector A=(A 1 ,A 2 ,...,A n ) and B =( B 1 ,B 2 ,...,B n The Manhattan distance similarity is: (9); for m Two vectors in a group vector A=(A 1 ,A 2 ,...,A n ) and B =( B 1 ,B 2 ,...,B n The Euclidean distance similarity is: (10); for m Two vectors in a group vector A=(A 1 ,A 2 ,...,A n ) and B =( B 1 ,B 2 ,...,B n The dot product similarity is: (11); for m Two vectors in a group vector A=(A 1 ,A 2 ,...,A n ) and B =( B 1 ,B 2 ,...,B n The cosine similarity is: (12); Four semantic similarities were calculated: Manhattan distance, Euclidean distance, Dot product similarity, and Cosine similarity, and their values were used as... Y i Substituting into equations (1) and (2), we can obtain the Pearson coefficient values of the model under four different calculation methods. P and Spearman value S ; During the testing phase, accuracy, precision, recall, and F1 score are calculated to evaluate the model's ability to identify target hazards and historically similar hazards. (3); (4); (5); (6); In the formula, TP represents a true positive, indicating a positive sample that was correctly identified; FN represents a false negative, indicating a positive sample that was incorrectly identified; FP represents a false positive, indicating a negative sample that was incorrectly identified; and TN represents a true negative, indicating a negative sample that was correctly identified.
Citation Information
Patent Citations
Hidden danger processing method based on knowledge graph
CN114328946A
Knowledge graph automatic construction method and system for massive unstructured text
WO2020000848A1