Method and device for constructing ship site supervision knowledge graph and electronic equipment

By constructing a knowledge graph for on-site ship supervision, the problem of low efficiency of traditional databases in on-site ship supervision has been solved, realizing information-based and intelligent decision support and improving the work efficiency of maritime law enforcement personnel.

CN115905563BActive Publication Date: 2026-03-03YANCHENG MARITIME SAFETY BUREAU OF THE PEOPLES +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211427336.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-15
Publication Date
2026-03-03
Estimated Expiration
2042-11-15

AI Technical Summary

Technical Problem

In the current technology, on-site ship supervision lacks information and intelligent means. Maritime law enforcement officers rely on experience and traditional database queries, resulting in low decision-making efficiency, data redundancy, and low query and analysis efficiency.

Method used

A knowledge graph for ship on-site supervision is constructed. By building an ontology model and knowledge base, entity fusion is judged using Jaccard coefficient, Jaro-Winkler similarity and uSIF similarity. Entity attribute completion and association alignment are performed to generate knowledge fusion data, which is finally mapped to the graph database.

Benefits of technology

It has enabled the informatization and intelligentization of ship safety supervision, assisting maritime law enforcement personnel in making efficient decisions during on-site inspections and improving data utilization efficiency and decision-making accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115905563B_ABST
    Figure CN115905563B_ABST
Patent Text Reader

Abstract

The application provides a ship field supervision knowledge graph construction method and device and electronic equipment, the method comprises the following steps: constructing an ontology model and a knowledge base of a ship field supervision knowledge graph, and extracting target project class entities from the knowledge base; determining to-be-fused entities in the target project class entities, and corresponding Jaccard coefficient similarity, Jaro-Winkler similarity and uSIF similarity; inputting the similarity into a knowledge fusion model to obtain a result of whether to fuse; the knowledge fusion model is obtained by training based on an XGBoosT model; in the case of needing to fuse, performing entity attribute completion and association alignment on the to-be-fused entities to obtain knowledge fusion data; and mapping the ontology model to the knowledge fusion data to obtain a ship field supervision knowledge graph. The application can assist maritime law enforcement personnel in decision-making in ship field inspection, and make ship safety supervision work informatized, intelligentized and specialized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge graph technology, specifically to a method, apparatus, and electronic device for constructing a knowledge graph for on-site ship monitoring. Background Technology

[0002] On-site vessel supervision refers to the routine safety supervision and spot checks conducted by maritime authorities on vessels and their related activities within their jurisdiction, also known as on-site vessel inspection or on-site vessel supervision inspection. It is one of the fundamental tasks of vessel safety supervision. A knowledge graph is composed of interconnected entities and their attributes; essentially, it is a semantic network, typically existing in the form of structured triples, and possesses rich semantic information. To some extent, knowledge graphs use graphs as a medium to organize and utilize large-scale data of different types, capable of expressing explicit general or domain-specific knowledge.

[0003] Currently, research on methods for constructing knowledge graphs for ship on-site supervision is still in its infancy, and methods from other vertical fields are not applicable to the field of ship on-site supervision. Ship on-site supervision is currently still largely reliant on traditional manual methods. Maritime law enforcement officers need to rely on experience and review extensive data to make decisions regarding ship safety during inspections. Before inspections, they often consult multiple databases to obtain information about the inspected vessel, but these traditional databases suffer from data redundancy and low query and analysis efficiency. Therefore, fully utilizing multi-source, heterogeneous ship on-site supervision business knowledge to construct a knowledge graph will compensate for the shortcomings of traditional databases, assist maritime law enforcement officers in making decisions during ship on-site inspections, and make ship safety supervision work more information-based, intelligent, and expert-oriented. Summary of the Invention

[0004] In view of this, it is necessary to provide a method, device and electronic equipment for constructing a knowledge graph for ship on-site supervision, so as to make up for the shortcomings of traditional databases, assist maritime law enforcement officers in making decisions during ship on-site inspections, and make ship safety supervision work more information-based, intelligent and expert-oriented.

[0005] To achieve the above objectives, the present invention provides a method for constructing a knowledge graph for ship on-site supervision, comprising:

[0006] An ontology model and knowledge base for a knowledge graph of ship on-site supervision are constructed, and target project entities are extracted from the knowledge base; the knowledge base includes entity names, relationships between entities, entity attribute names and attribute values;

[0007] Identify the entities to be merged in the target project class entities, and determine the Jaccard similarity, Jaro-Winkler similarity, and uSIF similarity corresponding to the entities to be merged;

[0008] The Jaccard similarity coefficient, the Jaro-Winkler similarity, and the uSIF similarity are input into a preset knowledge fusion model to obtain the result of whether the entities to be fused are fused; the knowledge fusion model is trained based on the XGBoosT model;

[0009] If it is determined that the entity to be merged needs to be merged based on the result of whether the entity to be merged is merged, entity attribute completion and association alignment are performed on the entity to be merged to obtain knowledge fusion data;

[0010] The ontology model is mapped onto the knowledge fusion data to obtain a knowledge graph for ship on-site supervision.

[0011] Furthermore, the ontology model and knowledge base for constructing the ship on-site supervision knowledge graph include:

[0012] Crawl shipping website data related to on-site ship supervision from the target website, as well as legal and regulatory data and historical inspection data related to on-site ship supervision;

[0013] The shipping website data is cleaned to form a shipping website data table; the legal and regulatory data is digitized and formatted to form a legal and regulatory data table; and the historical inspection data is cleaned to form a historical inspection data table.

[0014] Based on the shipping website data table, the legal regulations data table, and the historical inspection data table, the domain scope of the ship on-site supervision knowledge graph is determined. Within the domain scope, the entity hierarchy structure and entity relationship attributes are determined. Based on the entity hierarchy structure and entity relationship attributes, the ontology model is obtained.

[0015] Furthermore, the ontology model and knowledge base for constructing the ship on-site supervision knowledge graph also include:

[0016] Knowledge is extracted from the shipping website data table, the legal regulations data table, and the historical inspection data table to obtain the knowledge base.

[0017] Furthermore, based on the shipping website data table, the legal and regulatory data table, and the historical inspection data table, the domain scope of the ship on-site supervision knowledge graph is determined; within the domain scope, the entity hierarchy and entity relationship attributes are determined; and based on the entity hierarchy and entity relationship attributes, the ontology model is obtained, including:

[0018] Based on the shipping website data table, the legal and regulatory data table, and the historical inspection data table, as well as the preset concepts and business requirements for on-site ship supervision, the scope of on-site ship supervision is determined.

[0019] Within the scope of the aforementioned on-site ship supervision, determine the ontology concept classes and their attributes, as well as the relationships and attributes between ontology concept classes;

[0020] The ontology model is obtained by visualizing the ontology concept classes and their attributes, as well as the relationships and attributes between the ontology concept classes.

[0021] Furthermore, the step of extracting target project class entities from the knowledge base includes:

[0022] Based on the legal and regulatory data table and the historical inspection data table, a ship on-site supervision text is obtained; the ship on-site supervision text includes: the content of the clauses in the legal and regulatory data table and the content of the defects in the historical inspection data table;

[0023] The entities corresponding to the ship on-site supervision text are classified and fine-grained knowledge is extracted to obtain the target entities;

[0024] The ship on-site supervision text and the target entity are input into a preset entity recognition model to extract the semantic features of the ship on-site supervision text, and the globally optimal entity label sequence is determined based on the semantic features and the target entity. The target project class entity is obtained based on the globally optimal entity label sequence.

[0025] Furthermore, the entity recognition model includes:

[0026] The RoBERTa-wwm-ext embedding layer is used to determine the semantic features corresponding to the ship's on-site supervision text and output the low-dimensional feature vector corresponding to the semantic features.

[0027] The BiLSTM layer is used to obtain the label sequence probability matrix of each character based on the low-dimensional feature vector, and to infer and label the target entity based on the label sequence probability matrix.

[0028] The CRF layer is used to determine the globally optimal entity label sequence from the labeled target entities, and to obtain the target item class entity based on the globally optimal entity label sequence.

[0029] Furthermore, when it is determined that the entity to be fused needs to be fused based on the result of whether the entity to be fused has been fused, entity attribute completion and association alignment are performed on the entity to be fused to obtain knowledge fusion data, including:

[0030] If it is determined that the entities to be merged need to be merged based on the result of whether the entities to be merged are merged, and all the entities to be merged are entities of the first category, attribute completion is performed on each entity in the entities to be merged based on all the attributes corresponding to the entities to be merged, so as to obtain knowledge fusion data;

[0031] If it is determined that the entity to be fused needs to be fused based on the result of whether the entity to be fused is fused, and the entity to be fused contains a second category entity and a third category entity, an association relationship is added between the second category identification and the third category entity to obtain knowledge fusion data.

[0032] The present invention also provides an apparatus for constructing a knowledge graph for ship on-site supervision, comprising:

[0033] The construction module is used to build the ontology model and knowledge base of the ship on-site supervision knowledge graph, and extract target project class entities from the knowledge base; the knowledge base includes entity name, inter-entity relationship, entity attribute name and attribute value;

[0034] The similarity calculation module is used to identify entities to be merged in the target project class entities, and to determine the Jaccard similarity, Jaro-Winkler similarity, and uSIF similarity of the entities to be merged.

[0035] The fusion judgment module is used to input the Jaccard similarity coefficient, the Jaro-Winkler similarity, and the uSIF similarity into a preset knowledge fusion model to obtain the result of whether the entities to be fused are fused; the knowledge fusion model is trained based on the XGBoosT model;

[0036] The fusion module is used to perform entity attribute completion and association alignment on the entity to be fused when it is determined that the entity to be fused needs to be fused based on the result of whether the entity to be fused is fused, so as to obtain knowledge fusion data.

[0037] The knowledge graph production module is used to map the ontology model to the knowledge fusion data to obtain a knowledge graph for ship on-site supervision.

[0038] The present invention also provides an electronic device, including a memory and a processor, wherein,

[0039] The memory is used to store programs;

[0040] The processor, coupled to the memory, is used to execute the program stored in the memory to implement the steps in the method for constructing a ship on-site supervision knowledge graph as described above.

[0041] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for constructing a ship on-site supervision knowledge graph as described in any of the preceding claims.

[0042] The beneficial effects of adopting the above implementation method are as follows: The method, device, and electronic equipment for constructing a ship on-site supervision knowledge graph provided by the present invention construct an ontology model and knowledge base for the ship on-site supervision knowledge graph, extract target project class entities from the knowledge base, and then input the Jaccard similarity coefficient, Jaro-Winkler similarity, and uSIF similarity corresponding to the entities to be fused into a preset knowledge fusion model to determine whether they can be fused. If they can be fused, entity attribute completion and association alignment are performed on the entities to be fused to obtain knowledge fusion data. The ontology model is mapped to the knowledge fusion data to obtain the ship on-site supervision knowledge graph, which makes up for the deficiencies of traditional databases, assists maritime law enforcement personnel in decision-making during ship on-site inspections, and makes ship safety supervision work more information-based, intelligent, and expert-oriented. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 A flowchart illustrating an embodiment of the method for constructing a ship on-site supervision knowledge graph provided by the present invention;

[0045] Figure 2 This is a schematic diagram illustrating an embodiment of the relationship between entities in on-site ship monitoring provided by the present invention;

