Knowledge graph construction method and device, storage medium and electronic equipment
By using a bottom-up construction method, entities and relationships are extracted from the data source based on the business domain model to generate a knowledge graph in the thermal power field. This solves the problem of inconsistent entity attributes and relationships in existing technologies, and simplifies construction and improves the accuracy of application operations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NEUSOFT CORP
- Filing Date
- 2022-08-19
- Publication Date
- 2026-04-28
AI Technical Summary
In the thermal power sector, due to the complexity of business operations, existing technologies are unable to effectively construct knowledge graph ontology libraries. This results in inconsistencies in entity attributes and relationships in databases of different specialties, making entity alignment, fusion, and relationship extraction difficult. Furthermore, the top-down construction model suffers from incomplete or overly complex relationship settings.
A bottom-up approach is adopted. By obtaining the entity data structure in the initial knowledge graph ontology, entities and relationships are extracted from the data source based on the business domain model to generate a knowledge graph. The relationships between entity data structures are then completed based on the business domain attributes of the relationships to form the target knowledge graph ontology.
It simplifies the knowledge graph construction process, reduces the difficulty of creating the target knowledge graph ontology, avoids problems such as missing relationships or overly complex settings, and improves the accuracy and efficiency of application operations such as querying and reasoning.
Smart Images

