Knowledge graph completion method based on dual-view hyper-relation embedding framework

Through the dual-view hyperrelational embedding framework method, instance view and ontology view are constructed, and joint learning is performed using GRAN encoder and cross-view loss, which solves the problem of insufficient modeling of super-relationship and hierarchical relationships in the existing technology, improves the link prediction and entity classification effect of knowledge graphs, and is suitable for application scenarios of multi-layer knowledge decision-making.

CN115269866BActive Publication Date: 2025-08-12BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210831885.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-15
Publication Date
2025-08-12
Estimated Expiration
2042-07-15

AI Technical Summary

Technical Problem

Existing knowledge graph embedding methods fail to effectively jointly model hyperrelation and hierarchical relationships, resulting in poor performance in link prediction and entity classification tasks.

Method used

Using a method based on the dual-view hyperrelational embedding framework, we use the example view and ontology view to perform hyperrelational learning within the view using the GRAN encoder, and combine cross-view connection learning with cross-view loss and hypergraph field aggregation technology to achieve joint learning.

Benefits of technology

Improve the accuracy of the knowledge graph in link prediction and entity classification tasks, and is suitable for multi-layer knowledge decision-making fields such as recommendation systems, medical care, e-commerce and finance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269866B_ABST
    Figure CN115269866B_ABST
Patent Text Reader

Abstract

The present invention proposes a knowledge graph completion method based on a dual-view hyper-relation embedding framework, comprising: constructing a dataset based on a dual-view hyper-relation knowledge graph, the dataset comprising an instance view set, an ontology view set, and a cross-view link set; inputting the dataset into a DH-KG embedding model, wherein the DH-KG embedding model comprises a GRAN encoder, a cross-view link learning network, and a joint learning network; performing intra-view hyper-relation learning through the GRAN encoder, performing cross-view connection learning through hypergraph domain aggregation technology and cross-view loss, and performing joint learning by combining the loss functions corresponding to the instance view set, the ontology view set, and the cross-view connection set to obtain a trained DH-KG embedding model; and performing link prediction and entity classification of the knowledge graph through the trained DH-KG embedding model. The present invention jointly models the hierarchical relationship between hyper-relationships and entities in the knowledge graph through a dual-view structure, thereby better performing link prediction and entity classification tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of information technology and data services. Background Art

[0002] Knowledge graphs are large-scale semantic network knowledge bases that employ a symbolic knowledge representation approach, using triples (subject, relation, object) to describe specific knowledge. These triples are represented and stored in the form of directed graphs. These graphs offer advantages such as rich semantics, friendly structure, and ease of understanding. Due to their excellent ability to represent human prior knowledge, knowledge graphs have recently achieved widespread and successful application in fields such as natural language processing, question-answering systems, and recommender systems. However, knowledge graphs often suffer from missing links, which limits their application in related downstream tasks. To address this issue, the task of knowledge graph completion has emerged. Knowledge graph completion aims to infer new facts based on existing facts in the knowledge graph, thereby making the knowledge graph more complete. Knowledge graph embedding is one of the key approaches to addressing the knowledge graph completion problem. It embeds entities and relations in the knowledge graph into a continuous vector space, facilitating computation while preserving the knowledge graph's structural information. Therefore, a well-designed knowledge graph embedding method can significantly enhance the application of knowledge graphs.

[0003] In the real-world knowledge graph, hierarchical relations and hyperrelations are two important relations for describing facts. Their structures are as follows: Figure 2 、 Figure 3 However, there is currently no research on jointly modeling these two relations, which results in many limitations in the practical embedding of hyper-relational knowledge graph embedding methods.

[0004] The existing knowledge graph embedding methods are mainly divided into three categories: Figure 3 Tuple knowledge graph embedding method, this traditional knowledge graph embedding method mainly models triple information on a single view; another type is the single view hyper-relational knowledge graph embedding method, which improves the traditional method and makes it applicable to hyper-relational knowledge graphs. The facts in the hyper-relational knowledge graph consist of a main triple (s, r, o) and its auxiliary key-value pairs (ai:vi), but it is still limited to the single view case; the third type is the dual view Figure 3 Tuple knowledge graph embedding methods can jointly model hierarchical and logical information in the view, but cannot be used in hyper-relational knowledge graphs. The latter two methods both improve on traditional methods in some aspects, namely, enabling them to be applied to more realistic hyper-relational knowledge graphs and improving the problem that traditional methods tend to weaken the hierarchical information between entities. However, both methods only solve partial problems, resulting in further improvement in knowledge graph link prediction and entity classification tasks.