[0046] Figure 3 A schematic diagram of an embodiment of the fine-grained knowledge extraction method provided by the present invention;

[0047] Figure 4 This is a schematic diagram illustrating the process of constructing an ontology model according to an embodiment of the present invention;

[0048] Figure 5 This is a flowchart illustrating another embodiment of the method for constructing a ship on-site supervision knowledge graph provided by the present invention;

[0049] Figure 6 This is a schematic diagram illustrating the recognition effect of an embodiment of the entity recognition model provided by the present invention;

[0050] Figure 7This is a schematic diagram of the knowledge fusion effect corresponding to an embodiment of the method for constructing a knowledge graph for on-site ship supervision provided by the present invention;

[0051] Figure 8 This is a schematic diagram of an embodiment of the device for constructing a knowledge graph for on-site ship supervision provided by the present invention;

[0052] Figure 9 A schematic diagram of the structure of an embodiment of the electronic device provided by the present invention. Detailed Implementation

[0053] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0054] In the description of the embodiments of this application, unless otherwise stated, "a plurality of" means two or more.

[0055] In this embodiment of the invention, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, apparatus, product or device that includes a series of steps or modules is not necessarily limited to those steps or modules that are explicitly listed, but may include other steps or modules that are not explicitly listed or that are inherent to such process, method, product or device.

[0056] The naming or numbering of steps in the embodiments of the present invention does not mean that the steps in the method flow must be executed in the time / logical order indicated by the naming or numbering. The execution order of the named or numbered process steps can be changed according to the technical purpose to be achieved, as long as the same or similar technical effect can be achieved.

[0057] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0058] This invention provides a method, apparatus, and electronic device for constructing a knowledge graph for on-site ship monitoring, which will be described below.

[0059] like Figure 1As shown, the present invention provides a method for constructing a knowledge graph for ship on-site supervision, comprising:

[0060] Step 110: Construct the ontology model and knowledge base of the ship on-site supervision knowledge graph, and extract target project entities from the knowledge base; the knowledge base includes entity name, inter-entity relationship, entity attribute name and attribute value.

[0061] Understandably, this invention addresses the multi-source heterogeneous information in ship on-site supervision operations, including shipping website data, a large number of maritime administrative laws and regulations, and historical inspection records generated during enforcement. It utilizes information extraction technology to extract data from these multiple sources, performs knowledge extraction on the big data, and achieves knowledge association through a knowledge fusion model to construct a knowledge graph. Before constructing the knowledge graph, it is necessary to build an ontology model and a knowledge base for the knowledge graph.

[0062] For three types of knowledge sources—shipping websites, laws and regulations, and historical inspection data—information extraction technology is used to extract data, regular expressions are used for data cleaning, the concept of on-site ship supervision is extracted, and an ontology model is constructed.

[0063] Knowledge extraction is performed on the data obtained above to obtain a knowledge base containing entity names, relationships between entities, entity attribute names and attribute values.

[0064] The target project entity can be the project entity that needs to be inspected during on-site supervision and inspection of the ship. The target project entity can be defined according to the user's needs.

[0065] Step 120: Determine the entities to be merged in the target project class entities, and determine the Jaccard similarity, Jaro-Winkler similarity, and uSIF similarity corresponding to the entities to be merged.

[0066] It is understandable that in this embodiment, a neural network model is needed to determine whether entities to be fused can be fused, and this determination requires combining the Jaccard similarity coefficient, Jaro-Winkler similarity, and uSIF similarity of the entities to be fused.