Figure CN115391552B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of knowledge graph technology, specifically to a knowledge graph construction method, apparatus, storage medium, and electronic device. Background Technology
[0002] The business scenarios in the thermal power sector are complex. For example, under the four specialties of steam turbine, electrical, boiler, and thermal control, a typical generator set includes tens of thousands of pieces of equipment (including various pipelines, valves, etc.), making the unit composition extremely complex. Furthermore, the tasks handled by staff from different specialties for the same equipment vary greatly. For instance, for a coal mill, the equipment department focuses on its fault information and maintenance information; the operations department focuses on its operating parameters and equipment status; the thermal control department focuses on its alarm interlock shutdown conditions, parameter upper and lower limits, and sensor malfunctions; and the electrical department focuses on its power supply parameters, power supply design drawings, and corresponding circuit breakers.
[0003] For the same piece of equipment, the content contained in the databases of different departments (equipment department's document database, operations department's document database, thermal control department's document database, electrical department's document database) varies due to differences in business operations and information focus. Therefore, even if the entities extracted from the databases of different departments are the same, the attributes of the entities and the relationships between them are different. This presents significant challenges in entity alignment, entity fusion, entity completion, relationship extraction, and relationship completion.
[0004] In related technologies, the construction mode of domain knowledge graphs is top-down. This means that experts proficient in domain knowledge, business, mechanisms, and processes, combined with the application scenarios of the knowledge graph, construct a knowledge graph ontology (the schema layer of the knowledge graph). Then, specific resource data is integrated into the knowledge graph ontology to generate the domain knowledge graph. However, due to the complexity of the thermal power industry, even for domain experts, constructing a knowledge graph ontology while considering application scenarios remains extremely difficult. Summary of the Invention
[0005] To address the problems existing in related technologies, this disclosure proposes a knowledge graph construction method, apparatus, storage medium, and electronic device.
[0006] To achieve the above objectives, a first aspect of this disclosure provides a knowledge graph construction method, the method comprising:
[0007] Obtain an initial knowledge graph ontology, which includes multiple predefined entity data structures, each of which includes an entity category and entity attributes.
[0008] Based on the entity category and entity attributes of the entity data structure, entities corresponding to the entity category and including the entity attributes are extracted from the data source;
[0009] For the first and second entities that have a relationship among the extracted entities, the business domain attributes of the relationship are determined based on the business domain model. The relationship between the first entity and the second entity is determined based on the data source.
[0010] A knowledge graph is generated based on the extracted entities, the relationships, and the business domain attributes of the relationships, and / or the relationship between the first entity data structure and the second entity data structure in the initial knowledge graph ontology is completed based on the relationships and the business domain attributes of the relationships, to obtain the target knowledge graph ontology.
[0011] Optionally, the method further includes generating the business domain model in the following manner:
[0012] Extract business topic keywords from the data source;
[0013] For each of the aforementioned business topic terms, the business topic term and its preset weight are converted into a word vector;
[0014] Clustering of all the aforementioned word vectors yields multiple business clusters;
[0015] Assign a service domain ID to each of the aforementioned service clusters;
[0016] The business domain model is generated based on each of the business clusters and the business domain ID of each of the business clusters.
[0017] Optionally, for the first and second entities with a relationship among the extracted entities, determining the business domain attribute of the relationship based on the business domain model includes:
[0018] Determine the target sub-data source from the data source to extract the first entity and the second entity;
[0019] Based on the business domain model, calculate the first target business domain ID corresponding to the target sub-data source;
[0020] The first target business domain ID is determined as the business domain attribute of the association.
[0021] Optionally, calculating the first target business domain ID corresponding to the target sub-data source based on the business domain model includes:
[0022] Extract target business keywords from the target sub-data source;
[0023] Determine the target word vector corresponding to the target business topic term;
[0024] Determine the target business cluster that has the smallest distance to the target word vector from the business domain model;
[0025] Use the business domain ID of the target business cluster as the first target business domain ID.
[0026] Optionally, the method further includes:
[0027] In response to a user's business operation, determine the second target business domain ID corresponding to the business operation;
[0028] A subgraph corresponding to the second target business domain ID is determined from the knowledge graph, wherein the business domain attribute of the association in the subgraph is the second target business domain ID;
[0029] The business operation is performed based on the sub-map.
[0030] Optionally, determining the second target business domain ID corresponding to the user's business operation in response to the user's business operation includes:
[0031] Determine the user's business operation permission information;
[0032] The second target business domain ID is determined based on the business operation permission information and the business domain model.
[0033] Optionally, the method further includes:
[0034] In response to a user's business operation, determine the second target business domain ID corresponding to the business operation;
[0035] The sub-ontology corresponding to the second target business domain ID is determined from the target knowledge graph ontology, and the business domain attribute of the relationship between the entity data structures in the sub-ontology is the second target business domain ID;
[0036] Determine the sub-graph corresponding to the sub-ontology from the knowledge graph;
[0037] The business operation is performed based on the sub-map.
[0038] A second aspect of this disclosure provides a knowledge graph construction apparatus, the apparatus comprising:
[0039] The acquisition module is used to acquire an initial knowledge graph ontology library, which includes multiple predefined entity data structures, each of which includes an entity category and an entity attribute.
[0040] An extraction module is used to extract entities corresponding to the entity category and including the entity attributes from the data source based on the entity category and entity attributes of the entity data structure.
[0041] The first determining module is used to determine the business domain attribute of the relationship between the first entity and the second entity that have a relationship among the extracted entities, based on the business domain model. The relationship between the first entity and the second entity is determined based on the data source.
[0042] The first execution module is used to generate a knowledge graph based on the extracted entities, the relationships, and the business domain attributes of the relationships, and / or to complete the relationship between the first entity data structure and the second entity data structure in the initial knowledge graph ontology based on the relationships and the business domain attributes of the relationships, so as to obtain the target knowledge graph ontology.
[0043] Optionally, the device further includes:
[0044] The business domain model generation module is used to extract business topic words from the data source; for each business topic word, convert the business topic word and its preset weight into word vectors; cluster all the word vectors to obtain multiple business clusters; assign a business domain ID to each business cluster; and generate the business domain model based on each business cluster and its business domain ID.
[0045] Optionally, the first determining module includes:
[0046] The first extraction submodule is used to determine the target sub-data source from the data source for extracting the first entity and the second entity;
[0047] The calculation submodule is used to calculate the first target business domain ID corresponding to the target sub-data source based on the business domain model;
[0048] The first determining submodule is used to determine the first target business domain ID as the business domain attribute of the association relationship.
[0049] Optionally, the computing submodule includes:
[0050] The second extraction submodule is used to extract target business topic words from the target sub-data source;
[0051] The second determining submodule is used to determine the target word vector corresponding to the target business topic word;
[0052] The third determining submodule is used to determine the target business cluster with the smallest distance from the target word vector from the business domain model;
[0053] The execution submodule is used to use the business domain ID of the target business cluster as the first target business domain ID.
[0054] Optionally, the device further includes:
[0055] The first response module is used to respond to the user's business operation and determine the second target business domain ID corresponding to the business operation;
[0056] The second determining module is used to determine the subgraph corresponding to the second target business domain ID from the knowledge graph, wherein the business domain attribute of the association in the subgraph is the second target business domain ID;
[0057] The second execution module is used to execute the business operation based on the sub-map.
[0058] Optionally, the first response module includes:
[0059] The fourth determination submodule is used to determine the user's business operation permission information;
[0060] The fifth determining submodule is used to determine the second target business domain ID based on the business operation permission information and the business domain model.
[0061] Optionally, the device further includes:
[0062] The second response module is used to respond to the user's business operation and determine the second target business domain ID corresponding to the business operation;
[0063] The third determining module is used to determine the sub-ontology library corresponding to the second target business domain ID from the target knowledge graph ontology library, wherein the business domain attribute of the relationship between the entity data structures in the sub-ontology library is the second target business domain ID;
[0064] The fourth determining module is used to determine the sub-graph corresponding to the sub-ontology library from the knowledge graph;
[0065] The third execution module is used to execute the business operation based on the sub-map.
[0066] A third aspect of this disclosure provides a non-transitory computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the method described in any of the first aspects.
[0067] A fourth aspect of this disclosure provides an electronic device, including:
[0068] A memory on which computer programs are stored;
[0069] A processor for executing the computer program in the memory to implement the steps of the method of any one of the first aspects.
[0070] By adopting the above technical solution, at least the following beneficial technical effects can be achieved:
[0071] An initial knowledge graph ontology is obtained, comprising multiple predefined entity data structures, each including an entity category and entity attributes. Based on the entity categories and attributes of the entity data structures, entities corresponding to the entity categories and including entity attributes are extracted from the data source. For the first and second entities with a relationship among the extracted entities, the business domain attributes of the relationship are determined based on the business domain model. The relationship between the first and second entities is determined based on the data source. A knowledge graph is generated based on the extracted entities, the relationships, and the business domain attributes of the relationships. Compared with the top-down construction mode in related technologies, this method of generating knowledge graphs simplifies the knowledge graph construction process because it does not require the pre-construction of a complete knowledge graph ontology including the relationships between entity data structures. Without needing to construct a complete knowledge graph ontology, and without designing entity relationships (the relationships between entity data structures are abstracted from the relationships between corresponding entities), this avoids considering the different relationships between two entities in different scenarios. This prevents the potential inability to perform queries, reasoning, and other application operations based on the knowledge graph if the relationships between two entities are omitted, and also avoids the problem of an overly comprehensive knowledge graph ontology becoming excessively complex, difficult to interpret, and process. Furthermore, this disclosure completes the relationship between the first and second entity data structures in the initial knowledge graph ontology based on associations and the business domain attributes of those associations, thus obtaining the target knowledge graph ontology (i.e., the complete knowledge graph ontology). Compared to the manual construction of the target knowledge graph ontology in related technologies, this method reduces the difficulty of creating the target knowledge graph ontology.
[0072] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0073] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings:
[0074] Figure 1This is a knowledge graph ontology library illustrated in an exemplary embodiment of this disclosure.
[0075] Figure 2 This is a schematic diagram illustrating complex relationships in different scenarios according to an exemplary embodiment of this disclosure.
[0076] Figure 3 This is a flowchart illustrating a knowledge graph construction method according to an exemplary embodiment of the present disclosure.
[0077] Figure 4 This is a schematic diagram of a business domain model according to an exemplary embodiment of the present disclosure.
[0078] Figure 5 This is a schematic diagram illustrating a knowledge graph application according to an exemplary embodiment of the present disclosure.
[0079] Figure 6 This is a block diagram illustrating a knowledge graph construction apparatus according to an exemplary embodiment of the present disclosure.
[0080] Figure 7 This is a block diagram illustrating an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation
[0081] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.
[0082] It should be noted that all actions involving the acquisition of signals, information, or data in this disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the location is situated, and with authorization from the owner of the relevant device.
[0083] In related technologies, the top-down knowledge graph construction model generally involves first constructing a knowledge graph ontology based on the application scenario of the knowledge graph. For example, for the operation and maintenance of thermal power equipment, an ontology such as... Figure 1 The diagram shows a knowledge graph schema for the operation and maintenance of thermal power equipment. Then, specific resource data is integrated into the constructed knowledge graph ontology to generate the knowledge graph. The concept of a knowledge graph ontology (i.e., schema) in the knowledge graph domain is used to clearly define the entities, attributes, and relationships within the knowledge graph; it is the schema layer of the graph, typically constructed by experts based on experience and business objectives. The schema defines the format of the data to be added to the knowledge graph. It is equivalent to a data model within a specific domain, containing meaningful concept types and their attributes.
[0084] However, due to the complexity of domain-specific business scenarios, even domain experts find it extremely difficult to build a knowledge graph ontology while considering application scenarios. The challenge lies in how to organize and implement the setting of entity attributes and the design of entity relationships. Different relationships exist between two entities in different scenarios; for example, Figure 2 The diagram illustrates complex relationships in different scenarios. If relationships are omitted, the knowledge graph generated from the knowledge graph ontology may be unable to perform querying, reasoning, and other application operations in future applications. That is, when the relationships between entities are not fully defined (it should be explained that domain experts can define known entity relationships based on their own knowledge reserves, but are also limited by their own knowledge reserves, and may not be able to define them fully), it may not be able to support application operations in different application scenarios. It may also be impossible to find hidden entity relationships or entity reasoning results. For example, in the highly complex thermal power field, the construction of its knowledge graph ontology is very difficult. It requires comprehensive consideration and abstraction of different business areas (such as equipment department business, operation department business, safety, health and environmental business, electromechanical business, electrical business, etc.), defining entities, entity attributes, and entity relationships. Compared to entities and entity attributes, determining entity relationships is the most difficult. If this is not fully considered, future changes or expansions to the knowledge graph ontology will be very difficult, possibly requiring a complete rebuild of the knowledge graph ontology. It should be noted here that in the process of applying knowledge graphs, relationship-based querying, searching, recommendation, and pattern reasoning are common application methods. For details, please refer to the definitions and explanations in the relevant technologies.
[0085] Conversely, if the relationships between two entities are defined too comprehensively, the knowledge graph ontology will become extremely complex, making it difficult to interpret and process. The knowledge graph generated from such a complex ontology will also be extremely complex. Given such a complex knowledge graph, if the relationships between entities are exceptionally intricate, a large number of entities or attributes will be matched during the query, search, and recommendation processes. Faced with a large number of entity or attribute matching results, manual judgment and secondary filtering are required to obtain a small number of accurate matches.
[0086] In view of this, this disclosure proposes a novel knowledge graph construction method that differs from the top-down construction model in related technologies. In the technical solution of this disclosure, the definition of entities and entity attributes (i.e., entity data structures) is constructed from top to bottom; however, the extraction of relationships between entities / relationships between entity data structures is constructed from bottom to top. Bottom-up construction refers to directly using the relationships between entities extracted from various business data sources as data layer relationships to construct the knowledge graph, and abstracting the relationships in the schema layer knowledge graph ontology based on the entity relationships in the constructed data layer knowledge graph.
[0087] The technical solutions disclosed herein are described in detail below. In the following text, for simplicity, the relationship between entity data structures is referred to as the relationship between entity data structures. The association between entities is referred to as the association between entities.
[0088] Figure 3 This is a flowchart illustrating a knowledge graph construction method according to an exemplary embodiment of the present disclosure, such as... Figure 3 As shown, the knowledge graph construction method includes the following steps.
[0089] S11. Obtain an initial knowledge graph ontology library, which includes multiple predefined entity data structures, each of which includes an entity category and entity attributes.
[0090] The initial knowledge graph ontology includes multiple manually defined entity data structures. Each entity data structure includes an entity category and entity attributes. For example, such as... Figure 1 The entity data structure represented by each box. For example... Figure 1 One of the entity data structures is "Category: Unit; Attribute: Name". For example... Figure 1 Another entity data structure in the document is "Category: Measuring Point; Attributes: Name, KKS, Unit, Channel Type, Upper Range Limit, Lower Range Limit, Upper Alarm Limit, Lower Alarm Limit, Sensor Type (4-20Ma, K, etc.)". Here, KKS is an abbreviation for "Kraftwerk-Kennzeichensystem", meaning "Power Plant Identification System".
[0091] In this embodiment of the disclosure, the initial knowledge graph ontology may not include relationships between entity data structures, meaning that the human does not need to consider these relationships. In other embodiments, if the human knows some accurate relationships between entity data structures, then when constructing the initial knowledge graph ontology, the accurate and known relationships between entity data structures can be added to the initial knowledge graph ontology, meaning that the human does not need to fully consider the relationships between entity data structures.
[0092] For example, the initial knowledge graph ontology could be free of... Figure 1 The ontology library presented after all / partial connections (arrows) between entity data structures in the middle.
[0093] S12. Based on the entity category and entity attributes of the entity data structure, extract entities corresponding to the entity category and including the entity attributes from the data source.
[0094] A data source is a device or raw medium that provides a desired amount of data. For example, the device / raw medium could be a file, a database, etc. A data source is obtained by storing a certain type of data in a specific format using any data storage technology. To put it simply, if data is water, then the data source is a reservoir.
[0095] In this embodiment of the disclosure, the data source includes data for constructing a knowledge graph. For example, in the scenario of constructing a knowledge graph in the field of thermal power, the data source may include at least one type of data from the equipment department, operations department, thermal control department, and electrical department of a thermal power enterprise.
[0096] Based on the entity data structure in the initial knowledge graph ontology, entities corresponding to the respective entity categories and including the corresponding entity attributes are extracted from the data source. For example, based on... Figure 1 The entity data structure in the data is "Category: Equipment; Attributes: Name, KKS Code, Location Code, Equipment Model, Specifications, Material, Serial Number, Manufacturing Date, Commissioning Date". Entities extracted from the data source can be like this: Figure 2 The diagram shows control cabinet #1, coal feeder, coal mill, boiler, etc. KKS is an abbreviation for "Kraftwerk-Kennzeichensystem," meaning "Power Plant Identification System." KKS is used to identify components and auxiliary systems of a power plant.
[0097] It should be noted here that the method of extracting entities from the data source based on the entity data structure can be found in entity recognition techniques in related technologies, such as named entity recognition methods based on NLP (Natural Language Processing). Other examples include Hidden Markov Models (HMMs), Maximum Entropy Models (MEMs), Conditional Random Fields (CRFs), and deep learning-based CRF-BiLSTM models for entity recognition. This disclosure will not elaborate on the entity recognition process.
[0098] S13. For the first entity and the second entity that have a relationship among the extracted entities, determine the business domain attribute of the relationship based on the business domain model. The relationship between the first entity and the second entity is determined based on the data source.
[0099] In this embodiment of the disclosure, the business scope of the business is referred to as the business domain of the business, or simply the business domain. If the first entity A and the second entity B, which have a relationship, are both extracted from business data under a certain business M, then the relationship C between the first entity A and the second entity B is generally a relationship that exists under that certain business M. In order to characterize the relationship C between the first entity A and the second entity B as a relationship that exists under that certain business M, the business domain m corresponding to that certain business M can be used as an attribute of the relationship C. This attribute of the relationship C is referred to as the business domain attribute in this embodiment of the disclosure.
[0100] A business domain model is a mathematical model that includes mathematical representations of multiple business domains. The mathematical representation of each business domain is obtained through data processing such as weighting, encoding (e.g., using word embedding algorithms to encode keywords and weight values into vectors), and clustering based on keywords from the corresponding business. The mathematical representations of each business domain are independent of each other.
[0101] In some implementations, the business domain attribute of the association relationship C between the first entity A and the second entity B can be determined by extracting target text from the data source with the first entity A and the second entity B as endpoints, and determining the encoding vector corresponding to the target text. The mathematical representations of each business domain in the business domain model are then compared with this encoding vector to calculate similarity (e.g., using Euclidean distance, Euclidean distance, etc.), and the business domain with the highest similarity is determined as the business domain attribute of the association relationship C.
[0102] For example, the relationships between entities can be causal, spatiotemporal, quantitative, possessive, comparative, compatible, implied, or control relationships, etc., and this disclosure does not make specific limitations on these relationships.
[0103] The relationship between the first entity and the second entity is determined based on the data source; for details, please refer to the domain entity relationship extraction methods in related technologies. This disclosure only provides a simple explanation of the principles behind how to extract the relationships between entities. For example, for structured and semi-structured data sources, since there are relationships between various data resources in structured and semi-structured data sources, such as the pre-defined relationships between row and column data resources in Excel and Word tables, these pre-defined relationships can be directly mapped to the corresponding first and second entities based on data mapping rules. As another example, for unstructured data sources, supervised learning methods can be used to extract the relationships between entities. For instance, NLP schemes such as support vector machines, Naive Bayes algorithms, and neural networks can be used to determine the relationships between entities.
[0104] S14. Generate a knowledge graph based on the extracted entities, the relationships, and the business domain attributes of the relationships, and / or, complete the relationship between the first entity data structure and the second entity data structure in the initial knowledge graph ontology based on the relationships and the business domain attributes of the relationships, to obtain the target knowledge graph ontology.
[0105] The first entity data structure corresponds to the first entity, and the second entity data structure corresponds to the second entity.
[0106] It should be noted that, since a knowledge graph includes entities and the relationships between entities, a knowledge graph can be generated after extracting entities from an initial knowledge graph ontology, determining the relationships between entities, and identifying the business domain attributes of these relationships. Furthermore, because the relationships between entities possess business domain attributes, the knowledge graph generated in this disclosure can be stored / represented using an attribute graph approach. The attribute graph approach refers to a method that supports entities and / or relationships having attributes; that is, an attribute graph representation method.
[0107] Compared to the top-down construction model in related technologies, the knowledge graph generation method disclosed herein simplifies the knowledge graph construction process because it eliminates the need to pre-build a complete knowledge graph ontology that includes relationships between entity data structures. Furthermore, without the need to build a complete knowledge graph ontology, there is no need to design entity relationships (the relationships between entity data structures are abstracted from the relationships between corresponding entities). This avoids considering the different relationships between two entities in different scenarios, thus preventing the inability to perform querying, reasoning, and other application operations based on the knowledge graph in future applications if the relationships between two entities are omitted. It also avoids the problem of the knowledge graph ontology becoming extremely complex and difficult to interpret and process if the relationships between two entities are set too comprehensively.
[0108] The present disclosure completes the relationship between the first entity data structure and the second entity data structure in the initial knowledge graph ontology based on the association relationship and the business domain attributes of the association relationship to obtain the target knowledge graph ontology (i.e., the complete knowledge graph ontology). Compared with the method of manually constructing the target knowledge graph ontology in related technologies, this method reduces the difficulty of manually creating the target knowledge graph ontology.
[0109] Furthermore, based on the data layer (i.e., the knowledge graph), entities are abstracted (can be understood as mapped) onto the entity data structures in the initial knowledge graph ontology, and the relationships between entities are also abstracted onto the corresponding entity data structures, thus obtaining the target knowledge graph ontology. This approach ensures that the relationships between entity data structures in the target knowledge graph ontology are extracted from actual business layer data sources. Compared to manually setting relationships between entity data structures, this approach better reflects real-world application scenarios and allows for interpretation of the target knowledge graph ontology based on those scenarios. Moreover, with the target knowledge graph ontology better reflecting real-world application scenarios, the accuracy of knowledge retrieval, searching, recommendation, and reasoning operations can be improved.
[0110] Optionally, the method further includes generating the business domain model in the following manner:
[0111] Extract business topic terms from the data source; for each business topic term, convert the business topic term and its preset weight into word vectors; cluster all the word vectors to obtain multiple business clusters; assign a business domain ID to each business cluster; generate the business domain model based on each business cluster and its business domain ID.
[0112] Data sources can include multiple documents. Typically, the sources of these documents are relatively fixed, such as maintenance reports from the thermal control department, equipment manuals from the equipment department, and safety manuals from the operations department. Based on this, one implementation method involves manually pre-setting a set of business topic terms composed of business keywords under different business functions, along with a preset weight for each business topic term. During the generation of the business domain model, the business topic terms included in the data source are identified and extracted based on the set of business topic terms.
[0113] Another approach is to use traditional topic extraction algorithms, such as LDA (Latent Dirichlet Allocation, a topic model), to extract topic terms from the data source. LDA can identify the topic terms of each document in the document set according to a probability distribution, and determine the preset weight of each topic term based on the probability distribution. Alternatively, the term frequency-inverse document frequency (TF-IDF) algorithm can be used to extract topic terms from the data source, and determine the corresponding preset weight based on the importance of each topic term in the document. It should be explained that term frequency is a commonly used weighting technique in information retrieval and text mining to evaluate the degree of repetition of a word in a document or a domain set of documents in a corpus.
[0114] For each extracted business topic word, the word and its preset weight are converted into a word vector. This conversion can be achieved using representation learning (such as word embedding algorithms).
[0115] All word vectors are clustered, for example using the K-Means algorithm, to obtain multiple business clusters. A unique business domain ID is assigned to each business cluster. A business domain model is generated based on each business cluster and its business domain ID. Each business cluster can be represented by its focal points / clustering points. For example, such as... Figure 4 The diagram shows a business domain model.
[0116] Optionally, for the first and second entities with a relationship among the extracted entities, determining the business domain attribute of the relationship based on the business domain model includes:
[0117] Determine the target sub-data source from the data source to extract the first entity and the second entity; calculate the first target business domain ID corresponding to the target sub-data source based on the business domain model; and determine the first target business domain ID as the business domain attribute of the association relationship.
[0118] For example, a target sub-data source can be a target document. For instance, in a case where the data source includes multiple documents, the target document from which the first entity and the second entity are extracted can be determined; this target document is the target sub-data source.
[0119] As another example, the target sub-data source can also be the target text segment. For instance, if the data source is a long document, the target text segment from which the first and second entities are extracted can be determined; this target text segment is the target sub-data source.
[0120] After determining the target sub-data source, the first target business domain ID corresponding to the target sub-data source can be calculated based on the business domain model. One implementation method involves using a keyword extraction algorithm, or extracting target business keywords included in the target sub-data source based on a preset set of business keywords. The target business keywords and their corresponding preset weights are then converted into target word vectors. The distance between the target word vectors and the focal points of each business cluster in the business domain model is calculated, and the target business cluster with the smallest distance to the target word vectors is determined from the business domain model. The business domain ID of the target business cluster is used as the first target business domain ID. The first target business domain ID is then determined as the business domain attribute representing the association between the first entity and the second entity.
[0121] In another implementation, each character in the target sub-data source is converted into a character vector, and all character vectors are concatenated to obtain the target word vector. The distance between the target word vector and each business cluster in the business domain model is calculated, and the target business cluster with the smallest distance to the target word vector is determined from the business domain model. The business domain ID of the target business cluster is used as the first target business domain ID. The first target business domain ID is determined as the business domain attribute of the association relationship between the first entity and the second entity.
[0122] Optionally, the method further includes:
[0123] In response to a user's business operation, a second target business domain ID corresponding to the business operation is determined; a subgraph corresponding to the second target business domain ID is determined from the knowledge graph, wherein the business domain attribute of the association in the subgraph is the second target business domain ID; and the business operation is executed based on the subgraph.
[0124] Business operations refer to application operations at the business layer, such as querying, searching, recommending, and pattern reasoning.
[0125] One approach to determining the second target business domain ID corresponding to a business operation is to determine the user's business operation permission information. The second target business domain ID is then determined based on the business operation permission information and the business domain model. In one implementation, a unique second target business domain ID can be determined using a method similar to that described above for determining the first target business domain ID. In another implementation, the business operation vector corresponding to the business operation permission information can be determined, and multiple second target business domain IDs whose distance from the business operation vector is less than a preset distance threshold can be determined from the business domain model.
[0126] In another implementation, each user corresponds to a service domain ID table, which includes one or more service domain IDs. Each service domain ID is predetermined in a manner similar to the aforementioned implementation for determining the first target service domain ID. The second target service domain ID is the service domain ID in the service domain ID table.
[0127] Another way to determine the second target business domain ID corresponding to a business operation is to determine which functional module the user performed the business operation in, and then determine the second target business domain ID based on the business domain corresponding to that functional module.
[0128] Another way to determine the second target business domain ID corresponding to a business operation is to determine the second target business domain ID based on the operation request and business domain model corresponding to the business operation.
[0129] In other words, the method for determining the second target business domain ID corresponding to a business operation can be based on the system module where the user performs the business operation, the user's identity information, or the business operation request information entered by the user.
[0130] When the number of second target business domain IDs is 1, after determining the second target business domain ID corresponding to the business operation in response to the user's business operation, a sub-graph corresponding to the second target business domain ID is determined from the knowledge graph. The business domain attribute of the relationships between entities in this sub-graph is the second target business domain ID. The business operation is then executed based on this sub-graph. For example, such as... Figure 5 As shown, assuming the knowledge graph is Figure 5 In the knowledge graph on the left, the second target business domain ID is A001. Therefore, the subgraph corresponding to A001 can be determined from the knowledge graph as follows: Figure 5 The knowledge graph on the right side of the image. This approach, performing business operations within a smaller sub-graph than the main knowledge graph, improves operational efficiency, such as the efficiency of graph search, lookup, and reasoning. Furthermore, since the business domain attributes of the relationships between entities in the sub-graph are all based on the second target business domain ID, there are no other business domain IDs besides the second target business domain ID. Therefore, the results of business operations performed in the sub-graph will not contain results obtained based on business IDs other than the second target business domain ID, but rather results obtained based on the second target business domain ID itself. This improves the accuracy of the operation results.
[0131] The process of determining the subgraph corresponding to the second target business domain ID from the knowledge graph can be understood as retaining the target association relationship with the business domain attribute of the second target business domain ID in the knowledge graph, as well as the two target entities corresponding to each target association relationship, while deleting the remaining association relationships and entities to obtain the subgraph.
[0132] When there are multiple second target business domain IDs, after determining the second target business domain ID corresponding to the business operation in response to the user's business operation, the subgraph corresponding to the second target business domain ID is determined from the knowledge graph. The business domain attribute of the association between entities in the subgraph is any one of the multiple second target business domain IDs.
[0133] Optionally, the method further includes:
[0134] In response to a user's business operation, a second target business domain ID corresponding to the business operation is determined; a sub-ontology library corresponding to the second target business domain ID is determined from the target knowledge graph ontology library, wherein the business domain attribute of the relationship between the entity data structures in the sub-ontology library is the second target business domain ID; a sub-graph corresponding to the sub-ontology library is determined from the knowledge graph; and the business operation is executed based on the sub-graph.
[0135] Because the knowledge graph is more complex than the target knowledge graph ontology, determining the subgraph corresponding to the second target business domain ID from the knowledge graph is much less efficient than determining the sub-ontology corresponding to the second target business domain ID from the target knowledge graph ontology. Therefore, this disclosure also provides an implementation method for determining the subgraph. Specifically, in response to a user's business operation, the second target business domain ID corresponding to the business operation is determined. The sub-ontology corresponding to the second target business domain ID is determined from the target knowledge graph ontology, where the business domain attribute of the relationship between the entity data structures in the sub-ontology is the second target business domain ID. The subgraph corresponding to the sub-ontology is then determined from the knowledge graph.
[0136] It should be noted that, in the embodiments of this disclosure, there can be various relationships between entities, and correspondingly, there can also be various relationships between entity data structures.
[0137] Figure 6 This is a block diagram illustrating a knowledge graph construction apparatus according to an exemplary embodiment of the present disclosure. Figure 6 As shown, the knowledge graph construction device 600 includes:
[0138] The acquisition module 610 is used to acquire an initial knowledge graph ontology library, which includes multiple predefined entity data structures, each of which includes an entity category and an entity attribute.
[0139] Extraction module 620 is used to extract entities corresponding to the entity category and including the entity attributes from the data source based on the entity category and entity attributes of the entity data structure;
[0140] The first determining module 630 is used to determine the business domain attribute of the relationship between the first entity and the second entity that have an association relationship among the extracted entities, based on the business domain model. The association relationship between the first entity and the second entity is determined based on the data source.
[0141] The first execution module 640 is used to generate a knowledge graph based on the extracted entities, the relationships, and the business domain attributes of the relationships, and / or to complete the relationship between the first entity data structure and the second entity data structure in the initial knowledge graph ontology based on the relationships and the business domain attributes of the relationships, so as to obtain a target knowledge graph ontology.
[0142] Compared to the top-down construction mode in related technologies, the knowledge graph construction method described above simplifies the knowledge graph construction process by eliminating the need to pre-build a complete knowledge graph ontology that includes relationships between entity data structures. Furthermore, without the need to build a complete knowledge graph ontology, there is no need to design entity relationships (the relationships between entity data structures are abstracted from the relationships between corresponding entities). This avoids considering the different relationships between two entities in different scenarios, thus preventing the inability to perform querying, reasoning, and other application operations based on the knowledge graph in future applications if the relationships between two entities are omitted. It also avoids the problem of the knowledge graph ontology becoming extremely complex and difficult to interpret and process if the relationships between two entities are set too comprehensively.
[0143] The present disclosure completes the relationship between the first entity data structure and the second entity data structure in the initial knowledge graph ontology based on the association relationship and the business domain attributes of the association relationship to obtain the target knowledge graph ontology (i.e., the complete knowledge graph ontology). Compared with the method of manually constructing the target knowledge graph ontology in related technologies, this method reduces the difficulty of manually creating the target knowledge graph ontology.
[0144] Furthermore, based on the data layer (i.e., the knowledge graph), entities are abstracted (can be understood as mapped) onto the entity data structures in the initial knowledge graph ontology, and the relationships between entities are also abstracted onto the corresponding entity data structures, thus obtaining the target knowledge graph ontology. This approach ensures that the relationships between entity data structures in the target knowledge graph ontology are extracted from actual business layer data sources. Compared to manually setting relationships between entity data structures, this approach better reflects real-world application scenarios and allows for interpretation of the target knowledge graph ontology based on those scenarios. Moreover, with the target knowledge graph ontology better reflecting real-world application scenarios, the accuracy of knowledge retrieval, searching, recommendation, and reasoning operations can be improved.
[0145] Optionally, the device 600 further includes:
[0146] The business domain model generation module is used to extract business topic words from the data source; for each business topic word, convert the business topic word and its preset weight into word vectors; cluster all the word vectors to obtain multiple business clusters; assign a business domain ID to each business cluster; and generate the business domain model based on each business cluster and its business domain ID.
[0147] Optionally, the first determining module 630 includes:
[0148] The first extraction submodule is used to determine the target sub-data source from the data source for extracting the first entity and the second entity;
[0149] The calculation submodule is used to calculate the first target business domain ID corresponding to the target sub-data source based on the business domain model;
[0150] The first determining submodule is used to determine the first target business domain ID as the business domain attribute of the association relationship.
[0151] Optionally, the computing submodule includes:
[0152] The second extraction submodule is used to extract target business topic words from the target sub-data source;
[0153] The second determining submodule is used to determine the target word vector corresponding to the target business topic word;
[0154] The third determining submodule is used to determine the target business cluster with the smallest distance from the target word vector from the business domain model;
[0155] The execution submodule is used to use the business domain ID of the target business cluster as the first target business domain ID.
[0156] Optionally, the device 600 further includes:
[0157] The first response module is used to respond to the user's business operation and determine the second target business domain ID corresponding to the business operation;
[0158] The second determining module is used to determine the subgraph corresponding to the second target business domain ID from the knowledge graph, wherein the business domain attribute of the association in the subgraph is the second target business domain ID;
[0159] The second execution module is used to execute the business operation based on the sub-map.
[0160] Optionally, the first response module includes:
[0161] The fourth determination submodule is used to determine the user's business operation permission information;
[0162] The fifth determining submodule is used to determine the second target business domain ID based on the business operation permission information and the business domain model.
[0163] Optionally, the device 600 further includes:
[0164] The second response module is used to respond to the user's business operation and determine the second target business domain ID corresponding to the business operation;
[0165] The third determining module is used to determine the sub-ontology library corresponding to the second target business domain ID from the target knowledge graph ontology library, wherein the business domain attribute of the relationship between the entity data structures in the sub-ontology library is the second target business domain ID;
[0166] The fourth determining module is used to determine the sub-graph corresponding to the sub-ontology library from the knowledge graph;
[0167] The third execution module is used to execute the business operation based on the sub-map.
[0168] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0169] In another exemplary embodiment, a non-transitory computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the method described in any of the first aspects.
[0170] Figure 7 This is a block diagram illustrating an electronic device 700 according to an exemplary embodiment. Figure 7 As shown, the electronic device 700 may include a processor 701 and a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input / output (I / O) interface 704, and a communication component 705.
[0171] The processor 701 controls the overall operation of the electronic device 700 to complete all or part of the steps in the knowledge graph construction method described above. The memory 702 stores various types of data to support the operation of the electronic device 700. This data may include, for example, instructions for any application or method operating on the electronic device 700, and application-related data such as contact data, sent and received messages, images, audio, video, etc. The memory 702 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. Multimedia component 703 may include a screen and an audio component. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 702 or transmitted via communication component 705. The audio component also includes at least one speaker for outputting audio signals. I / O interface 704 provides an interface between processor 701 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IoT, eMTC, or other 5G technologies, or combinations thereof, is not limited here. Therefore, the corresponding communication component 705 may include: a Wi-Fi module, a Bluetooth module, an NFC module, etc.
[0172] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the knowledge graph construction method described above.
[0173] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the knowledge graph construction method described above. For example, the computer-readable storage medium may be the memory 702 including program instructions, which may be executed by the processor 701 of the electronic device 700 to complete the knowledge graph construction method described above.
[0174] In another exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program executable by a programmable device, the computer program having a code portion for performing the knowledge graph construction method described above when executed by the programmable device.
[0175] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and these simple modifications all fall within the protection scope of this disclosure.
[0176] It should also be noted that the various specific technical features described in the above embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.
[0177] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.
Claims
1. A method for constructing a knowledge graph, characterized in that, The method includes: Obtain an initial knowledge graph ontology, which includes multiple predefined entity data structures, each of which includes an entity category and entity attributes. Based on the entity category and entity attributes of the entity data structure, entities corresponding to the entity category and including the entity attributes are extracted from the data source; For the first and second entities that have a relationship among the extracted entities, the business domain attributes of the relationship are determined based on the business domain model. The relationship between the first entity and the second entity is determined based on the data source. A knowledge graph is generated based on the extracted entities, the relationships, and the business domain attributes of the relationships, and / or the relationship between the first entity data structure and the second entity data structure in the initial knowledge graph ontology is completed based on the relationships and the business domain attributes of the relationships, to obtain the target knowledge graph ontology. The method further includes generating the business domain model by: extracting business topic words from the data source; converting the business topic word and its preset weight into word vectors for each business topic word; clustering all the word vectors to obtain multiple business clusters; assigning a business domain ID to each business cluster; and generating the business domain model based on each business cluster and its business domain ID. For the first and second entities with a relationship among the extracted entities, the business domain attributes of the relationship are determined based on the business domain model, including: Determine the target sub-data source from the data source to extract the first entity and the second entity; Based on the business domain model, calculate the first target business domain ID corresponding to the target sub-data source; The first target business domain ID is determined as the business domain attribute of the association.
2. The method according to claim 1, characterized in that, The step of calculating the first target business domain ID corresponding to the target sub-data source based on the business domain model includes: Extract target business keywords from the target sub-data source; Determine the target word vector corresponding to the target business topic term; Determine the target business cluster that has the smallest distance to the target word vector from the business domain model; Use the business domain ID of the target business cluster as the first target business domain ID.
3. The method according to claim 1 or 2, characterized in that, The method further includes: In response to a user's business operation, determine the second target business domain ID corresponding to the business operation; A subgraph corresponding to the second target business domain ID is determined from the knowledge graph, wherein the business domain attribute of the association in the subgraph is the second target business domain ID; The business operation is performed based on the sub-map.
4. The method according to claim 3, characterized in that, The step of determining the second target business domain ID corresponding to the user's business operation in response to the business operation includes: Determine the user's business operation permission information; The second target business domain ID is determined based on the business operation permission information and the business domain model.
5. The method according to claim 1 or 2, characterized in that, The method further includes: In response to a user's business operation, determine the second target business domain ID corresponding to the business operation; The sub-ontology corresponding to the second target business domain ID is determined from the target knowledge graph ontology, and the business domain attribute of the relationship between the entity data structures in the sub-ontology is the second target business domain ID; Determine the sub-graph corresponding to the sub-ontology from the knowledge graph; The business operation is performed based on the sub-map.
6. A knowledge graph construction device, characterized in that, The device includes: The acquisition module is used to acquire an initial knowledge graph ontology library, which includes multiple predefined entity data structures, each of which includes an entity category and an entity attribute. An extraction module is used to extract entities corresponding to the entity category and including the entity attributes from the data source based on the entity category and entity attributes of the entity data structure. The first determining module is used to determine the business domain attribute of the relationship between the first entity and the second entity that have a relationship among the extracted entities, based on the business domain model. The relationship between the first entity and the second entity is determined based on the data source. The first execution module is used to generate a knowledge graph based on the extracted entities, the relationships, and the business domain attributes of the relationships, and / or to complete the relationship between the first entity data structure and the second entity data structure in the initial knowledge graph ontology based on the relationships and the business domain attributes of the relationships, so as to obtain the target knowledge graph ontology. A business domain model generation module is used to extract business topic words from the data source; for each business topic word, convert the business topic word and its preset weight into word vectors; cluster all the word vectors to obtain multiple business clusters; assign a business domain ID to each business cluster; and generate the business domain model based on each business cluster and its business domain ID. The first determining module includes: The first extraction submodule is used to determine the target sub-data source from the data source for extracting the first entity and the second entity; The calculation submodule is used to calculate the first target business domain ID corresponding to the target sub-data source based on the business domain model; The first determining submodule is used to determine the first target business domain ID as the business domain attribute of the association relationship.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1-5.
8. An electronic device, characterized in that, include: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method according to any one of claims 1-5.
Citation Information
Patent Citations
Method and device for constructing knowledge map
CN109508383A
Knowledge graph construction method for power grid main equipment
CN112612902A