[0005] To address the above problems, this paper proposes a dual-view hyper-relational knowledge graph (DH-KG) embedding structure, such as Figure 4 As shown in the figure, this structure uses a dual-view structure to jointly model the hierarchical relationships between hyper-relationships and entities in the knowledge graph, so as to learn the connections between entities more comprehensively and thus better perform link prediction and entity classification tasks. Summary of the Invention

[0006] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.

[0007] To this end, the first purpose of the present invention is to propose a knowledge graph completion method based on a dual-view hyper-relation embedding framework for better link prediction and entity classification tasks.

[0008] To achieve the above objectives, the first embodiment of the present invention proposes a knowledge graph completion method based on a dual-view hyper-relation embedding framework, comprising:

[0009] S101: Constructing a dataset based on a dual-view hyper-relational knowledge graph, the dataset including an instance view set, an ontology view set, and a cross-view link set;

[0010] S102: Input the dataset into a DH-KG embedding model, wherein the DH-KG embedding model includes a GRAN encoder, a cross-view link learning network, and a joint learning network;

[0011] S103: Perform intra-view hyper-relation learning through the GRAN encoder, perform cross-view connection learning through hypergraph domain aggregation technology and cross-view loss, and perform joint learning through the loss functions corresponding to the instance view set, ontology view set, and cross-view connection set, to obtain a trained DH-KG embedding model;

[0012] S104: Perform link prediction and entity classification on the knowledge graph using the trained DH-KG embedding model.

[0013] In addition, the knowledge graph completion method based on the dual-view hyper-relationship embedding framework according to the above embodiment of the present invention may also have the following additional technical features:

[0014] Furthermore, in one embodiment of the present invention, constructing a dataset based on a dual-view hyper-relational knowledge graph includes:

[0015] Obtain a hyper-relational knowledge graph dataset, and use entities in the hyper-relational knowledge graph dataset as instance view entity sets;

[0016] According to the first preset relationship, the tail entity set of the instance view entity set is obtained as the ontology view concept set or the cross-view connection set; the tail entity set of the ontology view concept set is obtained through the second preset relationship, and the union of the tail entity set of the ontology view concept set and the ontology view concept set is used as the ontology view entity set;

[0017] Acquire an instance view super-relationship fact set from the instance view, and acquire an instance view relationship set from the instance view super-relationship fact set; acquire an ontology view super-relationship fact set from the ontology view, and acquire an ontology view relationship set from the ontology view super-relationship fact set;

[0018] An instance view is constructed based on the instance view entity set, instance view super-relationship fact set, and instance view relationship set; an ontology view is constructed based on the ontology view entity set, ontology view super-relationship fact set, and ontology view relationship set; and a data set based on a dual-view super-relationship knowledge graph is generated based on the instance view, ontology view, and cross-view connection set.

[0019] Furthermore, in one embodiment of the present invention, the performing intra-view super-relation learning by the GRAN encoder includes:

[0020] Update entity embeddings through the GRAN model, use the updated entity embeddings to perform entity or relationship predictions, and calculate the loss within each subview.

[0021] Furthermore, in one embodiment of the present invention, updating entity embeddings using the GRAN model includes:

[0022] Through the GRAN model, a hyper-relational fact is treated as a heterogeneous graph, and then the mask learning strategy is used to construct the model input;

[0023] The heterogeneous graph is learned using edge-biased fully connected attention via GRAN;

[0024] Update the entity embedding vectors of all hyper-relation facts through the GRAN encoder;

[0025] Among them, the node embedding vector GRAN_E after the l-layer GRAN encoder is updated is:

[0026] X (l) =GRAN_E(X (l-1) ),

[0027] in, is the output result of the l-th layer GRAN.

[0028] Furthermore, in one embodiment of the present invention, using the updated entity embedding to perform entity or relationship prediction and calculating the loss in each subview includes:

[0029] Take out the node embedding vector h at the MASK position, and then perform a two-layer linear transformation operation.

[0030]

[0031] in, shares parameters with the input embedding matrix, while are parameters that can be self-learned. is the prediction score for all entities, i.e., there are v entities in the entire fact;

[0032] With label smoothing, the cross entropy loss between the predicted value and the label is obtained based on p:

[0033]

[0034] Among them, p t is the predicted value of the score vector p, y t is the value of the t-th position of the label vector y.

