CN113157935A - Graph neural network model and method for entity alignment based on relationship context - Google Patents
Graph neural network model and method for entity alignment based on relationship context Download PDFInfo
- Publication number
- CN113157935A CN113157935A CN202110281892.7A CN202110281892A CN113157935A CN 113157935 A CN113157935 A CN 113157935A CN 202110281892 A CN202110281892 A CN 202110281892A CN 113157935 A CN113157935 A CN 113157935A
- Authority
- CN
- China
- Prior art keywords
- entity
- context
- relation
- graph
- module
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000003062 neural network model Methods 0.000 title claims abstract description 48
- 238000000034 method Methods 0.000 title claims abstract description 39
- 239000013598 vector Substances 0.000 claims abstract description 80
- 238000013528 artificial neural network Methods 0.000 claims abstract description 10
- 238000012549 training Methods 0.000 claims description 12
- 230000004931 aggregating effect Effects 0.000 claims description 8
- 239000000126 substance Substances 0.000 claims description 7
- 239000011159 matrix material Substances 0.000 claims description 6
- 238000012545 processing Methods 0.000 claims description 6
- 230000004913 activation Effects 0.000 claims description 5
- 239000000203 mixture Substances 0.000 claims description 4
- 230000008569 process Effects 0.000 claims description 4
- 230000002776 aggregation Effects 0.000 claims description 3
- 238000004220 aggregation Methods 0.000 claims description 3
- 238000004364 calculation method Methods 0.000 claims description 3
- 239000002131 composite material Substances 0.000 claims description 3
- 230000006872 improvement Effects 0.000 abstract description 7
- 238000002679 ablation Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000002474 experimental method Methods 0.000 description 5
- 238000012360 testing method Methods 0.000 description 4
- 235000019738 Limestone Nutrition 0.000 description 2
- 238000013459 approach Methods 0.000 description 2
- 230000004927 fusion Effects 0.000 description 2
- 239000006028 limestone Substances 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 description 1
- OAICVXFJPJFONN-UHFFFAOYSA-N Phosphorus Chemical compound [P] OAICVXFJPJFONN-UHFFFAOYSA-N 0.000 description 1
- 239000011717 all-trans-retinol Substances 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
- G06F16/367—Ontology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
- G06F40/211—Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/289—Phrasal analysis, e.g. finite state techniques or chunking
- G06F40/295—Named entity recognition
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computational Linguistics (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- General Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Data Mining & Analysis (AREA)
- Biomedical Technology (AREA)
- Computing Systems (AREA)
- Molecular Biology (AREA)
- Evolutionary Computation (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Biophysics (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Animal Behavior & Ethology (AREA)
- Databases & Information Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
The invention discloses a graph neural network model and a method for entity alignment based on relationship context, wherein the model comprises the following steps: the entity context module is used for outputting an entity context vector of each entity in the knowledge graph by taking each entity and sub-graph information around the entity as input according to the aligned entity seeds; the relation context module is used for outputting a relation context vector of each entity in the knowledge graph by taking each entity and surrounding sub-graph information thereof as input according to the aligned entity seeds; the vector splicing module can splice the entity context vector and the relationship context vector output by the entity context module and the relationship context module to obtain a final vector of the entity; and the similarity judging module can calculate the inner product of the final vectors of the two entities as the similarity score of the two entities. The model and the method effectively utilize and model the relationship information in the knowledge graph, and simultaneously combine the related technology of the neural network of the graph, thereby achieving remarkable performance improvement.
Description
Technical Field
The invention relates to the field of knowledge graph processing, in particular to a graph neural network model and a method for entity alignment based on relationship context.
Background
The knowledge graph is a multi-relation directed graph, each node in the graph represents an entity, each edge represents a relation between two entities, and the direction of the edge represents the directivity of the relation. Each Fact (Fact) in a knowledge-graph is typically stored in the form of a triple (head entity, relationship, tail entity), e.g., a person's triple is: yaoming, Sheng Di and Shanghai.
In practical applications, when constructing a knowledge graph, the source corpora of knowledge may be across languages (different languages such as chinese and english) and across sources (different corpora). There are many identical entities and relationships between these cross-language and cross-source knowledge maps, but they often appear in different forms, such as the entity "yaoming" in the chinese knowledge map and the "Yao Ming" in the english knowledge map represent virtually the same entity. In addition, there is often a lot of complementary knowledge between these knowledge-maps. Therefore, there is a need to perform knowledge fusion of these cross-language and cross-source knowledgemaps to obtain a larger, more complete knowledgemap on a larger scale for better application to downstream tasks. One way of knowledge fusion is entity alignment. The aim of entity alignment is to find matching pairs of entities in the two knowledge-maps (as mentioned above for "yaoming" and "Yao Ming").
Currently, entity alignment tasks are performed using distributed representations of knowledge-graphs (also known as knowledge-graph embedding). These methods represent entities as low-dimensional vectors in a unified vector space and require that aligned pairs of entities have approximately the same embeddings. In recent years, Graph Neural Networks (Graph Neural Networks) have shown great capability in the field of modeling representations of graphs by exploiting neighborhood information of nodes. Recent efforts to align entities using GNNs have also begun, which are based on the assumption that two aligned entities should have similar neighboring nodes, resulting in significant performance gains. However, knowledge maps in the real world often suffer from misalignment problems, i.e. two different entities may also possess similar neighborhood information and thus may be misaligned by conventional GNN models that only use entity information. Fig. 1 illustrates this error problem, and the entity pairs Limestone County and George S _houston, although semantically distinct, the former being a place and the latter being a person, are misinterpreted by the conventional GCN as entities that should be aligned due to their possession of similar neighboring entities.
To solve the misalignment problem, researchers have proposed different approaches, one is the approach using mungn, which assumes that the misalignment problem is due to the incomplete structure of the knowledge-graph, i.e., some of the links in the knowledge-graph are missing. Thus, it first performs knowledge-graph completion, and then performs entity alignment based on the completed knowledge-graph. Another method of AliNet directly aggregates multi-hop neighbor nodes to increase neighborhood overlap between two aligned entities.
In the two existing methods, the connection of entities between the knowledge maps is increased (the knowledge maps are complemented or multi-hop neighbor nodes are directly aggregated), so that the neighbor entities of different entity pairs are different as much as possible, and the field contact ratio between two aligned entities is increased, thereby achieving the purpose of solving the problem of wrong alignment.
However, these two methods have at least the following problems: (1) the newly added entity connection cannot be guaranteed to be completely correct, so that noise is introduced, and the performance improvement is limited; (2) these methods do not take into account the rich relationship information in the knowledge-graph.
Disclosure of Invention
Based on the problems existing in the prior art, the invention aims to provide a graph neural network model and a graph neural network method for entity alignment based on a relationship context, which can solve the problems that the existing method for solving the problem of wrong alignment of a knowledge graph cannot ensure that the connection between newly added entities is completely correct, so that noise is introduced, the performance is improved to a limited extent, and rich relationship information in the knowledge graph is not considered.
The purpose of the invention is realized by the following technical scheme:
the embodiment of the invention provides a graph neural network model for entity alignment based on relationship context, which comprises the following steps:
the system comprises an entity context module, a relation context module, a vector splicing module and a similarity judging module; wherein the content of the first and second substances,
the entity context module is arranged in parallel with the relation context module, and outputs an entity context vector of each entity in the knowledge graph and sub-graph information around the entity according to the aligned entity seeds;
the relation context module is arranged in parallel with the entity context module, and outputs a relation context vector of each entity in the knowledge graph by taking each entity and sub-graph information around the entity as input according to the aligned entity seeds;
the vector splicing module is respectively connected with the output ends of the entity context module and the relation context module and can splice the entity context vector output by the entity context module and the relation context vector output by the relation context module to obtain a final vector of an entity;
the similarity judging module is connected with the output end of the vector splicing module and can calculate the inner product of the final vectors of the two entities as the similarity score of the two entities.
The embodiment of the invention provides a method for aligning entities based on relationship context, which comprises the following steps:
and 3, forming entity pairs by one entity in the first knowledge graph and all candidate entities in the second knowledge graph, processing the entity pairs through the optimized graph neural network model, scoring each candidate entity of each entity pair, wherein the candidate entity with the highest score is the aligned entity of the entity, and repeating the step until the alignment of all entities in the first knowledge graph and the second knowledge graph is completed.
It can be seen from the above technical solutions provided by the present invention that the graph neural network model and the method for entity alignment based on relationship context provided by the embodiments of the present invention have the following beneficial effects:
by fully utilizing the entity context information and the relation context information in the knowledge graph, the relation information in the knowledge graph is effectively utilized and modeled, and the entity alignment of the knowledge graph is obviously improved by combining the graph neural network model processing.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
Fig. 1 is a diagram illustrating a conventional GNN model for misalignment of entities using only entity information; wherein the dotted line with no error symbol X represents an aligned entity and the dotted line with an error symbol X represents an mis-aligned entity;
FIG. 2 is a diagram of a graph neural network model for entity alignment based on relationship context according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for entity alignment based on a relationship context according to an embodiment of the present invention;
fig. 4 is a schematic diagram of an aggregation relationship path in the method according to the embodiment of the present invention;
FIG. 5 is a schematic diagram of a relational directional modeling ablation experiment provided by an embodiment of the invention; wherein FIG. (a) is a schematic on H @1 and FIG. (b) is a schematic on MRR;
fig. 6 is a schematic diagram of a layer number ablation experiment of the RCGNN model provided by an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention are clearly and completely described below with reference to the specific contents of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention. Details which are not described in detail in the embodiments of the invention belong to the prior art which is known to the person skilled in the art.
Referring to fig. 2, an embodiment of the present invention provides a graph neural network model for entity alignment based on a relationship context, including:
the system comprises an entity context module, a relation context module, a vector splicing module and a similarity judging module; wherein the content of the first and second substances,
the entity context module is arranged in parallel with the relation context module, and outputs an entity context vector of each entity in the knowledge graph and sub-graph information around the entity according to the aligned entity seeds;
the relation context module is arranged in parallel with the entity context module, and outputs a relation context vector of each entity in the knowledge graph by taking each entity and sub-graph information around the entity as input according to the aligned entity seeds;
the vector splicing module is respectively connected with the output ends of the entity context module and the relation context module and can splice the entity context vector of a certain entity output by the entity context module with the relation context vector of the entity output by the relation context module to obtain a final vector of the entity;
the similarity judging module is connected with the output end of the vector splicing module and can calculate the inner product of the final vectors of the two entities as the similarity score of the two entities.
In the neural network model of the graph, the loss function of the similarity judging module is as follows:
wherein the content of the first and second substances,representing aligned entity seeds eiAnd ej;Indicating a misaligned entity ei' and ej', is the entity negative sample;relation seed r representing alignmentiAnd rj;Representing a non-aligned relationship ri' and rj', is the relation negative sample; the function d (,) represents the L2 distance between the final vectors of the two entities; [. the]+ represents a max {0, · } function; gamma raye,γr> 0 is an artificially defined pitch parameter.
In the graph neural network model, the entity context module adopts a GCN neural network model;
the relational context module employs a neural network model composed of a plurality of stacked GNN layers;
the vector splicing module splices an entity context vector h of an entity eeAnd relation context vector CeThe resulting final vector O of the entity eeComprises the following steps:where the norm () function represents the L2 regularization.
Referring to fig. 3, an embodiment of the present invention further provides a method for entity alignment based on a relationship context, including:
and 3, forming entity pairs by one entity in the first knowledge graph and all candidate entities in the second knowledge graph, processing the entity pairs through the optimized graph neural network model, scoring each candidate entity of each entity pair, wherein the candidate entity with the highest score is the aligned entity of the entity, and repeating the step until the alignment of all entities in the first knowledge graph and the second knowledge graph is completed.
In step 1 of the method, the two knowledge maps are respectively the first knowledge map G1=(E1,R1,T1) And a second knowledge-graph G2=(E2,R2,T2) (ii) a The first knowledge-graph G1And a second knowledge-graph G2In, E1、E2All represent a set of entities; r1、R2All represent a set of relationships; t is1、T2All represent a triple set, T1=E1×R1×T1,T2=E2×R2×T2Each triplet is represented by (h, r, t), where h, r, and t represent the head entity, relationship, and tail entity, respectively;
the entity pair (E1, E2) E1 × E2 refers to the same object in the real world, and is used asRepresenting an alignment relationship;
In step 2 of the method, unknown aligned entities in the two knowledge graphs are determined based on parameters in the neural network model of the aligned seed training graph. The training method is that a pair of alignment seeds e1 and e2 are input into the graph neural network model, the output of the graph neural network model is the scores of all candidate entities, the value of the loss function is calculated according to the scores, and then the optimization is carried out through a neural network optimizer (such as Adam), and the optimization aim is to minimize the value of the loss function in the training process; during testing, to determine unknown aligned entities in the two knowledge graphs; that is, given an entity e1 in knowledge-graph G1, it is desirable to find the corresponding aligned entity in knowledge-graph G2, and then the candidate entities in each G2 are scored by the graph neural network model of the present invention, the highest scoring one being the predicted aligned entity with entity e1 of G1.
In step 3 of the above method, scoring each candidate entity of another knowledge graph by the optimized graph neural network model comprises:
aggregating an entity context vector and a relation context vector for each entity in the two knowledge graphs by the optimized graph neural network model, and splicing the obtained entity context vector and the relation context vector to serve as a final vector of each entity;
and calculating the inner product of the final vectors of the two entities as the similarity score of the two entities.
In the above method, aggregating, by the entity context module of the optimized graph neural network model, an entity context vector for each entity in two knowledge graphs includes:
in the entity context modules sharing L layers, the entity context expression of the entity e of each layer is obtained through aggregation;
calculating the average value of the entity context representation of the entity e at each layer as the final entity context vector of the entity e, namely
Wherein h iseIs the final entity context vector of the entity e;an entity context representation at layer I of the entity context module for an entity e, the entity context moduleThe method comprises the following steps: obtaining entity context representation of entity e at layer l-1And entity context representation of all neighboring entities e' of entity e in the knowledge-graph at layer l-1Benefit to
Calculating the entity context expression of the entity e at the l layer by using the acquired information through the following formula
Wherein the content of the first and second substances,a set of neighbor entities e' representing entity e; weight αe,e′Representing the importance degree of the neighbor entity e' to the entity e; σ denotes the activation function.
Aggregating, by a relationship context module of the optimized graph neural network model, relationship context vectors for each entity in two knowledge-graphs, comprising:
in each layer of the relation context modules sharing L layers, aggregating to obtain the relation context expression of the entity e of each hop;
calculating the average value of the relation context expression of the entity e of each hop output by each layer of the relation context module as the relation context vector c of the entity eeThe calculation formula is as follows:
in the formula, L represents the number of layers of the relational context module;the l layer of the relation context module aggregates the relation context with the distance of one hop for the entity eBy the formulaAnd calculating to obtain the result that, in the formula,representing a set of relationships r such that triples (e', r, e) exist for certain entities e ″; w(1)A weight matrix representing a first layer; alpha is alphae,rWeights representing relationships r aggregated by entities eCalculating to obtain;
at the l-th layer of the relation context module, l is more than or equal to 2, the representation of the relation path with the length of l is calculated based on the relation path with the length of l-1, and the representations of the relation paths are aggregated into the relation context of the l-th hop; specifically, the relationship context of the ith hop of the entity e is determined by a formulaAnd calculating to obtain the result that, in the formula,representing a known-to-be-correct triplet set; f. of(l)(-) is a relational composition function that composites the relationship context of the l-1 hopRepresenting a relation path with length l with relation r; f. of(l)(-) is defined as:wherein, W(l)Is the weight matrix in layer i, and σ is the activation function.
And obtaining a final vector of an entity e by splicing the entity context vector output by the entity context module and the relation context vector output by the relation context module, wherein the final vector of the entity e is as follows:
in the above method, one path P in the knowledge-graph is represented as:wherein (e)i,ri,ei+1) Representing a triplet in the knowledge-graph; the path P corresponds to the relationship path PrExpressed as: pr:(r1,r2,...,rn)。
The embodiments of the present invention are described in further detail below.
The embodiment of the invention provides a graph neural network model and a method for entity alignment based on a relationship context, wherein the graph neural network model can be called RCGNN, the model is composed of an entity context module and a relationship context module as shown in FIG. 2, wherein the entity context module adopts a GCN neural network module, and the relationship context module is composed of a plurality of stacked GNN layers.
The knowledge-graph (KG) processed by the present invention is a multi-relationship directed graph representing structured human knowledge. In the invention, a knowledge graph is represented as G (E, R, T), wherein E represents an entity set, R represents a relation set, and T (E) multiplied by R multiplied by E represents a triple set; and (h, r, t) is used to represent triples, where h, r, and t represent head, relationship, and tail entities, respectively.
Considering two knowledge graphs G1 ═ E1, R1, T1 and G2 ═ E2, R2, T2, if the entity pair (E1, E2) ∈ E1 × E2 refers to the same object in the real world, then this is usedRepresenting an alignment relationship; given a set of pre-aligned entity pairs(also referred to as alignment seeds), it is an object of the present invention to discover unknown alignment entities by training alignment seeds.
Unlike the prior art, the method of the present invention solves the problem of mis-alignment by using a relational context. Mainly, the knowledge graph contains rich relationship information, and the existing GNNs based on entity information do not fully utilize the relationship information, but similar entities generally have similar relationship roles, and the relationship context is crucial to the accurate description of the entities. Referring to fig. 1, the difference between "Limestone County" and "George _ S. _ Houston" can be clearly identified by comparing their adjacency. However, to fully exploit the context of the relationship, two elements are essential, namely the relationship-oriented and the distant relationship neighborhood. Relationship-oriented representation a relationship provides different semantic information for its head and tail entities. For example, in a triplet (yaoming, shengho, shanghai), although the entity "yaoming" shares a common adjacent relationship "shengho" with the entity "shanghai", the relationship should provide different semantic information for "yaoming" and "shanghai" because the head entity of the relationship is a "person" and the tail entity is a "place".
The long-distance relationship neighborhood information considers the relationship role of the long-distance neighbor entity, thereby providing more accurate feature description for the entity. In some scenarios, it is not sufficient to use only the neighborhood. For example, a couple may have the same adjacent relationship, such as "spouse", "child", and "parent", but the two entities should not be aligned.
The invention provides a neural network model RCGNN consisting of an entity context module and a relation context module, which can utilize the relation context information of an entity to enhance the representation of the entity, and the main innovation of the RCGNN is that a relation direction and a remote relation neighborhood are introduced to utilize the relation context, and the two key factors are unified into a relation path form, wherein the relation path is defined as follows:
one path P in the knowledge-graph is represented as:wherein (e)i,ri,ei+1) Representing a triplet in the knowledge-graph. The corresponding relation path Pr of the path P is expressed as: pr (r)1,r2,...,rn) (ii) a Since the relational path is a sequence of directed relations, it can naturally model the two elements. The lengths of the relational entities are represented by relationship paths of different lengths.
The structure of the RCGNN model of the present invention is shown in fig. 2, which contains two GNN modules, namely an entity context module and a relationship context module, which respectively aggregate entity context and relationship context information for each entity and concatenate the outputs of the two modules as the final representation of each entity.
Wherein the entity context module adopts the traditional GCN, and for an entity e, the representation of the entity e at the l level is represented by he (l) e Rd, wherein d is an embedding dimension; he (0) is an initial representation of entity e; in the entity context module, the calculation formula of he (0) is:
the entity context vector he for entity e is calculated by:where L represents the number of layers of the entity context module.
The relational context module is composed of several stacked GNN layers, relational contexts are modeled by using a relational-based GNN structure, the output of a k-th layer represents a k-th-hop relational context of each entity and a k-th-length relational path ending at each entity, and in each layer, the relational context of the k-th hop is calculated by a relational composition-based method based on the relational context of the k-1-th hop, and the schematic of the aggregated relational path is shown in FIG. 3.
The first layer of the relation context module aggregates relation contexts with a distance of one hop for each entity e, and the relation contexts of one hop of the entity eBy the formulaAnd calculating to obtain the result that, in the formula,representing a set of relationships r such that triples (e', r, e) exist for certain entities e ″, W(1)Weight matrix, alpha, representing the first layere,rWeights representing relationships r aggregated by entities eCalculating to obtain;
at the l-th layer (l is more than or equal to 2) of the relation context module, the representation of the relation paths with the length of l is calculated based on the relation paths with the length of l-1, and the representations of the relation paths are aggregated into the relation context of the l-th hop, specifically, the relation context of the l-th hop of the entity e passes through the modeAnd calculating to obtain the result that, in the formula,representing a known-to-be-correct triplet set; f. of(l)(-) is a relational composition function that composites the relationship context of the l-1 hopA relation path which is related to the relation r and has a length l; f. of(l)(-) is defined as:wherein, W(l)Is the weight matrix in layer i, σ is the activation function;
calculating an average value by utilizing the output of each layer of the relation context module to obtain the final output c of the relation context moduleeI.e. the upper and lower vectors of the relation of the entity e, the average value passes through the formulaCalculating, wherein in the formula, L represents the layer number of the relation context module;
splicing the obtained entity context vector and the relation context vector to serve as a final vector of a corresponding entity e:
examples
the loss function of the neural network model RCGNN of the invention is divided into an alignment loss function and a TransE loss function, and the loss function of entity alignment and relationship alignmentAndis defined as follows:
wherein, among others,representing aligned entity seeds eiAnd ej;Indicating a misaligned entity ei' and ej', is the entity negative sample;relation seed r representing alignmentiAnd rj;Representing a non-aligned relationship ri' and rj', is the relation negative sample; the function d (,) represents the L2 distance between the final vectors of the two entities; [. the]-represents a max {0, · } function; gamma raye,γr> 0 is an artificially defined pitch parameter.
The TransE loss function is defined as follows:
whereinIs a collection of known valid triples that are valid,is a negative triple set obtained by replacing the head entity or the tail entity in the correct triple; f (h, τ, t) represents the scoring function of the triplet (h, r, t), defined asWherein d represents dimension, using | · | | non-woven phosphor1Represents the L1 norm; the final loss function of RCGNN is the sum of the alignment loss function and the TransE loss function:
the goal of the training phase is to optimize the following objective function: min L, the minimization of the final loss function;
in conducting the test, for a given two knowledge-graphsAndfor the first knowledge-graphA certain test entity e in1And then it is compared with the second knowledge mapAll candidate entities e in2One to one entity pair (e)1,e2)∈ε1×ε2(ii) a Then using RCGNN to obtain e1,e2Final vector o1,o2And calculating a final vector o1,o2Similarity f (o) between the two1,o2) Scoring, and finally, with the highest scoring entity e2As entity e1At the second knowledge-graphThe alignment entity of (1).
The performance data of the model of the embodiment of the invention is as follows:
Table 1:Evaluation results on DBI5K and DWY100K.Results of MTransE,JAPE,AlignE,GCN-Alin,and MuGNN are taken from Cao et al.(2019).Results of RGCN and AliNet are taken from Sun et al.(2020),We reimplement GCN,GAT and HGCN under our experimental settings for fair comparison.
the table above shows the results of the graph neural network model of the present invention for entity alignment based on relational context on DBP15K and DWY100K datasets for entity alignment. In the invention, the number of layers of GCN, GAT and RCGNN is set to be L-2 so as to carry out fair comparison. The results show that the performance of RCGNN is obviously superior to GCN and GAT baseline models and also superior to the latest models such as MuGNN and AliNet. In general, when the model of the present invention utilizes relational context, it can achieve more significant improvements on datasets with more relational types. In DBP15K, these three datasets contain thousands of relationship types, thus providing rich relationship context information for entities. On these data sets, the model of the invention gave a 0.121-0.138 band on H @1 and MRR compared to the GCN baseline. The model of the present invention still shows superior performance even when compared to the most advanced models of munnn and AliNet, etc. The number of relationships in DWY100K is much smaller than DBP 15K. For example, the Wikidata dataset of DBP-WD has only 200 relationships, and the YAGO3 dataset of DBP-YG has only 31 relationships. However, even on DBP-YG, the model of the invention still achieved a 0.052 performance improvement on MRR and a 0.068 performance improvement compared to GCN. The MRR of the model was 0.012 compared to AliNet. Overall, the results on DBP15K and DWY100K show that the model of the invention is not only valid, but is equally applicable to datasets with a small number of relationships.
The relation directivity modeling ablation experiment adopted by the invention is shown in fig. 5, and firstly, the relation directivity is subjected to the ablation experiment. The results are shown in FIG. 5. Modeling the relationship directionality brings a significant improvement over the three datasets of DBP 15K. On the FR-EN data set, the model of the invention improved H @1 of 0.070 and MRR of 0.050. For ZH-EN and JA-EN, the boost at H @1 is 0.052 and 0.059, respectively, and the boost at MRR is 0.033 and 0.041, respectively.
The layer number ablation experiment of the RCGNN model adopted by the invention is shown in fig. 6, and ablation research is performed on the layer number of the relation context module. In fig. 6, results for the number of layers L from 1 to 4 are shown. For fair comparison, the entity context module is uniformly set to L-2. FIG. 5 illustrates the effectiveness of multi-hop relational context modeling. On ZH-EN, the model of the invention improves MRR by 0.015 by introducing a two-hop relational context. The boost was 0.014 and 0.013 for JA-EN and FR-EN, respectively.
According to the performance, the model and the method effectively utilize and model the relationship information in the knowledge graph, and simultaneously combine the related technology of the neural network of the graph, thereby achieving remarkable performance improvement.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (8)
1. A graph neural network model for entity alignment based on relationship context, comprising:
the system comprises an entity context module, a relation context module, a vector splicing module and a similarity judging module; wherein the content of the first and second substances,
the entity context module is arranged in parallel with the relation context module, and outputs an entity context vector of each entity in the knowledge graph and sub-graph information around the entity according to the aligned entity seeds;
the relation context module is arranged in parallel with the entity context module, and outputs a relation context vector of each entity in the knowledge graph by taking each entity and sub-graph information around the entity as input according to the aligned entity seeds;
the vector splicing module is respectively connected with the output ends of the entity context module and the relation context module and can splice the entity context vector output by the entity context module and the relation context vector output by the relation context module to obtain a final vector of an entity;
the similarity judging module is connected with the output end of the vector splicing module and can calculate the inner product of the final vectors of the two entities as the similarity score of the two entities.
2. The graph neural network model for entity alignment based on relationship context of claim 1, wherein the loss function of the similarity determination module is:
wherein the content of the first and second substances,representing aligned entity seeds eiAnd ej;Indicating a misaligned entity ei' and ej', is the entity negative sample;relation seed r representing alignmentiAnd rj;Representing a non-aligned relationship ri' and rj', is the relation negative sample; the function d (,) represents the L2 distance between the final vectors of the two entities; [. the]+ represents a max {0, · } function; gamma raye,γr> 0 is an artificially defined pitch parameter.
3. The graph neural network model for entity alignment based on relationship context of claim 1, the entity context module employing a GCN neural network model;
the relational context module employs a neural network model composed of a plurality of stacked GNN layers;
4. A method for entity alignment based on relationship context, comprising:
step 1, selecting a group of entity pairs which are aligned in advance from a first knowledge graph and a second knowledge graph which are to be aligned as alignment seeds;
step 2, training parameters of the graph neural network model for entity alignment based on the relationship context according to claim 1 or 2 by taking the alignment seeds as input, and optimizing the graph neural network model by using a neural network optimizer to minimize the value of a loss function in the training process to obtain an optimized graph neural network model;
and 3, forming entity pairs by one entity in the first knowledge graph and all candidate entities in the second knowledge graph, processing the entity pairs through the optimized graph neural network model, scoring each candidate entity of each entity pair, wherein the candidate entity with the highest score is the aligned entity of the entity, and repeating the step until the alignment of all entities in the first knowledge graph and the second knowledge graph is completed.
5. The method of claim 4, wherein the processing the entity pairs through the optimized graph neural network model, and the scoring the similarity of each candidate entity of each entity pair comprises:
aggregating an entity context vector and a relation context vector for each entity in an entity pair by the optimized graph neural network model, and splicing the obtained entity context vector and the relation context vector to serve as a final vector of each entity;
and calculating the inner product of the final vectors of the two entities as the similarity score of the two entities, namely the score of the candidate entity.
6. The method for entity alignment based on relationship context according to claim 4 or 5, wherein in step 1, the two knowledge-graphs are the first knowledge-graph G respectively1=(E1,R1,T1) And a second knowledge-graph G2=(E2,R2,T2) Wherein E is1、E2All represent a set of entities; r1、R2All represent a set of relationships; t is1、T2All represent a triple set, T1=E1×R1×T1,T2=E2×R2×T2Each triplet is represented by (h, r, t), where h, r, and t represent the head entity, relationship, and tail entity, respectively;
the entity pair (E1, E2) E E1 × E2 refers to the real worldThe same object in (1) is usedRepresenting an alignment relationship;
7. The method of claim 5, wherein aggregating, by an entity context module of the optimized graph neural network model, entity context vectors for each entity in the pair of entities comprises:
in the entity context modules sharing L layers, the entity context expression of the entity e of each layer is obtained through aggregation;
calculating the average value of the entity context representation of the entity e at each layer as the final entity context vector of the entity e, namely
Wherein h iseIs the final entity context vector of the entity e;an entity context representation at layer I of the entity context module for an entity e, the entity context moduleThe method comprises the following steps: obtaining entity context representation of entity e at layer l-1And entity context representation of all neighboring entities e' of entity e in the knowledge-graph at layer l-1Calculating the entity context representation of the entity e at the l layer by using the acquired information through the following formula
Wherein the content of the first and second substances,a set of neighbor entities e' representing entity e; weight αe,e′Representing the importance degree of the neighbor entity e' to the entity e; σ represents an activation function;
aggregating, by an entity context module of the optimized graph neural network model, a relationship context vector for each entity in the pair of entities, comprising:
in each layer of the relation context modules sharing L layers, aggregating to obtain the relation context expression of the entity e of each hop;
calculating the average value of the relation context expression of the entity e of each hop output by each layer of the relation context module as the relation context vector c of the entity eeThe calculation formula is as follows:
in the formula, L represents the number of layers of the relational context module;the l layer of the relation context module aggregates the relation context with the distance of one hop for the entity eBy the formulaAnd calculating to obtain the result that, in the formula,representing a set of relationships r such that triples (e', r, e) exist for certain entities e ″; w(1)A weight matrix representing a first layer; alpha is alphae,rWeights representing relationships r aggregated by entities eCalculating to obtain;
at the l-th layer of the relation context module, l is more than or equal to 2, the representation of the relation path with the length of l is calculated based on the relation path with the length of l-1, and the representations of the relation paths are aggregated into the relation context of the l-th hop; specifically, the relationship context of the ith hop of the entity e is determined by a formulaAnd calculating to obtain the result that, in the formula,representing a known-to-be-correct triplet set; f. of(l)(-) is a relational composition function that composites the relationship context of the l-1 hopRepresenting a relation path with length l with relation r; f. of(l)(-) is defined as:wherein, W(l)Is the weight matrix in layer i, and σ is the activation function.
8. The method of claim 7The method for entity alignment based on the relationship context is characterized in that one path P in the knowledge graph is represented as:wherein (e)i,ri,ei+1) Representing a triple in the knowledge graph, i is more than or equal to 1 and less than or equal to n, n +1 represents the length of a path, and i represents any position in the path;
the path P corresponds to the relationship path PrExpressed as: pr:(r1,r2,...,rn)。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110281892.7A CN113157935B (en) | 2021-03-16 | 2021-03-16 | Entity alignment based on relation context and graph neural network system and method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110281892.7A CN113157935B (en) | 2021-03-16 | 2021-03-16 | Entity alignment based on relation context and graph neural network system and method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113157935A true CN113157935A (en) | 2021-07-23 |
CN113157935B CN113157935B (en) | 2024-02-27 |
Family
ID=76887258
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110281892.7A Active CN113157935B (en) | 2021-03-16 | 2021-03-16 | Entity alignment based on relation context and graph neural network system and method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113157935B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113704495A (en) * | 2021-08-30 | 2021-11-26 | 合肥智能语音创新发展有限公司 | Entity alignment method and device, electronic equipment and storage medium |
CN116702745A (en) * | 2023-06-14 | 2023-09-05 | 上交所技术有限责任公司 | Heuristic entity alignment method based on semantic matching model |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021000676A1 (en) * | 2019-07-03 | 2021-01-07 | 平安科技(深圳)有限公司 | Q&a method, q&a device, computer equipment and storage medium |
CN112417159A (en) * | 2020-11-02 | 2021-02-26 | 武汉大学 | Cross-language entity alignment method of context alignment enhanced graph attention network |
-
2021
- 2021-03-16 CN CN202110281892.7A patent/CN113157935B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021000676A1 (en) * | 2019-07-03 | 2021-01-07 | 平安科技(深圳)有限公司 | Q&a method, q&a device, computer equipment and storage medium |
CN112417159A (en) * | 2020-11-02 | 2021-02-26 | 武汉大学 | Cross-language entity alignment method of context alignment enhanced graph attention network |
Non-Patent Citations (1)
Title |
---|
王子涵;邵明光;刘国军;郭茂祖;毕建东;刘扬;: "基于实体相似度信息的知识图谱补全算法", 计算机应用, no. 11 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113704495A (en) * | 2021-08-30 | 2021-11-26 | 合肥智能语音创新发展有限公司 | Entity alignment method and device, electronic equipment and storage medium |
CN113704495B (en) * | 2021-08-30 | 2024-05-28 | 合肥智能语音创新发展有限公司 | Entity alignment method, device, electronic equipment and storage medium |
CN116702745A (en) * | 2023-06-14 | 2023-09-05 | 上交所技术有限责任公司 | Heuristic entity alignment method based on semantic matching model |
Also Published As
Publication number | Publication date |
---|---|
CN113157935B (en) | 2024-02-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022011681A1 (en) | Method for fusing knowledge graph based on iterative completion | |
CN113157935B (en) | Entity alignment based on relation context and graph neural network system and method | |
CN110413704B (en) | Entity alignment method based on weighted neighbor information coding | |
CN112131395A (en) | Iterative knowledge graph entity alignment method based on dynamic threshold | |
CN113239131B (en) | Low-sample knowledge graph completion method based on meta-learning | |
CN112651406B (en) | Depth perception and multi-mode automatic fusion RGB-D significance target detection method | |
CN113761221B (en) | Knowledge graph entity alignment method based on graph neural network | |
CN113436197B (en) | Domain-adaptive unsupervised image segmentation method based on generation of confrontation and class feature distribution | |
WO2022262320A1 (en) | Information completion method for knowledge graph-based power distribution network cim model, and system | |
CN114969367B (en) | Cross-language entity alignment method based on multi-aspect subtask interaction | |
CN115100678A (en) | Cross-modal pedestrian re-identification method based on channel recombination and attention mechanism | |
CN113903031A (en) | Cross-domain semantic segmentation method based on graph convolution and contrast learning | |
CN107451617B (en) | Graph transduction semi-supervised classification method | |
CN113297429A (en) | Social network link prediction method based on neural network architecture search | |
CN115828143A (en) | Node classification method for realizing heterogeneous primitive path aggregation based on graph convolution and self-attention mechanism | |
CN116089627A (en) | Knowledge graph construction method based on big data technology | |
CN115346037A (en) | Image tampering detection method | |
CN114519107A (en) | Knowledge graph fusion method combining entity relationship representation | |
CN106530100A (en) | Community discovery technical method facing confidence-level social network | |
CN114528971A (en) | Atlas frequent relation mode mining method based on heterogeneous atlas neural network | |
CN112101358B (en) | Method for aligning phrase and picture region based on decoupling and intervention graph network | |
CN116226467A (en) | Community discovery method of graph convolution neural network based on node structural features | |
CN115600012B (en) | API recommendation method based on knowledge enhancement and structure comparison | |
CN115601745A (en) | Multi-view three-dimensional object identification method facing application end | |
CN115080871A (en) | Cross-social network social user alignment method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |