Urban building safety risk knowledge graph construction method
By expanding the type of building type, improving the integration of time and space data, improving the efficiency and accuracy of knowledge extraction, and optimizing the integration of knowledge, the problem of incomplete building types in the existing technology, insufficient space -time data integration, and low knowledge efficiency in the existing technology have achieved more and more efficient efficiency. Complete and practical urban architectural safety risk knowledge map.
Patent Information
- Application Number
- CN202411034656.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2025-01-28
AI Technical Summary
The existing technology has problems such as incomplete construction type coverage, insufficient spatial and temporal data integration, low knowledge extraction efficiency and accuracy, and immature information fusion in urban building safety risk management, which limits the practicality and application of knowledge graph technology in practical applications. sex.
By expanding the type of building covered by the knowledge map, improve the integration method of time and space data, improve the accuracy and efficiency of knowledge extraction, and optimize the strategy of knowledge integration. Specific methods include data type analysis, framework construction from the bottom downward, the extraction and fusion of the entity and relationship, and the data storage in the NEO4J diagram database.
增强了城市建筑安全风险知识图谱的完备性和实用性,提高了知识图谱在多样化建筑安全风险管理中的应用能力,确保了对建筑时空特性的深入分析和准确反映。
Smart Images

Figure CN119378661A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of knowledge graphs, and in particular to a method for constructing a knowledge graph of urban building safety risks, which enhances the completeness of the knowledge graph of urban building safety risks by mining multivariate information on building safety risks. Background Art
[0002] At present, with the development of science and technology, the massive knowledge of multivariate and heterogeneous is growing rapidly. Faced with the difficulties of screening knowledge and data information redundancy in Internet resource information, paper technical books, electronic scientific research literature and other information, a large amount of data with different structures and growing continuously poses a great challenge to the discovery of valuable knowledge. Whether it is ordinary residents, construction-related practitioners or scientific researchers, they need to spend a lot of time and energy to obtain high-quality information that is credible and meets the needs. The knowledge graph (KG) technology shows great potential for integrating high-quality building safety knowledge and understanding massive building data. It has application prospects and practical significance for providing rich and accurate building safety data and improving analysis quality and scientific research efficiency. The knowledge graph has good readability, extensibility and interpretability. Its graph-based knowledge representation can effectively organize massive data, express rich semantic information, and facilitate data analysis and relationship reasoning. The knowledge graph can associate and retrieve information more comprehensively and accurately, and has been widely used in vertical fields such as medical care, finance, and transportation. However, the research on knowledge graph in the field of building safety is still relatively scarce. Building safety knowledge is characterized by dispersion, specialization, and heterogeneity. Constructing a knowledge graph in the field of building safety can standardize domain knowledge, reveal the intrinsic connections between different knowledge elements, conduct in-depth mining of core knowledge, and sort out the safety laws of different buildings under different conditions. The construction of the graph can achieve accurate and efficient information intelligent inspection at the application level, and improve the efficiency of safety regulation and management queries.
[0003] The application of knowledge graph technology in urban building safety risk management is gradually unfolding. Jia Wang et al. in the literature "Wang J, Mu L, Zhang J, et al. On intelligent fire drawings review based on building information modeling and knowledge graph [C] Construction Research Congress 2020. Reston, VA: American Society of Civil Engineers, 2020: 812-820" combined BIM technology and knowledge graph to provide a new intelligent method for building fire drawing review, focusing on automation and precision review process; Shijing Zhang et al. in the literature "ZHANG S, WANG J, DENG W, et al. Ontology Construction for Building Fire Emergency Response [J]. 2022" further refined this field, and by constructing the B-FERO2 ontology model, in-depth semantic knowledge expression was carried out for building fire emergency response; Xudong Wang et al. in the literature "Wang X, Nady S, Zhang Z, et al. Knowledge Graph of Urban Firefighting with Rule-Based Entity Extraction [C] International Conference on Engineering Applications of Neural Networks. Cham: Springer Nature Switzerland, 2023: 168-177” proposed a rule-based entity extraction method in the field of urban fire protection, laying the foundation for building a domain knowledge graph; Xian Cao et al. focused on the protection of urban historical buildings, in the document “Cao X, Guo X, Jiang J. Knowledge Graph Enabled Representation and Exploration for Urban Historical Buildings: a Case Study in Beijing, China[J].The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, 2022, 48: 1-7” strengthened the understanding and management of historical building protection by constructing a knowledge graph of urban historical buildings; Jun Hu et al. proposed a structured storage method for building fire cases based on knowledge graphs in the document “Hu J, Shu X, Xie X, et al. Construction and Application of Knowledge Graph for Building Fire[J]. Fire Technology, 2024: 1-29”, which provided strong support for fire cause analysis and prevention strategies. These studies have jointly promoted the construction and application of urban building safety risk knowledge graphs and provided a new perspective for risk assessment and management.
[0004] Although existing research has made progress in the construction of knowledge graphs for urban building safety risks, facing challenges such as the dispersion of existing knowledge sources and data information redundancy in urban building safety risk management, existing research has limitations in many aspects, which restricts the application and development of knowledge graph technology. First, existing research is not comprehensive in covering building types and cannot fully reflect the safety risks of diverse buildings in cities. Most studies focus on specific types of buildings, such as residential or historical buildings, while paying insufficient attention to other types such as industrial buildings. This limits the application of knowledge graphs in the management of diversified building safety risks. In addition, existing research is still insufficient in integrating time and space data, lacking in-depth analysis of the spatiotemporal characteristics of buildings; secondly, the integration of time and space data is insufficient, making it difficult to accurately reflect the dynamic changes of building safety risks; in addition, the efficiency and accuracy of knowledge extraction are not high, resulting in a large amount of valuable information not being fully utilized; and knowledge fusion is immature, and it is impossible to effectively associate and integrate multi-source heterogeneous data. These problems limit the practicality and applicability of knowledge graph technology in the field of building safety in practical applications, and innovative methods are urgently needed to optimize the construction of its knowledge graph for building safety risks. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a method for constructing a knowledge graph of urban building safety risks, by expanding the building types covered by the knowledge graph, improving the integration method of time and space data, improving the accuracy and efficiency of knowledge extraction, and optimizing the knowledge fusion strategy, so as to solve the problems of existing technologies such as incomplete coverage of building types, insufficient integration of time and space data, low efficiency and accuracy of knowledge extraction, and information fusion.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] A method for constructing a knowledge graph of urban building safety risks includes data type analysis and overall framework construction, specifically including the following steps:
[0008] S1. Data type analysis: Select structured data, semi-structured data, and unstructured data for subsequent knowledge graph construction;
[0009] S2. Overall construction framework: Based on the data obtained in step S1, a top-down approach is adopted to first build a model layer from the perspective of ontology construction, and then use the model information of the ontology to complete knowledge extraction from the existing data. The extracted knowledge data is then fused and stored to complete the construction of the knowledge graph.
[0010] As a further technical solution of the present invention, the structured data includes the standard documents of the National Standardization Administration and the table information in the document data; the semi-structured data is the data with certain naming tags, which uses relevant tags to separate different semantic fields, including Wikipedia and HTML web page data in architecture-related websites; the unstructured data includes textbooks and technical books, popular science books, scientific research documents, and online forum articles.
[0011] As a further technical solution of the present invention, the specific process of step S2 is:
[0012] S21. Through the analysis of semantic concepts in the field of building safety, the ontology construction method is used to complete the construction of the knowledge graph model layer;
[0013] S22, acquiring and preprocessing unstructured data;
[0014] S23, complete knowledge extraction according to the ontology concept of the pattern layer, knowledge extraction includes entity extraction and relationship extraction;
[0015] S24, integrating the knowledge data extracted in step S23, eliminating redundant information, and realizing entity alignment based on dictionary and similarity matching, completing knowledge fusion, and obtaining multivariate data after knowledge fusion;
[0016] S25. Store the multivariate data after knowledge fusion in the Neo4j graph database to achieve persistent storage of data and provide business needs and data support for subsequent knowledge iteration and complex semantic query.
[0017] As a further technical solution of the present invention, the construction process of the knowledge graph model layer in step S21 is:
[0018] S211. Determine the fields and scope of the ontology, clarify the direction of model layer construction, and limit building safety knowledge to building design and building maintenance according to actual building needs and application scenarios, and exclude content related to building decoration and building material production;
[0019] S212. Define various entities based on important terms and data characteristics in the field. For the concept of building, refer to the classification of buildings in building technology by the National Standardization Administration, and divide buildings into two categories according to safety characteristics: civil buildings and industrial buildings. For safety-related concepts, divide the knowledge in the field of building safety risks into multiple entity types based on the national building standard (GB) documents including the "General Code for Civil Buildings" and the "Building Fire Protection Code";
[0020] S213. Complete the definition of relationships based on the hierarchical concepts between entities, and fully describe the semantic network of the building safety risk field by determining the relationships between entities to obtain the knowledge graph model layer, where the relationships are the relationships between domain ontology concepts, expressed in binary first-order predicate logic, and described in the form of triples of <subject, relationship, object> in the knowledge graph.
[0021] As a further technical solution of the present invention, the specific process of step S22 is: first crawl the literature abstract part of the building safety column of the "Journal of Architecture" journal in the CNKI database, and use the PaddleOCR open source technology framework based on deep learning to convert the text format of the "General Code for Building Fire Protection" and the "Fire Accident Investigation Report". The comprehensiveness of domain knowledge is guaranteed through the support of multi-source data, and then the acquired data is cleaned. The cleaning work includes unifying the format, converting illegal characters incorrectly recognized by OCR, clearing spaces, filtering irrelevant text, and screening valid text data that can constitute the corpus, thereby obtaining unstructured text for knowledge extraction.
[0022] As a further technical solution of the present invention, the specific process of step S23 is:
[0023] S231. For structured data and semi-structured data, entity groups are formed according to rule-based field mapping extraction. Specifically, the construction safety risk alias fields in the "Construction Network" and "Construction Bao" construction websites are obtained through Scrapy crawler technology, and the alias fields are constructed into a construction safety risk alias dictionary to provide data support for subsequent knowledge fusion;
[0024] S232. For unstructured data, a named entity recognition model integrating multiple semantic features is used for entity extraction;
[0025] S233. Use the R-BERT classification model based on ChatGPT data enhancement for relationship extraction.
[0026] As a further technical solution of the present invention, the working process of the deep learning model integrating multiple semantic features in step S232 is as follows:
[0027] S2321. The input corpus to be recognized enters the encoding embedding layer, and the word-level RoBERTa-wwm-ext pre-training model is introduced to obtain prior knowledge representation;
[0028] S2322. Design a word vector embedding method that integrates the building safety risk domain dictionary to meet the downstream domain characteristics, and fuse it with the character feature embedding that represents the radical information of Chinese characters to obtain a multi-semantic code embedding, which is represented in the form of a vector matrix;
[0029] S2323, extracting sequence feature information from the generated vector matrix via the BiGRU model in the context information extraction layer;
[0030] S2324: Perform reduced decoding through the CRF model in the label decoding layer, extract the sequence label with the highest probability and output it.
[0031] As a further technical solution of the present invention, the specific process of relationship extraction in step S232 is:
[0032] S2331. Use ChatGPT for data enhancement, and expand the training data through the designed prompt template and entity replacement technology. The prompt template design includes identity and intent settings, requirement statements, output settings, and example descriptions to guide ChatGPT to generate a diverse relational corpus. Entity replacement is to replace entities in the original corpus with labels based on pre-defined dictionaries and relation types to expand the training data.
[0033] S2332, preprocessing each input text sequence, including using special identifiers to mark the beginning and end of sentences, using [CLS] as the beginning of a sentence and [SEP] as the end of a sentence. At the same time, using "#" to indicate the head entity position and "$" to indicate the tail entity position to mark the entity position information of the relationship to be extracted;
[0034] S2333. Use the R-BERT model to extract sentence and entity features, and generate feature representations suitable for relationship classification through fully connected layer processing;
[0035] S2334. Perform a full connection operation on the feature representation, output the probability distribution of each relationship category through the softmax function, and select the relationship label corresponding to the highest probability to complete the relationship extraction task.
[0036] As a further technical solution of the present invention, the specific process of step S24 is:
[0037] S241, traverse the entity group elements, and traverse all elements in the current entity group;
[0038] S242, check the entity type. If the entity is of type "building", check whether the current entity is of type "building". If so, it means that the entity needs to be further matched with the alias dictionary, and go to step S243; if not, it means that the entity needs to be checked whether it contains numerical information, and go to S244;
[0039] S243, if the alias dictionary is matched successfully, check whether the entity name is matched successfully in the alias dictionary. If the match is successful, it means that the entity already has a corresponding standard name in the system and can be used directly. At this time, enter Step 2410. If the match is unsuccessful, it means that the entity may be new or needs further processing, enter S246;
[0040] S244, check whether the entity contains an entity type of numerical information, if yes, it means that the entity needs to be standardized, and go to S245, if no, it means that the entity does not need to be standardized, and go to S246;
[0041] S245, standardization processing, standardization processing is performed on the entity containing numerical information, and the standardization processing includes unit conversion and format unification operations. After the processing is completed, return to S241 to continue traversing the next entity;
[0042] S246, calculating the similarity with existing entities of the same type, calculating the similarity between the current entity and existing entities of the same type in the system, and determining whether there are duplicate or similar entities;
[0043] S247, checking whether the calculated similarity is greater than a set threshold, the threshold is a pre-set standard used to determine whether two entities are similar enough to be considered the same or similar, if the similarity is greater than the threshold, it means that the current entity is very similar to the existing entity, and enter S248, if the similarity is not greater than the threshold, it means that the current entity is very different from the existing entity, and enter S249;
[0044] S248, replace the current entity with an existing entity of the same type, and after the replacement is completed, return to S241 to continue traversing the next entity;
[0045] S249, check whether the current entity is the same as the existing entity, that is, confirm whether the two entities are exactly the same. If yes, it means that the current entity can directly replace the existing entity, and enter S248; if not, return to S241 to continue traversing the next entity;
[0046] S2410, check whether all entities have been traversed. If all entities have been checked and processed, go to 2411. If the traversal has not been completed, return to S241 to continue traversing the remaining entities.
[0047] S2411, check whether the entity group is a multi-tuple group, if yes, it means that the node alignment task needs to be performed, and go to S2412; if no, go to S2413;
[0048] S2412, perform node alignment task for entity groups that are tuples, first traverse all nodes in the knowledge graph, check whether entities in the tuple already exist in the graph, for each tuple, if its entity set has an overlap or inclusion relationship with the entity set of an existing tuple in the graph, merge the entities and relationships of the two, and store the merged result in the graph; if there is no overlap or inclusion relationship, store the tuple directly in the knowledge graph;
[0049] S2413. Save all processed entity information to the database for update operation to obtain an updated database.
[0050] As a further technical solution of the present invention, the specific process of step S25 is: use the Py2neo toolkit provided by Neo4j to batch import data, convert the extracted data into csv format, use the Node and Relationship methods to complete the creation of entities and relationships, and use the merge method to complete the import of nodes and edges, and store the data for backup.
[0051] Compared with the prior art, the present invention has the following beneficial effects:
[0052] (1) More data sources have been added, and the urban building safety risk knowledge graph has been constructed from both civil and industrial building aspects to enhance the completeness of the urban building safety risk knowledge graph. In addition, spatiotemporal data has been added to conduct in-depth analysis of the spatiotemporal characteristics of buildings.
[0053] (2) A special design is made for the two parts of knowledge extraction: entity extraction and relationship extraction. For entity extraction, a named entity recognition model for building safety risks that integrates multiple semantic features is proposed. For relationship extraction, an R-BERT classification model based on ChatGPT data enhancement is proposed to extract relationships, thereby improving the knowledge extraction performance.
[0054] (3) A method based on dictionary and similarity matching is proposed for knowledge fusion, which solves the problem of heterogeneous data fusion in the existing technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 A framework diagram for constructing the building safety risk knowledge graph described in the present invention.
[0056] Figure 2 A schematic diagram of the fire risk model layer in the urban building safety risk constructed for an embodiment of the present invention.
[0057] Figure 3 A schematic diagram of a fire risk map for urban building safety risks constructed in an embodiment of the present invention.
[0058] Figure 4 This is a flow chart of the method for constructing the urban building safety risk knowledge graph described in the present invention.
[0059] Figure 5 This is the knowledge fusion flow chart of the present invention. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0061] Example:
[0062] This embodiment provides a method for constructing a knowledge graph of urban building safety risks. For entity extraction in the construction process, a named entity recognition model that integrates multiple semantic features is proposed. For relationship extraction, an R-BERT classification model based on ChatGPT data enhancement is proposed to extract relationships, so as to improve the knowledge extraction performance. In addition, a method based on dictionary and similarity matching is proposed for knowledge fusion to solve the information fusion problem. The framework diagram of this method is shown in the figure below. Figure 1 As shown in the flowchart of steps Figure 4 As shown in the figure, the knowledge fusion flow chart is as follows Figure 5 As shown, this embodiment constructs a knowledge graph according to the fire risk in the urban building safety risk, and the specific implementation includes the following steps:
[0063] S1. Data type analysis. At present, most of the research on domain knowledge graphs focuses on extracting knowledge that is often concentrated on a specific type or several types of data, but cannot well reflect the generalization ability of the domain knowledge graph for other heterogeneous information in the field. The completeness of constructing a knowledge graph depends on the richness of the data source. The wider the data source, the more complete the constructed knowledge graph. Similarly, data in the field of building safety risks also have the characteristics of strong professionalism, diverse data structure, complex concepts, and multiple information carriers. In order to explore a complete and highly generalized knowledge graph construction technology, it is first necessary to ensure that the source of building safety risk information is diverse and comprehensive. Structured data mainly includes tabular information in regulatory documents and document data such as the National Standardization Administration; semi-structured data often carries certain naming tag information, and uses relevant tags to segment different semantic fields, including HTML web page data in Wikipedia and building-related websites. Structured data and semi-structured data can be used after a little processing; unstructured data has rich semantic information and data value. Compared with structured data, it has more complex implicit semantics and contextual information. It is also the focus and difficulty in the process of researching and building knowledge graphs. Unstructured data includes textbooks and technical books, popular science books, scientific research literature, and online forum articles.
[0064] This embodiment analyzes and constructs the following types of unstructured data: first, textbooks and technical books, which have standardized knowledge integration, complete content system and wide coverage, accurate description, contain a large number of professional terms and knowledge in the field of building safety risks, and are professional and authoritative. They can be used as the main content of building safety risk knowledge elements to ensure the quality of knowledge, but the disadvantages are that it is not convenient to obtain and use information, and the technology is not updated in time; second, popular science books, which have relatively specific language descriptions, tend to focus more on common building types for building safety risks, have relatively broad expressions, and involve relatively coarse granularity in the expression of safety parameters, and can be used as a knowledge supplement for constructing maps; third, scientific research literature, which is often highly theoretical, with complex professional terms and reflects The latest scientific research progress and research trends in the current field can provide updated and cutting-edge knowledge sources for the atlas. In order to ensure the efficiency of knowledge extraction, the extracted data is temporarily based on the abstract part of the literature; fourth, building safety literature is often concentrated in academic journals of architecture and engineering, such as "Building Safety", "Journal of Architecture" and other journals in the columns of safety specifications, building structure safety, etc.; fifth, online forum articles have clear themes, are relatively short and fragmented, and the description of building safety risks is relatively informal, requiring later knowledge integration to complete data standardization. Because of its lack of authoritative endorsement, it can be used as supplementary data in the extraction and construction process. This type of data includes, for example, building safety forums, building safety communities, public account articles, etc.
[0065] S2. Overall construction framework. In the field of building safety risks, based on the existing background and existing problems, combined with the data characteristics analyzed above, a knowledge graph framework for building safety risks is constructed. The construction of the knowledge graph requires reasonable modeling of domain data, and ultimately completes efficient storage of knowledge through a variety of data acquisition methods and efficient and adaptive extraction models. Common knowledge graph construction processes are divided into two methods: top-down and bottom-up. The top-down method completes the model layer design from the perspective of ontology construction, and then uses the model information of the ontology to complete knowledge extraction from existing data. It is suitable for the construction of domain knowledge graphs with high professionalism and clear knowledge scope. Due to the professional knowledge and domain characteristics in the field of building safety, it is decided to adopt a top-down approach to complete the knowledge graph construction. The specific construction process includes the following steps:
[0066] S21. Through the analysis of semantic concepts in the field of building safety, the ontology construction method is used to complete the construction of the knowledge graph model layer;
[0067] S22, acquiring and preprocessing unstructured data;
[0068] S23, complete knowledge extraction according to the ontology concept of the pattern layer, knowledge extraction includes entity extraction and relationship extraction;
[0069] S24, integrating the knowledge data extracted in step S23, eliminating redundant information, and realizing entity alignment based on dictionary and similarity matching, completing knowledge fusion, and obtaining multivariate data after knowledge fusion;
[0070] S25. Store the multivariate data after knowledge fusion in the Neo4j graph database to achieve persistent storage of data and provide business needs and data support for subsequent knowledge iteration and complex semantic query.
[0071] Specifically, in step S21, the model layer mainly completes the semantic standardization of professional terms, eliminates the ambiguity of the same concept in different data sources, extracts concepts in domain knowledge and the relationships between them, and completes the constraints on the data layer knowledge extraction, so that knowledge is more formalized and standardized, which is convenient for humans and computers to better understand and process information. This embodiment refers to the design ideas of the Stanford ontology construction seven-step method, and asks for suggestions from experts in related fields such as building safety researchers and corporate experts. The model layer is constructed by abstracting and summarizing the content in the field of building safety risks. This embodiment constructs the urban building fire risk knowledge graph model layer, and stores the constructed knowledge graph entity and relationship data based on the designed triple pattern based on the Neo4j graph database. Figure 2This is a schematic diagram of the model layer of the constructed urban building fire risk knowledge graph. The constructed urban building fire risk knowledge graph model layer includes 7 types of entities, including fire location, fire cause, incident time, extinguishing time, fire event, fire consequence level, and improvement measure category, and 12 types of relationships, including, including, located, incident, extinguishing, duration, taking, leading to, deciding, affecting, causing, reflecting, and targeting. There are also 2 types of attributes, including specific address and fire name. The formatted data is stored in the Neo4j graph database in the form of triples to complete the construction of the knowledge graph.
[0072] Specifically, since relatively few structured and semi-structured data in this field are published, it is also difficult to obtain them. Therefore, this embodiment mainly uses unstructured data to construct a knowledge graph. In step S22, for unstructured data, this crawls the abstracts of the literature in the architectural safety column of journals such as the "Journal of Architecture" in the CNKI database. In addition, the PaddleOCR open source technology framework based on deep learning is used to complete the text format conversion of the "General Code for Building Fire Protection" and "Fire Accident Investigation Report". The support of multi-source data ensures the comprehensiveness of domain knowledge, and then performs data cleaning on the acquired data, such as unifying the format, converting illegal characters that are incorrectly recognized by OCR, clearing spaces, filtering irrelevant texts, and screening valid text data that can constitute the corpus. A total of 170,000 words of unstructured text are obtained for further knowledge extraction.
[0073] Specifically, in step S23, knowledge extraction is divided into entity extraction and relationship extraction. First, entity extraction is performed. This embodiment adopts a named entity recognition model that integrates multi-feature semantics to complete the entity extraction task. The named entity recognition model that integrates multiple semantic features is divided into a three-layer structure, namely, a coding embedding layer, a context information extraction layer, and a label decoding layer. The input corpus to be recognized first enters the coding embedding layer, and the word-level RoBERTa-wwm-ext pre-training model is introduced to obtain prior knowledge representation to avoid the influence of poor model recognition effect caused by small sample data training; then the word vector embedding method integrating the urban building fire field dictionary is designed to further meet the downstream field characteristics, and is integrated with the character feature embedding representing the radical information of Chinese characters to obtain multi-semantic coding embedding, and then the generated vector matrix is subjected to the BiGRU model in the context information extraction layer to extract sequence feature information, and finally is subjected to the CRF model in the label decoding layer for reduced decoding, and the sequence label with the highest probability is extracted and output. The specific process includes the following steps:
[0074] S231: In the encoding embedding layer, a pre-trained model is first embedded. The Transformer-based pre-trained model is used as an unsupervised deep bidirectional language representation model. It is trained using hundreds of millions of large-scale unlabeled text corpora to obtain relevant language prior knowledge and context information. The trained ultra-large-scale parameters are used to form an embedded representation of character semantics. The pre-trained model is used for downstream named entity recognition tasks through fine-tuning, which greatly alleviates the dependence on large-scale labeled data and reduces the computing power cost of downstream tasks. The captured massive language features are used to improve the accuracy of entity boundaries and recognition types, and further enhance the context understanding ability of the extraction model. In this embodiment, the RoBERTa-wwm-ext pre-trained model is introduced in the encoding embedding layer, which makes full use of the associated semantics of the context, learns rich feature representation information, and can solve the representation of word polysemy in different contexts. For example, in the text of a building fire investigation report, "8:15 on March 11, 2011" may be expressed as the time of fire or the time of fire extinguishing in different contexts. Compared with the BERT model, the RoBERTa-wwm-ext model uses a multi-layer bidirectional Transformer structure while adopting a larger amount of corpus for training, optimizing internal hyperparameters, and adopting a dynamic masking mechanism to enable the model to better learn global features during training. Due to the characteristics of the Chinese corpus, RoBERTa-wwm-ext abandons the masking operation based on word granularity, fully considers the characteristics of Chinese word segmentation, and adopts a whole word mask (Whole Word Mask, WWM) strategy, that is, masking each character in the word, thereby enhancing the Chinese word-level feature information in the original character embedding. In the model of this embodiment, the RoBERTa-wwm-ext model that integrates large-scale prior knowledge is used to extract text features. It consists of 12 layers of Transformer, and a multi-head attention mechanism is introduced in each layer of Transformer. For a given input sentence sequence s={c1,c2,…,c n}, each layer integrates context information, and fine-tunes the model according to the actual corpus during training. The [CLS] label and [SEP] label are added to the beginning and end of the sentence, and the pre-trained embedding vector sequence of the target sentence is obtained as {E b0 ,E b1 ,…,E bn ,E bn+1}, where n represents the number of characters in the original sentence, E b is the embedded vector representation obtained by RoBERTa-wwm-ext.
[0075] S232, the remaining three methods of the encoding embedding layer are implemented as follows:
[0076] First, word vector feature embedding is performed. In order to avoid the Out-if-vocabulary (OOV) error that is easy to occur in Chinese word segmentation and to ensure that the model can fully understand the rich entity information contained in Chinese words, this embodiment further embeds word vector features to improve the semantic analysis ability of the model. In the named entities in the field of urban building fires, entity types such as fire causes and improvement measures contain many professional terms, but the prior knowledge that only benefits the pre-training model cannot achieve good results, and the extraction performance in professional fields needs to be improved. Therefore, this embodiment adopts the improved SoftLexicon method and integrates the urban building fire field dictionary to generate word vector feature embedding. First, the Word2vec unsupervised model is used to train the professional field dictionary under the urban building fire corpus, and a field dictionary retrieval tree is formed for this. For the input sentence sequence s={c1,c2,…,c n}, where each character c i The maximum positive matching strategy is adopted to complete the vocabulary matching of the domain dictionary retrieval tree. For each character c to be matched i Construct 4 word sets B, M, E, S, which represent the characters c in the word elements in the set respectively. i Located at the beginning, middle, end or a single word. If the set is empty, it is represented by {"None"}. After matching and generating the word set of each character, the feature vector of each word set of the character is calculated by weighted average. The calculation formula is as follows:
[0077]
[0078] Where ω is the word element of word set B (same for word sets M, E, S), z(ω) represents the word frequency, e ω (ω) is the word vector corresponding to ω, and Z is the sum of the frequencies of the four types of words corresponding to ω. The calculation formula of Z is as follows:
[0079]
[0080] Finally, the character c i The corresponding word set vectors are concatenated to complete the word vector embedding and obtain the word feature E with domain knowledge characteristics. wi :
[0081] E wi =[v i (B);v i (M); v i (E); v i (S)] (3)
[0082] This method not only effectively integrates the semantic information related to each character and the position information in the word, but also reduces the noise interference of incorrect word segmentation in the field, greatly making up for the problem of difficult recognition of proper nouns in the field of urban building fires.
[0083] Secondly is character feature embedding. From the perspective of text data in the field of urban building fires, this embodiment further mines the semantic information in character features. Compared with English, the literal meaning contained in the radicals of Chinese characters can make the character information more accurately expressed. Generally, the radical expresses the most basic meaning of the Chinese character, and the literal meanings of the same radicals are similar. In the entities of building fires, for example, for "lin" (淋), "pao" (泡), etc., their radical is "氵", belonging to fire extinguishing tools; for "zhu" (柱), "liang" (梁), etc., their radical is "mu" (木), belonging to building components. This embodiment integrates the radical information at the character granularity in the embedding layer to enhance the semantic embedding in the feature space. First, the present invention uses the Chinese character code table as the radical comparison dictionary. For the input sentence sequence s = {c1, c2, …, c n}, radical feature mapping is performed. Then, the mapped sequence is used with the word2vec model that has learned radical information to obtain radical vectors, and then the context features are extracted through a fully connected layer. The calculation formula is as follows:
[0084] (x1, x2, …, x n ) = feature_dic(c1, c2, …, c n ) (4)
[0085] (r1, r2, …, r n ) = word2vec rad (x1, x2, …, x n ) (5)
[0086] (e1, e2, …, e n ) = dense(r1, r2, …, r n ) (6)
[0087] Where x i is the radical representation of the character, feature_dic is the radical comparison dictionary, c i is the input character, word2vec rad represents the word vector model trained with radical features, r i represents the feature embedding of x i , e i represents the finally output radical feature vector, and dense represents the fully connected operation. Through the above operations, the semantic embedding at the character granularity is completed.
[0088] Then, multi-feature fusion is performed. The character embedding obtained by the RoBERTa-wwm-ext pre-training model, the word vector embedding of the building fire domain dictionary, and the character feature embedding are spliced. The calculation formula is as follows, where ⊕ represents splicing:
[0089]
[0090] The encoding embedding layer integrates large corpus prior knowledge, domain knowledge, and word information, which expands the feature space while making great use of the semantic information of Chinese domain data, further improving the ability of entity extraction.
[0091] S233, after the fusion of multiple semantic features and embedding, in the context information extraction layer, in order to further capture the context information and long-distance semantic dependencies of the sentence, this embodiment adopts BiGRU (Bidirectional Gate Recurrent Unit) for modeling. The gated recurrent unit (Gated Recurrent Unit, GRU) is similar to the long short-term memory neural network (Long Short Term Memory, LSTM), and selects the data flow direction through gating. However, unlike the three-gate structure of LSTM, GRU adopts a double-gate structure of update gate and reset gate, combines the forget gate and input gate into an update gate, and mixes the cell state and hidden state. This simplifies the model structure and reduces the computational complexity, while effectively solving the problems of gradient vanishing and gradient explosion. In the internal structure of the GRU unit, t and r t Represent the update gate and reset gate respectively, x t represents the input vector at time t, h t-1 represents the hidden state at the previous moment, i.e., t-1. represents the candidate hidden state at time t, h t is the hidden state at time t, and the GRU forward propagation formula is as follows:
[0092] r t =σ(W r ·[h t-1 ,x t ]) (8)
[0093] z t =σ(W z ·[h t-1 ,x t ]) (9)
[0094]
[0095] Where W r , W z , represents the weight matrix of the activation function σ, tanh is the hyperbolic tangent activation function, and * represents the Hadamard product. It can be seen that GRU uses a gating mechanism to adjust the current input x t and the previous hidden state h t-1 , dynamically adjust the retention and update of information to effectively capture the dependencies of sequence data. In order to capture the context information of the text in the named entity recognition process, this embodiment adopts a BiGRU model composed of a forward GRU network and a backward GRU. The sequence E is obtained by processing the encoding embedding layer. emb ={E1,E2,…,E n}, after BiGRU context information extraction, the sequence H is obtained ext ={h1,h2,…,h n}, for each E i The obtained feature vector h i The calculation expression is as follows:
[0096]
[0097]
[0098]
[0099] in and Respectively represent E i The hidden layer state of the previous information and the following information, Indicates splicing.
[0100] S234. Although the BiGRU model in the context extraction layer can learn context information and select the label with the highest probability as output, it is relatively independent as the probability value of entity recognition and cannot learn the constraints of the output sequence labeling. Therefore, the CRF probability model is needed in all decoding layers to solve it. Since the output of the BiGRU module may have the I-food prediction label as the entity header, or a sequence that is contrary to the grammatical structure such as I-method immediately following B-food, there are no relevant constraints under the BMES labeling system. For example, the prediction label of the first character of the entity must be B-xxx, and the label_a type M-label_b prediction label cannot appear after the label_b type M-label_b. In this regard, the CRF model is used in the label decoding layer to learn the dependency constraints of the previous and next labels. The deviation of the emission score of the previous layer is corrected by the transfer score, and the probability of invalid labels is reduced, thereby calculating the prediction label with the highest probability value. Specifically, the prediction label sequence corresponding to the input sentence S is Y = {y1, y2, ..., y n}, the score of the label sequence is calculated according to the following formula:
[0101]
[0102] in Represents the label y i Move to label y i+1 The transfer score, Indicates that character i is predicted to have label y i The probability value is then used to generate the conditional probability for all possible labels through the softmax function, as shown in Formula 16:
[0103]
[0104] in is the true label sequence, Y S is the tag set, and the Viterbi algorithm is used to calculate the optimal tag sequence y with score S * , and finally obtain the best predicted annotation sequence corresponding to the input text, thus completing the task of entity extraction:
[0105]
[0106] It should be noted that, since the first layer in this embodiment includes many technologies, it is implemented in two steps.
[0107] S235. After entity extraction is completed, relationship extraction is performed. The relationship extraction constructed by the pattern layer can be regarded as a classification problem for relationship types. Therefore, this embodiment completes the relationship extraction through the classification model based on R-BERT, and adopts the ChatGPT data enhancement method to increase the training samples to further improve the accuracy and generalization of classification, including the following steps:
[0108] Step 1, data enhancement. Among the predefined 12 types of relationships, since the knowledge samples of the two types of relationships "duration" and "impact" in the corpus are relatively small compared with other types of relationships, the data distribution is uneven, and the descriptive sentences are relatively fixed, this may prevent the model from fully acquiring the type features, resulting in poor recognition of these types of texts. In order to compensate for the impact of other long-tail types of relationships, this embodiment proposes a domain data enhancement method based on ChatGPT to expand the training data. Specifically, ChatGPT shows strong capabilities in natural language understanding and text generation. At the same time, prompt engineering can guide large language models to complete different scenario requirements. Accurate and clear prompts can improve the model. In order to improve the task performance, the data enhancement module first combines ChatGPT with the original corpus text, and uses the designed prompt template to allow the large model to fully understand the task intent. This embodiment divides the prompt elements into four types in order: the first is the identity and intent setting, which controls the semantic style of the reply by clarifying the identity of ChatGPT and indicates the intent, thereby limiting the diversity of the generated text; the second is the requirement statement, which requires specific tasks and explains which specific relationship types need to be enhanced; the third is the output setting, which standardizes the output format to facilitate subsequent data processing and model training; the fourth is the example description, which uses examples to further understand the instruction information. This embodiment uses the real data in the original corpus, and replaces the head and tail entities of the corresponding relationship with labels as examples to help understand. After the various data templates generated by ChatGPT, a dictionary is formed according to the different types of entity extraction before, and random entity replacement is performed according to the labels in the template. Different semantic templates can be replaced by multiple entities to form a richer enhanced corpus, and these data formed by the data enhancement module can better capture the key information of the sentence when training the classification model.
[0109] Step 2: R-BERT relation classification. For the input text sequence, the R-BERT model can be used to generate semantically rich feature vectors, thereby improving the effect of relation extraction. However, it is different from the role of the pre-trained model in the entity extraction task. It not only obtains the semantic information of the sentence, but also combines the entity and entity location information to predict the relation classification through the feature vector.
[0110] The input information of the extraction model includes the text of the entity and the head and tail entity information of the relationship to be extracted. During data preprocessing, special identifiers are used to represent the two entity positions of the relationship to be determined, where the entity position is represented by "#" before and after, and the tail entity position is represented by "$" before and after. [CLS] is used as the beginning of the sentence and [SEP] is used as the end of the sentence. Then, the R-BERT model extracts the sentence information features, entity semantic features, and entity position information, and divides the extracted feature vector H into three parts, of which the first part is the implicit state vector H of the [CLS] label. cls , and the other two parts are the implicit state vectors H of the head and tail entities i ~H j , H k ~H m For H0, the activation function and full connection operation are performed. Since Chinese entities are generally composed of multiple characters, each vector in the entity is arithmetic averaged and then subjected to the activation function and full connection operation. The calculated vector outputs are H c ' ls , H e '1, H e '2, the calculation formula is as follows:
[0111] H' cls =W cls (tanh(H cls ))+b cls (18)
[0112]
[0113] Then H c ' ls , H e '1, H e '2 After concatenation, the probability prediction of relationship classification is completed through softmax:
[0114] H”=W H” (concat(H c ' ls ,H e '1,H e '2))+b H” (twenty one)
[0115] p=softmax(H”) (22)
[0116] Finally, the relationship label corresponding to the maximum probability is selected according to the p value.
[0117] Specifically, in the knowledge fusion process of step S24, this embodiment adopts a knowledge fusion method based on dictionary and similarity matching. After the relationship extraction task, the entities are divided into two categories: entity pairs and multi-groups. After the entities identified in the multi-group have passed the entity alignment task, it is necessary to additionally determine whether there is redundant multi-group information to complete the node alignment task, that is, to eliminate relationship redundancy. First, input the entities in the group in turn to determine their types. If the input entity is of the "building" type, match and search it using the alias dictionary in the field of building fire risk. If found, replace it according to the main name in the dictionary. If not found, enter the similarity matching calculation. For entity types containing numerical information, standardization is required, that is, the entity content is unified into: (description) + numerical range + unit / %, and if it is the same as the updated entity expression, it is regarded as the same entity; for data in the field of building fire risk, a large proportion of redundant information can be eliminated by aligning the above two types of entities. Therefore, for the remaining types of entities, the present invention adopts a fast and effective cosine similarity algorithm to match the similarity between entities, and uses the tfidf tool in sklearn to complete the vectorized representation of the entity vocabulary level, and calculates the cosine similarity S between it and each entity of the same type in the graph in turn. The calculation formula is as follows:
[0118]
[0119] Where E and X represent the word vectors of the entity, n represents the vector dimension, and e i and x i They represent the i-th component of E and X respectively. The larger the S is, the stronger the cosine similarity of the two vectors is, that is, the closer the semantics of the two entities are. The entity that exceeds the set threshold and has the largest value is selected as the fusion object, otherwise it is selected as a new entity if the matching fails. The above process is repeated in sequence to complete the entity alignment task within the group. Since there may be certain errors in the above processing, in order to ensure accuracy, after the end of the cycle, it should be verified whether the unmatched entity needs entity alignment. If it is an entity in the entity pair, after completing the entity alignment task, a new triple is obtained or linked to an existing node in the graph to complete the database update. After knowledge fusion, the quality of knowledge elements is improved and storage space is saved. The data extracted by the model is divided into two categories: triples and multitudes as input items of the knowledge fusion method. The fusion process includes the retrieval of the alias dictionary in the field of building fire risk, vectorized similarity comparison, multitude set overlap, etc. It is stored in json format to facilitate character search and matching in the algorithm. At the same time, the cosine similarity threshold is set to 0.7. After the knowledge fusion method, a high-quality entity relationship group is obtained, and the redundancy of entity alignment is eliminated.
[0120] Specifically, in step S25, the Py2neo toolkit provided by Neo4j is used to batch import data, the extracted data is converted into csv format, and the Node, Relationship and other methods are used to complete the creation of entities and relationships. At the same time, the merge method is used to complete the import of nodes and edges. A total of 3358 entities and 5526 relationships are imported. Figure 3 A schematic diagram showing the knowledge graph of urban building fire risks.
[0121] The network structures, algorithms, etc. not described in detail herein are all common technologies in the art.
[0122] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A method for constructing a knowledge graph of urban building safety risks, characterized in that: Including data type analysis and overall framework construction, specifically: S1. Data type analysis: Select structured data, semi-structured data, and unstructured data for subsequent knowledge graph construction; S2. Overall construction framework: Based on the data obtained in step S1, a top-down approach is adopted to first build a model layer from the perspective of ontology construction, and then use the model information of the ontology to complete knowledge extraction from the existing data. The extracted knowledge data is then fused and stored to complete the construction of the knowledge graph.
2. The method for constructing the urban building safety risk knowledge graph according to claim 1 is characterized in that: The structured data includes the standard documents of the National Standardization Administration and the table information in the document data; the semi-structured data is information with certain naming tags, which uses relevant tags to separate different semantic fields, including Wikipedia and HTML web page data in architecture-related websites; the unstructured data includes textbooks and technical books, popular science books, scientific research documents, and online forum articles.
3. The method for constructing the urban building safety risk knowledge graph according to claim 2 is characterized in that: The specific process of step S2 is: S21. Through the analysis of semantic concepts in the field of building safety, the ontology construction method is used to complete the construction of the knowledge graph model layer; S22, acquiring and preprocessing unstructured data; S23, complete knowledge extraction according to the ontology concept of the pattern layer, knowledge extraction includes entity extraction and relationship extraction; S24, integrating the knowledge data extracted in step S23, eliminating redundant information, and realizing entity alignment based on dictionary and similarity matching, completing knowledge fusion, and obtaining multivariate data after knowledge fusion; S25. Store the multivariate data after knowledge fusion in the Neo4j graph database to achieve persistent storage of data and provide business needs and data support for subsequent knowledge iteration and complex semantic query.
4. The method for constructing the urban building safety risk knowledge graph according to claim 3 is characterized in that: The construction process of the knowledge graph model layer in step S21 is as follows: S211. Determine the fields and scope of the ontology, clarify the direction of model layer construction, and limit building safety knowledge to building design and building maintenance according to actual building needs and application scenarios, and exclude content related to building decoration and building material production; S212. Define various entities based on important terms and data characteristics in the field. For the concept of building, refer to the classification of buildings in building technology by the National Standardization Administration, and divide buildings into two categories according to safety characteristics: civil buildings and industrial buildings. For safety-related concepts, divide the knowledge in the field of building safety risks into multiple entity types based on the national building standard (GB) documents including the "General Code for Civil Buildings" and the "Building Fire Protection Code"; S213. Complete the definition of relationships based on the hierarchical concepts between entities, and fully describe the semantic network of the building safety risk field by determining the relationships between entities to obtain the knowledge graph model layer, where the relationships are the relationships between domain ontology concepts, expressed in binary first-order predicate logic, and described in the form of triples of <subject, relationship, object> in the knowledge graph.
5. The method for constructing the urban building safety risk knowledge graph according to claim 4 is characterized in that: The specific process of step S22 is: first crawl the literature abstract part of the building safety column of the "Journal of Architecture" journal in the HowNet database, and use the PaddleOCR open source technology framework based on deep learning to convert the text format of the "General Code for Building Fire Protection" and "Fire Accident Investigation Report". The comprehensiveness of domain knowledge is guaranteed through the support of multi-source data, and then the acquired data is cleaned. The cleaning work includes unifying the format, converting illegal characters that are incorrectly recognized by OCR, clearing spaces, filtering irrelevant text, and screening valid text data that can constitute the corpus, so as to obtain unstructured text for knowledge extraction.
6. The method for constructing the urban building safety risk knowledge graph according to claim 5 is characterized in that: The specific process of step S23 is: S231. For structured data and semi-structured data, entity groups are formed according to rule-based field mapping extraction. Specifically, the construction safety risk alias fields in the "Architecture Network" and "Construction Bao" construction websites are obtained through Scrapy crawler technology, and the alias fields are constructed into a construction safety risk alias dictionary to provide data support for subsequent knowledge fusion; S232. For unstructured data, a named entity recognition model integrating multiple semantic features is used for entity extraction; S233. Use the R-BERT classification model based on ChatGPT data enhancement for relationship extraction.
7. The method for constructing the urban building safety risk knowledge graph according to claim 6 is characterized in that: The working process of the deep learning model integrating multiple semantic features in step S232 is as follows: S2321. The input corpus to be recognized enters the encoding embedding layer, and the word-level RoBERTa-wwm-ext pre-training model is introduced to obtain prior knowledge representation; S2322. Design a word vector embedding method that integrates the building safety risk domain dictionary to meet the downstream domain characteristics, and fuse it with the character feature embedding that represents the radical information of Chinese characters to obtain a multi-semantic code embedding, which is represented in the form of a vector matrix; S2323, extracting sequence feature information from the generated vector matrix via the BiGRU model in the context information extraction layer; S2324: Perform reduced decoding through the CRF model in the label decoding layer, extract the sequence label with the highest probability and output it.
8. The method for constructing the urban building safety risk knowledge graph according to claim 7 is characterized in that: The specific process of relationship extraction in step S232 is as follows: S2331. Use ChatGPT for data enhancement, and expand the training data through the designed prompt template and entity replacement technology. The prompt template design includes identity and intent settings, requirement statements, output settings, and example descriptions to guide ChatGPT to generate a diverse relational corpus. Entity replacement is to replace entities in the original corpus with labels based on pre-defined dictionaries and relation types to expand the training data. S2332, preprocessing each input text sequence, including using special identifiers to mark the beginning and end of sentences, using [CLS] as the beginning of a sentence and [SEP] as the end of a sentence. At the same time, using "#" to indicate the head entity position and "$" to indicate the tail entity position to mark the entity position information of the relationship to be extracted; S2333. Use the R-BERT model to extract sentence and entity features, and generate feature representations suitable for relationship classification through fully connected layer processing; S2334. Perform a full connection operation on the feature representation, output the probability distribution of each relationship category through the softmax function, and select the relationship label corresponding to the highest probability to complete the relationship extraction task.
9. The method for constructing the urban building safety risk knowledge graph according to claim 8 is characterized in that: The specific process of step S24 is: S241, traverse the entity group elements, and traverse all elements in the current entity group; S242, check the entity type. If the entity is of type "building", check whether the current entity is of type "building". If so, it means that the entity needs to be further matched with the alias dictionary, and go to step S243; if not, it means that the entity needs to be checked whether it contains numerical information, and go to S244; S243, if the alias dictionary is matched successfully, check whether the entity name is matched successfully in the alias dictionary. If the match is successful, it means that the entity already has a corresponding standard name in the system and can be used directly. At this time, enter Step 2410. If the match is unsuccessful, it means that the entity may be new or needs further processing, enter S246; S244, check whether the entity contains an entity type of numerical information, if yes, it means that the entity needs to be standardized, and go to S245, if no, it means that the entity does not need to be standardized, and go to S246; S245, standardization processing, standardization processing is performed on the entity containing numerical information, and the standardization processing includes unit conversion and format unification operations. After the processing is completed, return to S241 to continue traversing the next entity; S246, calculating the similarity with existing entities of the same type, calculating the similarity between the current entity and existing entities of the same type in the system, and determining whether there are duplicate or similar entities; S247, checking whether the calculated similarity is greater than a set threshold, the threshold is a pre-set standard used to determine whether two entities are similar enough to be considered the same or similar, if the similarity is greater than the threshold, it means that the current entity is very similar to the existing entity, and enter S248, if the similarity is not greater than the threshold, it means that the current entity is very different from the existing entity, and enter S249; S248, replace the current entity with an existing entity of the same type, and after the replacement is completed, return to S241 to continue traversing the next entity; S249, check whether the current entity is the same as the existing entity, that is, confirm whether the two entities are exactly the same. If yes, it means that the current entity can directly replace the existing entity, and enter S248; if not, return to S241 to continue traversing the next entity; S2410, check whether all entities have been traversed. If all entities have been checked and processed, go to 2411. If the traversal has not been completed, return to S241 to continue traversing the remaining entities. S2411, check whether the entity group is a multi-tuple group, if yes, it means that the node alignment task needs to be performed, and go to S2412; if no, go to S2413; S2412, perform node alignment task for entity groups that are tuples, first traverse all nodes in the knowledge graph, check whether entities in the tuple already exist in the graph, for each tuple, if its entity set has an overlap or inclusion relationship with the entity set of an existing tuple in the graph, merge the entities and relationships of the two, and store the merged result in the graph; if there is no overlap or inclusion relationship, store the tuple directly in the knowledge graph; S2413. Save all processed entity information to the database for update operation to obtain an updated database.
10. The method for constructing the urban building safety risk knowledge graph according to claim 9 is characterized in that: The specific process of step S25 is: use the Py2neo toolkit provided by Neo4j to batch import data, convert the extracted data into csv format, use the Node and Relationship methods to complete the creation of entities and relationships, and use the merge method to complete the import of nodes and edges, and store the data for backup.
Citation Information
Cited By
Shield construction typical risk knowledge graph construction method based on RoBERTa-WWM-ext-BiLSTM-CRF
CN120316315A
Chinese semantic matching enhancement method and system based on BAAI-bge model
CN120578756A
A Chinese semantic matching enhancement method and system based on a BAAI-bge model
CN120578756B
YOLO-OCR highway engineering quantity intelligent hooking system
CN120580714A
Multi-source heterogeneous model data standardized storage method and system based on graph database
CN121117245A