[0035] Furthermore, in one embodiment of the present invention, the cross-view connection learning using the hypergraph domain aggregation technology and the cross-view loss includes:

[0036] Obtain node embeddings of entities in all hyper-relational facts through the GRAN encoder, and input the node embeddings into the HGNN hypergraph learning model;

[0037] The message passing process from the (k-1) layer to the k-th layer in HGNN is defined as follows:

[0038]

[0039] U (k) =U (k-1) +σ(W H U (k-1) Θ (k) +b (k) ),

[0040] in, is the transformation matrix, is the bias vector of the kth layer, σ is the activation function, is the incidence matrix of the knowledge hypergraph, is the degree matrix of the node, is the degree matrix of the hyperedge, is the output of the kth layer.

[0041] Furthermore, in one embodiment of the present invention, the cross-view loss includes:

[0042] The first entity set is mapped to the ontology view vector space through the mapping operation:

[0043]

[0044] The cross-view link loss is defined as follows:

[0045]

[0046] Among them, the two norm is used to calculate the distance deviation between entities and concepts in the same vector space, t′ s It is t s negative examples, and γ is a boundary parameter.

[0047] Furthermore, in one embodiment of the present invention, the joint learning is performed by combining the loss functions corresponding to the instance view set, the ontology view set, and the cross-view connection set, which is expressed as:

[0048]

[0049] Furthermore, the Adam optimizer is used to optimize the three loss functions separately, where ω distinguishes the learning rates of the intra-view loss and the cross-view loss to achieve joint learning.

[0050] To achieve the above objectives, the second embodiment of the present invention proposes a device for completing a knowledge graph based on a dual-view hyper-relationship embedding framework, comprising the following modules:

[0051] An acquisition module is used to construct a dataset based on a dual-view hyper-relational knowledge graph, wherein the dataset includes an instance view set, an ontology view set, and a cross-view link set;

[0052] An input module, configured to input the dataset into a DH-KG embedding model, wherein the DH-KG embedding model includes a GRAN encoder, a cross-view link learning network, and a joint learning network;

[0053] A training module is configured to perform intra-view hyperrelation learning using the GRAN encoder, cross-view connection learning using hypergraph domain aggregation technology and cross-view loss, and joint learning using the loss functions corresponding to the instance view set, ontology view set, and cross-view connection set, to obtain a trained DH-KG embedding model;

[0054] The output module is used to perform link prediction and entity classification of the knowledge graph through the trained DH-KG embedding model.

[0055] Furthermore, in one embodiment of the present invention, the acquisition module is further configured to:

[0056] Obtain a hyper-relational knowledge graph dataset, and use entities in the hyper-relational knowledge graph dataset as instance view entity sets;

[0057] According to the first preset relationship, the tail entity set of the instance view entity set is obtained as the ontology view concept set or the cross-view connection set; the tail entity set of the ontology view concept set is obtained through the second preset relationship, and the union of the tail entity set of the ontology view concept set and the ontology view concept set is used as the ontology view entity set;

[0058] Acquire an instance view super-relationship fact set from the instance view, and acquire an instance view relationship set from the instance view super-relationship fact set; acquire an ontology view super-relationship fact set from the ontology view, and acquire an ontology view relationship set from the ontology view super-relationship fact set;

[0059] An instance view is constructed based on the instance view entity set, instance view super-relationship fact set, and instance view relationship set; an ontology view is constructed based on the ontology view entity set, ontology view super-relationship fact set, and ontology view relationship set; and a data set based on a dual-view super-relationship knowledge graph is generated based on the instance view, ontology view, and cross-view connection set.

[0060] The knowledge graph completion method based on the dual-view hyper-relationship embedding framework proposed in the embodiment of the present invention has the following main advantages: (1) It solves the modeling and reasoning of multi-relational facts in the industrial knowledge graph, laying a theoretical foundation for the new graph structure of the industrial knowledge graph. (2) The hierarchical structure is applied to recommendation systems and hierarchical decision-making, which can be popularized in fields such as medicine, e-commerce, finance, and industry that require multi-layer knowledge decision-making. (3) Cross-view link prediction can be applied to node classification tasks such as paper tagging and product classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0062] Figure 1 A flow chart of a knowledge graph completion method based on a dual-view hyper-relation embedding framework provided in an embodiment of the present invention.

[0063] Figure 2 A schematic diagram of a knowledge graph hyperrelation structure provided by an embodiment of the present invention.