[0067] Jaccard coefficient similarity (J S As the first feature input of the knowledge fusion model, it reflects the word segmentation structure features between entities. The Jaccard coefficient is the ratio of the number of intersecting elements to the number of union elements in two sets. Since most entities are composed of domain-specific vocabulary, Jaccard... S The expression represents the proportion of the same number of words in two entities e1 and e2 after removing stop words, as shown in formula (1).

[0068]

[0069] Jaro-Winkler similarity (JW) S This approach better reflects the characteristics of entity prefixes, serving as the second feature input to the model. The Jaro-Winkler algorithm, a variant of the Jaro algorithm, focuses more on the length l (0–4) of the prefix matching of entity pairs and adjusts the weight of prefix matching using a constant p (0–0.25). S As shown in formula (2).

[0070]

[0071] In the formula: m is the number of characters matched; t is half the number of transpositions; d j The final score for Jaro distance.

[0072] uSIF similarity (U S By mapping entities to low-dimensional space vectors to represent the semantic features of entities, the model's third feature input is used. uSIF proposes a random walk model based on angular distance, where the probability of word generation is inversely proportional to the angular distance between the word and sentence vectors. It is robust to the confounding effect of word vector length on sentence generation probability, as shown in formula (3). As shown in formula (4), the uSIF model generates vectors vec1 and vec2 of two entities, and calculates the cosine similarity between the vectors to obtain U S .

[0073]

[0074]

[0075] U S =cos(vec1,vec2) (4)

[0076] In the formula: c t Let v be the sentence vector at time t; w be the individual words; ... v be the sentence w is the word vector; p(w) is the generation probability of each word.

[0077] Step 130: Input the Jaccard similarity coefficient, the Jaro-Winkler similarity, and the uSIF similarity into the preset knowledge fusion model to obtain the result of whether the entities to be fused are fused; the knowledge fusion model is trained based on the XGBoosT (eXtreme Gradient Boosting) model.

[0078] Understandably, the objective function of the XGBoost model is given by equation (5):

[0079]

[0080] In the formula: The loss function Ω(f) measures the prediction accuracy by the difference between the actual and fitted values; i ) is a regularization function that can control complexity and improve the model's generalization ability.

[0081] This paper transforms knowledge fusion into a binary classification problem, dividing it into attribute completion and association alignment tasks. A knowledge fusion model based on entity similarity calculation is proposed. In knowledge fusion, there are only two possible outcomes: positive or negative. This is treated as a binary classification problem, i.e., knowledge fusion or non-fusion.

[0082] The XGBoost model was chosen as a binary classification model because XGBoost is an efficient and flexible mainstream decision tree algorithm. Its idea is to integrate multiple decision tree models to form a strong classifier.

[0083] Step 140: If it is determined that the entity to be merged needs to be merged based on the result of whether the entity to be merged is merged, perform entity attribute completion and association alignment on the entity to be merged to obtain knowledge fusion data.

[0084] Understandably, the knowledge base obtained above is fused using a machine learning-based method, which transforms the fusion problem into a binary classification problem. The knowledge fusion is then broken down into two tasks: entity attribute completion and association alignment. After fusion, the knowledge is represented as a triple and used as data for the ship on-site supervision knowledge graph.

[0085] Step 150: Map the ontology model to the knowledge fusion data to obtain a ship on-site supervision knowledge graph.

[0086] Understandably, the data of the ship on-site supervision knowledge graph is stored in the form of triples. The entities in the triples are stored as corresponding nodes, the relations are stored as corresponding edges, and the attributes and attribute values ​​are stored as the attributes and attribute values ​​of the corresponding nodes and edges. The ship on-site supervision knowledge graph is then constructed and stored in a graph database.

[0087] Specifically, the ontology model is mapped to the structured triple data obtained after knowledge fusion. The graph database Neo4j is used to store the structured triple data obtained through knowledge extraction and knowledge fusion steps. The entities in the triple are stored as corresponding nodes, the relations are stored as corresponding edges, and the attributes and attribute values ​​are stored as the attributes and attribute values ​​of the corresponding nodes and edges.

[0088] In some embodiments, the construction of the ontology model and knowledge base for the ship's on-site supervision knowledge graph includes:

[0089] Crawl shipping website data related to on-site ship supervision from the target website, as well as legal and regulatory data and historical inspection data related to on-site ship supervision;

[0090] The shipping website data is cleaned to form a shipping website data table; the legal and regulatory data is digitized and formatted to form a legal and regulatory data table; and the historical inspection data is cleaned to form a historical inspection data table.

[0091] Based on the shipping website data table, the legal regulations data table, and the historical inspection data table, the domain scope of the ship on-site supervision knowledge graph is determined. Within the domain scope, the entity hierarchy structure and entity relationship attributes are determined. Based on the entity hierarchy structure and entity relationship attributes, the ontology model is obtained.

[0092] It is understood that this embodiment is specifically as follows: web crawling technology is used to collect shipping website data, including data on ships, shipowners, ports, and inspection agencies. The websites include the official websites of various maritime bureaus, Shipxy.com, and ShipQuest.com.

[0093] Collect maritime laws and regulations, including national laws, administrative regulations, local regulations, and departmental rules;

[0094] Collect historical inspection data of ships on-site, including inspection location, date, agency, defects, and handling decisions;

[0095] The process of digitizing, standardizing, and formatting four types of maritime laws and regulations includes: 1) digitizing and formatting the legal texts to create a legal data table, with the specific format including basic information, scope of application, specific clauses, and detailed content of the laws and regulations; 2) cleaning semi-structured data from shipping websites, with the specific format including vessel name, length, beam, MMSI number, IMO number, port of registry, call sign, vessel type, shipowner's name, telephone number, email address, legal representative and port name, address, telephone number, inspection agency name, address, telephone number, postal code, inspector's name, enforcement certificate number, and work unit, creating a shipping website data table; and 3) cleaning historical on-site inspection data of vessels, with the specific format including inspection location, time, type, agency, inspector, inspected vessel, defects, and handling decisions, creating a historical on-site inspection record data table of vessels.

[0096] The knowledge of ship on-site supervision is represented using an RDF (Resource Description Framework) structure, with triples <s, p, o> describing the entities, attributes, and relationships of ship on-site supervision. Here, s (subject) is the subject, with an entity or relation as its value; p (predicate) is the predicate, with a relation or attribute as its value; and o (object) is the object, typically an entity or a simple value. <s, p, o> can indicate that s and o have a relationship p, or that s has attribute p with the value o. The ship on-site supervision ontology, as the schema layer of the knowledge graph, is an abstract expression of entities and their relationships, capable of organizing the hierarchical relationships and types of the knowledge graph. The ship on-site supervision ontology model is represented as O = (C, A, R), where C represents the entity corresponding to the concept set, A represents the attribute corresponding to the attribute set, and R represents the relation corresponding to the relation set.

[0097] In some embodiments, the ontology model and knowledge base for constructing a ship on-site supervision knowledge graph further include:

[0098] Knowledge is extracted from the shipping website data table, the legal regulations data table, and the historical inspection data table to obtain the knowledge base.

[0099] Understandably, the aforementioned legal and regulatory data tables, shipping website data tables, and historical ship inspection records data tables undergo knowledge extraction and are mapped into entities, relationships, attributes, and attribute values. The relationships between ship inspection entities are as follows: Figure 2 As shown.

[0100] Specifically, the clauses in the legal and regulatory data table are mapped to entities, and the clause content, scope of application, and basic information are mapped to entity attributes and attribute values. The relationship between laws and regulations and specific clauses is defined as the clause. The ship name, shipowner name, port name, inspection agency name, and inspector name in the shipping website data table are mapped to entities. The ship length, beam, MMSI number, IMO number, port of registry, call sign, and ship type are the ship name attributes and attribute values. The shipowner name entity's attributes include telephone number, email address, and legal representative; the port name entity's attributes include address and telephone number; the inspection agency name entity's attributes include address, telephone number, and postal code; and the inspector name entity's attributes include enforcement certificate number and work unit. The ship on-site supervision historical inspection record data table is mapped to entities: agency, inspector, inspected vessel, defect, and handling. The relationships between these entities are shown in the diagram below, and the inspection time, location, and type are mapped to attributes related to inspection, discovery, existence, decision, and action.

