Knowledge graph auxiliary construction method, device, equipment and storage medium

By building an instance map in the knowledge graph management platform and using clustering and attention weights to generate general concepts and relationships, the problem of low efficiency in knowledge graph construction in the existing technology is solved, and automated knowledge graph construction is realized, reducing expert participation Spend.

CN113961721BActive Publication Date: 2024-12-06ANHUI IFLYTEK INTELLIGENT SYST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111298783.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-04
Publication Date
2024-12-06
Estimated Expiration
2041-11-04

AI Technical Summary

Technical Problem

The existing knowledge graph management platform has high requirements for users during the construction process and requires in-depth participation of business experts, resulting in low efficiency in knowledge graph construction. Especially after the automatic extraction of entities and relationships in the bottom-up construction process, business experts are still needed. Summary and summary increase the difficulty.

Method used

By extracting triples from the target data source, general concepts and relationships are generated based on entity clustering and attention weights, knowledge graph ontology is automatically constructed, and experts participate in summary and induction work.

Benefits of technology

It reduces the difficulty of building a knowledge graph, improves efficiency, reduces dependence on business experts, and simplifies the process of building a knowledge graph.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113961721B_ABST
    Figure CN113961721B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a knowledge graph auxiliary construction method, device, equipment and storage medium, which obtains general concepts and relationships by abstracting the various associations in the existing knowledge graph, and after using triples to construct an instance graph, clusters the entities in the instance graph to obtain clustering results, and finally constructs the knowledge graph ontology according to the general concepts and relationships corresponding to the type of the instance graph, as well as the clustering results. It can be seen that based on this application, some links of summarizing and inducing entities are automatically realized, and with the assistance of general concepts and relationships, the process of constructing a knowledge graph greatly reduces the workload of experts / graph builders in summarizing and inducing entities, thereby reducing the difficulty of knowledge graph construction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information processing technology, and more specifically, to a knowledge graph-assisted construction method, device, equipment and storage medium. Background Art

[0002] As a typical product of big data knowledge engineering, knowledge graphs explicitly express complex domain knowledge and knowledge systems in a symbolic manner through steps such as data mining, knowledge modeling, cognitive computing, and graphics drawing, providing a comprehensive, holistic, and relational chain reference and support for domain knowledge research and development laws.

[0003] The construction of knowledge graph includes a whole set of processes, including ontology construction, knowledge extraction, entity alignment, knowledge fusion, and knowledge storage. Each link is indispensable. Among them, the quality of ontology construction is the cornerstone for determining the reasoning ability of knowledge graphs and the performance of intelligent applications. At present, domain ontology mainly relies on manual construction, which requires frequent intervention of industry experts and algorithm personnel. When implementing map-related applications in a new industry, it takes weeks or even months to build a complete and usable knowledge graph ontology.

[0004] In order to improve the efficiency of knowledge graph construction, the knowledge graph management platform came into being. With the help of the visual interface and knowledge management functions of the knowledge graph management platform, the construction of the knowledge graph and data access can be completed quickly. However, in actual use, there are still the following shortcomings:

[0005] The current knowledge graph management platform has high requirements for users. For example, in the top-down construction process, in-depth participation of business experts is still needed to help the business side clarify needs and application scenarios, enumerate abstract concepts in the data, and clarify the complex hierarchical relationships between concepts. In the bottom-up construction process, only the automatic extraction of entities and relationships is achieved, and business experts are still needed to summarize and generalize to form an ontology.

[0006] Therefore, it is necessary to provide a knowledge graph construction method that can reduce the difficulty of knowledge graph construction. Summary of the invention

[0007] In view of this, the present application provides a knowledge graph auxiliary construction method, device, equipment and storage medium to reduce the difficulty of knowledge graph construction.

[0008] In order to achieve the above objectives, the proposed solution is as follows:

[0009] A knowledge graph auxiliary construction method, comprising:

[0010] Constructing an instance graph based on triples; the triples are data extracted from the target data source and organized in an entity-relationship-entity manner;

[0011] Clustering each entity in the instance graph to obtain a clustering result;

[0012] A knowledge graph ontology is constructed based on the general concepts and relationships corresponding to the type of the instance graph and the clustering results; the general concepts and relationships are obtained by abstracting the various association relationships in the existing knowledge graph.

[0013] In the above method, preferably, clustering the entities in the instance graph includes:

[0014] Clustering entities in the instance graph based on the attention weights of the entities in the instance graph.

[0015] In the above method, preferably, clustering the entities in the instance graph based on the attention weights of the entities in the instance graph comprises:

[0016] Obtaining a target feature representation of each entity in the instance graph, wherein the target feature representation of the i-th entity is obtained by aggregating feature representations of the i-th entity and its neighbor entities within T hops based on an attention mechanism;

[0017] The entities in the instance graph are clustered using the target feature representation of each entity to obtain a clustering result.

[0018] In the above method, preferably, the initialization feature representation of each entity in the instance graph is determined based on at least part of the following features: the graph structure of the instance graph, entity features and inter-entity relationship features.

[0019] In the above method, preferably, the process of performing attention mechanism-based aggregation processing on the feature representations of the i-th entity and its neighboring entities within T hops includes:

[0020] Using the feature representation of the 1-hop neighbor entity of the ith entity in the k-1th round, calculate the aggregate feature representation of the 1-hop neighbor entity of the ith entity in the kth round; k is a positive integer less than or equal to T;

[0021] Concatenate the feature representation of the i-th entity in the k-1th round with the aggregated feature representation of the one-hop neighbor entity of the i-th entity in the kth round to obtain a concatenated feature;

[0022] Performing a nonlinear transformation on the splicing feature to obtain a nonlinear transformation result;

[0023] Multiplying the nonlinear transformation result by the attention weight corresponding to the k-th hop neighbor entity of the i-th entity to obtain the feature representation of the i-th entity in the k-th round;

[0024] The feature representation of the i-th entity in the T-th round is the target feature representation of the i-th entity.

[0025] In the above method, preferably, the attention weight corresponding to the k-th hop neighbor entity of the i-th entity is determined by the following method:

[0026] Obtaining the aggregate feature representation corresponding to the neighbor entity of the same hop in the kth round among the neighbor entities within T hops of the i-th entity;

[0027] Perform a linear transformation on the aggregated feature representation of each hop neighbor entity to obtain a linear transformation result corresponding to each hop neighbor entity;

[0028] According to the linear transformation results corresponding to each hop neighbor entity, the attention weight corresponding to the k-hop neighbor entity of the ith entity is calculated.

[0029] The above method preferably further comprises:

[0030] Performing quality assessment on the knowledge graph ontology to obtain a quality assessment result;

[0031] Output the quality assessment result; the quality assessment result is used to correct the knowledge graph ontology.

[0032] In the above method, preferably, the quality assessment of the knowledge graph ontology includes:

[0033] Obtain at least one evaluation index of the knowledge graph ontology, wherein the at least one evaluation index includes at least one of the following evaluation indexes: a structure evaluation index, a semantic evaluation index, a reuse evaluation index, and an application evaluation index;

[0034] Processing the at least one evaluation indicator to obtain a quality evaluation result of the knowledge graph ontology;

[0035] Wherein, the structural evaluation index is used to evaluate the structure of the knowledge graph ontology;

[0036] The semantic evaluation index is used to evaluate the clarity and standardization of the knowledge description in the knowledge graph ontology;

[0037] The reuse evaluation index is used to evaluate the reusability of the knowledge graph ontology in its own field and the degree of reuse in other fields;

[0038] The application evaluation index is used to evaluate the supporting performance of the knowledge graph ontology for upper-level applications.

[0039] The above method, preferably,

[0040] The structural evaluation index includes: a cohesion index and a hierarchical depth index; wherein the cohesion index refers to the closeness of the connection between concepts within the ontology; the hierarchical depth index refers to the depth of the hierarchical structure of concepts in the ontology; and / or,

[0041] The semantic evaluation indicators include: grammar check indicators, relationship check indicators and redundancy check indicators; wherein the grammar check indicator is a score for whether the knowledge description language in the knowledge graph ontology conforms to general specifications; the relationship check indicator refers to the proportion of inter-concept relationships in the knowledge graph ontology in general relationships; the redundancy check indicator refers to the proportion of incorrect concepts and relationships in the knowledge graph ontology; and / or,

[0042] The reuse evaluation index includes: an ontology reuse index and a knowledge reuse index; wherein the ontology reuse index is the ratio of the domain knowledge described in the knowledge graph ontology to the knowledge in other fields; the knowledge reuse index is the ratio of the number of concepts of subclasses in the knowledge graph ontology to the number of subclasses in the knowledge ontology in other fields; and / or,

[0043] The application evaluation indicators include: model accuracy indicators, response time indicators and resource consumption indicators of the knowledge graph ontology in each target application scenario.

[0044] In the above method, preferably, constructing a knowledge graph ontology according to the common concepts and relationships corresponding to the types of the instance graphs and the clustering results includes:

[0045] The common concepts and relationships and the clustering results are output so that the knowledge graph builder can view and build the knowledge graph ontology.

[0046] A knowledge graph auxiliary construction device, comprising:

[0047] A construction module, for constructing an instance graph based on triples; the triples are data extracted from a target data source and organized in an entity-relationship-entity manner;

[0048] A clustering module, used for clustering each entity in the instance graph based on the attention weight of each entity in the instance graph to obtain a clustering result;

[0049] A construction module is used to construct a knowledge graph ontology based on the general concepts and relationships corresponding to the type of the instance graph and the clustering results; the general concepts and relationships are obtained by abstracting the various association relationships in the existing knowledge graph.

[0050] A knowledge graph auxiliary construction device, comprising a memory and a processor;

[0051] The memory is used to store programs;

[0052] The processor is used to execute the program to implement each step of the knowledge graph assisted construction method as described in any of the above items.

[0053] A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, each step of the knowledge graph-assisted construction method as described in any one of the above items is implemented.

[0054] From the above technical scheme, it can be seen that the knowledge graph auxiliary construction method, device, equipment and storage medium provided in the embodiment of the present application, construct an instance graph according to the triples extracted from the target data source, cluster each entity in the instance graph, and obtain a clustering result; according to the general concepts and relationships corresponding to the type of the instance graph (the general concepts and relationships are abstracted by the various association relationships of the existing knowledge graph), and the clustering results, the knowledge graph ontology is constructed. Based on the embodiment of the present application, the general concepts and relationships are obtained by abstracting the various association relationships in the existing knowledge graph, and after the instance graph is constructed using the triples, the various entities in the instance graph are clustered to obtain clustering results, and finally the knowledge graph ontology is constructed according to the general concepts and relationships corresponding to the type of the instance graph, and the clustering results. It can be seen that based on this application, some links of summarizing and inducing entities (for example, clustering entities in the instance graph) are automatically realized, and with the assistance of general concepts and relationships, the process of constructing the knowledge graph greatly reduces the workload of experts / graph builders to summarize and summarize entities, thereby reducing the difficulty of knowledge graph construction. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0056] Figure 1 A flowchart for implementing the knowledge graph-assisted construction method disclosed in the embodiment of the present application;

[0057] Figure 2 A schematic diagram of the structure of an example map disclosed in an embodiment of the present application;

[0058] Figure 3 Based on the disclosed embodiment of this application Figure 2 An example diagram of a graph ontology constructed from the example graph shown;

[0059] Figure 4 A flowchart for implementing clustering of entities in an instance graph based on the attention weights of each entity in the instance graph disclosed in an embodiment of the present application;

[0060] Figure 5 A flowchart for implementing the aggregation processing based on the attention mechanism for the feature representation of the i-th entity and its neighboring entities within T hops disclosed in the embodiment of the present application;

[0061] Figure 6 A flowchart for implementing clustering entities in an instance graph by using target feature representations of each entity disclosed in an embodiment of the present application;

[0062] Figure 7 A flowchart for implementing quality assessment of knowledge graph ontology disclosed in an embodiment of the present application;

[0063] Figure 8 An overall construction process architecture diagram of constructing a knowledge graph ontology based on an instance graph disclosed in an embodiment of the present application;

[0064] Fig. 9 A schematic diagram of the structure of a knowledge graph auxiliary construction device disclosed in an embodiment of the present application;

[0065] Fig.10 This is a hardware structure block diagram of the electronic device disclosed in the embodiment of the present application. DETAILED DESCRIPTION

[0066] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0067] Although cognitive intelligence represented by knowledge graphs is developing slowly, it is the only way for the third generation of artificial intelligence. Based on the nature of knowledge, the knowledge graphs currently being studied can be divided into two categories: general knowledge graphs and industry knowledge graphs (also called domain knowledge graphs).

[0068] The general knowledge graph is based on Internet development data, with encyclopedias or community crowdsourcing as the main source. Its knowledge is mainly factual triples, and most of it is extracted from open domain Web information. It has a certain tolerance for the quality of knowledge extraction and uses knowledge fusion to improve data quality. Its application areas are mainly in search and question-answering, with relatively low requirements for reasoning.

[0069] Industry knowledge graphs are mainly sourced from vertical fields such as transportation, government affairs, and medical care, or data within enterprises. They usually require rapid expansion and the construction of industry barriers. The knowledge structure is more complex and usually includes ontology engineering and rule-based knowledge. The quality requirements for knowledge extraction are very high. Most of them rely on joint extraction from structured, unstructured, and semi-structured data within the enterprise, and require manual review and verification to ensure quality. The application form of industry knowledge graphs is more comprehensive, with higher requirements for reasoning and strong interpretability. Generally, multi-field graph fusion is an effective means to expand the scale of industry knowledge graphs.

[0070] With the continuous development of cognitive intelligence, knowledge graphs have gradually shifted from the first half of artificial intelligence, which was pursued by the academic community, to the second half of industrial application. They have played a valuable role in many fields and applications, and have also allowed more people to understand and contact knowledge graphs. However, in the actual implementation of industry knowledge graphs, there are still many difficulties, and there are many business and technical problems that need to be solved. The first is graph design and construction, which is also the direct threshold for applying knowledge graphs to empower businesses. At present, the industry has not yet solved the problem of graphs from scratch. This is mainly reflected in the low degree of automation in the knowledge graph ontology design process. It still requires a lot of participation and repeated discussions between business experts and graph designers to finally determine the types of domain concepts, granularity, and knowledge boundaries. In addition, when the application scenario or data source changes, the originally designed graph structure needs to be reconstructed, and the above steps will have to be repeated.

[0071] Therefore, how to reduce the cost of ontology construction based on big data knowledge mining technology is undoubtedly a very meaningful research direction. In the process of using knowledge graphs to empower various industries, there is an urgent need for an auxiliary construction method and system that can quickly complete the construction of industry knowledge graphs based on existing industry data and industry knowledge.

[0072] At present, in order to improve the efficiency of knowledge graph construction, the knowledge graph management platform has come into being. With the help of the visual interface and knowledge management functions of the knowledge graph management platform, the construction of the knowledge graph and data access can be completed quickly. However, there are still the following shortcomings in actual use:

[0073] The current knowledge graph management platform has high requirements for users. For example, in the top-down ontology construction process, in-depth participation of business experts is still required to help the business side clarify needs and application scenarios, enumerate abstract concepts in the data, and clarify the complex hierarchical relationships between concepts. In the bottom-up ontology construction process, only the automatic extraction of entities and relationships is achieved, and business experts are still needed to summarize and generalize to form the ontology.

[0074] In order to solve the problems existing in the bottom-up ontology construction method, the knowledge graph assisted construction method of the present application is proposed. Although there are some knowledge graph assisted construction methods in the prior art, their essence is still the top-down ontology construction method.

