An intelligent recommendation method for coal mine accident case via ontology knowledge service

Coal mine accidents, for example, water leakage and collapse, can damage the circuit system, and they in turn can affect the stable operation of the coal mine. Therefore, it is necessary to identify the causes of coal mine accidents and reduce the number of accidents in coal mines. Government and enterprises have already accumulated numerous coal mine accident cases. To summarize the characteristics and rules of accidents, survey the deep cause of the accident, avoid the recurrence of similar accidents, and early pre‐control of risk source, there is a need to analyze the correlation in the accident characteristics. Then, with the help of ontology knowledge service model, we address this issue in this article. For guaranteeing the inference efficiency of ontology knowledge, we propose a semiautomatic construction method for coal mine accident cases to construct ontology. Here, the reliability of ontology construction and the professionalism of domain knowledge provide a feasible approach to ontology learning using structured and semi‐structured data sources. Furthermore, the weighted Word2vec and spectral clustering method are combined, an intelligent recommendation algorithm with accident ontology is accordingly presented, while presenting a local optimal distance calculation similarity strategy. This method can serve as an assistant to help users mine similar coal mine accident cases. Finally, the experimental results show that after comparing with some other popular methods, the proposed approach can achieve a satisfactory performance on the coal mine dataset with an accuracy of 99.47%, the precision of 98.92%, and the F1‐score of 99.35.

energy has always been the fundamental energy to ensure the stable development of the national economy and society.According to the data released by the National Bureau of Statistics in China, the total coal consumption in China reaches 3.9 billion tons in 2020, accounting for 56.8% of the total energy consumption.Specifically, coal is expected to become a Chinese main energy source.*Its sources are mainly divided into open-pit and underground mining, of which underground mining accounts for 95%.Due to these limitations of some factors such as geological conditions, mining technology, personnel quality, safety management, and lack of primary responsibility of the coal mining enterprises, underground mining has resulted in occurrences of coal mine production safety accidents, which caused huge losses to the country, life, and property.Figure 1 shows that from 2001 to 2020, a total of 33,644 coal mine accidents occurred, resulting in 53,259 deaths † ‡. § Therefore, it is necessary to identify the causes of coal mine accidents and reduce the number of accidents in coal mines.
Moreover, it can be seen from Figure 1 that the frequencies of coal mine accidents and the number of deaths involved gradually declined from 3082 and 5670 in 2001 to 168 and 245 in 2022, both decreasing by 95%.However, there is still a large gap between the Chinese coal mine safety production level and the international advanced level.The huge accident base makes the situation in coal mine safety grim.In 2020, the National Mine Safety Administration published 10 typical coal mine accidents, which completely exposed the problems of weak legal consciousness, repeated violations of laws and regulations, weak safety foundations, and numerous potential accidents in some coal mining enterprises.For example, on August 20, in the underground coal dust explosion accidents of Shandong Feicheng Mining Group Liang Bao Temple Energy Co., Ltd, seven people died and nine people were injured.The cause of the accident was a dust explosion caused by metal support materials and mechanical friction sparks during the mechanization of the mine.On September 27, a major coal mine fire at Chongqing New Energy Co., Ltd.killed 16 people, injured 42 others, and caused a direct economic loss of 25.01 million.The reason is that the flame-retardant performance directly led the unqualified tape to ignite, so the poisonous and harmful high-temperature flue gas spread rapidly to the coal mining face, resulting in heavy casualties.On November 29, a major flood accident occurred in the Yuanjiangshan coal mine causing 13 deaths and an economic loss of about 34.84 million.On December 4, Chongqing Yongchuan district crane tunnel coal illegal retracement downhole equipment fire accident killed 23 people, and the cause of the accident is the mine during the retreat operations using oxygen/liquefied petroleum gas cutting water pump suction pipe, a high temperature drop of molten slag deposition in lit water warehouse water oil dirties, oil dirties, and rock leaking oil combustion produces numerous poisonous and harmful gas ¶.** Every time an accident occurs, government regulators organized experts to investigate the accident and released a survey report to the public.The accident investigation report has introduced the accident situation of the accident in detail, including accident and emergency rescue, the cause and nature of the accident, suggestions about the processing of those responsible for the accident, preventive measures, and suggestions.† † Although the situation of Chinese coal mine safety has improved in recent years, different kinds of accidents happen occasionally.In the case of frequent coal mine accidents, safety cannot be ignored, and the safety management level of coal mine accidents must be further improved. 1Currently, numerous data technologies have been widely applied in the field of coal mining safety.With the increase of ontological knowledge resources of coal mine accidents, various accident data accumulated by coal mining enterprises also gradually increased.How to use these coal mine accident data to address the coal mine safety problems, minimize the re-release of similar coal mine accidents, and achieve the intelligent coal mine safety management has become the focus in the coal mining field. 2 Furthermore, despite there are numerous coal mine accident data, how to quickly and efficiently retrieve and access data resources related to the coal mine accident, to promote the in-depth analysis of coal mine accidents, avoid the recurrence of similar accidents, and prevent and control the sources of risk have become a crucial and urgent problem to be solved.To achieve the intelligent retrieval and recommendation of coal mine accident cases, the concept of ontology knowledge has been gradually introduced.Ontology knowledge has a good concept hierarchy structure.It supports logical reasoning and can express concept semantics through the relationship between concepts, thus providing a good knowledge base for semantic and concept retrieval.In this field, the ontology knowledge service-management technology has not been fully developed, and the organization, sharing, and reuse of coal mine accident case knowledge are extremely insufficient.Here, the knowledge of ontology-based intelligent information retrieval is superior to the keyword search, since the ontology knowledge includes machines that can determine the definition of the field concept.Based on the unified understanding of the relationships between the concept and basic axioms in the knowledge field, the intelligent system can understand the users' query by analyzing the words of semantics contained in the user query (group), and accurately finds the coal mine accident resources.In view of it, we present an intelligent recommendation method for the causes of coal mine accidents via ontology knowledge service.This method is to improve the performance of coal mine accident retrieval and intelligent recommendation.
The rest of this article is arranged as follows.Section 2 focuses on related works on ontology knowledge services and intelligent recommendations of coal mine accidents.The coal mine accident case approach of ontology knowledge service, including the construction rules of ontology knowledge service of coal mine accidents, is detailed in Section 3. It includes the description of coal mine accidents, rescue activities, precursor information, accident cause, rectification measures, attribute inference rules, coal mine accident case inference model and realization of ontology knowledge service, and intelligent recommendation model of coal mine accident case.Section 4 discusses experimental results and demonstrates the advantages of the scheme proposed in this article.Finally, the conclusion is provided in Section 5.