[0101] Fine-grained knowledge extraction was performed on the entity categories in the ship inspection documents (including clauses in laws and regulations and defects in historical inspection records). The inspection items were categorized into nine types: self-inspection status, certificates and documents, crew manning, ship appearance, port entry and exit reports, navigation and berthing operations, tax and fee payment, passenger and cargo transport, and ship pollution prevention. One type of label was added for non-entity items, for a total of ten labels. The BIO annotation method was used, where B represents the start of an entity, I represents the remainder of the entity, and O represents non-entity items. An example of fine-grained knowledge extraction is shown below. Figure 3 As shown.

[0102] In some embodiments, determining the domain scope of the ship on-site supervision knowledge graph based on the shipping website data table, the legal regulations data table, and the historical inspection data table, determining the entity hierarchy and entity relationship attributes within the domain scope, and obtaining the ontology model based on the entity hierarchy and entity relationship attributes includes:

[0103] Based on the shipping website data table, the legal and regulatory data table, and the historical inspection data table, as well as the preset concepts and business requirements for on-site ship supervision, the scope of on-site ship supervision is determined.

[0104] Within the scope of the aforementioned on-site ship supervision, determine the ontology concept classes and their attributes, as well as the relationships and attributes between ontology concept classes;

[0105] The ontology model is obtained by visualizing the ontology concept classes and their attributes, as well as the relationships and attributes between the ontology concept classes.

[0106] It is understandable that constructing an ontology model, such as Figure 4 As shown, it includes the following steps:

[0107] Collect knowledge in the field of on-site ship supervision, including historical inspection records, laws and regulations, and shipping website data, and construct shipping website data tables, legal and regulatory data tables, and historical inspection data tables;

[0108] Analyze the concepts and business needs of on-site ship supervision, and determine the scope of on-site ship supervision.

[0109] Define the ontology concept classes, which include inspection scenarios, inspection procedures, and inspection activities. Determine the relationships between the classes, as shown in Table 1.

[0110] The attributes of classes and relationships are determined as shown in Table 2, and the ontology model is evaluated by experts.

[0111] Use the software Protégé to manage and visualize the ontology.

[0112]

[0113]

[0114] Table 1

[0115]

[0116] Table 2

[0117] In some embodiments, extracting target project class entities from the knowledge base includes:

[0118] Based on the legal and regulatory data table and the historical inspection data table, a ship on-site supervision text is obtained; the ship on-site supervision text includes: the content of the clauses in the legal and regulatory data table and the content of the defects in the historical inspection data table;

[0119] The entities corresponding to the ship on-site supervision text are classified and fine-grained knowledge is extracted to obtain the target entities;

[0120] The ship on-site supervision text and the target entity are input into a preset entity recognition model to extract the semantic features of the ship on-site supervision text, and the globally optimal entity label sequence is determined based on the semantic features and the target entity. The target project class entity is obtained based on the globally optimal entity label sequence.

[0121] Understandably, the RoBERT-wwm-ext-BiLSTM-CRF entity recognition model, which uses a bidirectional long short-term memory (BiLSTM) network and a conditional random field (CRF) model based on the RoBERT-wwm-ext (A Robustly Optimized BERT Pre-training Approach-Whole Word Masking) pre-trained language model, is used to identify and extract the checked item class entities (i.e., the target item class entities).

[0122] Specifically, the RoBERTa-wwm-ext embedding layer uses a large-scale pre-trained language model to acquire semantic features of the input text and outputs low-dimensional feature vectors to enhance entity recognition performance. These output feature vectors can be one-dimensional. The BiLSTM layer uses the acquired feature vectors to output a label sequence probability matrix for each character, thus inferring and labeling the entity sequence. The CRF layer uses a probabilistic model to find and output the globally optimal label sequence, thereby achieving automatic sequence labeling of the shipboard on-site supervision business knowledge corpus.

[0123] In some embodiments, the entity recognition model includes:

[0124] The RoBERTa-wwm-ext embedding layer is used to determine the semantic features corresponding to the ship's on-site supervision text and output the low-dimensional feature vector corresponding to the semantic features.

[0125] The BiLSTM layer is used to obtain the label sequence probability matrix of each character based on the low-dimensional feature vector, and to infer and label the target entity based on the label sequence probability matrix.

[0126] The CRF layer is used to determine the globally optimal entity label sequence from the labeled target entities, and to obtain the target item class entity based on the globally optimal entity label sequence.

[0127] Understandably, compared to BERT networks, which can only acquire character-level semantic knowledge, RoBERTa-wwm-ext, composed of bidirectional Transformers, predicts masked words during the pre-training phase using full-word coverage and dynamic masking strategies to learn word boundaries. It also changes the masked words in each epoch, thus acquiring richer word-level semantic knowledge. Furthermore, the parameters of RoBERTa-wwm-ext are fine-tuned based on the training set during the named entity recognition model training to learn semantic knowledge from the field of ship surveillance, ultimately outputting a vector sequence of the input character sequence.

[0128] In the BiLSTM layer, the vector sequence (x1, x2, ..., x...) output from the previous layer is... n (x) serves as the initial input value at each time step. t The input to the forward LSTM layer is the sequential sequence of the word vectors, and the input to the backward LSTM layer is the reverse sequence of the word vectors. The model outputs the hidden state sequences at time t based on their positions. and The hidden state sequence is obtained by concatenation. And by using a linear transformation, the hidden state sequence h t The mapping from m dimensions to k dimensions, where m is the dimension of the hidden state vector and k represents the number of entity types in the corpus annotations, ultimately outputs y. t The probability p at time t is calculated as shown in formula (6).