[0075] like Figure 1 As shown, a flowchart for implementing the knowledge graph-assisted construction method provided in the embodiment of the present application may include:

[0076] Step S101: construct an instance graph based on triples; wherein triples are data extracted from a target data source and organized in an entity-relationship-entity manner.

[0077] The target data source refers to the industry data used to extract triples, which may include at least one type of data in the industry: structured data (e.g., relational databases), unstructured data (e.g., pictures, videos, audios, etc.), and semi-structured data (e.g., XML data, JSON data, encyclopedias, etc.).

[0078] As an example, Ang Lee is an entity and Life of Pi is an entity. It is obvious that there is a relationship between the two entities, that is, Ang Lee is the director of Life of Pi, that is, the triple is: Ang Lee→Director→Life of Pi.

[0079] The triples may be obtained by at least one of the following methods: manual extraction and entry, and automatic extraction.

[0080] like Figure 2 FIG. 1 is a schematic diagram of a structure of an example map provided in an embodiment of the present application. The example map embodies some traffic scoring regulations. Figure 2 Among the entities shown, only one-way relationships exist between entities. In some scenarios, two-way relationships may exist between entities.

[0081] Step S102: Cluster each entity in the instance graph to obtain a clustering result.

[0082] In an embodiment of the present application, when clustering entities in an instance graph, the entities may be clustered based on target features of the entities.

[0083] Optionally, the target feature of each entity can be obtained by aggregating the feature representations of the entity and at least some of its one-hop neighbor entities. As an example, for any entity, the feature identifiers of at least some of its one-hop neighbor entities can be used to calculate the aggregate feature representation corresponding to the entity, the aggregate feature representation can be concatenated with the feature representation of the entity to obtain a concatenated feature, and the concatenated feature can be nonlinearly transformed to obtain the target feature of the entity.

[0084] or,

[0085] The target feature of each entity can be obtained by aggregating the features of the entity and its neighbor entities within T (T is a positive integer greater than 1) hops; at least some entities are selected for aggregation for each hop neighbor entity. As an example, for any entity, the aggregated feature representation of the 1-hop neighbor entity of the entity in the k-1 round can be used to calculate the aggregated feature representation of the 1-hop neighbor entity of the entity in the k-1 round; k is a positive integer less than or equal to T. The feature representation of the entity in the k-1 round is concatenated with the aggregated feature representation of the 1-hop neighbor entity of the entity in the k-1 round to obtain the concatenated feature, and the concatenated feature is nonlinearly transformed to obtain the target feature of the entity.

[0086] Step S103: Construct a knowledge graph ontology based on the common concepts and relationships corresponding to the type of instance graph and the clustering results.

[0087] Among them, common concepts and relationships are obtained by abstracting the various association relationships in the existing knowledge graph.

[0088] The inventors of this application have discovered that the graph structures of knowledge in different fields are often different. For example, condition-guided graphs have a more obvious hierarchical structure, which is suitable for service recommendations in government affairs, finance, and operator customer service; policy and regulation graphs are centered on a certain type of concept and are externally linked to a variety of abstract condition types, which is suitable for association analysis of policy, law, event and other scenarios; domain general knowledge graphs emphasize decentralization, which is suitable for knowledge representation in scenarios such as transportation and education.

[0089] Optionally, the type of the instance graph can be determined by using a GCN (Graph Convolutional Network) graph classifier or a K-WL algorithm to classify the instance graph. Of course, in the embodiment of the present application, the type of the graph may include but is not limited to the three categories listed above (conditional guidance, policy and regulation, and general knowledge), and may also include other categories.

[0090] In the embodiment of the present application, the existing knowledge graph is classified in advance in terms of graph structure to determine the type of the existing knowledge graph. In addition, the existing knowledge graph is also mined for association patterns to determine common concepts and relationships. Specifically, the graph prior knowledge can be combined to summarize and mine the common association patterns under each type. The common association pattern is a high-level summary and abstraction of the entities and various associations in the existing knowledge graph. The common association pattern reflects the most essential interconnection organization method between concepts. As shown in Table 1, the relationships and their English definitions in some common association patterns provided in the embodiment of the present application are shown. The graph type and the common association pattern provide a reusable graph ontology template, which can also include the graph's hierarchical structure, entity attributes, and relationship attributes.

[0091] Table 1 General association pattern table and its definition

[0092]

[0093]

[0094] Optionally, after obtaining the general association pattern, the general association pattern can be used to guide data entry personnel to perform D2R mapping and manually enter triples. For those who do not understand the concept of knowledge graph, there is no need to understand professional terms such as entities and attributes. They only need to enter triples that conform to the general association pattern. Manual entry is suitable for scenarios such as small data samples and scattered knowledge distribution. At this time, data entry personnel can refer to the general association pattern and collect and fill in entities in the field that contain the general association pattern by distributed crowdsourcing annotation.

[0095] The general association pattern can also be used to guide open domain extraction, that is, to guide the automatic extraction of triples. Unlike general knowledge graphs, industry knowledge graphs have clear business orientation and internal logic. After forming a general association pattern, the plain text extraction task can be converted into a relationship detection task. The extraction difficulty will be greatly reduced, and the results are more controllable. Open domain extraction can match and extract entities / attributes based on Bert+CRF+AC-Trie, and perform general association relationship detection in Table 1 based on Bert+TextCNN guided by the general association pattern. The specific extraction process can refer to the existing implementation method. Since it is not the main focus of this application, it will not be described in detail here.

[0096] As an example, the entities in the instance graph can be clustered based on the attention weights of the entities based on the HDBSCAN (Hierarchical Density-Based Spatial Clustering of Applications with Noise) clustering algorithm. Of course, the clustering algorithm in the embodiment of the present application is not limited to the HDBSCAN algorithm, but can also be other algorithms, which will not be illustrated one by one here.

[0097] The knowledge graph auxiliary construction method provided in the embodiment of the present application obtains general concepts and relationships by abstracting the various associations in the existing knowledge graph, and after using triples to construct the instance graph, clusters the entities in the instance graph to obtain clustering results, and finally constructs the knowledge graph ontology according to the general concepts and relationships corresponding to the type of the instance graph, as well as the clustering results. It can be seen that based on the present application, some links of summarizing and generalizing entities (for example, clustering entities in the instance graph) are automatically implemented, and with the assistance of general concepts and relationships, the process of constructing the knowledge graph greatly reduces the workload of experts / graph builders in summarizing and generalizing entities, thereby reducing the difficulty of knowledge graph construction.

[0098] Optionally, the common concepts and relationships corresponding to the type of instance graph, as well as the clustering results, can be output so that the knowledge graph builder can view and build the knowledge graph ontology.

[0099] In the embodiment of the present application, after obtaining the clustering results, the general concepts and relationships corresponding to the type and the clustering results can be output. Clustering refers to the aggregation of entities with similar characteristics, so that users (i.e., experts or knowledge graph builders) can abstract and summarize the entities clustered into one category according to the clustering results to obtain abstract concepts. For the relationships between entities, users can abstract or not. If abstraction is required, the relationships in the entity graph can be abstracted by referring to the general concepts and relationships corresponding to the type.

[0100] by Figure 2 For example, assume that the corresponding clustering results are: Regulation 1, Regulation 2, and Regulation 3 are clustered into one category, school buses, trucks, and buses are clustered into one category, speeding and overcrowding are clustered into one category, expressways, highways, and trunk roads are clustered into one category, 6 points are clustered into one category, and <20% and <50% are clustered into one category. As an example, the user can abstract Regulation 1, Regulation 2, and Regulation 3 into regulations, school buses, trucks, and buses into vehicle types, speeding and overcrowding into reasons, expressways, highways, and trunk roads into road types, 6 points into scores, and <20% and <50% into ranges.

[0101] As an example, the type relationship can be abstracted as being triggered, and the vehicle relationship can be abstracted as occurring in. Other relationships remain unchanged, and the constructed knowledge graph ontology is as follows: Figure 3 shown.

[0102] Optionally, the user can determine whether the clustering result is appropriate based on business needs. If it is not appropriate, the user can adjust the clustering granularity according to needs, for example, adjusting the number of categories in the clustering algorithm.

[0103] Optionally, when abstracting the clustering results, you can choose different aggregation granularities, different conceptual hierarchical classifications, etc. according to business needs. For example, assuming that "strawberry" and "watermelon" are clustered into one category, the user can abstract "strawberry" and "watermelon" into the "fruit" category, or classify them into "berry" and "melon" categories, or abstract "strawberry" and "watermelon" into the "fruit" category, and then use "fruit" as the parent category and abstract "strawberry" into subcategories such as "berry" and "melon" under the parent category "fruit".

[0104] In an optional embodiment, one implementation method of clustering the entities in the example graph may be:

[0105] Based on the attention weights of each entity in the instance graph, each entity in the instance graph is clustered.

[0106] In the above-mentioned embodiment, the attention weight of each entity is not considered when clustering each entity. In this embodiment, attention weight is assigned to each entity in the instance graph, and each entity in the instance graph is clustered based on the attention weight of each entity. By introducing the attention mechanism, the clustering accuracy is improved.

[0107] The attention weight of an entity can be determined based on at least some of the following features: the structure of the knowledge graph, the characteristics of the entity, the characteristics of the relationship between entities, etc.

[0108] Among them, the structure of the knowledge graph mainly refers to the connection relationship between nodes in the knowledge graph, such as 1-hop connection relationship, 2-hop connection relationship, and so on.

[0109] The characteristics of an entity mainly refer to the characteristics of the entity itself. For example, if the entity is a piece of text, the characteristics of the entity itself may include but are not limited to the characteristics obtained by encoding the text, or the keywords extracted from the text; for another example, if the entity is a user of an application software, the characteristics of the entity itself may include but are not limited to: the user's attribute information, such as gender, age, occupation, etc.

[0110] The inter-entity relationship feature mainly refers to the relationship between entities determined based on triples.

[0111] In the process of knowledge graph construction, the key to concept abstraction is to aggregate the entities in the entity graph according to the graph structure, node (each entity in the instance graph corresponds to a node) characteristics and association relationships, so as to obtain the mapping relationship between entities and concepts (abstracted).

[0112] Let the instance graph be g, the entity in the graph be ξ, the relationship edge be R, and there are n entities in total. Then R can be expressed as an n×n matrix, and the r in the relationship matrix i,j Represents the head entity e i To the end entity e j The relationship between them can be the relationship label in the entity graph or the open sentence retrieved from the original text. Entity aggregation means: for a given instance graph g, assign an attribute category e to each of the n entities in the graph. y , thus summarizing g into several concepts The example graph described in the embodiment of the present application belongs to a heterogeneous graph, so the graph structure of g and the relationship matrix R are clear, and the entity ξ can contain its own characteristics.

[0113] In practical applications, there may be homonymous relationships in the instance graph. Therefore, it is necessary to sample multi-hop neighbor entities for aggregation and discrimination. The inventors of this application have found that the neighbor entities with larger hop counts from the entity usually have smaller impacts on the entity clustering results. That is, the neighbor entities with larger hop counts from the entity should have weaker influence factors. Therefore, this application introduces attention weights. In theory, the neighbor entities with larger hop counts from the i-th entity have smaller attention weights, and the neighbor entities with smaller hop counts from the i-th entity have larger attention weights. That is, the attention weight corresponding to the k-hop neighbor entity of the i-th entity should be smaller than the attention weight corresponding to the k-1-hop neighbor entity of the i-th entity. However, in practical applications, the above rules are not absolutely met. The specific values ​​are determined by the data distribution of the data source corresponding to the instance graph. Based on this, the above-mentioned flowchart for clustering each entity in the instance graph based on the attention weights of each entity in the instance graph is as follows. Figure 4 As shown, it may include:

[0114] Step S401: Obtain the target feature representation of each entity in the instance graph, wherein the target feature representation of the i-th entity is obtained by aggregating the feature representations of the i-th entity and its neighbor entities within T hops based on the attention mechanism.

[0115] Wherein, T is a positive integer greater than 1. i = 1, 2, 3, ..., L, where L is the number of entities in the instance graph.

[0116] by Figure 2Taking Regulation 3 as an example, the entities such as Highway, Bus, Overcrowding, 6 Points, and <20% are all 1-hop neighbor entities of Regulation 3, and the Expressway entity is a 2-hop neighbor entity of Regulation 3.

[0117] Step S402: clustering entities in the instance graph using the target feature representation of each entity to obtain a clustering result.

[0118] In an embodiment of the present application, when the target feature representation of the i-th entity is aggregated based on the feature representations of its neighbor entities within T hops, the attention weights of the neighbor entities in each hop are taken into account, which can ensure that the knowledge graph-assisted construction method has good robustness and improve the fault tolerance for domain data quality.

[0119] In an optional embodiment, the above process of aggregating the feature representations of the i-th entity and its neighbor entities within T hops based on the attention mechanism can be implemented by a pre-trained graph neural network (GraphSage). A flowchart of an implementation of the above process of aggregating the feature representations of the i-th entity and its neighbor entities within T hops based on the attention mechanism is shown in FIG. Figure 5 As shown, it may include:

[0120] Step S501: using the feature representation of the 1-hop neighbor entity of the ith entity in the k-1th round, calculate the aggregate feature representation of the 1-hop neighbor entity of the ith entity in the kth round; k is a positive integer less than or equal to T.

[0121] In the embodiment of the present application, each entity calculates T rounds of feature representations, and the next round of feature representations will be calculated only after all entities in the instance graph have calculated one round of feature representations. Among them, in the kth round, for the i-th entity, the feature representation of the i-th entity's 1-hop neighbor entity in the k-1 round is used to calculate the aggregated feature representation of the i-th entity's 1-hop neighbor entity in the kth round, so that the aggregated feature representation of the i-th entity's 1-hop neighbor entity in the kth round carries the information of the i-th entity's k-hop neighbor entity.

[0122] Specifically, for any node v in the instance graph, the aggregate feature representation of the one-hop neighboring nodes of the node v in the kth round can be calculated as follows:

[0123]

[0124] in, It represents the aggregated feature representation of at least some of the neighboring nodes of node v in the kth round. In practical applications, a fixed number (denoted as size) of randomly sampled neighboring nodes is generally taken, that is, in each round, size 1-hop neighboring nodes are randomly sampled from the 1-hop neighboring nodes of node v for aggregation; Represents the feature representation of node u, the neighbor node of node v, in round k-1; AGGREGATE k Represents an aggregation operation.

[0125] When k = 1, is the initialized feature representation of node u, which may contain only the features of node u itself, or, in addition to its own features, the initialized feature representation may also incorporate the features of its 1-hop neighboring nodes. As an example, the initialized feature representation of node v that incorporates the features of its 1-hop neighboring nodes can be calculated as follows:

[0126]

[0127] Among them, h v Represents the initialized feature representation of node v that incorporates the features of its 1-hop neighbor nodes; represents the set of nodes whose adjacency relationship with node v is r (i.e., the set of at least some of the one-hop neighbor nodes of node v), h i express The initialized feature representation of the i-th node in , the value of the feature representation is a preset value; W r is the relationship matrix conversion function obtained through training, c v,r is the normalization constant, and its value is (that is, the number of nodes), x v is the feature of node v. The above formula combines the node's own features with neighboring nodes connected by different edge types. When node v does not contain its own features, the node features are represented by the positive and negative adjacency relationships.

[0128] Specifically, graph neural networks can use max-pooling aggregators Aggregate the feature representations of node v's neighbor nodes, where max represents the maximum value operation of the corresponding elements, that is, taking the maximum value of the features at the same position in each feature representation. Specifically, the max-pooling aggregator can aggregate the feature representations of the k-1th round of the 1-hop neighbor nodes of node v in the following way:

[0129]

[0130] Where σ is the sigmoid function, W pool is a pooling function; b is a pre-learned bias parameter. That is, the max-pooling aggregator uses W for each sampled 1-hop neighbor node. poolThe transformed feature representation corresponding to each 1-hop neighbor node is obtained, and then the transformed feature representation is normalized by the sigmoid function to obtain the normalized feature representation. Then, the maximum value operation is taken for each normalized feature representation, that is, the maximum value is taken for the value at the same position in each normalized feature representation to obtain the aggregated feature representation of the 1-hop neighbor entity of node v in the kth round.

[0131] Step S502: concatenate the feature representation of the i-th entity in the k-1th round with the aggregated feature representation of the i-th entity's one-hop neighbor entity in the kth round to obtain a concatenated feature.

[0132] Step S503: Perform nonlinear transformation on the splicing features to obtain a nonlinear transformation result.

[0133] The concatenated features are linearly transformed using the pre-learned parameter matrix to obtain a transformation result, and then the transformation result is normalized to obtain a nonlinear transformation result. Optionally, the concatenated features can be nonlinearly transformed using a sigmoid function.

[0134] Step S504: multiply the nonlinear transformation result by the attention weight corresponding to the k-th hop neighbor entity of the i-th entity to obtain the feature representation of the i-th entity in the k-th round;

[0135] Among them, the attention weight corresponding to the k-th hop neighbor entity of the ith entity is the same as or different from the attention weight corresponding to the k-1-th hop neighbor entity of the ith entity. In some scenarios, the attention weight corresponding to the k-th hop neighbor entity is less than or equal to the attention weight corresponding to the k-1-th hop neighbor entity. In other scenarios, the attention weight corresponding to the k-th hop neighbor entity is greater than or equal to the attention weight corresponding to the k-1-th hop neighbor entity. The specific size relationship is determined by the data distribution of the data source corresponding to the knowledge graph.

[0136] Assuming that the node corresponding to the i-th entity is node v, steps S502 to S504 can be expressed as follows:

[0137]

[0138] in, represents the feature representation of node v in round k; α k represents the attention weight corresponding to the k-th hop neighbor node of node v, that is, the attention weight corresponding to the k-th hop neighbor entity of the ith entity; σ is the sigmoid function, W k represents the linear transformation parameters corresponding to the kth round that have been learned in advance; CONCAT represents the concatenation operation; Represents the feature representation of node v in the k-1th round; Represents the aggregated feature representation of the 1-hop neighbor entities of the i-th entity at the k-th round.

[0139] The feature representation of the i-th entity in round T is the target feature representation of the i-th entity, that is, when k = T That is the target feature representation of the entity corresponding to node v.

[0140] In an optional embodiment, the attention weight α corresponding to the k-th hop neighbor entity of the i-th entity is k This can be determined as follows:

[0141] Obtain the aggregated feature representation corresponding to the neighbor entities in the same hop in the kth round among the neighbor entities within T hops of the i-th entity.

[0142] For the i-th entity, the aggregate feature representation corresponding to each entity in its k-th hop neighbor entities is calculated by the above formulas (1) and (3). That is, after obtaining the feature representation of each entity in the k-1th round, for each entity, the feature representation of the entity's 1-hop neighbor entity in the k-1th round is used to calculate the aggregate feature representation of the entity's 1-hop neighbor node in the kth round, and the aggregate feature representation is the aggregate feature representation corresponding to the entity in the kth round.

[0143] Perform a linear transformation on the aggregated feature representation of each hop neighbor entity obtained to obtain the linear transformation result corresponding to each hop neighbor entity. That is, perform a linear transformation on the aggregated feature corresponding to the 1-hop neighbor entity of the i-th entity in the k-th round to obtain the linear transformation result corresponding to the 1-hop neighbor entity of the i-th entity; perform a linear transformation on the aggregated feature corresponding to the 2-hop neighbor entity of the i-th entity in the k-th round to obtain the linear transformation result corresponding to the 2-hop neighbor entity of the i-th entity; perform a linear transformation on the aggregated feature corresponding to the 3-hop neighbor entity of the i-th entity in the k-th round to obtain the linear transformation result corresponding to the 3-hop neighbor entity of the i-th entity... and so on, until the linear transformation result corresponding to the T-hop neighbor entity of the i-th entity is obtained.

[0144] For each hop neighbor entity, the linear transformation may be performed using aggregate features of all entities in the hop neighbor entity, or may be performed using aggregate features of some entities in the hop neighbor entity.

[0145] Optionally, a pre-trained parameter matrix may be used to perform a linear transformation on the aggregated feature representation corresponding to the same hop-neighbor entity in the kth round to obtain a linear transformation result corresponding to each hop-neighbor entity.

[0146] According to the linear transformation results corresponding to each hop neighbor entity, the attention weight corresponding to the k-hop neighbor entity of the ith entity is calculated.

[0147] Optionally, the attention weight α corresponding to the k-hop neighbor entity of the i-th entity (corresponding to node v) can be calculated based on the following formula: k :

[0148]

[0149] Among them, W a Represents the pre-trained parameter matrix.

[0150] In an optional embodiment, a flowchart for implementing clustering entities in the instance graph using the target feature representation of each entity is as follows: Figure 6 As shown, it may include:

[0151] Step S601: Dimensionality reduction is performed on the target feature representation of each entity to obtain the reduced-dimensional feature representation of each entity.

[0152] Optionally, the UMAP (uniform manifold approximation and projection) algorithm can be used to reduce the dimension of the target feature representation of each entity.

[0153] Step S602: clustering entities in the instance graph using the dimensionally reduced feature representation of each entity.

[0154] By reducing the dimension, we can not only reduce the computational complexity, the amount of calculation and memory usage, but also effectively extract key features.

[0155] Furthermore, after obtaining the knowledge graph ontology, the embodiment of the present application can also evaluate the knowledge graph ontology. Optionally, the knowledge graph auxiliary construction method provided by the embodiment of the present application can also include:

[0156] Perform quality assessment on the knowledge graph ontology to obtain quality assessment results;

[0157] Output quality assessment results, which are used to correct the knowledge graph ontology.

[0158] At present, after the knowledge graph ontology is built, it is usually directly applied without an evaluation mechanism for the knowledge graph ontology. The quality of the knowledge graph ontology can only be discovered after the knowledge graph ontology is applied to the actual application scenario. When the quality of the knowledge graph ontology is found to be poor, the knowledge graph ontology is corrected. This method leads to a long construction cycle of the knowledge graph. In the embodiment of the present application, after the knowledge graph ontology is obtained, the quality of the knowledge graph ontology is automatically evaluated, and then the user can directly correct the knowledge graph according to the quality evaluation results, thereby shortening the construction cycle of the knowledge graph ontology.

[0159] In an optional embodiment, a flowchart for implementing the quality assessment of the knowledge graph ontology is as follows: Figure 7 As shown, it may include:

[0160] Step S701: Obtain at least one evaluation indicator of the constructed knowledge graph ontology, where the at least one evaluation indicator may include but is not limited to at least one of the following evaluation indicators: a structural evaluation indicator, a semantic evaluation indicator, a reuse evaluation indicator, and an application evaluation indicator.

[0161] Step S702: Process at least one of the above evaluation indicators to obtain a quality evaluation result of the knowledge graph ontology.

[0162] Optionally, scores of various evaluation indicators may be obtained (e.g., scores of structural evaluation indicators, and / or scores of semantic evaluation indicators, and / or scores of reuse evaluation indicators, and / or scores of application evaluation indicators);