[0064] Figure 3 A schematic diagram of the knowledge graph hierarchical structure provided by an embodiment of the present invention.

[0065] Figure 4 A schematic diagram of a dual-view hyper-relational knowledge graph structure provided by an embodiment of the present invention.

[0066] Figure 5 This is an overall framework diagram of a DH-GE model provided by an embodiment of the present invention.

[0067] Figure 6 A schematic flow chart of a knowledge graph completion device based on a dual-view hyper-relationship embedding framework provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0068] The following describes embodiments of the present invention in detail, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and are not to be construed as limiting the present invention.

[0069] The following describes a knowledge graph completion method based on a dual-view hyper-relationship embedding framework according to an embodiment of the present invention with reference to the accompanying drawings.

[0070] Figure 1 A flowchart of a knowledge graph completion method based on a dual-view hyper-relation embedding framework provided in an embodiment of the present invention.

[0071] like Figure 1 As shown in FIG, the knowledge graph completion method based on the dual-view hyper-relation embedding framework includes the following steps:

[0072] S101: Construct a dataset based on a dual-view hyper-relational knowledge graph, which includes an instance view set, an ontology view set, and a cross-view link set;

[0073] S102: Input the dataset into the DH-KG embedding model, where the DH-KG embedding model includes a GRAN encoder, a cross-view link learning network, and a joint learning network;

[0074] S103: Perform intra-view hyper-relation learning through the GRAN encoder, perform cross-view connection learning through hypergraph domain aggregation technology and cross-view loss, and perform joint learning through the loss functions corresponding to the instance view set, ontology view set, and cross-view connection set respectively, to obtain the trained DH-KG embedding model;

[0075] S104: Use the trained DH-KG embedding model to perform link prediction and entity classification on the knowledge graph.

[0076] DH-KG consists of two subviews and a cross-view link Among them, the instance view of one of the subviews By an instance entity set ε I , an instance relationship set and an instance superrelation fact set: Composition, where (s, r, o) represents the main triple, Represents m auxiliary key-value pairs. Similarly, the ontology view set An ontology concept set An ontology relationship set and an ontological superrelation: Composition. Cross-view link set is a set of super-relational facts without auxiliary key-value pairs, where h S ∈ε I ,

[0077] The purpose of hyper-relational link prediction is to predict hyper-relational facts The missing elements in . The missing elements can be {s, o, v1, ..., v m}, or {r, a1, ..., a m}. In DH-KG, and The link prediction tasks on are hyperrelation link prediction tasks on instance view and ontology view respectively.

[0078] The entity classification task is to try to predict the concepts related to a given entity. On DH-KG, the entity classification task is to predict the tail concept in the cross-relation link.

[0079] This article introduces the JW44K-6K dataset, constructed based on DH-KG and extracted from Wikidata. This dataset consists of 44,000 entities from instance views and 6,000 concepts from ontology views, containing rich cross-view connection information and intra-view hyperrelational facts. The construction of this dataset involves the following four steps:

[0080] S201: Entity filtering in instance view. The WD50K hyper-relational knowledge graph dataset extracted from Wikidata includes 50,000 entities. First, the entities in WD50K are regarded as the entity set ε in the instance view. I The present invention regards this entity set as the head entity set, and finds the corresponding tail entity set T in Wikidata according to the “instance_of” relationship, and then finds the tail entity set T according to ε I -ε I ∩T to update ε I , to filter out conceptual entities. After filtering, ε I Has 44,000 entities.

[0081] S202: Ontology view concept screening. Continue to search for ε through the "instance_of" relationship IThe tail entity set of the ontology view is the concept set of And use this fact set as the cross-view connection set Then, ε I The tail entity set Q is found through the "subclass_of" relationship, and through To find deeper concepts in the existing concepts of the ontology view, so as to update Repeat this process until there are no deeper concepts to update

[0082] S203: Extract super-relationship facts from the two sub-views. Extract super-relationship fact sets from the instance view All entity and auxiliary key-value pairs are derived from ε I Then, use the same method to get the super-relationship fact set from the ontology view. All concepts and auxiliary key-value pairs are derived from Obtained from .

[0083] S204: Dataset generation. We get the relation sets and And thus build the instance view and ontology view Finally, we obtained a DH-KG dataset JW44K-6K,

[0084] Furthermore, in one embodiment of the present invention, constructing a dataset based on a dual-view hyper-relational knowledge graph includes:

