Subway construction risk classification method based on LDA topic modeling
By using the LDA topic modeling method to automatically classify texts of potential hazards in subway construction, the problems of strong subjectivity in hazard records and inconsistent classification standards are solved, enabling efficient risk identification and management, improving the accuracy and efficiency of risk identification, and supporting intelligent early warning and response.
Patent Information
- Application Number
- CN202510993023.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-10-31
AI Technical Summary
In subway construction, the recording of hidden dangers is highly subjective, the classification standards are not uniform, and key information is difficult to extract. Traditional analysis methods are unable to handle the implicit patterns in massive amounts of text, which affects the scientific nature and foresight of risk governance.
A subway construction risk classification method based on LDA topic modeling is adopted. By automatically modeling the hidden danger text data, potential risk topics are extracted to achieve structured and standardized classification. A bag-of-words model is constructed using TF-IDF weights and the Gensim library. The optimal number of topics is determined by combining perplexity and consistency scores to form a structured risk text database.
It has improved the accuracy and comprehensiveness of hazard information, reduced labor costs, improved the accuracy of risk identification and processing efficiency, supported intelligent early warning and response measure recommendations, and enhanced the systematicness and timeliness of risk management.
Smart Images

Figure CN120873186A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of engineering risk management technology, and in particular to a method for classifying subway construction risks based on LDA topic modeling. Background Technology
[0002] In subway construction, the identification and classification of risks and hazards are crucial for ensuring construction safety and project quality. However, current practices in hazard recording and management by subway construction companies commonly suffer from problems such as reliance on manual experience for information recording and inconsistent classification standards. Due to differences in the professional backgrounds, risk awareness, and liability biases of the recorders, hazard information is often subjective, inconsistent in its granularity, and lacks clear logic. This highly human-dependent approach to hazard management severely limits the standardized processing and systematic analysis of information.
[0003] Furthermore, current analysis of subway hazard information largely relies on manual summarization and experience-based judgment, lacking data-driven intelligent analysis methods. Many construction hazard records contain rich implicit information, such as frequently occurring hazard categories, typical risk conditions, and key investigation points, which have not been effectively extracted. This leads to the repeated occurrence of similar hazard problems in different sections and processes, hindering early warning and prevention measures and impacting the scientific and forward-looking nature of risk management. Especially when faced with massive and complex construction safety records, traditional analysis methods are inadequate for extracting and classifying implicit patterns from vast amounts of text.
[0004] Therefore, providing a subway construction risk classification method based on LDA topic modeling to solve the problems of strong subjectivity in hazard recording, inconsistent classification standards, and difficulty in mining key information in existing subway construction technologies is an urgent problem to be solved by those skilled in the art. Summary of the Invention
[0005] In view of this, the present invention provides a subway construction risk classification method based on LDA topic modeling. By automatically modeling a large amount of hidden danger text data, the potential risk themes are extracted to achieve structured and standardized classification of hidden danger information, thereby improving the accuracy and comprehensiveness of risk identification. At the same time, it provides scientific data support for construction units and enhances the initiative and timeliness of hidden danger early warning and management.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] A subway construction risk classification method based on LDA topic modeling includes the following steps: Data acquisition step: Exporting hidden danger text records from the construction unit's safety inspection system to obtain initial text content;
[0008] Data preprocessing steps: Regularize the initial text content to obtain cleaned text content; Text segmentation steps: Build a dictionary based on the cleaned text content, input the dictionary into the segmentation tool, and obtain the segmentation results;
[0009] Parameter acquisition steps: Construct a bag-of-words model, calculate TF-IDF weights based on word segmentation results, use TF-IDF weights to form a corpus vector set, and determine LDA hyperparameters;
[0010] Model building steps: Input the corpus vector set and LDA hyperparameters into the LDA model for training to obtain a trained LDA model;
[0011] Results output steps: Input the text to be detected into the LDA model to obtain the topic keywords and text topic distribution, and perform risk classification to form a structured risk text database.
[0012] Optionally, regularization processing includes using regular expressions to clean the text content, removing spaces, English characters, meaningless numbers and symbols, and retaining Chinese text.
[0013] Optionally, the dictionary is divided into a custom dictionary and a stop word dictionary. The custom dictionary includes fixed expressions and construction terms to improve word segmentation accuracy, while the stop word dictionary includes high-frequency words that have no actual semantic meaning to avoid interfering with modeling.
[0014] Optionally, the bag-of-words model is built using the Gensim library, and the expression is:
[0015] BoW(t i )={(w j ,f i,j )}, where f i,j For the word w in the i-th text j Word frequency.
[0016] Optionally, LDA hyperparameters include: the optimal number of topics, sparsity control parameters for document-topic distribution, sparsity control parameters for topic-term distribution, the number of model training iterations, and the number of document batches per training iteration.
[0017] Optionally, the optimal number of topics can be obtained as follows:
[0018] The perplexity metric and consistency score were used to evaluate the model quality for different numbers of topics: Perplexity: measures the model’s predictive ability on the test set, the lower the value, the better the model; Consistency score: measures the semantic coherence between words within each topic, the higher the value, the better.
[0019] By iterating through the number of topics K, the final value of K is determined at the intersection of the two indicators.
[0020] As can be seen from the above technical solutions, compared with the prior art, this invention provides a subway construction risk classification method based on LDA topic modeling, which has the following beneficial effects: 1) This invention abandons the traditional subjective method of relying on manual experience to classify hidden dangers. Through unsupervised LDA topic modeling, it automatically identifies potential risk categories, effectively overcoming the problems of misunderstanding bias and inconsistent terminology in manual classification, and constructing a unified and standardized risk classification system; 2) Through TF-IDF weighted and topic probability modeling, this invention can identify high-frequency core risk elements in text, especially for texts with vague, implicit, and non-standard descriptions, it can still mine potential topics, thereby achieving higher accuracy and wider coverage of hidden danger identification; 3) This invention uses Python language and Gensim library to build an automatic processing flow. From word segmentation and cleaning to modeling and output, the entire process is completed automatically, greatly reducing labor costs and improving the processing efficiency of large-scale hidden danger texts; 4) The text topic distribution and keyword weights output by the model of this invention can quantitatively present risk characteristics, which is convenient for construction units to conduct statistical analysis and risk profiling. At the same time, it can be used for automatic classification, early warning labeling, and response measure recommendation of similar hidden dangers in the future, improving the foresight and systematic nature of risk management. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0022] Figure 1 This is a flowchart of a subway construction risk classification method based on LDA topic modeling disclosed in this invention;
[0023] Figure 2 This is a flowchart of the word segmentation process disclosed in an embodiment of the present invention;
[0024] Figure 3a This is a consistency scoring curve diagram disclosed in an embodiment of the present invention;
[0025] Figure 3b This is a confusion curve disclosed in an embodiment of the present invention. Detailed Implementation
[0026] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0027] Referring Figure 1 as shown, the present invention discloses a subway construction risk classification method based on LDA topic modeling, including the following steps:
[0028] Data acquisition step: Export the hidden danger text records from the construction unit's safety inspection system to obtain the initial text content, denoted as the corpus T = {t1, t2,..., t i}, where ti represents the i-th hidden danger text;
[0029] Data preprocessing step: Perform regularization processing on the initial text content to obtain the cleaned text content; Text tokenization step: Build a dictionary based on the cleaned text content, and input the dictionary into the tokenization tool to obtain the tokenization result;
[0030] Parameter acquisition step: Build a bag-of-words model, calculate the TF-IDF weights in combination with the tokenization result, form a corpus vector set corpus_tfidf using the TF-IDF weights, and determine the LDA hyperparameters;
[0031] Model construction step: Input the corpus vector set and the LDA hyperparameters into the LDA model for training to obtain a trained LDA model;
[0032] Result output step: Input the text to be detected into the LDA model to obtain the topic keywords and the text topic distribution, and perform risk classification to form a structured risk text database.
[0033] Furthermore, the regularization processing includes cleaning the text content using regular expressions, removing spaces, English characters, meaningless numbers and symbols, and retaining Chinese text.
[0034] Furthermore, the dictionary is divided into a custom dictionary and a stop word dictionary. The custom dictionary includes fixed expressions and construction terms such as "connection passage", "safety helmet", "grouting record", etc., and is loaded through the following function: jieba.load_userdict(dict_path) to improve the tokenization accuracy. The stop word dictionary includes removing high-frequency words without actual semantics such as "of", "and", "is", "carry out", etc. to avoid interfering with the modeling.
[0035] Furthermore, jieba is used for Chinese word segmentation, and stop words and non-Chinese characters are removed to obtain the word segmentation sequence for each text, expressed as follows:
[0036] words = jieba.cut(text)
[0037] cleaned_words=[w forwinwords ifwnotin stopwords andis_chinese(w)].
[0038] Furthermore, the bag-of-words model is built using the Gensim library, and its expression is:
[0039] BoW(t i )={(w j ,f i,j )}, where f i,j For the word w in the i-th text j Word frequency.
[0040] Furthermore, the TF-IDF weights for each word are calculated using the gensim.models.TfidfModel() model.
[0041] Furthermore, the inputs to the LDA model include:
[0042] _tfidf: The corpus after TF-IDF vectorization; dictionary: A dictionary mapping words to indices.
[0043] Furthermore, the LDA hyperparameters include: the optimal number of topics, the sparsity control parameters for the document-topic distribution, the sparsity control parameters for the topic-term distribution, the number of model training iterations, and the number of document batches per training iteration.
[0044] Specifically, the optimal number of topics determines the number of risk categories output by the model, and needs to be evaluated in conjunction with perplexity and consistency scores;
[0045] The sparsity control parameter alpha(α) for document-topic distribution means that the smaller the value, the more each text tends to be related to a few topics.
[0046] The sparsity control parameter eta(η) for topic-term distribution is smaller; the smaller the value, the more each topic focuses on a few keywords.
[0047] The more training iterations (passes) a model undergoes, the more perfectly it fits the model.
[0048] The number of document batches (chunksize) used in each training session affects memory usage and speed.
[0049] Furthermore, the optimal number of topics is obtained as follows:
[0050] The perplexity metric and consistency score were used to evaluate the model quality for different numbers of topics: Perplexity: measures the model’s predictive ability on the test set, the lower the value, the better the model; Consistency score: measures the semantic coherence between words within each topic, the higher the value, the better.
[0051] By iterating through the number of topics K, the final value of K is determined at the intersection of the two indicators.
[0052] Furthermore, the output steps include: saving the keywords and their weights for each topic to the local text; naming risk topics based on the topic keywords and human knowledge, such as "personnel safety management" and "mechanical equipment failure"; and using the maximum topic distribution of each text as its risk label to form a structured risk text database to support subsequent statistical analysis, intelligent recommendation, and early warning.
[0053] In one specific implementation, a subway construction risk classification method based on LDA topic modeling includes the following steps:
[0054] Data acquisition steps: Save the 3,351 hidden danger issues recorded by the subway construction unit as a text document. Each hidden danger record is a line of text, forming a hidden danger corpus, with a total of 3,351 lines of text records.
[0055] Data preprocessing steps: Regularize the initial text content to obtain cleaned text content; Text segmentation steps: Collect a professional terminology database for construction, a terminology database for safety production, commonly used expressions on construction sites, and fixed collocations in construction, etc., to build a custom dictionary. Combine the Harbin Institute of Technology's stop word dictionary with the characteristics of construction texts to build a stop word dictionary, which is used to exclude common words without actual semantic meaning. Use the jieba Chinese word segmentation tool to load the above custom dictionary and stop word dictionary, such as... Figure 2 As shown, precise pattern segmentation is performed on each text. Stop words, numbers, punctuation, and non-Chinese characters are automatically removed during the segmentation process. The cleaned segmentation results are written to a new file, with each line representing one segmentation result, serving as input data for modeling. Parameter acquisition steps include: constructing a bag-of-words model, statistically analyzing the segmentation results, generating a document-to-term correspondence structure, calculating TF-IDF weights based on term frequency and document coverage to measure the importance of each word in the current document, and using the TF-IDF results as weight input for LDA modeling to improve the accuracy and stability of topic extraction. Consistency scoring curves and perplexity curves are used to compare the effects of different numbers of topics. Figures 3a-3b As shown, the initial optimal number of topics was determined to be approximately 30. After multiple rounds of experimental adjustments and verifications, the final number of topics was determined to be 16, and the following LDA modeling parameters were set:
[0056] Set α (document-topic distribution control parameter) to 0.01;
[0057] η (topic-term distribution control parameter) is set to 0.01;
[0058] Set the number of passes (iterations) to 50;
[0059] Set chunksize (the number of documents processed each time) to 10000;
[0060] Model building steps: Use Python and the LDA model training module in the Gensim library to train the TF-IDF weighted corpus;
[0061] Output steps: Output the set of high keywords for each topic; name and classify the 16 topics according to the keyword clustering characteristics under each topic; and summarize the risk points under each risk topic based on the keywords under each topic.
[0062] Furthermore, the naming and categorization of topics specifically includes the following:
[0063] Excavation operation risks include: excavation, mining, control, reservation, length, sufficiency, opening, incompleteness, drilling, geology, over-provisioning, and overlap;
[0064] Safety risks for personnel operating in passageways include passageways, construction work, safety belts, operation, signage, personnel, workers, warnings, three-point switches, reversing switches, operations, five-point switches, and equipment.
[0065] Construction risks of foundation pits include the foundation pit itself, failure to restore in a timely manner, demolition, the north side, inability to cover, incomplete paving, and cover slabs.
[0066] Shaft management risks include shafts, signage, platforms, locks, secondary structures, mortar, buttons, switch boxes, etc.
[0067] Risks associated with monitoring point management include monitoring points, vaults, cross passages, settlement, groups, spot checks, damage, and shafts;
[0068] Water accumulation risks include water accumulation, area, emergency response, pumping, station hall, tunnel boring machine, formwork, equipment, sealing, etc.; worker safety operation risks include spacing, specifications, binding, workers, exceeding limits, fastening, wellhead, screws, poles, etc.
[0069] Risks associated with edge protection include loosening, edge protection itself, multiple locations, walkway panels, and nearby areas;
[0070] Risks associated with fire extinguisher configuration and material storage include fire extinguishers, electric vehicles, setup, materials, storage, drivers, and surrounding areas;
[0071] Risks related to patrol records include delays, patrol records themselves, and platform issues.
[0072] Monitoring data risks include installation, analysis, hooks, monitoring data, zones, tunnel boring machines, beams, unhooking, and early warning systems;
[0073] Risks related to construction unit and personnel management include construction, construction unit, personnel, signatures, work site, tracking, related matters, and incomplete information.
[0074] Equipment failure risks include failure, replacement, non-compliance, protection, wiring, flooring, displays, delays, elevators, non-compliance, grounding, fire extinguishers, ground, devices, overruns, secondary distribution boxes, angles, and inspections, etc.
[0075] Risks in tunnel electrical equipment management include pilot tunnels, tunnels, placement, limit switches, height, posting, safety voltage, infrared sensors, limit switches, malfunctions, multi-socket outlets, telephones, and unreasonable aspects;
[0076] Risks associated with handover record management include handover, support, handover records, format, third party, and specificity; risks associated with electrical wires include ground, anti-tipping, welding machines, top, exposure, terminals, leakage, east side, and power outages.
[0077] The key risk points for each risk theme include:
[0078] Risks associated with excavation operations include: 1. Incomplete excavation plan; 2. Failure to conduct advanced geological drilling as required; 3. Failure of the anti-disengagement device of the drilling rig; 4. Incomplete acceptance documentation for excavation milestones, and failure to conduct verification in accordance with the verification management procedures.
[0079] Safety risks for personnel operating in passageways include: 1. lack of safety signs or unclear signs; 2. personnel not wearing five-point safety harnesses; 3. improper use of equipment.
[0080] The risks of foundation pit construction include: 1. The foundation pit dewatering wells are not covered or protected; 2. There is a risk of the fog cannons falling off the foundation pit, and the foundation pit guardrails have not been restored in time after being removed; 3. Water accumulation and leakage have not been dealt with in a timely manner.
[0081] Vertical shaft management risks include: 1. Some monitoring points are unmarked; 2. Electrical boxes at the construction site are not locked; 3. Equipment is placed at the entrance of secondary electrical boxes, the boxes cannot be opened normally, switch boxes are not set up properly, and disconnect switches are not provided. Monitoring point management risks include: 1. Some buildings have no monitoring points, and monitoring point signs are missing; 2. The number of monitoring points on the monitoring drawings does not match the number in the daily monitoring report; 3. Ground settlement monitoring projects lack relevant data, and there is no explanation of the daily monitoring results report; 4. The monitoring point on the arch of the connecting passage is contaminated and not restored in a timely manner; 5. Monitoring points are damaged and not repaired in a timely manner.
[0082] The risks of water accumulation include: 1. Multiple areas of the construction site have accumulated water that has not been drained in a timely manner, including areas with suspended pipelines in the foundation pit, station construction areas, and tunnel connecting passages; 2. There are instances where water has submerged the tracks inside the tunnel; 3. Drainage ditches contain silt that has not been cleared, and there is a significant amount of water accumulation in the ditches; 4. Multiple leaks inside the tunnel have not been sealed in a timely manner. The risks to worker safety include: 1. Excessive gaps between landing doors in multiple areas of the construction site, and some landing door locks are damaged and replaced with wire bindings; 2. Unauthorized wiring and power strips have been installed in worker dormitories.
[0083] Risks associated with edge protection include: 1. Lack of or incomplete protective measures in the edge area; 2. Loose or ineffectively secured edge guardrails or fences; 3. Lack of clear warning signs in the edge protection area; 4. Ineffective protective measures not taken for edge operations.
[0084] Risks related to fire extinguisher configuration and material storage include: 1. Insufficient fire extinguisher configuration; 2. Expired fire extinguishers not replaced; 3. Flammable materials stored in poorly ventilated locations or near heat sources; 4. Disorganized material storage.
[0085] The risks associated with patrol records include: 1. Untimely completion of patrol records, resulting in delayed records; 2. Incomplete patrol records, omitting key inspection points.
[0086] Risks associated with monitoring data include: 1. Improper installation of monitoring equipment; 2. Inappropriate installation location of monitoring equipment; 3. Incomplete recording of monitoring data; 4. Failure to analyze and compare monitoring data in a timely manner.
[0087] Risks related to construction unit and personnel management include: 1. Failure to track construction progress in real time; 2. Failure to sign and confirm construction plans and safety measures by relevant personnel; 3. Failure to provide pre-job training and safety education to construction personnel as required; 4. Construction personnel working without valid certificates.
[0088] Equipment failure risks include: 1. Expired fire extinguishers that have not been replaced, corroded cylinders, missing safety pins, or damaged markings; 2. Elevators lacking anti-overrun devices, loose or unsecured guardrails; 3. Aerial work platforms, fall arrest nets, etc., lacking upper limit devices; 4. Mobile lifting work platforms with malfunctioning operating switches or missing limit switches; 5. Lifting equipment lacking limit switches or malfunctioning anti-disengagement devices; 6. Some secondary control boxes missing doors, lacking grounding, or with unclear serial numbers; 7. Some cameras malfunctioning; 8. Damaged fire extinguisher nozzle hoses.
[0089] Risks associated with the management of electrical equipment in tunnels include: 1. Improper placement of electrical equipment; chaotic wiring in multi-socket outlets; 2. Failure to replace aging or damaged electrical wiring in a timely manner; 3. Failure to install safe voltage on electrical equipment; 4. Failure to promptly repair malfunctioning electrical equipment; 5. Failure to post operating instructions and safety warning signs on electrical equipment.
[0090] Risks associated with construction handover record management include: 1. Incomplete handover records; 2. Handover records not filled out according to the prescribed format; 3. No handover of supporting structure construction; 4. Lack of specificity in handover content.
[0091] Electrical wire risks include: 1. Exposed welding machine terminals; 2. Wires dragging on the ground; 3. Wires submerged in water.
[0092] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A subway construction risk classification method based on LDA topic modeling, characterized in that, Includes the following steps: Data acquisition steps: Export the hazard text records from the construction unit's safety inspection system to obtain the initial text content; Data preprocessing steps: Regularize the initial text content to obtain cleaned text content; Text segmentation steps: Build a dictionary based on the cleaned text content, input the dictionary into the segmentation tool, and obtain the segmentation results; Parameter acquisition steps: Construct a bag-of-words model, calculate TF-IDF weights based on word segmentation results, use TF-IDF weights to form a corpus vector set, and determine LDA hyperparameters; Model building steps: Input the corpus vector set and LDA hyperparameters into the LDA model for training to obtain a trained LDA model; Results output steps: Input the text to be detected into the LDA model to obtain the topic keywords and text topic distribution, and perform risk classification to form a structured risk text database.
2. The subway construction risk classification method based on LDA topic modeling according to claim 1, characterized in that, Regularization processing includes using regular expressions to clean the text content, removing spaces, English characters, meaningless numbers and symbols, and retaining Chinese text.
3. The subway construction risk classification method based on LDA topic modeling according to claim 1, characterized in that, The dictionary is divided into a custom dictionary and a stop word dictionary. The custom dictionary includes fixed expressions and construction terms to improve word segmentation accuracy, while the stop word dictionary removes high-frequency words that have no actual semantic meaning to avoid interfering with modeling.
4. The subway construction risk classification method based on LDA topic modeling according to claim 1, characterized in that, The bag-of-words model is built using the Gensim library, and its expression is: BoW(t i )={(w j ,f i,j )}, where f i,j For the word w in the i-th text j Word frequency.
5. The subway construction risk classification method based on LDA topic modeling according to claim 1, characterized in that, LDA hyperparameters include: the optimal number of topics, sparsity control parameters for document-topic distribution, sparsity control parameters for topic-term distribution, the number of training iterations, and the number of document batches per training iteration.
6. The subway construction risk classification method based on LDA topic modeling according to claim 5, characterized in that, The optimal number of topics is obtained as follows: The perplexity metric and consistency score were used to evaluate the model quality for different numbers of topics: Perplexity: measures the model’s predictive ability on the test set, the lower the value, the better the model; Consistency score: measures the semantic coherence between words within each topic, the higher the value, the better. By iterating through the number of topics K, the final value of K is determined at the intersection of the two indicators.