RELATED WORK
As a knowledge organization model, ontology knowledge provides a good carrier for the knowledge-based realization of knowledge acquisition, organization, representation, and reuse. 3Currently, the research of ontology knowledge has made considerable progress in biology, medicine, aviation, and some other fields. 4Specifically, in the field of coal mining safety, the ontology and rule reasoning-based knowledge base can be established through the construction of mine motor fault-knowledge domain ontology. 5A mine hoist fault diagnosis ontology knowledge base was constructed, and an ontology mapping-based fault diagnosis method was proposed. 6The reasoning and retrieval of hydraulic drill knowledge were achieved by constructing the mining hydraulic drill ontology model. 7Based on constructing the ontology of time, space, coal mine risk, and spatio-temporal accident tree, the intelligent warning knowledge of coal mine accidents were provided by combining the multiagent theory. 8After constructing an ontology-based knowledge base of water inrush prediction, the decision support system of water inrush prediction was designed, and the application of ontology knowledge in coal mine water inrush accident was achieved. 9,10These research results have preliminarily demonstrated the application of ontology-based knowledge management in the field of coal mine safety.However, there are relatively few studies on the application of knowledge of coal mine accident cases, and most of them do not pay more attention to the in-depth analysis of the construction.In response to such limitation, this article applies ontology knowledge to the intelligent recommendation of coal mine accident cases considering the characteristics of coal mine accident case knowledge.Developing a powerful coal mine safety accident ontology is beneficial to the construction of coal mine accident case knowledge through the use of ontology application methods and reasoning.Meanwhile, it can realize the effective management of coal mine accident case knowledge, achieve intelligent recommendation and efficient use of knowledge resources, and finally provide a theoretical basis for the safety management decision-making of coal mine enterprise.Formal ontology is used to describe background knowledge to develop an intelligent accident recommendation, clarify the semantics of web pages, and comprehensively utilize the expression ability and reasoning mechanism of ontology. 11,12t consists of three parts: web crawler, inference engine, and query interface.The web crawlers search and collect tagged knowledge fragments through labeled web pages. 13In addition, the expression language used by web crawlers transforms knowledge fragments into normalized facts.Inference engine and query users do not have to understand the syntax of factual representations on the internet, but only the annotator must use the annotation language.After receiving the user's question, the inference engine uses two information sources to determine the answer, such as the ontology of the subject and the facts in the web crawler. 14The basic reasoning mechanism of the inference engine is similar to the intelligent inference system in the knowledge base.Ontology captures the knowledge of relevant fields, provides a common understanding of the knowledge in these fields, determines the recognized specialist vocabularies, and clearly defines these vocabularies (terms) and the relationship between them from different levels of formal patterns. 15Furthermore, ontology bridges a gap between semantic exchange and can help different agents reach a consensus on terms and concepts.In terms of the theoretical research of ontology-based intelligent retrieval, 16 recent years have witnessed rapid advancements.Here, the query methods are more in accordance with human thinking habits, and the query results are more reasonable and available.Malhotra and Nair, 17 Nagarajan and Minu 18 discussed the relevance judgment of the current information retrieval systems and pointed out that in the complex concept of multidimensional and multilevel relevance judgment, users are concerned about pragmatic relevance, but most retrieval systems can only provide formal correlation.
Inspired by it, this article is to construct an information retrieval system using the basic principles of ontology to achieve the pragmatic relevance judgment of retrieval.Based on extensible markup language (XML) description metadata, the meta-language of the basic concepts of gas accidents and association rules between concepts can be accurately described with XML and semantic web rule language (SWRL) languages and then stored in an ontology model. 19This is to achieve semantic reasoning of ontology.Unlike the traditional models, for example, wavelet neural network and gray system theory, the real-time data is introduced into the ontology in the form of an entity, and gas early warning is achieved through semantic reasoning, which greatly improves the accuracy and efficiency of gas early warning. 20,21With the analysis of the limitations of the existing prediction and early warning systems, an ontology-based combined prediction and early warning model was proposed to address the issue of the semantic heterogeneity among a single prediction model and indicator system in the combined prediction and early warning system. 22The consistent representation of data, model, and knowledge in the system is realized by establishing an ontology knowledge base.The composition, realization principles, and methods of the ontology knowledge base are analyzed in detail.According to the ontology modeling theory, the ontology models of domain index, index, prediction task, and case ontology are established.The ontology is formalized by using the ontology editing tool (Protégé 3.3.1),and Pellet is selected as the internal ontology inference machine.To improve the accuracy of prediction and early warning, a single prediction model and index system could be selected carefully for combining prediction and early warning.Furthermore, a prototype system was presented. 23n the last decade, with the development of intelligent learning technologies in industrial applications, [24][25][26] several ontology-based information retrieval systems and models have been proposed.Omotosho et al. 27 outlined ontology-based information retrieval technology and corresponding ontology tools, which could be used to develop prototypes or commercial products.Ontology-based information retrieval models including ontology-based document recognition model and vector space model-based information retrieval model were discussed.These models improved the retrieval efficiency of large databases. 28Ramli et al. 29 and El-Ansari et al. 30 discussed two methods of using fuzzy theory to achieve ontology models of information retrieval.The analysis and expansion of user query demands are important technologies to realize ontology-based intelligent information retrieval.Afuan et al. 31 proposed a natural language processing method and implemented an ontology-based query processing method to improve the performance of information retrieval.Padeken et al. 32 proposed a query extension method, which could achieve query extension by searching similar ontology concepts related to query topics.The relevance ranking of query results is a critical issue in intelligent information retrieval.The results of the traditional sorting are implemented by analyzing the keywords in the database rather than on the semantic level.Then, the work on semantic retrieval and related issues has gradually attracted the attention of researchers, 33 and the accumulation of relevant research provides experiences and inspirations for semantic retrieval and matching of Chinese information retrieval systems.
The last decade has witnessed the advancement of ontology knowledge service, while preliminarily achieving the application of knowledge management in coal mine safety and other fields.However, for the analysis of coal mine accident cases, there are relatively little intelligent methods for the application of knowledge service recommendation, through the use of ontology knowledge base. 34Then, we conduct a coal mine accident case modeling based on ontology knowledge service.

COAL MINE ACCIDENT CASE MODEL OF ONTOLOGY KNOWLEDGE SERVICE
In this section, some key technologies used in our method are presented.

Ontology knowledge services-based rule construction
At the starting point of each step, the coal mine accident reporting factor is connected to the accident by the attribute "has_construction", and the precursor information is related to the cause of the accident by the attribute "cause_risk".The cause is mentioned in the ontology.The recursor can be obtained from the precursor information by the attribute "cause_recursor."This article is limited to the selected range of coal mine ontology knowledge and is represented by "cause_recursor."The cause of the accident has relevance to the corrective action by the attribute "has_solution."The precursor information, the cause of the accident, and the corrective action are not linked to the accident by the attributes "cause_recuror," "cause_risk," and "has_solution." In the process of coal mine accidents, coal mine accidents, rescue activities, precursor information, accident causes, and rectification measures have the following attribute inference rules: Rule 1:

Coal mine accident case-based intelligent recommendation by ontology knowledge
When a coal mine accident report provides specific domain rules and facts for entity recognition, the ontology recognition algorithm can handle multiple ontology reasoning tasks.Through the corresponding format transformation, the knowledge expressed in the form of ontology and rules described by SWRL is transformed into rules and facts understood and supported by the ontology recognition algorithm.Then, the ontology recognition algorithm inference engine is employed to achieve the domain-related problem inference and obtain new facts.
In the inference process, the following four activities are mainly performed: 1. Using ontological fact to express individual instance knowledge.
3. Running ontology recognition inference engine with facts and rules.4. Inferring new facts and updating the knowledge base.
Figure 3 shows the recognition and reasoning process through the use of an ontology knowledge service.The ontology reasoning of coal mine accident case served by ontology knowledge is composed of ontology definition, rule definition, and coal mine accident case reasoning.The whole process covers knowledge storage, knowledge representation, knowledge acquisition, coal mine accident ontology storage, knowledge representation, and representation group of coal mine accident case ontology.As far as ontology definition, it mainly includes ontology form, coal mine accident case, case knowledge base, and rule base.As far as rule definition, it includes rule form, rule description, rule formalization, and accident ontology rule extraction.In case-based reasoning of coal mine accident, it mainly carries on the extraction of accident knowledge, the definition of concepts, attributes, and reasoning rules.
Based on the ontology knowledge service, the recognition combining SWRL and ontology is applied to the reasoning analysis of the coal mine accident report, and the location of a coal mine accident report can be observed.Jess inference engine launches risk events that may produce coal mine accidents to achieve the intelligent recognition of coal mine activities risks.Furthermore, the inference machine can infer the measures that should be taken for risk events, and the construction site can take safety measures in time to improve and rectify the coal mine construction scheme, to reduce and prevent the occurrence of risk events.This is very important for identifying and managing coal mine safety risks.Figure 4 shows an example result of the ontology knowledge service.As shown in Figure 4, the knowledge, for example, accident type, accident address, direct information, and disposal reason are identified from the coal mine accident report text which is based on ontology knowledge service.If the accident type is the coal mine fire, the accident address is Sangzhi of Zhangjiajie in the Hunan Province in China, identity info is the direct for the accident.The punishment Reason is that Yangping Li took use of iron tools on rice husk illegally, resulting in a major gunpowder explosion accident.

F I G U R E 3
Case-based ontology reasoning of coal mine accidents using ontology knowledge service.
As the administrator of the warehouse of Nanyang Firework Factory in Pukou of Liling City, death, , who held , shall not be held liable.
In the view of the

F I G U R E 4
Inference results of ontology knowledge services.

Intelligent recommendation algorithm for coal mine accident case
According to the report from the information of hazardous chemicals entered by users, the similarity between the key information (e.g., title, abstract, reason) of different reports in historical data is calculated and comprehensively analyzed by using a machine learning algorithm.Finally, the report related to the input content and its corresponding key information is generated.Inspired by the text similarity calculation model using weighted Word2vec, 35,36 this article presents a local optimal distance calculation similarity matrix using adaptive weights.In the spectral clustering method, the text keywords are often regarded as points in space, and each keyword can be represented by a unique feature vector.Let the text X = ( with multiple keywords, where d represents the vector dimension of each keyword, n and m represent the number of keywords in the text, respectively.The presented method is described as follows.
1.The distance between the feature vectors of text X and Y is calculated, where the cosine similarity is employed to represent the similarity between text X and Y. Let x i and y j be two keyword vectors.Then, we have: (1) 2. The similarity between each key word in text X and text Y is calculated using (1), and the similarity matrix S(X, Y) ∈ R n×m is obtained, where S ij represents the similarity between the i-th key word in text X and the j-th key word in text Y.Meanwhile, if S ij ≥ p, the i-th key word in text X and the j-th key word in text Y will be regarded as cross words, where p is a hyperparameter.The maximum value in the S(X, Y) is extracted as S max , and all similarities will be updated with S max for adaptive weight adjustment as follows.
where W max and W min are two hyperparameters, and they can be set according to the actual situation.Then, the improved similarity matrix is S ′ ∈ R n×m , where S ′ ij = S ij × W ij .Then, the cross similarity of text X and text Y can be got as follows.
where t is a threshold.3. The keywords whose similarity values are over threshold in S ′ ij are deleted to obtain the non-crossing words ) from X and Y.Then, the improved similarity matrix S ′ is utilized to generate the similarity matrix S ′′ ∈ R n ′ ×m ′ of non-crossing words, where n ′ and m ′ are two numbers of keywords in text X ′ and text Y ′ .The method of calculating the similarity of non-cross words is as follows.First, we select the maximum value of matrix S ′′ and store it in list C. Furthermore, we remove keywords in the same row and column as the maximum value.We repeat the previous operation in the remaining similarity matrix until the matrix is empty, then the non-crossing similarity of text X ′ and text Y ′ is shown as follows. sim where L is the number of keywords in C.
4. Finally, the combined weight of adjustable parameters is used to calculate the similarity of text X and Y, where the adjustable parameter is The sim total (X, Y) is applied to determine whether X and Y are similar.If sim total (X, Y) ≥ T, the text X and Y are highly similar, where the hyperparameter T = min(n, m) ×  × P, and P ∈ [0.6, 0.8].
Based on the extracted report IDs with high relevance, the key element information of the associated report is queried, and the output of business objectives is finally achieved.A flow chart of this intelligent recommendation algorithm is shown in Figure 5.

Motivation analysis
Compared with the text similarity calculation model with weighted Word2vec, 35,36 in the improved method, the keyword of the coal mine accident report text is regarded as a point, and each point is represented by a unique feature vector.In the process of similarity calculation, the similarity can be obtained when some value is greater than a certain threshold, and the value of threshold and similarity is adjusted adaptively according to the actual situation.In this way, the optimal value can be dynamically selected in the process of similarity calculation, while achieving the mine accident similar reference information recommendation.

SIMULATION VERIFICATION
This section shows the experimental results.First, we preprocess and clean the data.Then, we use the proposed algorithm to deal with the problem.To achieve a good result, we select appropriate hyperparameters in the scheme.Finally, we employ five metrics to evaluate the performance of different models in the experiment.

Experiment description
The datasets used in this experiment are the available coal mine datasets.In this field, some popular machine learning models, including bidirectional encoder representation from transformers (BERT), bi-directional long short-term memory (BiLSTM), and multi-layer perceptron (MLP) have been employed to achieve the optimization task.Then, we compare the proposed method with those approaches, that is, BERT + MLP model and BERT + BiLSTM + MLP model, wherein each model we consider two versions, that is, fixing and unfixing the specified parameters of the BERT model, respectively.
Here, our experiment is conducted in the Python 3.7 environment running on a computer with an Intel (R) Core (TM) i5-8250 U CPU with 8 GB RAM.

Data preprocessing
The coal mine data can be classified into 35 labels, including mechanics, poisoning, task, and some others.If the current data contain any of these labels, the corresponding value is one, otherwise, it is zero.Thus, each data may have multiple labels.It can be found the characteristic of imbalance in coal mine datasets.To avoid such an impact of imbalance, in the experimental verification there are three strategies used to minimize its impact on the final performance.First, at the sample level, we combine random undersampling and oversampling techniques to minimize the number of multiple types and increase the number of few types.Second, while adjusting the balance of the coal mine data set, different weights are given to different classifications to minimize the imbalance of samples.Third, the method of self-adaptive weight calculation of similarity is adopted to make the results more optimized based on the current data set.
To ensure sufficient data used for the training model with the small amount of data, the accident report ID, accident category, accident process, an overview of indirect causes, and direct and indirect causes of the data are all used as independent feature data.
Figure 6 shows the coal mine containing a total of 35 labels, where the amount of labels task, coal and safety are relatively large.Meanwhile, Table 1 demonstrates some samples of the coal mine dataset.

4.3
Baseline description

BERT + MLP
The data is preprocessed, the datasets are constructed, and then these datasets are inputted into the BERT model to obtain the output.Then, MLP is used to deal with it.Here, the output processed by the full connection layer is activated through the ReLU function, and the number of intermediate features is further reduced through the dropout layer.Finally, it is passed through a full connection layer.First, the test data are inputted into the trained model, the prediction result is achieved, and the loss value is calculated through the Softmax activation function.If the prediction result is empty, the data is iterated to obtain a prediction result.By using the prediction results, the values of accuracy, precision, recall, and F1-score are calculated as the model evaluation metrics.Finally, the input words are matched with the existing tags to obtain the most similar tags, all data are iterated, the trained model is used to predict the label of data, and the intersection of the label of each data and the most similar label is obtained.If the intersection is not empty, the data can be used as the output result.
The compositions of the neural network are BERT, dropout (p = 0.3), linear (hidden sizes of BERT and classifier), ReLU, another dropout (p = 0.3), and linear (hidden size of classifier and the number of labels).Considering the training time, we observe that when the epoch is set to 5 and the batch size is 16, the training time is acceptable.Further, we find that when the learning rate is set to 5 × e −5 and the epsilon value is set to 1 × e −8 , the accuracy of the model is the best.

BERT + BiLSTM + MLP
In this subsection, the preprocessing is the same as the previous part.The output is processed through the BiLSTM layer and MLP.The input of the BiLSTM layer is the dimensions of the BERT, perceptron, and BiLSTM hidden layers.In the model, the hidden layer dimension of the BiLSTM layer is defined as two.The output of the BiLSTM layer passes through the dropout layer to reduce the number of intermediate features before passing through the full connection layer.The input dimension of the full connection layer is twice the size of the hidden layer dimension of the perceptron, and the output dimension is the number of tags.If the output is not empty, then it is activated by the Sigmoid function, and the loss function is the cross-entropy function.It is noted that since the obtained BERT output is 2D and the input of the BiLSTM layer is 3D, it is crucial to convert the input from 2D to 3D tensor and then transfer the weight when defining the transfer function of each layer.This scheme is composed of BERT, BiLSTM ([hidden size of BERT, hidden size of classifier], the number of layers = 2, and dropout = 0.1), dropout (p = 0.3), linear (hidden size of classifier × 2, and the number of labels).In this algorithm, the epoch, batch size, learning rate, and epsilon values are set to 5, 16, 5 × e −5 , and 1× e −8 .

Evaluation metrics
To effectively evaluate the performance of the model, the following metrics, including accuracy, precision, recall, F1-score and loss-value are used as follows.
where ŷ is the predicted label and y is the ground-truth label.
Table 2 shows the definitions of TP, FP, TN, and FN.