[0163] If there is only one evaluation indicator, the score of the evaluation indicator can be used as the quality evaluation result of the knowledge graph ontology; if there are at least two evaluation indicators, the scores of each evaluation indicator can be weighted and summed to obtain the quality evaluation result of the constructed knowledge graph ontology. The score of each evaluation indicator can be determined by the corresponding relationship between the indicator value and the score.

[0164] The quality assessment result is the quality score of the knowledge graph ontology (i.e., the result of weighted summation). The higher the quality score, the higher the quality of the knowledge graph ontology.

[0165] When there are at least two evaluation indicators, the weights corresponding to the evaluation indicators may be the same or different. For example, the weight of the application evaluation indicator is greater than the weight of the structure evaluation indicator, the weight of the structure evaluation indicator is greater than the weight of the semantic evaluation indicator, and the weight of the semantic evaluation indicator is greater than the weight of the reuse evaluation indicator.

[0166] Optionally, the weights of each evaluation index can be determined based on the analytic hierarchy process (AHP). The specific implementation method can refer to the existing solution and will not be described in detail here. As an example, the weights of the structure evaluation index, semantic evaluation index, reuse index and application evaluation index are 0.24, 0.13, 0.08 and 0.55 respectively.

[0167] Among them, the structural evaluation index is used to evaluate the structure of the knowledge graph ontology. The structural evaluation index can be determined based on the number of concepts in the knowledge graph ontology (each node in the knowledge graph represents a concept) and the path-related information between nodes. Optionally, the structural evaluation index may include: cohesion index and hierarchical depth index. The cohesion index refers to the degree of connection between concepts within the knowledge graph ontology. The higher the cohesion of the ontology, the closer the connection between the concepts, and vice versa. The hierarchical depth index is the depth of the hierarchical structure of the concepts in the ontology, reflecting the richness of the concepts and the degree of refinement of the description. The deeper the depth of the conceptual hierarchy, the richer the concepts described by the ontology, the more refined and specific the description of the real world, and the more conducive to the knowledge graph ontology users to obtain comprehensive domain knowledge. The score of the structural evaluation index can be the weighted sum of the score of the cohesion index and the score of the hierarchical depth index. The weights of the cohesion index and the hierarchical depth index can be the same or different, and this application does not make specific restrictions.

[0168] Optionally, cohesion can be calculated as follows:

[0169] The knowledge graph ontology is G. Each node in the graph represents a concept, and each directed edge represents the relationship between concepts. The ontology G describes the hierarchical structure of the ontology. Based on this, the knowledge graph ontology can be divided into K submodules according to the directed acyclic graph (DAG) detection algorithm. Each submodule is a directed acyclic graph. Each submodule can represent the knowledge description of a field. For each submodule m, its cohesion C m It can be calculated based on the number of concepts in submodule m and the relationship between concepts. Specifically, it can be calculated as follows:

[0170]

[0171] Where N represents the number of concepts in submodule m. i and c j , R(c i , c j ) means c i Can it be associated to c through a multi-hop path j , if there is a direct or indirect relationship (i.e. c i Can be connected to c through a 1-hop or multi-hop path j ), then R(c i , c j )=1, otherwise R(c i , c j )=0. If module m has only one concept, its cohesion is 1, that is, if N=1, then C m=1. Then, the cohesion C of the body G According to the cohesion of each submodule, the average of the cohesion of each submodule can be calculated to obtain the cohesion of the knowledge graph ontology, which can be expressed as follows:

[0172]

[0173] The hierarchical depth D of the knowledge graph ontology G It can be determined based on the number of paths and the number of relationships of each submodule. The number of paths of each submodule is the number of all paths from the root node to the leaf node of the submodule, and the number of relationships of each submodule is the number of relationships passed through in all paths from the root node to the leaf node of the submodule. The hierarchical depth D G It can be calculated by the following formula:

[0174]

[0175] Among them, for each submodule i, P i Represents the number of all paths from the root node to the leaf node of the DAG graph; R i represents the number of relations passed through in the above path, that is, the length of all paths, D G It represents the average hierarchical depth of all knowledge types described in the knowledge graph ontology structure.

[0176] Semantic evaluation indicators are used to evaluate the clarity and standardization of knowledge description in the knowledge graph ontology. Semantic evaluation indicators can be determined based on the standardization, universality and correctness of the knowledge description language in the knowledge graph ontology. Optionally, semantic evaluation indicators may include grammar check indicators, relationship check indicators and redundancy check indicators. The grammar check indicator is a score for whether the knowledge description language in the knowledge graph ontology conforms to the general specification. The knowledge graph ontology with a low grammar evaluation score is difficult for users to understand, inherit and reuse, and pre-trained language models, industry knowledge models, etc. cannot be used for fine-tuning the upper-level applications of the ontology; the relationship check indicator refers to the proportion of the relationship between concepts in the knowledge graph ontology in the general relationship. The higher the proportion, the higher the score. The ontology with a higher relationship evaluation score has a higher relationship standardization and is more in line with the abstract standards of the industry knowledge system; the redundancy detection indicator refers to the proportion of incorrect concepts and relationships in the knowledge graph ontology. The higher the proportion, the lower the score. Redundancy refers to errors such as duplication and ambiguity in the knowledge graph ontology. The score of the semantic evaluation index can be the weighted sum of the score of the grammar check index, the score of the relationship check index and the score of the redundancy check index. The weights of the grammar check index, the relationship check index and the redundancy check index can be the same or different, and this application does not make specific limitations.

[0177] The reuse (i.e. repeated use) evaluation index is used to evaluate the reusability of the knowledge graph ontology in its own field and the degree of reuse in other fields. The reuse evaluation index can be determined based on the relationship between the domain knowledge described by the knowledge graph ontology and other domain knowledge. The higher the reuse evaluation index score, the more likely the knowledge graph ontology is to utilize the integration and reasoning of knowledge from different industry fields. The reuse evaluation index may include an ontology reuse index and a knowledge reuse index; wherein the ontology reuse index is the ratio of the domain knowledge described in the knowledge graph ontology to other domain knowledge (specifically, it may be other domain knowledge described in the knowledge graph ontology library). A too high ratio indicates that no new domain knowledge is generated and it is difficult to be reused by new domain knowledge, while a too low ratio indicates that the correlation with other domain knowledge is low and it is difficult to perform knowledge graph fusion. Based on this, when the ratio is in the target interval [a, b], the score of the ontology reuse index is high. When it exceeds the target interval, the score of the ontology reuse index is low, and a is less than b. The knowledge reuse index evaluates the degree of reuse of knowledge in the ontology, which may be the number of concepts belonging to subclasses in the knowledge graph ontology or subclasses in the knowledge graph ontology of other fields (for any concept in the constructed knowledge graph ontology, if the concept has a parent class in the constructed knowledge graph ontology, or the concept has a parent class in the knowledge graph ontology of other fields, then the concept is 1 subclass in the constructed knowledge graph ontology and needs to be counted) in the constructed knowledge graph ontology. The higher the ratio, the higher the score. The score of the reuse evaluation index may be a weighted sum of the score of the subject reuse index and the score of the knowledge reuse index. The weights of the subject reuse index and the knowledge reuse index may be the same or different, and this application does not make any specific limitation.

[0178] Application evaluation indicators are used to evaluate the supporting performance of the knowledge graph ontology for upper-level applications. Application evaluation indicators can be determined based on the operating parameters of the knowledge graph ontology in the model under the target application scenario. It may include: model accuracy indicators, response time indicators and resource consumption indicators of the knowledge graph ontology in each target application scenario. The target application scenarios may include but are not limited to the following: search, question and answer, recommendation, etc. Among them, the higher the model accuracy, the higher the application evaluation score, the shorter the model response time, the higher the application evaluation score, the less the model resource consumption, and the higher the application evaluation. The ontology with a higher application evaluation score can better meet the actual business usage needs. Optionally, the scores corresponding to the above three indicators (model accuracy indicator, response time indicator and resource consumption indicator) can be weighted and summed to obtain the score of the application evaluation indicator. The weights corresponding to the three indicators can be the same or different, and this application does not make specific restrictions.

[0179] The knowledge graph ontology quality assessment system provided in the embodiments of the present application comprehensively assesses the quality of the ontology from at least four aspects, and each dimension reflects the performance of the graph ontology quality in a certain aspect, thereby achieving effective assessment of the knowledge graph ontology.

[0180] Based on the above embodiments, the overall construction process architecture diagram of constructing a knowledge graph ontology based on an instance graph provided in the embodiment of the present application is as follows: Figure 8 As shown, the entities in the instance graph are represented by knowledge (i.e., the aforementioned feature representation) through a graph neural network, and then entity clustering based on attention weights is performed based on the knowledge representation. After that, the knowledge graph ontology can be generated based on the general concepts and relationships (not shown in the figure) corresponding to the type of the instance graph and the clustering results. Thereafter, business and algorithm experts can modify the ontology, or adjust the clustering parameters (the number of clustering categories, the number of nearest neighbors of UMAP, etc.) according to the quality assessment results, or adjust the parameters of the graph neural network, such as adjusting the hyperparameters.

[0181] That is to say, based on the embodiments of the present application, business / algorithm experts can participate in the evaluation, correction and model parameter adjustment of the results of each stage at any time. Optionally, the concepts and instances after entity aggregation can be dragged or merged, new concepts can be created, and existing results can be split.

[0182] Corresponding to the method embodiment, the embodiment of the present application also provides a knowledge graph auxiliary construction device. A structural schematic diagram of the knowledge graph auxiliary construction device provided in the embodiment of the present application is as follows: Fig. 9 As shown, it may include:

[0183] Construction module 901, clustering module 902 and construction module 903; wherein,

[0184] The construction module 901 is used to construct an instance graph according to triples; the triples are data extracted from the target data source and organized in an entity-relationship-entity manner;

[0185] The clustering module 902 is used to cluster the entities in the instance graph to obtain a clustering result;

[0186] The construction module 903 is used to construct a knowledge graph ontology according to the general concepts and relationships corresponding to the type of the instance graph and the clustering results; the general concepts and relationships are obtained by abstracting the various association relationships in the existing knowledge graph.

[0187] The knowledge graph auxiliary construction device provided in the embodiment of the present application obtains general concepts and relationships by abstracting the various associations in the existing knowledge graph. After constructing the instance graph using triples, the entities in the instance graph can be clustered based on the attention weights of the entities in the instance graph to obtain clustering results. Finally, the knowledge graph ontology is constructed based on the general concepts and relationships corresponding to the types of the instance graphs, as well as the clustering results. It can be seen that based on the present application, some links of summarizing and generalizing entities (for example, clustering entities in the instance graph) are automatically implemented, so that the process of constructing the knowledge graph greatly reduces the workload of experts in summarizing and generalizing entities, thereby reducing the difficulty of knowledge graph construction.

[0188] In an optional embodiment, the clustering module 902 is used to cluster the entities in the instance graph based on the attention weights of the entities in the instance graph.

[0189] In an optional embodiment, the clustering module 902 includes:

[0190] An acquisition module, used to obtain a target feature representation of each entity in the instance graph, wherein the target feature representation of the i-th entity is obtained by aggregating the feature representations of the i-th entity and its neighbor entities within T hops based on an attention mechanism;

[0191] The clustering processing module is used to cluster the entities in the instance graph using the target feature representation of each entity to obtain a clustering result.

[0192] In an optional embodiment, the initialization feature representation of each entity in the instance graph is determined based on at least part of the following features: the graph structure of the instance graph, entity features, and inter-entity relationship features.

[0193] In an optional embodiment, when the obtaining module performs an attention mechanism-based aggregation process on the feature representations of the i-th entity and its neighboring entities within T hops, it is used to:

[0194] Using the feature representation of the 1-hop neighbor entity of the ith entity in the k-1th round, calculate the aggregate feature representation of the 1-hop neighbor entity of the ith entity in the kth round; k is a positive integer less than or equal to T;

[0195] Concatenate the feature representation of the i-th entity in the k-1th round with the aggregated feature representation of the one-hop neighbor entity of the i-th entity in the kth round to obtain a concatenated feature;

[0196] Performing a nonlinear transformation on the splicing feature to obtain a nonlinear transformation result;

[0197] Multiplying the nonlinear transformation result by the attention weight corresponding to the k-th hop neighbor entity of the i-th entity to obtain the feature representation of the i-th entity in the k-th round;

[0198] The feature representation of the i-th entity in the T-th round is the target feature representation of the i-th entity.

[0199] In an optional embodiment, when the acquisition module determines the attention weight corresponding to the k-th hop neighbor entity of the i-th entity, it is used to:

[0200] Obtaining the aggregate feature representation corresponding to the neighbor entity of the same hop in the kth round among the neighbor entities within T hops of the i-th entity;

[0201] Perform a linear transformation on the aggregated feature representation of each hop neighbor entity to obtain a linear transformation result corresponding to each hop neighbor entity;

[0202] According to the linear transformation results corresponding to each hop neighbor entity, the attention weight corresponding to the k-hop neighbor entity of the ith entity is calculated.

[0203] In an optional embodiment, the clustering processing module uses the target feature representation of each entity to cluster the entities in the instance graph, and is used to:

[0204] Perform dimension reduction on the target feature representation of each entity to obtain the reduced-dimensional feature representation of each entity;

[0205] The entities in the instance graph are clustered using the dimensionally reduced feature representation of each entity.

[0206] In an optional embodiment, the triples are extracted from the target data source based on common concepts and relationships in the field to which the target data source belongs.

[0207] In an optional embodiment, it also includes:

[0208] An evaluation module is used to perform quality evaluation on the knowledge graph ontology to obtain a quality evaluation result; output the quality evaluation result; and the quality evaluation result is used to modify the knowledge graph ontology.

[0209] In an optional embodiment, the evaluation module is used to perform quality evaluation on the knowledge graph ontology:

[0210] Obtaining at least one evaluation index of the knowledge graph ontology, wherein the at least one evaluation index includes at least one of the following evaluation indexes: a structure evaluation index, a semantic evaluation index, a reuse evaluation index, and an application evaluation index;

[0211] Processing the at least one evaluation indicator to obtain a quality evaluation result of the knowledge graph ontology;

[0212] Wherein, the structural evaluation index is used to evaluate the structure of the knowledge graph ontology;

[0213] The semantic evaluation index is used to evaluate the clarity and standardization of the knowledge description in the knowledge graph ontology;

[0214] The reuse evaluation index is used to evaluate the reusability of the knowledge graph ontology in its own field and the degree of reuse in other fields;

[0215] The application evaluation index is used to evaluate the supporting performance of the knowledge graph ontology for upper-level applications.

[0216] In an optional embodiment,

[0217] The structural evaluation index includes: a cohesion index and a hierarchical depth index; wherein the cohesion index refers to the closeness of the connection between concepts within the ontology; the hierarchical depth index refers to the depth of the hierarchical structure of concepts in the ontology; and / or,

[0218] The semantic evaluation indicators include: grammar check indicators, relationship check indicators and redundancy check indicators; wherein the grammar check indicator is a score for whether the knowledge description language in the knowledge graph ontology conforms to general specifications; the relationship check indicator refers to the proportion of concepts and relationships in the knowledge graph ontology in general relationships; the redundancy detection indicator refers to the proportion of incorrect concepts and relationships in the knowledge graph ontology; and / or,

[0219] The reuse evaluation index includes: an ontology reuse index and a knowledge reuse index; wherein the ontology reuse index is the ratio of the domain knowledge described in the knowledge graph ontology to the knowledge in other fields; the knowledge reuse index is the ratio of the number of concepts of subclasses in the knowledge graph ontology to the number of subclasses in the knowledge ontology in other fields; and / or,

