A method and device for constructing a knowledge graph of inland river collision avoidance rules
The knowledge map of inland river collision avoidance rules is constructed through reptile technology and supervision learning methods, which solves the problems of complexity and automated construction of inland river collision avoidance rules, realizes automatic retrieval and decision-making support, and improves ship safety and supervision efficiency.
Patent Information
- Application Number
- CN202210071927.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-21
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2042-01-21
AI Technical Summary
The existing technology cannot effectively build a knowledge map of inland river collision avoidance rules, resulting in frequent ship collisions, difficult to understand complex collision avoidance rules based on manual experience, and lack of automated retrieval and decision-making support.
The data on inland ship collision accidents are obtained by using crawler technology, and the knowledge elements in the form of triple are extracted using supervised learning methods to build a complex network structure, and combined with graph databases and visual output to realize the automatic construction and expansion of the knowledge graph of inland collision avoidance rules.
It realizes automatic search and query of inland river collision avoidance rules and automatic decision-making and collision avoidance behavior, improves the judgment and decision-making assistance capabilities of ship drivers and regulatory departments, and significantly improves the efficiency of building knowledge graphs.
Smart Images

Figure CN114443859B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence knowledge expression technology, and in particular to a method and device for constructing a knowledge graph of inland river collision avoidance rules. Background Art
[0002] Knowledge graphs have powerful semantic representation capabilities and can well represent the complex relationships of inland water traffic scenes. However, the research on the construction method of inland collision avoidance rules is still in a blank period. Most of the existing knowledge graph technologies are general knowledge graphs with simple relationship representation and obviously insufficient practicality. There are still few knowledge graphs for specific industries, especially inland shipping. The inland collision avoidance rules have many and complex clauses, which greatly rely on the driver's sailing experience to understand the inland collision avoidance rules. However, the level of drivers is uneven, which often causes ships to fail to comply with the rules well and lead to ship collisions. To address this problem, the use of knowledge graph technology to conduct qualitative and quantitative analysis of inland collision avoidance rules can help people automatically search and query inland collision avoidance rules, automatically decide on collision avoidance behaviors, and assist ship drivers and regulatory authorities in making judgments and decisions.
[0003] The construction of the knowledge graph of the Inland Waterway Collision Avoidance Rules mainly involves manually or automatically extracting entities, relationships, and attributes from unstructured data. Manual extraction is to extract knowledge by collecting and organizing relevant information from the inland waterway collision accident reports on the Inland Waterway Collision Avoidance Rules network. Automatic extraction uses information extraction technologies such as machine learning, artificial intelligence, and data mining to automatically extract the basic components of the knowledge graph from the data source. The cost of manual extraction is too high, and the automatic extraction of knowledge is currently a key research direction and a trend in the construction of knowledge graphs in the future. How to manually extract knowledge and information from the data source, including entity, relationship, and attribute extraction, is a problem that needs to be solved in the construction of the knowledge graph of the Inland Waterway Collision Avoidance Rules. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method and device for constructing a knowledge graph of inland river collision avoidance rules in response to the defects in the prior art, which can automatically search and query inland river collision avoidance rules, automatically decide on collision avoidance behaviors, and assist ship drivers and regulatory authorities in making judgments and decisions.
[0005] The technical solution adopted by the present invention to solve its technical problem is:
[0006] The present invention provides a method for constructing a knowledge graph of inland river collision avoidance rules, the method comprising the following steps:
[0007] Step 1: Obtain the inland river collision avoidance rules dataset, and use crawler technology to obtain the inland river ship collision accident dataset from the Internet;
[0008] Step 2: Use a supervised learning-based method to extract knowledge elements in the form of triples from the inland river collision avoidance rules dataset and the inland river ship collision accident dataset. The knowledge elements include entities, entity attributes, and entity relationships as the basic data for constructing the inland river collision avoidance rules knowledge graph, and process and fuse the extracted knowledge;
[0009] Step 3: construct entity node sets and entity attribute node sets with entities and entity attributes as nodes, construct edge sets with entity relationships or attribute relationships as edges, construct a complex network structure, form an initial inland river collision avoidance rule knowledge network, and store the inland river collision avoidance rule knowledge network in a graph database;
[0010] Step 4: Further expand the knowledge base and define knowledge reasoning rules to complete the construction of the knowledge graph of inland river collision avoidance rules;
[0011] Step 5: Use graph database storage software and programming language to visually output the knowledge graph of inland river collision avoidance rules.
[0012] Furthermore, the method for obtaining a data set in step 1 of the present invention specifically includes:
[0013] By accessing the official website of the Maritime Safety Administration to download the inland river collision avoidance rules dataset, the inland river ship collision accident dataset is obtained from the Internet using crawler technology; the dataset is organized and stored in the form of documents, and the jieba tool is used to segment the documents, and the TF-IDF technology is used to extract the core words and important words of the documents.
[0014] Furthermore, the method of extracting the core words and important words of the document using the TF-IDF technology in step 1 of the present invention specifically includes:
[0015] The TF-IDF technology is used to extract the core words and important words of the document. The TF-IDF algorithm uses two parameters, TF and IDF, to calculate the feature weight. For the feature word t in the data set text obtained by the crawler and the inland river collision avoidance rule text f j The feature weight calculation formula is as follows:
[0016]
[0017] Where, N(tj) is the number of times tj appears in f; n is the number of feature words t in the inland river collision avoidance rules text;
[0018] Extract keywords and core words according to their weight values.
[0019] Furthermore, the method for extracting knowledge elements in step 2 of the present invention specifically includes:
[0020] Find the verb in the sentence, and combine the nouns before and after the verb in the sentence into a candidate triple, whose format is: (noun, verb, noun);
[0021] Similarity analysis is used to calculate the similarity between the relationship in the relationship library of the field to which the document belongs and the verb in the candidate triple. If the similarity is greater than the threshold, the verb is placed in the relationship library of the document, and the noun in the candidate triple is placed in the entity library of the document. At this time, the candidate (noun, verb, noun) triple is the formal entity, relationship and entity triple extracted from the document.
[0022] Furthermore, the method for extracting knowledge elements in step 2 of the present invention specifically includes:
[0023] Step 21, using the Softmax model, the conditional random field probability model of the entity noun is expressed as p(Y|X}) under all possible triples of verbs, that is, given the verb X in the triple, the probability of predicting the possible noun Y before and after, the calculation formula is as shown in formula (2), and the calculation formula of the logarithmic probability is as shown in formula (3); during training, the goal of the model is to maximize the logarithmic probability of the correct label sequence;
[0024]
[0025]
[0026] During prediction, the output triple sequence with the largest prediction loss can be obtained as follows:
[0027]
[0028] where Y X Triples representing all possible noun sequences for verb X;
[0029] Step 22: Perform similarity comparison analysis on the obtained triples. Assume that n triples are extracted from the inland river collision avoidance rules. For an input sentence X = (X1, X2, ..., X t ,...,X n ) in the t-th triple Xt,V k , and W t,k They represent the reference vector of the kth triplet and the similarity weight of the input triplet Xt to the reference vector respectively; the similarity weight is normalized to satisfy formula (5):
[0030]
[0031] The similarity scores of the input triples corresponding to the reference vectors of different label types are normalized to obtain the similarity weight that satisfies formula (6):
[0032]
[0033] Where l is the number of triplet labels, s(Xt,Vk) is the similarity score between the input triplet vector Xt and the reference triplet vector Vk;
[0034] Finally, the weighted representation of the relationship between the input triple vector Xt and different triple labels is finally expressed in the form of a vector:
[0035]
[0036] Where l is the number of triple labels, W t,k is the similarity weight, V k is a vector of three elements.
[0037] Furthermore, the method for forming an initial inland river collision avoidance rule knowledge network in step 3 of the present invention specifically includes:
[0038] Using protege software, the extracted triples are constructed into a complex knowledge network to form the initial inland river collision avoidance rules knowledge network. Entity node sets and entity attribute node sets are constructed with entities and entity attributes as nodes, and edge sets are constructed with entity relationships or attribute relationships as edges to form a preliminary knowledge graph.
[0039] Furthermore, the method of further expanding the knowledge base and defining knowledge inference rules in step 4 of the present invention specifically includes:
[0040] Based on the obtained triples, the similarity of the triples based on semantic information is further calculated to concatenate the triples to construct the knowledge graph of inland river collision avoidance rules;
[0041] Triple V i ,V j The similarity of semantic information is:
[0042]
[0043] Among them, Ti, Tj are the semantic information vectors of two triples, and the weighted graph G = {V, e|e ij =sim(Vi,Vj)}, label propagation is performed on the graph. If the size of the triple set is N(L), the propagation probability P of Vi,Vj is defined as:
[0044]
[0045] The propagation probability is propagated from high to low until the data of the constructed triple set is propagated completely, forming a complete knowledge graph of inland river collision avoidance rules.
[0046] Furthermore, the method in step 5 of the present invention specifically includes:
[0047] The knowledge graph of inland river collision avoidance rules is visually output using neo4j graph database storage software and HTML programming language.
[0048] The present invention provides a device for constructing a knowledge graph of inland river collision avoidance rules, comprising the following modules: an entity recognition processing module, a fusion processing module, a relationship strength index calculation module, a correlation construction module and a storage module;
[0049] An entity recognition processing module is used to perform entity recognition processing on the inland river collision accident to obtain an entity;
[0050] A fusion processing module, used for performing heterogeneous data fusion processing on the entity, so as to obtain an inland river collision avoidance rule knowledge graph entity;
[0051] A relationship strength index calculation module is used to calculate the relationship strength index between different entities in the inland river collision avoidance rules knowledge graph entity, and the relationship strength index is calculated using a normalized Google distance algorithm;
[0052] A correlation building module, used to build correlations between different entities in the inland river collision avoidance rules knowledge graph entities;
[0053] The storage module is used to save the inland river collision avoidance rules knowledge graph entities and the related relationships into a graph database.
[0054] The beneficial effects of the present invention are as follows: the method and device for constructing the knowledge graph of inland river collision avoidance rules of the present invention can automatically search and query the inland river collision avoidance rules, automatically decide on collision avoidance behaviors, and assist ship drivers and regulatory departments in making judgments and decisions. In terms of algorithms, the present invention uses an improved natural language processing word segmentation processing method and knowledge graph automatic construction path propagation technology, so that the machine can automatically segment the text of inland river collision avoidance rules and automatically construct the knowledge graph of inland river collision avoidance rules, which greatly improves the efficiency of knowledge graph construction compared to manual construction. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0056] Figure 1 This is a flow chart of the method for constructing the knowledge graph of inland river collision avoidance rules of the present invention;
[0057] Figure 2 This is a flow chart of knowledge extraction of inland river collision avoidance rules of the present invention;
[0058] Figure 3 A schematic diagram of a device for constructing a knowledge graph of inland river collision avoidance rules according to the present invention. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0060] The present invention proposes a method and device for constructing a knowledge graph of inland river collision avoidance rules. Figure 1 to Figure 2 This is an embodiment of the method and device for constructing a knowledge graph of inland river collision avoidance rules proposed by the present invention.
[0061] Reference Figure 1 , Figure 1 An embodiment of a method for constructing a knowledge graph of inland river collision avoidance rules according to the present invention includes:
[0062] S101 downloaded the "Regulations for Preventing Collisions on Inland Waterways" and its amendments from the official website of the Maritime Safety Administration, and used crawler technology to obtain a data set of inland waterway ship collision accidents from the Internet;
[0063] S102 uses a supervised learning-based method to extract knowledge elements in the form of triples from the "Inland River Collision Avoidance Rules" and inland river collision accidents. This knowledge element includes entities, entity attributes, and relationships between entities, which serve as the basic data for constructing the inland river collision avoidance rules knowledge graph, and processes and integrates the extracted knowledge;
[0064] S103 constructs an entity node set and an entity attribute node set with entities and entity attributes as nodes, constructs an edge set with entity relationships or attribute relationships as edges, constructs a complex network structure using machine learning methods, forms an initial inland river collision avoidance rule knowledge network, and stores the inland river collision avoidance rule knowledge network in a graph database
[0065] S104 uses neo4j graph database storage software and HTML programming language to visually output the knowledge graph of inland river collision avoidance rules.
[0066] Reference Figure 2 , Figure 2 An embodiment of a method for extracting knowledge of inland river collision avoidance rules according to the present invention comprises:
[0067] S201 organizes the data set and stores it in the form of documents. It uses the jieba tool to segment the documents and uses the TF-IDF technology to extract the core words and important words of the documents.
[0068] S202 constructs candidate triples with verbs as the core;
[0069] S203 uses similarity analysis to calculate the similarity between the relationship in the relationship library of the field to which the document belongs and the verb in the candidate triple. If the similarity is greater than a threshold, the verb is placed in the relationship library of the document, and the noun in the candidate triple is placed in the entity library of the document.
[0070] S204 At this time, the candidate (noun, verb, noun) triples are formal entities, relations, and entity triples extracted from the document; entity node sets and entity attribute node sets are constructed with entities and entity attributes as nodes, and edge sets are constructed with relations between entities or attribute relations as edges, so as to form a preliminary knowledge graph;
[0071] Reference Figure 3 , Figure 3 The schematic diagram of the device for constructing the knowledge graph of inland river collision avoidance rules of the present invention comprises:
[0072] The device for the inland river collision avoidance rule knowledge graph includes an entity recognition processing module, a fusion processing module, a relationship strength index calculation module, a related relationship construction module and a storage module;
[0073] S301 entity recognition processing module is used to perform entity recognition processing on the inland river collision accident, so as to obtain the entity;
[0074] S302 fusion processing module is used to perform heterogeneous data fusion processing on the entity, so as to obtain the inland river collision avoidance rule knowledge graph entity;
[0075] S303 relationship strength index calculation module is used to calculate the relationship strength index between different entities in the inland river collision avoidance rules knowledge graph entity, and the relationship strength index is calculated using the normalized Google distance algorithm;
[0076] S304 correlation building module is used to build correlations between different entities in the inland river collision avoidance rules knowledge graph entities;
[0077] The S305 storage module is used to save the inland river collision avoidance rules knowledge graph entities and the related relationships into the graph database.
[0078] It should be understood that those skilled in the art can make improvements or changes based on the above description, and all these improvements and changes should fall within the scope of protection of the appended claims of the present invention.
Claims
1. A method for constructing a knowledge graph of inland river collision avoidance rules. It is characterized in that The method comprises the following steps: Step 1: Obtain the inland river collision avoidance rules dataset, and use crawler technology to obtain the inland river ship collision accident dataset from the Internet; Step 2: Use a supervised learning-based method to extract knowledge elements in the form of triples from the inland river collision avoidance rules dataset and the inland river ship collision accident dataset. The knowledge elements include entities, entity attributes, and entity relationships as the basic data for constructing the inland river collision avoidance rules knowledge graph, and process and fuse the extracted knowledge; Step 3: construct entity node sets and entity attribute node sets with entities and entity attributes as nodes, construct edge sets with entity relationships or attribute relationships as edges, construct a complex network structure, form an initial inland river collision avoidance rule knowledge network, and store the inland river collision avoidance rule knowledge network in a graph database; Step 4: Further expand the knowledge base and define knowledge reasoning rules to complete the construction of the knowledge graph of inland river collision avoidance rules; Step 5: Use graph database storage software and programming language to visually output the knowledge graph of inland river collision avoidance rules; The method for extracting knowledge elements in step 2 specifically includes: Find the verb in the sentence, and combine the nouns before and after the verb in the sentence into a candidate triple, whose format is: (noun, verb, noun); Similarity analysis is used to calculate the similarity between the relationship in the relationship library of the field to which the document belongs and the verb in the candidate triple. If the similarity is greater than the threshold, the verb is placed in the relationship library of the document, and the noun in the candidate triple is placed in the entity library of the document. At this time, the candidate (noun, verb, noun) triple is the formal entity, relationship and entity triple extracted from the document. The method for extracting knowledge elements in step 2 specifically includes: Step 21, using the Softmax model, the conditional random field probability model of the entity noun is expressed as p(Y|X) under all possible triples of verbs, that is, given the verb X in the triple, the probability of the possible prediction of the previous and following nouns Y is calculated as formula (2), and the calculation formula of the logarithmic probability is as formula (3); during training, the goal of the model is to maximize the logarithmic probability of the correct label sequence; During prediction, the output triple sequence with the largest prediction loss can be obtained as follows: where Y X Triples representing all possible noun sequences for verb X; Step 22: Perform similarity comparison analysis on the obtained triples. Assume that n triples are extracted from the inland river collision avoidance rules. For an input sentence X=(X 1 ,X 2 ,...,X t ,...,X n ) in the t-th triple Xt,V k , and W t,k They represent the reference vector of the kth triplet and the similarity weight of the input triplet Xt to the reference vector respectively; the similarity weight is normalized to satisfy formula (5): The similarity scores of the input triples corresponding to the reference vectors of different label types are normalized to obtain the similarity weight that satisfies formula (6): Where l is the number of triplet labels, s(Xt,Vk) is the similarity score between the input triplet vector Xt and the reference triplet vector Vk; Finally, the weighted representation of the relationship between the input triple vector Xt and different triple labels is finally expressed in the form of a vector: Where l is the number of triple labels, W t,k is the similarity weight, V k is a vector of three elements.
2. The method for constructing the knowledge graph of inland river collision avoidance rules according to claim 1, It is characterized in that The method for obtaining the data set in step 1 specifically includes: By accessing the official website of the Maritime Safety Administration to download the inland river collision avoidance rules dataset, the inland river ship collision accident dataset is obtained from the Internet using crawler technology; the dataset is organized and stored in the form of documents, and the jieba tool is used to segment the documents, and the TF-IDF technology is used to extract the core words and important words of the documents.
3. The method for constructing the knowledge graph of inland river collision avoidance rules according to claim 2, It is characterized in that The method of extracting the core words and important words of the document using the TF-IDF technology in step 1 specifically includes: The TF-IDF technology is used to extract the core words and important words of the document. The TF-IDF algorithm uses two parameters, TF and IDF, to calculate the feature weight. For the feature word t in the data set text obtained by the crawler and the inland river collision avoidance rule text f j The feature weight calculation formula is as follows: Where, N(tj) is the number of times tj appears in f; n is the number of feature words t in the inland river collision avoidance rules text; Extract keywords and core words according to their weight values.
4. The method for constructing the knowledge graph of inland river collision avoidance rules according to claim 1, It is characterized in that The method for forming the initial inland river collision avoidance rule knowledge network in step 3 specifically includes: Using protege software, the extracted triples are constructed into a complex knowledge network to form the initial inland river collision avoidance rules knowledge network. Entity node sets and entity attribute node sets are constructed with entities and entity attributes as nodes, and edge sets are constructed with entity relationships or attribute relationships as edges to form a preliminary knowledge graph.
5. The method for constructing the knowledge graph of inland river collision avoidance rules according to claim 1, It is characterized in that The method of further expanding the knowledge base and defining knowledge inference rules in step 4 specifically includes: Based on the obtained triples, the similarity of the triples based on semantic information is further calculated to concatenate the triples to construct the knowledge graph of inland river collision avoidance rules; Triple V i ,V j The similarity of semantic information is: Among them, Ti, Tj are the semantic information vectors of two triples, and the weighted graph G = {V, e|e ij =sim(Vi,Vj)}, label propagation is performed on the graph. If the size of the triple set is N(L), the propagation probability P of Vi,Vj is defined as: The propagation probability is propagated from high to low until the data of the constructed triple set is propagated completely, forming a complete knowledge graph of inland river collision avoidance rules.
6. The method for constructing the knowledge graph of inland river collision avoidance rules according to claim 1, It is characterized in that The method in step 5 specifically includes: The knowledge graph of inland river collision avoidance rules is visually output using neo4j graph database storage software and HTML programming language.
7. The method for constructing the knowledge graph of inland river collision avoidance rules according to claim 1, It is characterized in that The method is implemented by a device for constructing a knowledge graph of inland river collision avoidance rules, comprising the following modules: an entity recognition processing module, a fusion processing module, a relationship strength index calculation module, a related relationship construction module and a storage module; An entity recognition processing module is used to perform entity recognition processing on the inland river collision accident to obtain an entity; A fusion processing module, used for performing heterogeneous data fusion processing on the entity, so as to obtain an inland river collision avoidance rule knowledge graph entity; A relationship strength index calculation module is used to calculate the relationship strength index between different entities in the inland river collision avoidance rules knowledge graph entity, and the relationship strength index is calculated using a normalized Google distance algorithm; A correlation building module, used to build correlations between different entities in the inland river collision avoidance rules knowledge graph entities; The storage module is used to save the inland river collision avoidance rules knowledge graph entities and the related relationships into a graph database.