[0085] Obtain a hyper-relational knowledge graph dataset, and use entities in the hyper-relational knowledge graph dataset as instance view entity sets;

[0086] According to the first preset relationship, the tail entity set of the instance view entity set is obtained as the ontology view concept set or the cross-view connection set; the tail entity set of the ontology view concept set is obtained through the second preset relationship, and the union of the tail entity set of the ontology view concept set and the ontology view concept set is used as the ontology view entity set;

[0087] Obtain the instance view super-relationship fact set from the instance view, and obtain the instance view relationship set from the instance view super-relationship fact set; obtain the ontology view super-relationship fact set from the ontology view, and obtain the ontology view relationship set from the ontology view super-relationship fact set;

[0088] An instance view is constructed based on the instance view entity set, instance view hyper-relationship fact set, and instance view relationship set. An ontology view is constructed based on the ontology view entity set, ontology view hyper-relationship fact set, and ontology view relationship set. A dataset based on the dual-view hyper-relationship knowledge graph is generated based on the instance view, ontology view, and cross-view connection set.

[0089] In order to learn representations on DH-KG, this paper proposes the first DH-KG embedding model DHGE, whose overall framework is as follows Figure 5 As shown in Figure 2, it consists of a GRAN encoder within a view, cross-view link learning using the HGNN hypergraph learning model, and joint learning. These components are described in detail below.

[0090] In order to perform intra-view super-relation learning, the present invention uses the GRAN model to update entity embeddings, then uses the updated entity embeddings to predict entities or relations, and finally calculates the loss within each sub-view.

[0091] GRAN will be a super-relational fact It is considered as a heterogeneous graph and then uses the mask learning strategy to construct the model input. For example: is a training sample that covers the subject position. Then, GRAN uses edge-biased fully connected attention to learn heterogeneous graphs. We randomly assign the entity set in the view Embed as Where d is the entity embedding dimension. After learning a batch of samples, the GRAN encoder updates the entity embedding vectors of all hyper-relation facts. The updated node embedding vector (GRAN_E) of the l-th layer GRAN encoder is:

[0092] X (l) =GRAN_E(X (l-1) ) (1)

[0093] in is the output result of the l-th layer GRAN.

[0094] The present invention uses an L-layer GRAN encoder to update node embeddings in the instance view and the ontology view respectively. When obtaining the updated node, we take out the node embedding vector h at the [MASK] position and then perform a two-layer linear transformation operation.

[0095]

[0096] in, shares parameters with the input embedding matrix, while are parameters that can be self-learned. is the prediction score for all entities, that is, there are v entities in the entire fact. Finally, with label smoothing, the cross entropy loss between the predicted value and the label can be obtained based on p:

[0097]

[0098] Among them, p t is the predicted value of the score vector p, y t is the value of the t-th position of the label vector y.

[0099] Thus, the loss in the instance view can be obtained respectively and the loss in the ontology view

[0100] Furthermore, in one embodiment of the present invention, intra-view super-relation learning is performed by a GRAN encoder, including:

[0101] Update entity embeddings through the GRAN model, use the updated entity embeddings to perform entity or relationship predictions, and calculate the loss within each subview.

[0102] Furthermore, in one embodiment of the present invention, updating entity embeddings using the GRAN model includes:

[0103] Through the GRAN model, a hyper-relational fact is treated as a heterogeneous graph, and then the mask learning strategy is used to construct the model input;

[0104] Learning heterogeneous graphs using edge-biased fully connected attention via GRAN;

[0105] Update the entity embedding vectors of all hyper-relation facts through the GRAN encoder;

[0106] Among them, the node embedding vector GRAN_E after the l-layer GRAN encoder is updated is:

[0107] X (l) =GRAN_E(x (l-1) ),

[0108] in, is the output result of the l-th layer GRAN.

[0109] Furthermore, in one embodiment of the present invention, the updated entity embedding is used to perform entity or relationship prediction, and the loss in each subview is calculated, including:

[0110] Take out the node embedding vector h at the MASK position, and then perform a two-layer linear transformation operation.

[0111]

[0112] in, shares parameters with the input embedding matrix, while are parameters that can be self-learned. is the prediction score for all entities, i.e., there are v entities in the entire fact;

[0113] With label smoothing, the cross entropy loss between the predicted value and the label is obtained based on p:

[0114]

[0115] Among them, p t is the predicted value of the score vector p, y t is the value of the t-th position of the label vector y.