[0220] The application evaluation indicators include: model accuracy indicators, response time indicators and resource consumption indicators of the knowledge graph ontology in each target application scenario.

[0221] In an optional embodiment, the construction module 903 is used to:

[0222] The common concepts and relationships and the clustering results are output so that the knowledge graph builder can view and build the knowledge graph ontology.

[0223] The knowledge graph auxiliary construction device provided in the embodiment of the present application can be applied to electronic devices, such as PC terminals, cloud platforms, servers and server clusters. Fig.10 The hardware structure diagram of the electronic device is shown in FIG. Fig.10 , the hardware structure of the electronic device may include: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;

[0224] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;

[0225] The processor 1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;

[0226] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;

[0227] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:

[0228] Constructing an instance graph based on triples; the triples are data extracted from the target data source and organized in an entity-relationship-entity manner;

[0229] Clustering each entity in the instance graph to obtain a clustering result;

[0230] A knowledge graph ontology is constructed based on the general concepts and relationships corresponding to the type of the instance graph and the clustering results; the general concepts and relationships are obtained by abstracting the various association relationships in the existing knowledge graph.

[0231] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0232] The embodiment of the present application further provides a storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:

[0233] Constructing an instance graph based on triples; the triples are data extracted from the target data source and organized in an entity-relationship-entity manner;

[0234] Clustering each entity in the instance graph to obtain a clustering result;

[0235] A knowledge graph ontology is constructed based on the general concepts and relationships corresponding to the type of the instance graph and the clustering results; the general concepts and relationships are obtained by abstracting the various association relationships in the existing knowledge graph.

[0236] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0237] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0238] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0239] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0240] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0241] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0242] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0243] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0244] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A knowledge graph-assisted construction method, characterized in that: include: Build an instance graph based on triples; The triples are data extracted from the target data source and organized in an entity-relationship-entity manner; Obtaining a target feature representation of each entity in the instance graph, wherein the target feature representation of the ith entity is obtained by performing an attention-based aggregation process on the feature representations of the ith entity and its neighbor entities within T hops, including: using the feature representation of the 1-hop neighbor entity of the ith entity in the k-1 round to calculate the aggregated feature representation of the 1-hop neighbor entity of the ith entity in the k-round; k is a positive integer less than or equal to T; concatenating the feature representation of the ith entity in the k-1 round with the aggregated feature representation of the 1-hop neighbor entity of the ith entity in the k-round to obtain a concatenated feature; performing a nonlinear transformation on the concatenated feature to obtain a nonlinear transformation result; obtaining the feature representation of the ith entity in the k round based on the linear transformation result and the attention weight corresponding to the k-hop neighbor entity of the ith entity; the feature representation of the ith entity in the T round is the target feature representation of the ith entity; Clustering the entities in the instance graph using the target feature representation of each entity to obtain a clustering result; A knowledge graph ontology is constructed based on the general concepts and relationships corresponding to the type of the instance graph and the clustering results; the general concepts and relationships are obtained by abstracting the various association relationships in the existing knowledge graph.

2. The method according to claim 1, characterized in that The initialization feature representation of each entity in the instance graph is determined based on at least part of the following features: the graph structure of the instance graph, entity features, and inter-entity relationship features.

3. The method according to claim 1 or 2, characterized in that: The step of obtaining the feature representation of the i-th entity in the k-th round based on the linear transformation result and the attention weight corresponding to the k-th hop neighbor entity of the i-th entity includes: The nonlinear transformation result is multiplied by the attention weight corresponding to the k-th hop neighbor entity of the i-th entity to obtain the feature representation of the i-th entity in the k-th round.

4. The method according to claim 1, characterized in that: The attention weight corresponding to the k-th hop neighbor entity of the i-th entity is determined as follows: Obtaining the aggregate feature representation corresponding to the neighbor entity of the same hop in the kth round among the neighbor entities within T hops of the i-th entity; Perform a linear transformation on the aggregated feature representation of each hop neighbor entity to obtain a linear transformation result corresponding to each hop neighbor entity; According to the linear transformation results corresponding to each hop neighbor entity, the attention weight corresponding to the k-hop neighbor entity of the ith entity is calculated.

5. The method according to claim 1, characterized in that Also includes: Performing quality assessment on the knowledge graph ontology to obtain a quality assessment result; Output the quality assessment result; the quality assessment result is used to correct the knowledge graph ontology.

6. The method according to claim 5, characterized in that The quality assessment of the knowledge graph ontology includes: Obtain at least one evaluation index of the knowledge graph ontology, wherein the at least one evaluation index includes at least one of the following evaluation indexes: a structure evaluation index, a semantic evaluation index, a reuse evaluation index, and an application evaluation index; Processing the at least one evaluation indicator to obtain a quality evaluation result of the knowledge graph ontology; Wherein, the structural evaluation index is used to evaluate the structure of the knowledge graph ontology; The semantic evaluation index is used to evaluate the clarity and standardization of the knowledge description in the knowledge graph ontology; The reuse evaluation index is used to evaluate the reusability of the knowledge graph ontology in its own field and the degree of reuse in other fields; The application evaluation index is used to evaluate the supporting performance of the knowledge graph ontology for upper-level applications.

7. The method according to claim 6, characterized in that The structural evaluation index includes: a cohesion index and a hierarchical depth index; wherein the cohesion index refers to the closeness of the connection between concepts within the ontology; the hierarchical depth index refers to the depth of the hierarchical structure of concepts in the ontology; and / or, The semantic evaluation indicators include: grammar check indicators, relationship check indicators and redundancy check indicators; wherein the grammar check indicator is a score for whether the knowledge description language in the knowledge graph ontology conforms to general specifications; the relationship check indicator refers to the proportion of inter-concept relationships in the knowledge graph ontology in general relationships; the redundancy check indicator refers to the proportion of incorrect concepts and relationships in the knowledge graph ontology; and / or, The reuse evaluation index includes: an ontology reuse index and a knowledge reuse index; wherein the ontology reuse index is the ratio of the domain knowledge described in the knowledge graph ontology to the knowledge in other fields; the knowledge reuse index is the ratio of the number of concepts of subclasses in the knowledge graph ontology to the number of subclasses in the knowledge ontology in other fields; and / or, The application evaluation indicators include: model accuracy indicators, response time indicators and resource consumption indicators of the knowledge graph ontology in each target application scenario.

8. A knowledge graph auxiliary construction device, characterized in that: include: A construction module, used to construct an instance graph based on triples; The triples are data extracted from the target data source and organized in an entity-relationship-entity manner; A clustering module is used to obtain a target feature representation of each entity in the instance graph, wherein the target feature representation of the ith entity is obtained by performing an attention-based aggregation process on the feature representations of the ith entity and its neighbor entities within T hops, including: using the feature representation of the 1-hop neighbor entity of the ith entity in the k-1 round to calculate the aggregated feature representation of the 1-hop neighbor entity of the ith entity in the k-1 round; k is a positive integer less than or equal to T; concatenating the feature representation of the ith entity in the k-1 round with the aggregated feature representation of the 1-hop neighbor entity of the ith entity in the k-round to obtain a concatenated feature; performing a nonlinear transformation on the concatenated feature to obtain a nonlinear transformation result; obtaining the feature representation of the ith entity in the k round based on the linear transformation result and the attention weight corresponding to the k-hop neighbor entity of the ith entity; the feature representation of the ith entity in the T round is the target feature representation of the ith entity; clustering the entities in the instance graph using the target feature representations of each entity to obtain a clustering result; A construction module is used to construct a knowledge graph ontology based on the general concepts and relationships corresponding to the type of the instance graph and the clustering results; the general concepts and relationships are obtained by abstracting the various association relationships in the existing knowledge graph.