[0129] p(y t |x t ) = softmax(Wh t +b y (6)

[0130] Where W is the weight matrix, b y For y tThe paranoid conceptual attribute.

[0131] In the CRF layer, solving t n-class classification problems is transformed into solving n... t The problem is to find the prediction sequence with the highest probability among several sequences in order to obtain the globally optimal label sequence. The model first processes the label sequence (y1, y2, ..., y3) output by the corresponding word vector sequence from the previous layer. n Scoring is performed and its probability p(y|x) is defined. The calculation method is shown in formulas (7) and (8).

[0132]

[0133]

[0134] Where M is the transition matrix, n is the sequence length, and YX is all possible label sequences corresponding to the input sequence X.

[0135] During training, the maximum likelihood probability log(p(y|x)) of p(y|x) is shown in Equation (9).

[0136]

[0137] Finally, the model uses the Viterbi algorithm to calculate the set of label sequences with the highest global probability. The calculation result is denoted as y^*, as shown in formula (10).

[0138]

[0139] In some embodiments, when it is determined that the entities to be fused need to be fused based on the result of whether the entities to be fused are fused, performing entity attribute completion and association alignment on the entities to be fused to obtain knowledge fusion data includes:

[0140] If it is determined that the entities to be merged need to be merged based on the result of whether the entities to be merged are merged, and all the entities to be merged are entities of the first category, attribute completion is performed on each entity in the entities to be merged based on all the attributes corresponding to the entities to be merged, so as to obtain knowledge fusion data;

[0141] If it is determined that the entity to be fused needs to be fused based on the result of whether the entity to be fused is fused, and the entity to be fused contains a second category entity and a third category entity, an association relationship is added between the second category identification and the third category entity to obtain knowledge fusion data.

[0142] Understandably, the Jaccard similarity coefficient, Jaro-Winkler similarity, and uSIF similarity are calculated separately for the knowledge to be fused. The results of these three calculations are used as input to the XGBoost model, and the model output is whether or not the knowledge is fused.

[0143] The first category of entities can be "Inspection Scenario" entities, the second category can be "Inspection Item" or "Major Defect" entities, and the third category can be "Defect" entities. Among these, "Major Defect" entities are pre-defined entities that may have defects, while "Defect" entities are entities that actually have defects during supervision. The attributes of "Inspection Scenario" entities are completed, and association relationships are added between "Inspection Item," "Major Defect," and "Defect" entities.

[0144] In other embodiments, the flowchart of the method for constructing a ship on-site supervision knowledge graph provided by the present invention is as follows: Figure 5 As shown, this invention can effectively link multi-source heterogeneous domain knowledge, strongly supporting maritime law enforcement personnel in retrospecting and utilizing inspection events, and providing a new method for realizing smart maritime affairs.

[0145] The entity recognition model RoBERTa-wwm-ext-BiLSTM-CRF proposed in this invention, compared with other models, including Bi-directional Gated Recurrent Units (BiGRU), Convolutional Neural Networks (CNN) combined with Long Short-Term Memory (LSTM), BiGRU-CRF, BiLSTM, and BiLSTM-CRF, demonstrates the best F1 score performance with increasing epochs, surpassing other models. Figure 6 As shown.

[0146] The knowledge fusion model proposed in this invention selects and compares linear regression, logistic regression, decision tree, and random forest models, and sets four different sets of feature value inputs for the XGBoost model to obtain the importance of feature values. Here, XGBoost1 represents J... S JW S Feature value input; XGBoost2 represents J S U S Feature value input; XGBoost3 represents JW S U SFeature value input; XGBoost4 represents all feature value inputs. In the knowledge fusion model, XGBoost4 with all feature value inputs outperforms other classification models in P, R, and F1 scores, exceeding 88%. Among these, feature value J... S The impact on the model is greatest, followed by JW. S And U S This plays a role in fine-tuning the model's performance, such as... Figure 7 As shown.

[0147] In summary, the method for constructing a ship on-site supervision knowledge graph provided by this invention includes: constructing an ontology model and a knowledge base for the ship on-site supervision knowledge graph, and extracting target project entities from the knowledge base; the knowledge base includes entity names, relationships between entities, entity attribute names, and attribute values; determining entities to be fused among the target project entities, and determining the Jaccard similarity coefficient, Jaro-Winkler similarity, and uSIF similarity corresponding to the entities to be fused; inputting the Jaccard similarity coefficient, the Jaro-Winkler similarity, and the uSIF similarity into a preset knowledge fusion model to obtain the result of whether the entities to be fused are fused; the knowledge fusion model is trained based on the XGBoosT model; if it is determined that the entities to be fused need to be fused based on the result of whether the entities to be fused are fused, performing entity attribute completion and association alignment on the entities to be fused to obtain knowledge fusion data; mapping the ontology model to the knowledge fusion data to obtain the ship on-site supervision knowledge graph.

[0148] In the method for constructing a ship on-site supervision knowledge graph provided by this invention, an ontology model and knowledge base for the ship on-site supervision knowledge graph are constructed, and target project class entities are extracted from the knowledge base. Then, the Jaccard similarity coefficient, Jaro-Winkler similarity, and uSIF similarity corresponding to the entities to be fused are input into a preset knowledge fusion model to determine whether they can be fused. If they can be fused, entity attribute completion and association alignment are performed on the entities to be fused to obtain knowledge fusion data. The ontology model is mapped to the knowledge fusion data to obtain the ship on-site supervision knowledge graph, which makes up for the shortcomings of traditional databases, assists maritime law enforcement personnel in decision-making during ship on-site inspections, and makes ship safety supervision work more information-based, intelligent, and expert-oriented.

[0149] like Figure 8 As shown, the present invention also provides a device 800 for constructing a knowledge graph for ship on-site supervision, comprising:

[0150] The construction module 810 is used to construct the ontology model and knowledge base of the ship on-site supervision knowledge graph, and extract target project class entities from the knowledge base; the knowledge base includes entity name, inter-entity relationship, entity attribute name and attribute value;

[0151] The similarity calculation module 820 is used to determine the entities to be merged in the target project class entities, and to determine the Jaccard coefficient similarity, Jaro-Winkler similarity and uSIF similarity corresponding to the entities to be merged;

[0152] The fusion judgment module 830 is used to input the Jaccard coefficient similarity, the Jaro-Winkler similarity, and the uSIF similarity into a preset knowledge fusion model to obtain the result of whether the entities to be fused are fused; the knowledge fusion model is trained based on the XGBoosT model;

[0153] The fusion module 840 is used to perform entity attribute completion and association alignment on the entity to be fused to obtain knowledge fusion data when it is determined that the entity to be fused needs to be fused based on the result of whether the entity to be fused is fused or not.

[0154] The knowledge graph production module 850 is used to map the ontology model to the knowledge fusion data to obtain a knowledge graph for ship on-site supervision.

[0155] The apparatus for constructing a knowledge graph for on-site ship supervision provided in the above embodiments can realize the technical solutions described in the embodiments of the method for constructing a knowledge graph for on-site ship supervision. The specific implementation principles of each module or unit can be found in the corresponding content in the embodiments of the method for constructing a knowledge graph for on-site ship supervision, and will not be repeated here.

[0156] like Figure 9 As shown, the present invention also provides an electronic device 900. The electronic device 900 includes a processor 901, a memory 902, and a display 903. Figure 9 Only some components of the electronic device 900 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0157] In some embodiments, memory 902 may be an internal storage unit of electronic device 900, such as a hard disk or memory of electronic device 900. In other embodiments, memory 902 may also be an external storage device of electronic device 900, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on electronic device 900.

[0158] Furthermore, the memory 902 may include both internal storage units of the electronic device 900 and external storage devices. The memory 902 is used to store application software and various types of data installed on the electronic device 900.

[0159] In some embodiments, processor 901 may be a central processing unit (CPU), microprocessor, or other data processing chip, used to run program code stored in memory 902 or process data, such as the method for constructing a ship on-site supervision knowledge graph in this invention.

[0160] In some embodiments, display 903 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 903 is used to display information from electronic device 900 and to display a visual user interface. Components 901-903 of electronic device 900 communicate with each other via a system bus.

[0161] In some embodiments of the present invention, when the processor 901 executes the program for constructing a ship on-site supervision knowledge graph in the memory 902, the following steps can be implemented:

[0162] An ontology model and knowledge base for a knowledge graph of ship on-site supervision are constructed, and target project entities are extracted from the knowledge base; the knowledge base includes entity names, relationships between entities, entity attribute names and attribute values;

[0163] Identify the entities to be merged in the target project class entities, and determine the Jaccard similarity, Jaro-Winkler similarity, and uSIF similarity corresponding to the entities to be merged;

[0164] The Jaccard similarity coefficient, the Jaro-Winkler similarity, and the uSIF similarity are input into a preset knowledge fusion model to obtain the result of whether the entities to be fused are fused; the knowledge fusion model is trained based on the XGBoosT model;

[0165] If it is determined that the entity to be merged needs to be merged based on the result of whether the entity to be merged is merged, entity attribute completion and association alignment are performed on the entity to be merged to obtain knowledge fusion data;

[0166] The ontology model is mapped onto the knowledge fusion data to obtain a knowledge graph for ship on-site supervision.

[0167] It should be understood that when the processor 901 executes the program for constructing the ship site supervision knowledge graph in the memory 902, in addition to the functions mentioned above, it can also perform other functions, as detailed in the description of the corresponding method embodiments above.

[0168] Furthermore, this embodiment of the invention does not specifically limit the type of electronic device 900 mentioned. Electronic device 900 can be a mobile phone, tablet computer, personal digital assistant (PDA), wearable device, laptop computer, or other portable electronic device. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices running iOS, Android, Microsoft, or other operating systems. The aforementioned portable electronic device can also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the invention, electronic device 900 may not be a portable electronic device, but rather a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0169] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for constructing a ship on-site supervision knowledge graph provided by the methods described above, the method comprising:

[0170] An ontology model and knowledge base for a knowledge graph of ship on-site supervision are constructed, and target project entities are extracted from the knowledge base; the knowledge base includes entity names, relationships between entities, entity attribute names and attribute values;

[0171] Identify the entities to be merged in the target project class entities, and determine the Jaccard similarity, Jaro-Winkler similarity, and uSIF similarity corresponding to the entities to be merged;

[0172] The Jaccard similarity coefficient, the Jaro-Winkler similarity, and the uSIF similarity are input into a preset knowledge fusion model to obtain the result of whether the entities to be fused are fused; the knowledge fusion model is trained based on the XGBoosT model;

[0173] If it is determined that the entity to be merged needs to be merged based on the result of whether the entity to be merged is merged, entity attribute completion and association alignment are performed on the entity to be merged to obtain knowledge fusion data;

[0174] The ontology model is mapped onto the knowledge fusion data to obtain a knowledge graph for ship on-site supervision.

[0175] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.

[0176] The above provides a detailed description of the method, apparatus, and electronic equipment for constructing a ship on-site supervision knowledge graph provided by this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.

Claims