[0116] After learning with the GRAN encoder in each subview, we use the hypergraph domain aggregation technique and cross-view loss to learn cross-view connections.

[0117] Due to the existence of binary or multi-tuple hyperrelation facts, each subview of DH-KG can be viewed as a hypergraph consisting of entity nodes and hyperedges between nodes. In order to connect the information in the two subviews in series, the present invention first uses HGNN to aggregate the node information connected by the hyperedge. Through the GRAN encoder introduced above, we have obtained the node embedding of the entities in all hyperrelation facts. And use it as the input of HGNN. The message passing process from (k-1) layer to kth layer in HGNN is defined as follows:

[0118]

[0119] U (k) =U (k-1) +σ(W H U (k-1) Θ (k) +b (k) ) (5)

[0120] in, is the transformation matrix, is the bias vector of the kth layer. σ is the activation function. is the incidence matrix of the knowledge hypergraph, is the degree matrix of the node, is the degree matrix of the hyperedge. is the output of the kth layer. In order to further benefit from the relational transformation, the present invention combines the vector representation of the input and output U=U (0) +U (K)as the final embedding vector.

[0121] After applying hypergraph domain aggregation techniques to both instance view and ontology view, we obtain and In the cross-view connection set H S In the example, the embedding vector h of the first entity S Exists in the embedded vector space of instance views and can be expressed as And the embedding vector t of the tail entity S Exists in the embedding vector space of the ontology view and can be expressed as Therefore, in order to make the two be calculated in the same vector space, this method maps the header entity set to the ontology view vector space through a mapping operation:

[0122]

[0123] And the cross-view link loss is defined as follows:

[0124]

[0125] The 2-norm is used in the formula to calculate the distance deviation between entities and concepts in the same vector space, where t′ s It is t s negative examples, and γ is a boundary parameter.

[0126] Furthermore, in one embodiment of the present invention, cross-view connection learning is performed using hypergraph domain aggregation technology and cross-view loss, including:

[0127] Obtain the node embeddings of entities in all hyper-relational facts through the GRAN encoder, and input the node embeddings into the HGNN hypergraph learning model;

[0128] The message passing process from the (k-1) layer to the k-th layer in HGNN is defined as follows:

[0129]

[0130] U (k) =U (k-1) +σ(W H U (k-1) Θ (k) +b (k) ),

[0131] in, is the transformation matrix, is the bias vector of the kth layer, σ is the activation function, is the incidence matrix of the knowledge hypergraph, is the degree matrix of the node, is the degree matrix of the hyperedge, is the output of the kth layer.

[0132] Furthermore, in one embodiment of the present invention, the cross-view loss includes:

[0133] The first entity set is mapped to the ontology view vector space through the mapping operation:

[0134]

[0135] The cross-view link loss is defined as follows:

[0136]

[0137] Among them, the two norm is used to calculate the distance deviation between entities and concepts in the same vector space, t′ s It is t s negative examples, and γ is a boundary parameter.

[0138] The present invention combines three loss functions from instance view, ontology view and cross-view connection to design a joint learning loss:

[0139]

[0140] And the present invention uses the Adam optimizer to optimize the three loss functions separately, where ω distinguishes the learning rates of the intra-view loss and the cross-view loss to achieve joint learning.

[0141] Furthermore, in one embodiment of the present invention, joint learning is performed by combining the loss functions corresponding to the instance view set, the ontology view set, and the cross-view connection set, which can be expressed as:

[0142]

[0143] Furthermore, the Adam optimizer is used to optimize the three loss functions separately, where ω distinguishes the learning rates of the intra-view loss and the cross-view loss to achieve joint learning.

[0144] The embodiment of the present invention proposes a knowledge graph completion method based on a dual-view hyper-relationship embedding framework. On the one hand, a dual-view hyper-relationship knowledge graph embedding framework is proposed. The framework divides hyper-relationship facts into instance view and ontology view to respectively learn the hyper-relationships and hierarchical relationships in the hyper-relationship knowledge graph, thereby making the hyper-relationship knowledge graph closer to the real world and more conducive to the link prediction and entity classification tasks of the knowledge graph; on the other hand, a method for constructing a dual-view hyper-relationship knowledge graph dataset is proposed, so that the dual-view hyper-relationship knowledge graph framework can be applied to real life; on the third hand, the first model DHGE that can be used for DH-KG representation learning is constructed by combining the characteristics of GRAN, HGNN and joint learning. The effect of this model on the DH-KG framework and general knowledge graph datasets is better than the existing models.

