Tower crane accident cause acquisition method, device and equipment based on apriori algorithm and medium
By using language model fusion and directional interest model based on the Apriori algorithm, the causes of tower crane accidents can be automatically identified, solving the problem of cumbersome acquisition process in existing technologies and improving efficiency and reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 湖南工商大学
- Filing Date
- 2025-08-28
- Publication Date
- 2026-06-19
AI Technical Summary
In existing technologies, the process of obtaining the causes of tower crane accidents is cumbersome, resulting in low efficiency and susceptibility to human intervention.
Using an Apriori algorithm-based approach, word vectors, positional encoding vectors, and segment vectors are fused from the trained language model to analyze tower crane accident texts. Combined with a predefined directional interest model, the causes of tower crane accidents are automatically identified.
It improves the efficiency of obtaining the causes of tower crane accidents, reduces manual intervention, ensures the reliability and accuracy of cause identification, and shortens the analysis cycle.
Smart Images

Figure CN121303319B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of building engineering technology and artificial intelligence technology, and in particular to a method, apparatus, equipment and medium for obtaining the causes of tower crane accidents based on the Apriori algorithm. Background Technology
[0002] Tower cranes, often simply called tower cranes, have become core equipment on modern construction sites due to their highly efficient integrated vertical and horizontal transportation capabilities, driven by the industrialization of the construction industry. Tower crane accident reports are detailed records of unexpected events that occur during the operation of tower cranes. Obtaining these reports reveals the causes of tower crane accidents, helping to understand the areas where problems are likely to occur during actual operation, and providing a basis for tower crane design improvements and maintenance.
[0003] However, the current process of obtaining the causes of tower crane accidents from accident reports is cumbersome, hindering the efficiency of this process. This is because existing technologies primarily rely on manual methods to obtain the causes of tower crane accidents from accident reports. This manual method consumes significant human and time resources, increasing the time required to obtain the causes, and is also susceptible to human intervention, thus hindering the improvement of efficiency in obtaining the causes of tower crane accidents. Summary of the Invention
[0004] This application provides a method, apparatus, equipment, and medium for obtaining the causes of tower crane accidents based on the Apriori algorithm, in order to solve the technical problem that the current process of obtaining the causes of tower crane accidents from tower crane accident texts is cumbersome and not conducive to improving the efficiency of obtaining the causes of tower crane accidents.
[0005] In a first aspect, embodiments of this application provide a method for obtaining the cause of tower crane accidents based on the Apriori algorithm, applied to electronic devices. The method for obtaining the cause of tower crane accidents includes:
[0006] The trained language model is obtained. The embedding layer of the trained language model includes a word embedding module, a position encoding module, and a paragraph encoder.
[0007] The current tower crane accident text is obtained, and the word vector, position encoding vector, and segment vector of the current tower crane accident text are determined based on the word embedding module, position encoding module, and paragraph encoder, respectively.
[0008] The word vector, position encoding vector, and segment vector of the current tower crane accident text are fused to obtain the fused vector of the current tower crane accident text.
[0009] Based on the fusion vector of the current tower crane accident text, multiple causal relationship triples corresponding to the current tower crane accident text are determined. The Apriori algorithm is used to obtain multiple preferred triples from the multiple causal relationship triples corresponding to the current tower crane accident text.
[0010] Based on a predefined directional interest model, the causes of tower crane accidents in the current tower crane accident text are determined.
[0011] In one possible implementation of the first aspect,
[0012] The process of obtaining the trained language model includes:
[0013] Obtain a preset tower crane accident text, and form a training sample by combining the preset tower crane accident text and multiple causal relationship triples corresponding to the preset tower crane accident text. The preset tower crane accident text is the accident text corresponding to the model of the preset tower crane. Different training samples are combined into a training set, and the language model is trained using the training set. The trained language model is then saved.
[0014] In one possible implementation of the first aspect, obtaining the current tower crane accident text, based on a word embedding module, a position encoding module, and a paragraph encoder, respectively determines the word vector, the position encoding vector, and the segment vector of the current tower crane accident text, including:
[0015] Access the database and retrieve the current tower crane accident text from the database. The current tower crane accident text is the accident text corresponding to the current tower crane model.
[0016] The word embedding module processes the words in the current tower crane accident text to obtain word vectors. The position encoding module processes the position information of the words to obtain position encoded vectors. The paragraph encoder processes the paragraph information of the words to obtain paragraph vectors.
[0017] In one possible implementation of the first aspect, fusing the word vector, the position encoding vector, and the segment vector of the current tower crane accident text to obtain the fused vector of the current tower crane accident text includes:
[0018] Input the word vectors, position encoding vectors, and segment vectors of the current tower crane accident text into the fusion layer of the trained language model;
[0019] The word vectors, positional encoding vectors, and segment vectors of the current tower crane accident text are fused together through the fusion layer of the trained language model to obtain the fused vector of the current tower crane accident text.
[0020] In one possible implementation of the first aspect, the step of determining multiple causal relationship triples corresponding to the current tower crane accident text based on the fusion vector of the current tower crane accident text, and using the Apriori algorithm to obtain multiple preferred triples from the multiple causal relationship triples corresponding to the current tower crane accident text, includes:
[0021] Input the fused vector of the current tower crane accident text into the classification layer of the trained language model;
[0022] The fusion vector of the current tower crane accident text is processed through the classification layer of the trained language model to generate multiple causal relationship triples corresponding to the current tower crane accident text. The Apriori algorithm is used to obtain multiple preferred triples from the multiple causal relationship triples corresponding to the current tower crane accident text. The preferred triples are the causal relationship triples that appear more frequently than a preset frequency.
[0023] In one possible implementation of the first aspect, selecting the preferred triplet with the highest directional interest as the cause of the tower crane accident in the current tower crane accident text includes:
[0024] Based on the predefined directional interest degree model, the directional interest degree corresponding to each preferred triplet is calculated, and the preferred triplet with the largest directional interest degree is selected as the cause of the tower crane accident in the current tower crane accident text.
[0025] In one possible implementation of the first aspect, after selecting the preferred triplet with the highest directional interest as the cause of the tower crane accident in the current tower crane accident text, the tower crane accident cause acquisition method includes:
[0026] Create a display window to show the cause of the current tower crane accident.
[0027] Secondly, embodiments of this application provide a tower crane accident cause acquisition device based on the Apriori algorithm, applied to electronic equipment, comprising:
[0028] The first acquisition module is used to acquire the trained language model. The embedding layer of the trained language model includes a word embedding module, a position encoding module, and a paragraph encoder.
[0029] The determination module is used to obtain the current tower crane accident text. Based on the word embedding module, the position encoding module, and the paragraph encoder, it determines the word vector, the position encoding vector, and the paragraph vector of the current tower crane accident text, respectively.
[0030] The fusion module is used to fuse the word vector, the position encoding vector, and the segment vector of the current tower crane accident text to obtain the fused vector of the current tower crane accident text.
[0031] The second acquisition module is used to determine multiple causal relationship triples corresponding to the current tower crane accident text based on the fusion vector of the current tower crane accident text, and to obtain multiple preferred triples from the multiple causal relationship triples corresponding to the current tower crane accident text using the Apriori algorithm.
[0032] The third acquisition module is used to determine the cause of the tower crane accident in the current tower crane accident text based on a predefined directional interest degree model.
[0033] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the tower crane accident cause acquisition method described in the first aspect above.
[0034] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the tower crane accident cause acquisition method described in the first aspect above.
[0035] Fifthly, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to execute the tower crane accident cause acquisition method described in the first aspect above.
[0036] The beneficial effects of this application's embodiments are twofold. Firstly, selecting the preferred triplet with the highest directional interest as the cause of the current tower crane accident text reduces the acquisition time for the cause of the current tower crane accident text since no manual acquisition is required, thus improving the acquisition efficiency. Secondly, through a predefined directional interest model, the directional interest corresponding to each preferred triplet can be calculated, and then the preferred triplet with the highest directional interest can be selected as the cause of the current tower crane accident text. The greater the directional interest of the preferred triplet, the stronger the positive correlation between the causal entity and the accident entity in the preferred triplet, which means the causal relationship between the causal entity and the accident entity is more explicit. The smaller the directional interest of the preferred triplet, the weaker the positive correlation between the causal entity and the accident entity in the preferred triplet, which means the causal relationship between the causal entity and the accident entity is less explicit. Selecting the preferred triplet with the highest directional interest as the cause of the current tower crane accident text ensures the reliability of the cause of the current tower crane accident text. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is an application scenario diagram of the tower crane accident cause acquisition method provided in the embodiments of this application;
[0039] Figure 2 This is a flowchart illustrating the method for obtaining the causes of tower crane accidents provided in an embodiment of this application;
[0040] Figure 3 A flowchart of S203 provided in the embodiments of this application;
[0041] Figure 4 A schematic block diagram of a tower crane accident cause acquisition device provided in an embodiment of this application;
[0042] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0044] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0045] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0046] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0047] The tower crane accident cause acquisition method provided in this application embodiment can be applied to electronic devices such as mobile phones, tablets, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). This application embodiment does not impose any restrictions on the specific type of electronic device.
[0048] Please see Figure 1 , Figure 1 The application scenario diagram of the tower crane accident cause acquisition method provided in the embodiments of this application is described in detail below:
[0049] The electronic device accesses the database and retrieves the current tower crane accident text from the database. The current tower crane accident text is the accident text corresponding to the current tower crane model.
[0050] The current tower crane accident record documents the malfunctions, failures, or accidents that occur during the actual operation of the tower crane.
[0051] In this embodiment of the application, the electronic device accesses the database through a wired or wireless network to obtain the current tower crane accident text from the database, which helps to improve the efficiency of obtaining the current tower crane accident text.
[0052] Please see Figure 2 , Figure 2 This is a flowchart illustrating the method for obtaining the cause of tower crane accidents provided in this application embodiment. This method can be applied to electronic devices.
[0053] like Figure 2As shown in the embodiments of this application, the method for obtaining the cause of tower crane accidents includes the following steps, which are detailed below:
[0054] S201, Obtain the trained language model. The embedding layer of the trained language model includes a word embedding module, a position encoding module, and a paragraph encoder.
[0055] The language model employs an improved Transformer model, which introduces positional encoding to represent the sequential relationships between entities. To distinguish between two or more sentences in the input, the improved Transformer model introduces segment embeddings to separate multiple sentences in a long text.
[0056] The step of obtaining the trained language model includes:
[0057] Obtain a preset tower crane accident text, and form a training sample by combining the preset tower crane accident text and multiple causal relationship triples corresponding to the preset tower crane accident text. The preset tower crane accident text is the accident text corresponding to the model of the preset tower crane. Different training samples are combined into a training set, and the language model is trained using the training set. The trained language model is then saved.
[0058] Among them, the preset tower crane accident text records the malfunctions, failures, or accidents that occur in the actual operation of the preset tower crane.
[0059] Obtain preset tower crane accident texts. Combine the preset tower crane accident texts and their corresponding causal relationship triples into a training sample. Assemble different training samples into a training set. Use the training set to train the language model. Save the trained language model, including:
[0060] Obtain a preset tower crane accident text, and construct a training sample by combining the preset tower crane accident text and multiple causal relationship triples corresponding to the preset tower crane accident text. Combine different training samples into a training set, obtain the loss value of the language model on the training set through a loss function, and stop training the language model when the loss value is less than the preset value. Save the trained language model.
[0061] A causal triple is a triple that represents the causal relationship between events. A causal triple consists of a causal entity, a causal relationship, and an event entity.
[0062] The causative entity refers to the entity that directly or indirectly causes the accident.
[0063] The accident entity refers to the accident itself or the specific consequences caused by the accident.
[0064] For ease of explanation, the following example is provided:
[0065] For example, multiple causal triples are causal triple 1, causal triple 2, causal triple 3, and so on;
[0066] Causal relationship triple 1: Strong winds caused the tower crane to become unbalanced;
[0067] Causal relationship ternary group 2: Insufficient foundation bearing capacity leads to tower crane settlement and tilting;
[0068] Causal relationship ternary group 3: Wear of gears in the slewing mechanism caused the tower crane to lose control of its rotation.
[0069] Among these features, the language model can be quickly deployed to different scenarios without the need to retrain for each new task, thus avoiding the waste of computing power and time associated with repeated training.
[0070] S202, Obtain the current tower crane accident text, and determine the word vector, position encoding vector, and segment vector of the current tower crane accident text based on the word embedding module, position encoding module, and paragraph encoder, respectively.
[0071] The step of obtaining the current tower crane accident text involves determining the word vector, position encoding vector, and segment vector of the current tower crane accident text based on a word embedding module, a position encoding module, and a paragraph encoder, respectively.
[0072] Access the database and retrieve the current tower crane accident text from the database. The current tower crane accident text is the accident text corresponding to the current tower crane model.
[0073] The word embedding module processes the words in the current tower crane accident text to obtain word vectors. The position encoding module processes the position information of the words to obtain position encoded vectors. The paragraph encoder processes the paragraph information of the words to obtain paragraph vectors.
[0074] Among them, determining the word vector, position encoding vector, and segment vector of the current tower crane accident text can improve the language model's ability to understand the current tower crane accident text after training.
[0075] S203, fuse the word vector, the position encoding vector, and the segment vector of the current tower crane accident text to obtain the fused vector of the current tower crane accident text;
[0076] Among them, the fusion vector of the current tower crane accident text not only retains local semantic details but also incorporates global structural information, which can more accurately capture the hierarchical features of the current tower crane accident text.
[0077] S204. Based on the fusion vector of the current tower crane accident text, determine multiple causal relationship triples corresponding to the current tower crane accident text, and use the Apriori algorithm to obtain multiple preferred triples from the multiple causal relationship triples corresponding to the current tower crane accident text.
[0078] Specifically, based on the fusion vector of the current tower crane accident text, multiple causal relationship triples corresponding to the current tower crane accident text are determined. The Apriori algorithm is used to obtain multiple preferred triples from these causal relationship triples, including:
[0079] Input the fused vector of the current tower crane accident text into the classification layer of the trained language model;
[0080] The fusion vector of the current tower crane accident text is processed through the classification layer of the trained language model to generate multiple causal relationship triples corresponding to the current tower crane accident text. The Apriori algorithm is used to obtain multiple preferred triples from the multiple causal relationship triples corresponding to the current tower crane accident text. The preferred triples are the causal relationship triples that appear more frequently than a preset frequency.
[0081] Among them, the Apriori algorithm is a classic association rule mining algorithm. The core logic of the Apriori algorithm is to discover frequent itemsets and association rules of frequent itemsets from large-scale datasets through an iterative method of layer-by-layer search.
[0082] S205, Based on a predefined directional interest model, determine the cause of the tower crane accident in the current tower crane accident text.
[0083] The current tower crane accident text includes at least one publicly available accident report.
[0084] To further refine our understanding of tower crane-related risks, this paper proposes a secondary risk level for tower crane-related risks.
[0085] Table 1 shows the Level 1 risks of tower cranes, detailed below:
[0086]
[0087] Table 1
[0088] Due to space limitations, only a portion of the publicly disclosed accident reports selected for this paper, which are presented in Table 1, are included here. Based on the insufficient detail in the classification of primary risks, secondary risk factors are proposed. Table 2 shows the total frequency and relative frequency of occurrence of secondary risk factors in the text, detailed below:
[0089]
[0090]
[0091] Table 2
[0092] The selection of the preferred triplet with the highest directional interest as the cause of the tower crane accident in the current tower crane accident text includes:
[0093] Based on the predefined directional interest degree model, the directional interest degree corresponding to each preferred triplet is calculated, and the preferred triplet with the largest directional interest degree is selected as the cause of the tower crane accident in the current tower crane accident text.
[0094] For ease of explanation, the following example is provided:
[0095] For example, there are multiple preferred triplets, namely preferred triplet 1, preferred triplet 2, and preferred triplet 3;
[0096] The directional interest degrees of preferred triplet 1, preferred triplet 2, and preferred triplet 3 are directional interest degree 1, directional interest degree 2, and directional interest degree 3, respectively;
[0097] Among directional interest degree 1, directional interest degree 2, and directional interest degree 3, when directional interest degree 1 is the largest, the preferred triplet 1 is selected as the cause of the tower crane accident in the current tower crane accident text.
[0098] Among directional interest degree 1, directional interest degree 2, and directional interest degree 3, when directional interest degree 2 is the largest, the preferred triplet 2 is selected as the cause of the tower crane accident in the current tower crane accident text.
[0099] Among directional interest degree 1, directional interest degree 2, and directional interest degree 3, when directional interest degree 3 is the largest, the preferred triplet 3 is selected as the cause of the tower crane accident in the current tower crane accident text.
[0100] The directional interest model is as follows:
[0101]
[0102] Wherein, DIS(i) represents the directional interest degree corresponding to the i-th preferred triplet;
[0103] X represents the causative entity, and Y represents the incident entity. Indicates a negative relationship. Indicates cause and effect
[0104] The body does not exist;
[0105] Pi<Y|X> This indicates that when the causal entity of the i-th preferred triple exists, the event of the i-th preferred triple...
[0106] Therefore, the probability of the entity occurring;
[0107] ε represents the probability of the occurrence of the accident entity in the i-th preferred triplet when the causative entity of the i-th preferred triplet does not exist; ε is a smoothing coefficient, which is used to avoid the denominator being 0.
[0108] Among them, the greater the directional interest of the preferred triplet, the stronger the positive correlation between the causal entity and the accident entity in the preferred triplet. This means that the causal relationship between the causal entity and the accident entity is more explicit, and the greater the probability that this preferred triplet is the cause of the tower crane accident in the current tower crane accident text.
[0109] The lower the directional interest of the preferred triple, the weaker the positive correlation between the causal entity and the accident entity in the preferred triple. This means that the causal relationship between the causal entity and the accident entity is less clear, and the less likely this preferred triple is to be the cause of the tower crane accident in the current tower crane accident text.
[0110] The optimal triplet with the highest directional interest is selected as the cause of the tower crane accident in the current tower crane accident text. This ensures the reliability of the cause of the tower crane accident in the current tower crane accident text and directly shortens the analysis cycle of the cause of the tower crane accident in the current tower crane accident text. After identifying the cause of the tower crane accident in the tower crane accident text, the protection or monitoring of the tower crane can be strengthened according to the cause of the tower crane accident, thereby improving the safety of the tower crane.
[0111] For ease of explanation, the following example is provided:
[0112] For example, if a tower crane accident is caused by strong winds, a real-time wind speed monitoring system can be installed on the tower crane to enhance protection. This system can be linked to the tower crane's control system. For instance, when the wind speed sensor detects that the wind force exceeds a safe threshold, it automatically triggers an early warning and restricts tower crane operation, while simultaneously notifying management personnel to suspend work, thus preventing the tower crane from overturning due to strong winds.
[0113] Wherein, after selecting the preferred triplet with the highest directional interest as the cause of the tower crane accident in the current tower crane accident text, the tower crane accident cause acquisition method includes:
[0114] Create a display window to show the cause of the current tower crane accident.
[0115] In summary, this application integrates natural language processing technology and complex network theory to transform unstructured accident text into structured causal knowledge, providing a scientific method for the early identification and proactive prevention of tower crane safety risks. This application collected and analyzed 535 tower crane accident reports one by one using an improved Transformer model, successfully identifying the causal elements of tower crane accidents and extracting causal triples. Compared with traditional manual operation, this saves significant time and cost and reduces subjective errors caused by manual extraction. Furthermore, the traditional Apriori algorithm was improved by introducing directional interest during association rule mining. Finally, a complex causal network model of tower crane structured accidents with directional association rules was constructed. This application draws the following conclusions:
[0116] (1) Intelligent and accurate identification of tower crane safety accident causes based on the improved Transformer model. Focusing on the field of structured tower crane accidents, 23 structured causes of tower crane accidents were identified.
[0117] (2) The structural components of tower cranes are divided into 9 categories, and secondary risk factors are proposed based on the fact that the original risk classification is not refined enough. The structural causes of tower crane accidents are linked to the structural components of tower cranes, and the structural components with the highest probability of occurrence for each type of secondary risk factor are intelligently located, providing a scientific basis for intelligent diagnosis of tower crane risks.
[0118] (3) In the causal triangulation analysis of tower crane accidents, the improvement of the traditional Apriori algorithm based on directional interest degree and Apriori algorithm has achieved significant results in the pruning of frequent itemsets and the identification of positive and negative association rules. The number of itemsets has been significantly reduced, and the positive and negative association rules have been completely preserved. In the field of causal chain construction, on the one hand, the causal direction of any two nodes in the causal chain construction process can be identified by the frequency difference of positive and negative association rules; on the other hand, the absolute value of the frequency difference of positive and negative association rules reflects the weight of the causal link.
[0119] (4) By constructing a complex network model of causal factors in tower crane structured accidents, five key causal links and one high-weight closed loop were obtained. A risk blocking method for the loop was also given, providing ideas for future tower crane accident risk prevention.
[0120] This application primarily constructs a static causal network based on historical accident texts. Then, by combining real-time monitoring data, natural language processing technology, and time series analysis, a dynamic complex network model is built, establishing a dynamic risk assessment system to achieve real-time early warning and adaptive prevention and control of risks throughout the entire operation cycle and across multiple scenarios of tower cranes. Future development can further expand multimodal data fusion and dynamic risk evolution analysis to improve the model's adaptability in complex construction environments.
[0121] Please see Figure 3 , Figure 3 The flowchart of S203 provided in the embodiments of this application is described in detail below:
[0122] S301, input the word vector, position encoding vector, and segment vector of the current tower crane accident text into the fusion layer of the trained language model;
[0123] S302, through the fusion layer of the trained language model, the word vectors, position encoding vectors, and segment vectors of the current tower crane accident text are fused to obtain the fused vector of the current tower crane accident text.
[0124] In this embodiment, the word vector, position encoding vector, and segment vector of the current tower crane accident text are fused to obtain the fused vector of the current tower crane accident text. The fused vector of the current tower crane accident text solves the limitations of a single vector through information complementarity. Inputting the fused vector into the trained language model is beneficial to the generalization ability and task adaptability of the trained language model.
[0125] For the tower crane accident cause acquisition method described in the above embodiments, please refer to [link / reference]. Figure 4 , Figure 4 This is a schematic block diagram of the tower crane accident cause acquisition device provided in the embodiments of this application. Figure 4 The tower crane accident cause acquisition device 400 shown can be applied to, for example... Figure 1 The application scenario diagram shows electronic devices. The following section uses electronic devices as an example to illustrate this. Figure 4 The tower crane accident cause acquisition device 400 shown is described in detail. The tower crane accident cause acquisition device 400 may include a first acquisition module 401, a determination module 402, a fusion module 403, a second acquisition module 404, and a third acquisition module 405.
[0126] The first acquisition module 401 is used to acquire the trained language model. The embedding layer of the trained language model includes a word embedding module, a position encoding module, and a paragraph encoder.
[0127] The determination module 402 is used to obtain the current tower crane accident text. Based on the word embedding module, the position encoding module, and the paragraph encoder, it determines the word vector, the position encoding vector, and the paragraph vector of the current tower crane accident text, respectively.
[0128] The fusion module 403 is used to fuse the word vector, the position encoding vector, and the segment vector of the current tower crane accident text to obtain the fused vector of the current tower crane accident text.
[0129] The second acquisition module 404 is used to determine multiple causal relationship triples corresponding to the current tower crane accident text based on the fusion vector of the current tower crane accident text, and to obtain multiple preferred triples from the multiple causal relationship triples corresponding to the current tower crane accident text using the Apriori algorithm.
[0130] The third acquisition module 405 is used to determine the cause of the tower crane accident in the current tower crane accident text based on a predefined directional interest degree model.
[0131] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0132] The beneficial effects of this application's embodiments are twofold. Firstly, selecting the preferred triplet with the highest directional interest as the cause of the current tower crane accident text reduces the acquisition time for the cause of the current tower crane accident text since no manual acquisition is required, thus improving the acquisition efficiency. Secondly, through a predefined directional interest model, the directional interest corresponding to each preferred triplet can be calculated, and then the preferred triplet with the highest directional interest can be selected as the cause of the current tower crane accident text. The greater the directional interest of the preferred triplet, the stronger the positive correlation between the causal entity and the accident entity in the preferred triplet, which means the causal relationship between the causal entity and the accident entity is more explicit. The smaller the directional interest of the preferred triplet, the weaker the positive correlation between the causal entity and the accident entity in the preferred triplet, which means the causal relationship between the causal entity and the accident entity is less explicit. Selecting the preferred triplet with the highest directional interest as the cause of the current tower crane accident text ensures the reliability of the cause of the current tower crane accident text.
[0133] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0134] like Figure 5 As shown, Figure 5 The electronic device 2 includes: at least one processor 20, a memory 21, and a computer program 22 stored in the memory 21 and executable on the at least one processor 20, wherein the processor 20 executes the computer program 22 to implement the steps in any of the above method embodiments.
[0135] The electronic device 2 may include, but is not limited to, a processor 20 and a memory 21. Those skilled in the art will understand that... Figure 5This is merely an example of electronic device 2 and does not constitute a limitation on electronic device 2. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, it may also include input / output devices, network access devices, etc.
[0136] The processor 20 is used to run a computer program 22 stored in the memory 21, and performs the following steps when executing the computer program 22:
[0137] The trained language model is obtained. The embedding layer of the trained language model includes a word embedding module, a position encoding module, and a paragraph encoder.
[0138] The current tower crane accident text is obtained, and the word vector, position encoding vector, and segment vector of the current tower crane accident text are determined based on the word embedding module, position encoding module, and paragraph encoder, respectively.
[0139] The word vector, position encoding vector, and segment vector of the current tower crane accident text are fused to obtain the fused vector of the current tower crane accident text.
[0140] Based on the fusion vector of the current tower crane accident text, multiple causal relationship triples corresponding to the current tower crane accident text are determined. The Apriori algorithm is used to obtain multiple preferred triples from the multiple causal relationship triples corresponding to the current tower crane accident text.
[0141] Based on a predefined directional interest model, the causes of tower crane accidents in the current tower crane accident text are determined.
[0142] The processor 20 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0143] In some embodiments, the memory 21 may be an internal storage unit of the electronic device 2, such as a hard disk or memory of the electronic device 2. In other embodiments, the memory 21 may be an external storage device of the electronic device 2, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 2. Furthermore, the memory 21 may include both internal and external storage units of the electronic device 2. The memory 21 is used to store the operating system, applications, boot loader, data, and other programs, such as the program code of the computer program. The memory 21 can also be used to temporarily store data that has been output or will be output.
[0144] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0145] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.
[0146] The computer-readable storage medium stores program code that can be called by a processor to execute the tower crane accident cause acquisition method described in the above method embodiments.
[0147] Computer-readable storage media have storage space for program code.
[0148] The program code includes the code for any step in the tower crane accident cause acquisition method described in the above method embodiments.
[0149] For example, when program code is invoked by the processor, it can perform the following steps:
[0150] The trained language model is obtained. The embedding layer of the trained language model includes a word embedding module, a position encoding module, and a paragraph encoder.
[0151] The current tower crane accident text is obtained, and the word vector, position encoding vector, and segment vector of the current tower crane accident text are determined based on the word embedding module, position encoding module, and paragraph encoder, respectively.
[0152] The word vector, position encoding vector, and segment vector of the current tower crane accident text are fused to obtain the fused vector of the current tower crane accident text.
[0153] Based on the fusion vector of the current tower crane accident text, multiple causal relationship triples corresponding to the current tower crane accident text are determined. The Apriori algorithm is used to obtain multiple preferred triples from the multiple causal relationship triples corresponding to the current tower crane accident text.
[0154] Based on a predefined directional interest model, the causes of tower crane accidents in the current tower crane accident text are determined.
[0155] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0156] The computer-readable storage medium may also be an external storage device of the tower crane accident cause acquisition device or electronic device, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, or non-transitory computer-readable storage medium equipped on the tower crane accident cause acquisition device or electronic device.
[0157] Since the computer program stored in the computer-readable storage medium can execute any of the tower crane accident cause acquisition methods based on the Apriori algorithm provided in the embodiments of this application, the computer-readable storage medium can achieve the beneficial effects that any of the tower crane accident cause acquisition methods based on the Apriori algorithm provided in the embodiments of this application can achieve, as detailed in the preceding embodiments, and will not be repeated here.
[0158] This application provides a computer program product that, when run on an electronic device, causes the electronic device to execute the above-described method for obtaining the cause of tower crane accidents.
[0159] When a computer program is loaded into an electronic device, it can perform the following steps:
[0160] The trained language model is obtained. The embedding layer of the trained language model includes a word embedding module, a position encoding module, and a paragraph encoder.
[0161] The current tower crane accident text is obtained, and the word vector, position encoding vector, and segment vector of the current tower crane accident text are determined based on the word embedding module, position encoding module, and paragraph encoder, respectively.
[0162] The word vector, position encoding vector, and segment vector of the current tower crane accident text are fused to obtain the fused vector of the current tower crane accident text.
[0163] Based on the fusion vector of the current tower crane accident text, multiple causal relationship triples corresponding to the current tower crane accident text are determined. The Apriori algorithm is used to obtain multiple preferred triples from the multiple causal relationship triples corresponding to the current tower crane accident text.
[0164] Based on a predefined directional interest model, the causes of tower crane accidents in the current tower crane accident text are determined.
[0165] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0166] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0167] Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium includes: an entity or device for carrying computer program code to an electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium.
[0168] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0169] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A tower crane accident cause acquisition method based on an Apriori algorithm, characterized by, The tower crane accident cause acquisition method, applied to electronic equipment, includes: The trained language model is obtained. The embedding layer of the trained language model includes a word embedding module, a position encoding module, and a paragraph encoder. The current tower crane accident text is obtained, and the word vector, position encoding vector, and segment vector of the current tower crane accident text are determined based on the word embedding module, position encoding module, and paragraph encoder, respectively. The word vector, position encoding vector, and segment vector of the current tower crane accident text are fused to obtain the fused vector of the current tower crane accident text. Based on the fusion vector of the current tower crane accident text, multiple causal relationship triples corresponding to the current tower crane accident text are determined. The Apriori algorithm is used to obtain multiple preferred triples from the multiple causal relationship triples corresponding to the current tower crane accident text. Based on the predefined directional interest degree model, calculate the directional interest degree corresponding to each preferred triplet, and select the preferred triplet with the largest directional interest degree as the cause of the tower crane accident in the current tower crane accident text. The directional interest model is as follows: ; wherein, represents the direction interest degree corresponding to the preferred triplet pair. represents a causation entity, Y represents an accident entity, represents a negative relationship, represents that the causation entity does not exist; Indicates the first When the causal entity of the preferred triplet exists, the first... The probability of an accident entity occurring in a preferred triplet; Indicates the first When the causal entity of the preferred triplet does not exist, the first... The probability of an accident entity occurring in a preferred triplet; It is a smoothing coefficient, and its function is to avoid the denominator being 0.
2. The method for obtaining the cause of tower crane accidents according to claim 1, characterized in that, The process of obtaining the trained language model includes: Obtain a preset tower crane accident text, and form a training sample by combining the preset tower crane accident text and multiple causal relationship triples corresponding to the preset tower crane accident text. The preset tower crane accident text is the accident text corresponding to the model of the preset tower crane. Different training samples are combined into a training set, and the language model is trained using the training set. The trained language model is then saved.
3. The method for obtaining the cause of tower crane accidents according to claim 1, characterized in that, The process of obtaining the current tower crane accident text involves determining the word vector, position encoding vector, and segment vector of the current tower crane accident text based on a word embedding module, a position encoding module, and a paragraph encoder, respectively. Access the database and retrieve the current tower crane accident text from the database. The current tower crane accident text is the accident text corresponding to the current tower crane model. The word embedding module processes the words in the current tower crane accident text to obtain word vectors. The position encoding module processes the position information of the words to obtain position encoded vectors. The paragraph encoder processes the paragraph information of the words to obtain paragraph vectors.
4. The method for obtaining the cause of tower crane accidents according to claim 1, characterized in that, The process of fusing the word vector, positional encoding vector, and segment vector of the current tower crane accident text to obtain the fused vector of the current tower crane accident text includes: Input the word vectors, position encoding vectors, and segment vectors of the current tower crane accident text into the fusion layer of the trained language model; The word vectors, positional encoding vectors, and segment vectors of the current tower crane accident text are fused together through the fusion layer of the trained language model to obtain the fused vector of the current tower crane accident text.
5. The method for obtaining the cause of tower crane accidents according to claim 1, characterized in that, The process involves using the fusion vector based on the current tower crane accident text to determine multiple causal relationship triples corresponding to the current tower crane accident text. Then, using the Apriori algorithm, multiple preferred triples are obtained from these causal relationship triples, including: Input the fused vector of the current tower crane accident text into the classification layer of the trained language model; The fusion vector of the current tower crane accident text is processed through the classification layer of the trained language model to generate multiple causal relationship triples corresponding to the current tower crane accident text. The Apriori algorithm is used to obtain multiple preferred triples from the multiple causal relationship triples corresponding to the current tower crane accident text. The preferred triples are the causal relationship triples that appear more frequently than a preset frequency.
6. The method for obtaining the cause of tower crane accidents according to claim 1, characterized in that, After selecting the preferred triplet with the highest directional interest as the cause of the current tower crane accident text, the tower crane accident cause acquisition method includes: Create a display window to show the cause of the current tower crane accident.
7. A device for obtaining the cause of tower crane accidents based on the Apriori algorithm, characterized in that, Applied to electronic devices, including: The first acquisition module is used to acquire the trained language model. The embedding layer of the trained language model includes a word embedding module, a position encoding module, and a paragraph encoder. The determination module is used to obtain the current tower crane accident text. Based on the word embedding module, the position encoding module, and the paragraph encoder, it determines the word vector, the position encoding vector, and the paragraph vector of the current tower crane accident text, respectively. The fusion module is used to fuse the word vector, the position encoding vector, and the segment vector of the current tower crane accident text to obtain the fused vector of the current tower crane accident text. The second acquisition module is used to determine multiple causal relationship triples corresponding to the current tower crane accident text based on the fusion vector of the current tower crane accident text, and to obtain multiple preferred triples from the multiple causal relationship triples corresponding to the current tower crane accident text using the Apriori algorithm. The third acquisition module is used to calculate the directional interest degree corresponding to each preferred triplet according to the predefined directional interest degree model, and select the preferred triplet with the largest directional interest degree as the cause of the tower crane accident in the current tower crane accident text. The directional interest model is as follows: ; in, Indicates the first The directional interest degree corresponding to each preferred triplet; Y represents the causal entity, and Y represents the accident entity. Indicates a negative relationship. This indicates that the causal entity does not exist; Indicates the first When the causal entity of the preferred triplet exists, the first... The probability of an accident entity occurring in a preferred triplet; Indicates the first When the causal entity of the preferred triplet does not exist, the first... The probability of an accident entity occurring in a preferred triplet; It is a smoothing coefficient, and its function is to avoid the denominator being 0.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the tower crane accident cause acquisition method as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the tower crane accident cause acquisition method as described in any one of claims 1 to 6.