1. A method for constructing a ship field supervision knowledge graph, characterized in that, The application comprises the following steps: An ontology model and a knowledge base of a ship site supervision knowledge graph are constructed, and target project class entities are extracted from the knowledge base; the knowledge base comprises entity names, entity relationships, entity attribute names and attribute values; Determine the to-be-fused entities in the target project class entities, and determine the Jaccard coefficient similarity, Jaro-Winkler similarity and uSIF similarity corresponding to the to-be-fused entities; The Jaccard coefficient similarity, the Jaro-Winkler similarity and the uSIF similarity are input into a preset knowledge fusion model to obtain a result of whether the to-be-fused entities are fused; The knowledge fusion model is trained based on an XGBoosT model; In a case where it is determined based on the result of whether the to-be-fused entities are fused that the to-be-fused entities need to be fused, entity attribute completion and correlation alignment are performed on the to-be-fused entities to obtain knowledge fusion data; The ontology model is mapped to the knowledge fusion data to obtain a ship site supervision knowledge graph; In a case where it is determined based on the result of whether the to-be-fused entities are fused that the to-be-fused entities need to be fused, entity attribute completion and correlation alignment are performed on the to-be-fused entities to obtain knowledge fusion data, comprising: In a case where it is determined based on the result of whether the to-be-fused entities are fused that the to-be-fused entities need to be fused, and the to-be-fused entities are all first-class entities, attribute completion is performed on each entity in the to-be-fused entities based on all attributes corresponding to the to-be-fused entities to obtain knowledge fusion data; In a case where it is determined based on the result of whether the to-be-fused entities are fused that the to-be-fused entities need to be fused, and the to-be-fused entities comprise second-class entities and third-class entities, a correlation relationship is added between the second-class entities and the third-class entities to obtain knowledge fusion data.

2. The method of claim 1, wherein, The ontology model and the knowledge base of the ship site supervision knowledge graph are constructed, comprising: Ship site supervision related shipping website data is crawled from a target website, and ship site supervision related legal regulation data and historical inspection data are obtained; The shipping website data is subjected to data cleaning to form a shipping website data table, the legal regulation data is subjected to digital processing and format processing to form a legal regulation data table, and the historical inspection data is subjected to data cleaning to form a historical inspection data table; Based on the shipping website data table, the legal regulation data table and the historical inspection data table, the domain range of the ship site supervision knowledge graph is determined, the entity hierarchical structure and the entity relationship attributes are determined in the domain range, and the ontology model is obtained based on the entity hierarchical structure and the entity relationship attributes.

3. The method of claim 2, wherein, The ontology model and the knowledge base of the ship site supervision knowledge graph are constructed, comprising: The shipping website data table, the legal regulation data table and the historical inspection data table are subjected to knowledge extraction to obtain the knowledge base.

4. The method of claim 2, wherein, The domain range of the ship site supervision knowledge graph is determined based on the shipping website data table, the legal regulation data table and the historical inspection data table, the entity hierarchical structure and the entity relationship attribute are determined within the domain range, and the ontology model is obtained based on the entity hierarchical structure and the entity relationship attribute, including: Determine the ship site supervision domain range based on the shipping website data table, the legal regulation data table and the historical inspection data table, and the preset ship site supervision concept and business requirement; Within the ship site supervision domain range, determine the ontology concept class and its attribute, the relationship between ontology concept classes and its attribute; The ontology concept class and its attribute, the relationship between ontology concept classes and its attribute are visualized to obtain the ontology model.

5. The method of claim 2, wherein, The target project class entity is extracted from the knowledge base, including: Based on the legal regulation data table and the historical inspection data table, the ship site supervision text is obtained; the ship site supervision text includes the clause content in the legal regulation data table and the defect content in the historical inspection data table; Classify and fine-grained knowledge extraction are performed on the entities corresponding to the ship site supervision text to obtain target entities; The ship site supervision text and the target entity are input into a preset entity recognition model to extract semantic features of the ship site supervision text, and based on the semantic features and the target entity, a globally optimal entity label sequence is determined, and the target project class entity is obtained based on the globally optimal entity label sequence.

6. The method of claim 5, wherein, The entity recognition model includes: The RoBERTa-wwm-ext embedding layer is used to determine the semantic features corresponding to the ship site supervision text and output low-dimensional feature vectors corresponding to the semantic features; The BiLSTM layer is used to obtain a label sequence probability matrix of each character based on the low-dimensional feature vectors, and the target entity is inferred and labeled based on the label sequence probability matrix; The CRF layer is used to determine a globally optimal entity label sequence from the labeled target entity, and the target project class entity is obtained based on the globally optimal entity label sequence. 7.A ship field supervision knowledge graph construction device, characterized in that, The device is used to implement the ship site supervision knowledge graph construction method of any one of claims 1-6, including: A construction module is configured to construct an ontology model and a knowledge base of a ship site supervision knowledge graph, and to extract a target project class entity from the knowledge base; the knowledge base includes entity names, entity relationships, entity attribute names and attribute values; A similarity calculation module is configured to determine a to-be-fused entity in the target project class entity and to determine Jaccard coefficient similarity, Jaro-Winkler similarity and uSIF similarity corresponding to the to-be-fused entity; A fusion judgment module is configured to input the Jaccard coefficient similarity, the Jaro-Winkler similarity and the uSIF similarity into a preset knowledge fusion model to obtain a result of whether the to-be-fused entity is fused; the knowledge fusion model is trained based on an XGBoosT model. a fusion module, configured to perform entity attribute completion and correlation alignment on the to-be-fused entities to obtain knowledge fusion data, based on a result of whether the to-be-fused entities are fused; a graph production module, configured to map the ontology model to the knowledge fusion data to obtain a ship field supervision knowledge graph.

8. An electronic device, comprising: comprising a memory and a processor, the memory, configured to store a program; the processor, coupled with the memory, configured to execute the program stored in the memory to implement the steps of the ship field supervision knowledge graph construction method in any one of claims 1 to 6. 9.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the ship field supervision knowledge graph construction method in any one of claims 1 to 6.