[0145] In order to implement the above embodiment, the present invention also proposes a knowledge graph completion device based on a dual-view hyper-relationship embedding framework.

[0146] Figure 6 A structural schematic diagram of a knowledge graph completion device based on a dual-view hyper-relation embedding framework provided in an embodiment of the present invention.

[0147] like Figure 6 As shown, the knowledge graph completion device based on the dual-view hyper-relation embedding framework includes: an acquisition module 100, an input module 200, a training module 300, and an output module 400.

[0148] An acquisition module is used to construct a dataset based on a dual-view hyper-relational knowledge graph. The dataset includes an instance view set, an ontology view set, and a cross-view link set.

[0149] An input module, used to input the dataset into the DH-KG embedding model, where the DH-KG embedding model includes a GRAN encoder, a cross-view link learning network, and a joint learning network;

[0150] The training module is used to learn intra-view hyper-relations through the GRAN encoder, learn cross-view connections through hypergraph domain aggregation technology and cross-view loss, and jointly learn the loss functions corresponding to the instance view set, ontology view set, and cross-view connection set to obtain the trained DH-KG embedding model;

[0151] The output module is used to perform link prediction and entity classification on the knowledge graph using the trained DH-KG embedding model.

[0152] Furthermore, in one embodiment of the present invention, the acquisition module is further configured to:

[0153] Obtain a hyper-relational knowledge graph dataset, and use entities in the hyper-relational knowledge graph dataset as instance view entity sets;

[0154] According to the first preset relationship, the tail entity set of the instance view entity set is obtained as the ontology view concept set or the cross-view connection set; the tail entity set of the ontology view concept set is obtained through the second preset relationship, and the union of the tail entity set of the ontology view concept set and the ontology view concept set is used as the ontology view entity set;

[0155] Obtain the instance view super-relationship fact set from the instance view, and obtain the instance view relationship set from the instance view super-relationship fact set; obtain the ontology view super-relationship fact set from the ontology view, and obtain the ontology view relationship set from the ontology view super-relationship fact set;

[0156] An instance view is constructed based on the instance view entity set, instance view hyper-relationship fact set, and instance view relationship set. An ontology view is constructed based on the ontology view entity set, ontology view hyper-relationship fact set, and ontology view relationship set. A dataset based on the dual-view hyper-relationship knowledge graph is generated based on the instance view, ontology view, and cross-view connection set.

[0157] In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.

[0158] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.

[0159] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limiting the present invention. A person skilled in the art may change, modify, replace, and modify the above embodiments within the scope of the present invention.

Claims

1. A knowledge graph completion method based on a dual-view hyper-relation embedding framework, characterized in that: The following steps are involved: Constructing a dataset based on a dual-view hyper-relational knowledge graph, the dataset including an instance view set, an ontology view set, and a cross-view link set; Inputting the dataset into a DH-KG embedding model, wherein the DH-KG embedding model includes a GRAN encoder, a cross-view link learning network, and a joint learning network; The GRAN encoder is used to learn intra-view hyper-relationships, the hypergraph domain aggregation technology and cross-view loss are used to learn cross-view connections, and the loss functions corresponding to the joint instance view set, the ontology view set, and the cross-view connection set are used to perform joint learning to obtain the trained DH-KG embedding model. Perform link prediction and entity classification on the knowledge graph using the trained DH-KG embedding model; The performing intra-view super relation learning by the GRAN encoder includes: Update entity embeddings through the GRAN model, use the updated entity embeddings to make entity or relationship predictions, and calculate the loss within each subview; Updating entity embeddings through the GRAN model includes: Through the GRAN model, a hyper-relational fact is treated as a heterogeneous graph, and then the mask learning strategy is used to construct the model input; The heterogeneous graph is learned using edge-biased fully connected attention via GRAN; Update the entity embedding vectors of all hyper-relation facts through the GRAN encoder; Among them, The updated node embedding vector GRAN_E of the layer GRAN encoder is: , in, It is The output of layer GRAN; The updated entity embedding is used to predict entities or relationships, and the loss in each subview is calculated, including: Take out the node embedding vector h at the MASK position, and then perform a two-layer linear transformation operation. , in, shares parameters with the input embedding matrix, while 、 、 are parameters that can be self-learned. is the prediction score for all entities, i.e., there are v entities in the entire fact; With label smoothing, the cross entropy loss between the predicted value and the label is obtained based on p: , in, is the value of the predicted score vector p-th position, is the value of the t-th position of the label vector y.