Results on coal mine dataset
The experimental results on the coal mine dataset are shown as follows.First, four BERT-based models are employed for training and predicting, while five metrics are utilized to evaluate the performance of models.
From the perspective of model training and verification, we fix the specified parameters of the model BERT to train models BERT + MLP and BERT + BiLSTM + MLP, and the specified parameters of the unfixed BERT model are used to train models BERT + MLP and BERT + BiLSTM + MLP.
Figure 7 shows the comparative result of the performance of BERT-based models on the coal mine dataset with different training steps.Here, Figure 7A shows that the accuracy of BERT + MLP_Unfixed is the highest, exceeding 98%, and the accuracy of the other four models is over 84%. Figure 7B shows that the precision of the model BERT + MLP for unfixing the specified parameters of the model BERT is the highest, which is approximately 80%.The effect of model BERT + BiLSTM + MLP for unfixing the specified parameters of the model BERT, the model BERT + MLP for fixing the specified parameters of the model BERT, and the model BERT + BiLSTM + MLP for fixing the specified parameters of the model BERT is unideal, and the accuracy is between 25% and 35%. Figure 7C shows that the recall of the model BERT + MLP for unfixing the specified parameters of the model BERT is the highest, which is approximately 100%, whereas the recall rate of the model BERT + BiLSTM + MLP for fixing the specified parameters of the model BERT, the model BERT + MLP for fixing the specified parameters of the model BERT, and the model BERT + BiLSTM + MLP for fixing the specified parameters of the model BERT are between 65% and 80%. Figure 7D shows that the F1-score of BERT + MLP for unfixing the specified parameters of the BERT is the highest, which is between 85% and 90%, whereas the recall of BERT + BiLSTM + MLP for unfixing the specified parameters of the BERT, BERT + MLP for fixing the specified parameters of the BERT, and BERT + BiLSTM + MLP for fixing the specified parameters of the BERT are between 40% and 50%. Figure 7E shows that the loss of the BERT + MLP for unfixing the specified parameters of the BERT is the lowest, which is between 5.5% and 5.7%.The loss value of the BERT + BiLSTM + MLP for unfixing the specified parameters of the BERT is approximately 6.0%, whereas the loss values of the BERT + MLP for fixing the specified parameters of the BERT and BERT + BiLSTM + MLP for fixing the specified parameters of the BERT is between 6.2% and 6.4%.Generally, in four BERT-based models, the BERT + MLP for unfixing the specified parameters of the BERT can achieve the best performance.
Then, we perform the proposed method on the coal mine dataset, the evaluation metrics of the model are observed by modifying the value of P. Figure 8 shows that the evaluation metrics improve gradually with the increase of P, and the precision, accuracy, recall, and F1-score reach the optimal value when P is set to 0.8.Thus, the parameters threshold P, W max , W min , and  are set to 0.8, 0.9, 0.3, and 0.9, respectively.
Finally, Table 3 shows the evaluation results of the test set related to coal mine data for four BERT-based models, where our proposed method is based on the local optimal distance calculation similarity matrix using adaptive weights.It is evident that the BERT for unfixing the specified parameters in the model is better than ordinary BERT.Meanwhile, the BiLSTM layer cannot work well in our experiment.Furthermore, the performance of the proposed method is the best.The reasons mainly lie in three aspects.First, we separate keywords into primary keywords and secondary keywords.Here, the primary keywords often play a decisive role in the meaning of the sentence.Then, we use a linear weighting method to widen the gap between the primary keywords and secondary keywords.Second, the optimal nodes act as standards to adjust the adaptive weight, so as to balance the difference between the similarity of different keywords.Finally, the general F I G U R E 8 Evaluation of the proposed method with different hyperparameter P on coal mine dataset.selection algorithm may generate errors in the calculation of non-crossing similarity.For example, when the maximum word similarity is obtained according to the row, the value of a column in the matrix can be obtained repeatedly, and it will ignore other keywords.Therefore, we use the greedy strategy to select optimal values.

CONCLUSION
Using ontology-based knowledge service to organize, represent, and store the knowledge of coal mine accident cases can considerably improve the expansion and semantic reasoning performance of coal mine accident knowledge, and it is more conducive to improve the sharing and use of intelligent recommendations for coal mine accident cases.The construction of coal mine accident case knowledge base provides a knowledge guarantee for the early warning and treatment of coal mine accidents, provides a theoretical support for improving the decision-making level of coal mine safety management, and promotes the application of knowledge management in the coal mining field.Then, it accordingly accelerates the informatization and intelligence level of coal mine enterprises.Here, with the intelligent recommendation model of ontology knowledge service, the tacit knowledge of safety management in the coal mine production can be mined and classified, and the relationship among accident case knowledge can be analyzed.Moreover the entity relationship diagram intuitively describes all kinds of knowledge and the relationship between them, and initially constructs the coal mine accident case decision system, while achieving the natural language knowledge query.However, there remain some technical challenges in the process of ontology knowledge service construction.In the ontology knowledge acquisition and construction process, most of them are manual operations, which actually guarantee the quality of ontology knowledge.Meanwhile, the efficiency is unsatisfactory, and the scale of the knowledge base is relatively small, therefore, it should be continuously expanded and improved.Then, automatic acquisition of coal mine accident knowledge and automatic/semiautomatic construction of ontology will be the focus in future works.
Ontological knowledge representation of coal mine accident casesCoal mine accident case reasoning

TA B L E 2 7
Definitions of TP, FP, TN, and FN.The performance of BERT-based model on coal mine dataset with different training steps.
This figure is based on business factors, such as coal mine accidents, rescue activities, precursor information, accident causes, rectification measures, and other factors in the process of coal mine accidents.
Some examples after preprocessing.
LabelsF I G U R E 6Statistics of labels in coal mine datasets.TA B L E 1 Evaluation criteria of test set related to coal mine data.