2. The method according to claim 1, characterized in that The construction of a dataset based on a dual-view hyper-relational knowledge graph includes: Obtain a hyper-relational knowledge graph dataset, and use entities in the hyper-relational knowledge graph dataset as instance view entity sets; According to the first preset relationship, the tail entity set of the instance view entity set is obtained as the ontology view concept set or the cross-view connection set; the tail entity set of the ontology view concept set is obtained through the second preset relationship, and the union of the tail entity set of the ontology view concept set and the ontology view concept set is used as the ontology view entity set; Acquire an instance view super-relationship fact set from the instance view, and acquire an instance view relationship set from the instance view super-relationship fact set; acquire an ontology view super-relationship fact set from the ontology view, and acquire an ontology view relationship set from the ontology view super-relationship fact set; An instance view is constructed based on the instance view entity set, instance view super-relationship fact set, and instance view relationship set; an ontology view is constructed based on the ontology view entity set, ontology view super-relationship fact set, and ontology view relationship set; and a data set based on a dual-view super-relationship knowledge graph is generated based on the instance view, ontology view, and cross-view connection set.

3. The method according to claim 1, characterized in that The cross-view connection learning using hypergraph domain aggregation technology and cross-view loss includes: Obtain node embeddings of entities in all hyper-relational facts through the GRAN encoder, and input the node embeddings into the HGNN hypergraph learning model; The message passing process from the (k-1) layer to the k-th layer in HGNN is defined as follows: , , in, is the transformation matrix, is the bias vector of the kth layer, is the activation function, is the incidence matrix of the knowledge hypergraph, is the degree matrix of the node, is the degree matrix of the hyperedge, is the output of the kth layer.

4. The method according to claim 1 or 3, characterized in that The cross-view loss includes: The first entity set is mapped to the ontology view vector space through the mapping operation: , The cross-view link loss is defined as follows: , Among them, the two norms are used to calculate the distance deviation between entities and concepts in the same vector space. yes negative examples, and is the boundary parameter.

5. The method according to claim 1, wherein The joint learning is performed by combining the loss functions corresponding to the instance view set, the ontology view set, and the cross-view connection set, which is expressed as: , Furthermore, the Adam optimizer is used to optimize the three loss functions respectively, where Differentiate the learning rates of intra-view loss and cross-view loss to achieve joint learning.

6. A knowledge graph completion device based on a dual-view hyper-relationship embedding framework using the method of claim 1, characterized in that: include: An acquisition module is used to construct a dataset based on a dual-view hyper-relational knowledge graph, wherein the dataset includes an instance view set, an ontology view set, and a cross-view link set; An input module, configured to input the dataset into a DH-KG embedding model, wherein the DH-KG embedding model includes a GRAN encoder, a cross-view link learning network, and a joint learning network; A training module is configured to perform intra-view hyperrelation learning using the GRAN encoder, cross-view connection learning using hypergraph domain aggregation technology and cross-view loss, and joint learning using the loss functions corresponding to the instance view set, ontology view set, and cross-view connection set, to obtain a trained DH-KG embedding model; The output module is used to perform link prediction and entity classification of the knowledge graph through the trained DH-KG embedding model.

7. The device according to claim 6, characterized in that The acquisition module is further used to: Obtain a hyper-relational knowledge graph dataset, and use entities in the hyper-relational knowledge graph dataset as instance view entity sets; Acquire the tail entity set of the instance view entity set as the ontology view concept set or the cross-view connection set according to the first preset relationship; Obtaining the tail entity set of the ontology view concept set through a second preset relationship, and taking the union of the tail entity set of the ontology view concept set and the ontology view concept set as the ontology view entity set; Acquire an instance view super-relationship fact set from the instance view, and acquire an instance view relationship set from the instance view super-relationship fact set; Acquire an ontology view super-relationship fact set from the ontology view, and acquire an ontology view relationship set from the ontology view super-relationship fact set; An instance view is constructed based on the instance view entity set, instance view super-relationship fact set, and instance view relationship set; an ontology view is constructed based on the ontology view entity set, ontology view super-relationship fact set, and ontology view relationship set; and a data set based on a dual-view super-relationship knowledge graph is generated based on the instance view, ontology view, and cross-view connection set.