CN111753101B - Knowledge graph representation learning method integrating entity description and type - Google Patents
Knowledge graph representation learning method integrating entity description and type Download PDFInfo
- Publication number
- CN111753101B CN111753101B CN202010623201.2A CN202010623201A CN111753101B CN 111753101 B CN111753101 B CN 111753101B CN 202010623201 A CN202010623201 A CN 202010623201A CN 111753101 B CN111753101 B CN 111753101B
- Authority
- CN
- China
- Prior art keywords
- entity
- triple
- embedding
- vector
- type
- 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.)
- Active
Links
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
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Computational Linguistics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Computation (AREA)
- Evolutionary Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Animal Behavior & Ethology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Databases & Information Systems (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Machine Translation (AREA)
Abstract
The invention provides a knowledge graph representation learning method integrating entity description and type, which comprises the following steps: step S1: embedding of triple entities is obtained by using a translation model, and the relation in the triple is used as the translation operation between a head entity and a tail entity to obtain the numerical vector representation of each triple entity and the relation; step S2: embedding text information described by an entity by adopting a Doc2Vec model; step S3: entity embedding obtained through a Trans model is combined with an entity level type mapping matrix to obtain embedding of a triple entity type; step S4: and connecting all the expression vectors to obtain a final triplet entity vector, optimizing the training model by adopting a random gradient descent method, and evaluating the effect. The method provided by the invention improves the semantic information expressed by the knowledge graph triple entity through the entity description and the embedding of the entity type.
Description
Technical Field
The invention relates to the field of knowledge graphs, in particular to a knowledge graph representation learning method fusing entity description and types.
Background
In 2012, *** proposed the concept of a knowledge graph and applied it to a search engine. Then, the construction of large-scale knowledge maps is greatly advanced, and a large number of knowledge maps are developed, which are represented by YAGO, DBpedia, FreeBase and the like. At present, the knowledge graph plays an important role in many artificial intelligence applications, such as intelligent question answering, information recommendation, web page search, and the like. A knowledge graph is a structured semantic network that stores a large number of fact triples (head, relationship, tail), usually reduced to (h, r, t).
However, as the scale of the knowledge graph is gradually enlarged, the data types are gradually diversified, the more complex the relationship between entities, and the traditional symbol and logic-based method makes the knowledge graph application challenging due to the computational inefficiency.
To solve this problem, expression learning is proposed and developed vigorously. The purpose of representation learning is to map entities and relationships in the three-tuple of the knowledge graph to a low-dimensional dense vector space, converting traditional logic and symbol-based operations into numerical-based vector calculations. The representation learning model based on the energy function obtains better results on tasks such as link prediction, triple classification and the like due to the simplicity and the high efficiency, and is widely applied to the fields of knowledge map completion, entity alignment and the like.
At present, the knowledge graph representation learning methods mainly comprise the following three types: a model based on tensor decomposition, a model based on translation operation, and a model fusing multi-source information. The representation learning model based on tensor decomposition is represented by a RESCAL model, the knowledge graph is encoded into a tensor, if the triplet exists in the knowledge graph, the value in the corresponding tensor is set to be 1, and otherwise, the value is 0. However, the RESCAL model requires a large number of parameters and is computationally inefficient. The translation operation-based representation learning model is represented by a TransE model, which considers the relationship in the triplet as a translation operation between the head entity and the tail entity, with the basic assumption that the true triplet (h, r, t) should satisfy the equation h + r-t. TransE is effective in one-to-one type of relationships, but has certain problems in dealing with one-to-many, many-to-one, and many-to-many problems. Many models improve the TransE, but only the triple structure information in the knowledge graph is considered, and a large amount of other information related to the entities and the relations is not effectively applied, so that the semantic information of the entities and the relations is not clear. In the aspect of representation learning of multi-source information fusion, a knowledge representation learning model of entity description and representation learning of text and knowledge base fusion are mainly considered, and information sources and fusion means of the models are very limited. In addition, the entity distribution in the knowledge graph shows a long tail distribution phenomenon, and part of entities do not have corresponding description texts in heterogeneous data sources.
Disclosure of Invention
The invention mainly aims to overcome the defects in the prior art, and provides a knowledge graph representation learning method fusing entity descriptions and types, which can solve the problems that most of the current representation learning models only consider triple information of knowledge graphs, the fusion degree of rich text information and type information in the knowledge graphs is low, and the fusion mode is single, so that the fuzzy degree of entities and relations can be well reduced, the accuracy of inference prediction is improved, and the semantic information represented by the triple entities of the knowledge graphs is improved.
The invention adopts the following technical scheme:
a knowledge graph representation learning method fusing entity description and type is characterized by comprising the following steps:
step S1: embedding of triple entities is obtained by using a Translation model (Trans), and the relation in the triple is used as the Translation operation between a head entity and a tail entity to obtain the numerical vector representation of each triple entity and the relation;
step S2: all text information described by the triple entities in the knowledge graph is considered, and a Doc2Vec model is adopted to embed the text information described by the entities;
step S3: entity embedding obtained through a Trans model is combined with an entity level type mapping matrix to obtain embedding of a triple entity type;
step S4: and connecting all the expression vectors to obtain a final triplet entity vector. And optimizing the training model by adopting a random gradient descent method, and evaluating the effect.
Preferably, the triple entity embedding in step S1 includes a TransE model and a TransR model acquisition triple embedding, where E, R represents an entity set and a relationship set of the knowledge graph, respectively, and the specific acquisition method includes:
s11: TransE model acquisition triple embedding
S111: and randomly generating vector representations of the head entity, the relation and the tail entity of the triad, and respectively recording the vector representations as h, r and t.
S112: and generating negative sample data randomly. Regarding an originally existing triple in the knowledge graph as a correct triple (h, R, t), randomly replacing a head entity or a tail entity in the correct triple by an entity in an entity set E, and randomly replacing a relation in the correct triple by a relation in a relation set R, specifically:
neg={(h,r,t)|h′∈E}∪{(h,r′,t)|r′∈R}∪{(h,r,t′)|t′∈E}
where h ' is the negative sample corresponding to h, r ' is the negative sample corresponding to r, and t ' is the negative sample corresponding to t;
s113: optimizing an objective function L (h, r, t) to obtain the embedding of the triple entity based on the TransE model;
wherein, γ is a hyper-parameter, and measures the boundary of the correct triple and the error triple, d (h + r, t) | | h + r-t |, d (h + r, t) is the distance measurement of h + r and t, pos is the correct triple in the knowledge map.
S12: TransR model acquisition triple embedding
S121: for each relation, multiplying a transformation matrix Mr with a head entity vector and a relation entity vector, mapping a head entity vector h and a tail entity vector t to a relation space, and obtaining an entity vector representation under the relation space, namely:
hr=hMr,tr=tMr
s122: negative sample data is generated. And (3) regarding the original existing triples in the knowledge graph as correct triples (h, R, t), randomly replacing head entities or tail entities in the correct triples by the entities in the entity set E, and randomly replacing the relations in the correct triples by the relations in the relation set R.
S123: finally, the objective function L (h, r, t) is optimized, and embedding of the triple entity based on the TransR model is obtained.
Wherein, gamma is a hyper-parameter, and the boundary of a correct triple and an error triple is measured, d (h + r, t) | | hr + r-tr |; d (h + r, t) is a distance measure of hr + r and tr, d (h ' + r ', t ') being the same; pos is the correct triplet in the knowledge-graph.
Preferably, the method for acquiring the description of the triplet entity in step S2 is as follows:
s21: randomly generating an N-dimensional document vector xparagraph-idAnd a word vector x for the unique form of each word in the N-dimensional documenti-m,...,i+mWhere i refers to the index of the current headword predicted by the context and m refers to the window size.
S22: reducing the dimension of the document vector and the word vector with the dimension of N:
vi-m=Vxi-m,vi-m+1=Vxi-m+1,...,vi+m=Vxi+m,vparagrap h-id=Vxparagrap h-id
wherein V is a unit matrix with N rows and N columns, and N < N;
s23: obtaining a central word vector through the word vector and the document vectoryi:
Wherein U is a unit matrix with N rows and N columns,
s24: the central word vector is normalized by the softmax function:
s25: and optimizing the objective function.
S26: and minimizing the objective function by using an optimization method of random gradient descent, updating and outputting the vector to obtain the embedding of the entity description.
Preferably, the method for acquiring the triple entity type in step S3 includes:
for a particular triplet (h, r, t), the head entity mapping matrix is calculated as:
wherein, CrhRepresenting a set of relationship types for the head entity given a relationship r, for each entity type c, ciRepresenting the ith type to which entity e belongs,is ciOf the mapping matrix, αiIs ciA corresponding weight;
wherein, CrtFor a given relationship r, a set of relationship types, M, for the tail entitycIs a projection matrix of type c, McIs defined as:
where m is the number of layers of the hierarchy type,denotes the ith sub-type c(i)The mapping matrix of (2);
finally, M is addedrh、MrtAnd multiplying the triple entity embedding obtained by TransE to obtain the embedding of the entity type.
Preferably, the loss function in step S4 is:
wherein, γ is a hyper-parameter, and measures the boundary of a correct triple and an error triple, T is a positive triple set, and T' is a negative triple set, and is obtained by randomly replacing a head entity or a tail entity or a relationship of the positive triple, that is:
T′={(h′,r,t)|h′∈E}∪{(h,r′,t)|r′∈R}∪{(h,r,t′)|t′∈E}
d (h + r, t) | | h + r-t | |, where d (h + r, t) is a distance metric of h + r and t.
Embedding e of triples is obtained by step S1sThe embedding e of the entity description information is obtained through step S2dThe description e of the entity type information is obtained through step S3tThrough an initialization vectorThe initial vectors are combined into a final model,representing a splicing operation; link prediction and triple classification are used for evaluation.
Compared with the prior art, the knowledge graph representation learning method fusing the entity description and the type can solve the problems that most of the current representation learning models only consider triple information of the knowledge graph, the fusion degree of rich text information and type information in the knowledge graph is low, and the fusion mode is single, so that the fuzzy degree of entities and relations can be well reduced, the accuracy of inference prediction is improved, and the semantic information represented by the triple entities of the knowledge graph is improved through the entity description and the entity type embedding.
Drawings
FIG. 1 is an overall flow chart of the present invention;
FIG. 2 is a flow chart of triple embedding acquisition;
FIG. 3 is a flow diagram of entity description embedding retrieval;
FIG. 4 is a flow chart of entity type embedding acquisition.
The invention is described in further detail below with reference to the figures and specific examples.
Detailed Description
Fig. 1 is a flowchart of a knowledge graph representing a learning method according to an embodiment of the present invention, which integrates entity descriptions and types; the method specifically comprises the following steps:
step S1: embedding the triple entities by using a translation model, and taking the relationship in the triple as translation operation between the head entity and the tail entity to obtain the numerical vector representation of each triple entity and the relationship;
1) TransE model acquisition triple embedding
The flow chart of the TransE method for acquiring entity embedding is shown in FIG. 2.
Firstly, vector representations of a head entity, a relation and a tail entity of the triad are randomly generated and are respectively marked as h, r and t.
Secondly, negative sample data is randomly generated using equation (1) according to the idea that the relationship is a translation operation between the head entity and the tail entity. Wherein E, R represent the set of entities and the set of relationships of the knowledge-graph, respectively.
neg={(h,r,t)|h′∈E}∪{(h,r′,t)|r′∈R}∪{(h,r,t′)|t′∈E} (1)
Where h ' is the negative sample corresponding to h, r ' is the negative sample corresponding to r, and t ' is the negative sample corresponding to t;
finally, the objective function L (h, r, t) is optimized, and embedding of the triple entity based on the TransE model is obtained.
L(h,r,t)=∑(h,r,t)∈pos∑(h′,r′,t′)∈negmax(γ+d(h+r,t)-d(h′+r′,t′),0) (2)
Where d (h + r, t) | | | h + r-t | |, d (h + r, t) is a distance measure of h + r and t. pos is the correct triplet in the knowledge-graph.
2) TransR model acquisition triple embedding
The TransE model assumes that entities and relationships are in the same semantic space, so that similar entities have similar positions in space, however, each entity can have many aspects, and different relationships concern different aspects of the entity. Therefore, the TransR model establishes respective relationship spaces for different relationships, and the entity is mapped to the relationship spaces for calculation.
First, for each relationship, there is a transformation matrix Mr and a representation vector r in its own space vector. Vector representations of the head entity and the tail entity are mapped to a relation space through a transformation matrix, namely Mr is multiplied by vectors of the head entity and the relation entity to obtain entity vector representation in the relation space.
Then, negative sample data is generated.
Finally, the objective function is optimized as shown in equation (2).
Step S2: all text information described by the triple entities in the knowledge graph is considered, and a Doc2Vec model is adopted to embed the text information described by the entities;
a flow chart of entity description embedding retrieval is shown in fig. 3.
First, an N-dimensional document vector x is randomly generatedparagraph-idAnd a word vector x in the form of a one-hot (one-hot) for each word in the N-dimensional documenti-m,...,i+mWhere i refers to the index of the current headword predicted by the context and m refers to the window size.
Then, the dimension of the document vector and the word vector with the dimension of N is reduced:
vi-m=Vxi-m,vi-m+1=Vxi-m+1,...,vi+m=Vxi+m,vparagrap h-id=Vxparagrap h-id (3)
where V is an identity matrix of N rows and N columns, and N is much smaller than N. The document vector and the word vector are reduced to n dimensions.
The central word vector y can be obtained through the word vector and the document vectori:
Wherein, U is an N-row and N-column unit matrix, and the central word vector is further normalized through a softmax function:
finally, the objective function is optimized.
And (3) minimizing the objective function by using an optimization method of random gradient descent, updating and outputting the vector, and thus embedding the entity description.
Step S3: entity embedding obtained through a Trans model is combined with an entity level type mapping matrix to obtain embedding of a triple entity type;
FIG. 4 is a flow chart of entity type embedding acquisition, with entity types having hierarchy. Therefore, the entity under the entity type needs to be mapped first; then, in the complex relationship schema of 1-N, N-1 and N-N, the entities have different representations under different relationships. In order to better perform complex relation prediction, entities under a specific relation need to be mapped, and finally knowledge representation of a fusion level type is obtained.
Let n be the number of all entity types of entity e, for each entity type c, ciRepresenting the ith type to which entity e belongs,is ciOf the mapping matrix, αiIs ciThe corresponding weight. Alpha is alphaiCan belong to c through an entity eiThe frequency of (2) is obtained. Set forth hereiniThe values of (a) are the same. For a particular triplet (h, r, t), the head entity mapping matrix is calculated as:
wherein, CrhRepresenting a set of relationship types for the head entity given the relationship r.
In the same way, CrtThe set of relationship types for the tail entity given a relationship r. McIs a projection matrix of type c.
Then, in the projection process, the entities are first mapped to a more general subtype space and then to a more accurate subtype space. McIs defined as:
where m is the number of layers of the hierarchy type,denotes the ith sub-type c(i)The mapping matrix of (2).
Finally, M is addedrh、MrtAnd multiplying the triple entity embedding obtained by TransE to obtain the embedding of the entity type.
Step S4: and connecting all the expression vectors to obtain a final triplet entity vector, optimizing the training model by adopting a random gradient descent method, and evaluating the effect.
The loss function is:
L=∑(h,r,t)∈T∑(h′,r′,t′)∈T′max(γ+d(h+r,t)-d(h′+r′,t′),0) (10)
wherein, T is a positive-case triple set, and T' is a negative-case triple set, and is obtained by randomly replacing a head entity or a tail entity or a relationship of the positive-case triple, that is:
T′={(h′,r,t)|h′∈E}∪{(h,r′,t)|r′∈R}∪{(h,r,t′)|t′∈E} (11)
d (h + r, t) ═ h + r-t | |, represents the distance metric of h + r and t.
Embedding of triples as esThe embedding of the entity description information is edDescription of entity type information is embedded as etBy passingThe initial vectors are combined into the final model,representing a splicing operation; link prediction and ternary component classes are used for evaluation.
(1) Model training
Given a Knowledge Graph (KG), the set of triplets existing in KG is T { (h, R, T) | h, T ∈ E, R ∈ R }, where E is the set of entities and R is the set of relationships. And setting the TDT model parameters as theta ═ { E, R, X, M }, wherein X is the embedding of the entity description, and M is the mapping matrix of all the subtypes.
An interval-based ordering loss function L is defined, the model is optimized by minimizing the loss function, i.e.:
L=∑(h,r,t)∈T∑(h′,r′,t′)∈T′max(γ+d(h+r,t)-d(h′+r′,t′),0) (12)
wherein, γ is a hyper-parameter, and measures the boundary of a correct triple and an error triple, T is a positive example triple set, and T' is a negative example triple set, and is obtained by randomly replacing a head entity or a tail entity or a relationship of the positive example triple, that is:
T′={(h,r,t)|h′∈E}∪{(h,r′,t)|r′∈R}∪{(h,r,t′)|t′∈E} (13)
d (h + r, t) is a distance measure of h + r and t, defined as:
d(h+r,t)=||h+r-t|| (14)
the embedding of the entity in the method of the invention comprises three parts of contents, so that the initialization is needed from three aspects. (1) The representation X of the entity description of the triplet can be embedded by the description of the Doc2Vec model; (2) embedding a knowledge graph triple E, R can be obtained through a Trans model; (3) embedding of entity type information can be obtained through embedding E of the triples and the mapping matrix M. All initialization vectors are combined into the initial vector of the final model by equation (15).
After initialization, optimization is performed using a random gradient descent method. The loss function shown in equation (10) is minimized during the training process.
(1) Evaluation of effects
The method provided by the invention utilizes the FB15K standard data set to verify the effectiveness of the method. FB15K was extracted from the large-scale knowledge-graph FreeBase, which was experimentally divided into a training data set, a test data set, and a valid data set.
In FB15K, each entity description comprises 69 words on average and 343 words at most; in terms of entity types, each entity contains at least one type, and the average number of entity types is 8. The training data set has 472,860 triplets and 1,341 relationships; the valid dataset has 48,991 triples and the test dataset has 57,803 triples. Table 1 shows data statistics of FB 15K.
TABLE 1 FB15K data statistics
The present invention defines: an embedded form based on the TDT model and strictly adhering to equation (13) is called a complete TDT model. However, there are many alternative variables for the TDT model. When e isdWhen the content is equal to 0, the content,when e istWhen the content is equal to 0, the content,the model is a non-complete embedding model based on TDT and is called a non-complete TDT model. The experimental setup was as follows:
(1) TDTE (TransE + Description + Type): and (3) obtaining triple entity embedding by using a TransE model, combining with a mapping matrix to obtain the expression of the type of the fused entity, and obtaining the expression of the entity description vector through Doc2 Vec.
(2) TDTEWT (transit + Description): triple entity embedding is obtained through a TransE model, and a representation of entity embedding is obtained through a Doc2Vec model.
(3) TDTEWD (TransE + Type): and obtaining triple entity representation through a TransE model, and combining the triple entity representation with a mapping matrix to obtain the representation of the fused entity type information.
(4) TDTR (TransR + Description + Type) uses a TransR model to obtain triple entity embedding, combines with a mapping matrix to obtain the representation of the Type of a fused entity, and obtains the representation of an entity Description vector through Doc2 Vec.
(5) TDTRWT (TransR + Description): triple entity embedding is obtained through a TransR model, and a representation of entity embedding is obtained through a Doc2Vec model.
(6) TDTRWD (TransR + Type): and obtaining triple entity representation through a TransR model, and combining the triple entity representation with a mapping matrix to obtain the representation of the fused entity type information.
For the training of the model, the parameters are set: triplet embedding dimension ntrEntity description vector dimension ndsAnd an entity type vector dimension ntyThe value set of (A) is {50,100,200 }. According to most translation operation-based models, the learning rate lambda value set is set to be {0.0005,0.001 and 0.002}, and the boundary gamma value set is set to be {1.0 and 2.0 }. In the above 6 sets of experiments, the parameters were first set: λ is 0.001, γ is 1.0, ntr=100,nds=100,nty100, i.e.: vector (including triple embedding, entity description embedding and entity type embedding dimension) n ═ n of complete TDT modeltr+nds+nty300. For selectable vector embedding, when three-tuple and entity description are selected for merging, the vector dimension n is ntr+nds200, when selecting triples and entity types for fusing, the vector dimension ntr+nty=200。
The evaluation criteria are as follows:
(1) link prediction
Link prediction is a subtask of knowledge-graph completion that aims at predicting missing h or t for a given triplet (h, r, t) by minimizing a scoring function. This task ranks a series of candidate entities rather than giving a best answer from the knowledge-graph. In the test, for a given triplet (h, r, t), we randomly replaced the head or tail entity in the triplet with all entities in the set of knowledge-graph entities, and then sorted in descending order according to the scoring function.
TABLE 2 entity Link prediction evaluation results
In the evaluation task, two evaluation criteria of the translation model are selected: (1) average ranking of correct triples or relationships (MeanRank, MR); (2) for an entity, the probability Hits @10 that the correct answer ranks top 10. A lower MR or a higher Hits @10 is a better experimental evaluation. In addition, triples after a head entity or tail entity is randomly replaced may also exist in the knowledge-graph and may be underestimated during the evaluation process. Therefore, we follow two settings: evaluation tasks can be classified as "Raw" and "Filter" according to whether these replaced but correct triples are filtered out before sorting.
The entity link prediction evaluation results are shown in table 2, and the best two results under each index are shown in bold.
(2) Triple classification
TABLE 3 triple Classification of Experimental results
Triple classification is a two-classification task that determines whether a given triple is correct. The FB15K dataset was used in the experiments to construct negative case triplets in the same way as the link prediction. The classification strategy is as follows: a different specific relationship threshold σ is set for each relationship, and for a tuple (h, r, t), if the d (h + r, t) score is less than σ, then the tuple is considered to be predicted correctly. The experimental results of the triple classification are shown in table 3.
In summary, the knowledge graph representation learning method fusing entity descriptions and types provided by the invention can solve the problems that most of the current representation learning models only consider triple information of knowledge graphs, the fusion degree of rich text information and type information in the knowledge graphs is low, and the fusion mode is single, so that the fuzzy degree of entities and relations can be well reduced, the accuracy of reasoning and prediction is improved, and the semantic information represented by the triple entities of the knowledge graphs is improved.
The above description is only an embodiment of the present invention, but the design concept of the present invention is not limited thereto, and any insubstantial modifications made by using the design concept should fall within the scope of infringing the present invention.
Claims (2)
1. A knowledge graph representation learning method fusing entity description and type is characterized by comprising the following steps:
step S1: embedding of triple entities is obtained by using a translation model, and the relation in the triple is used as the translation operation between a head entity and a tail entity to obtain the numerical vector representation of each triple entity and the relation;
step S2: embedding text information described by an entity by adopting a Doc2Vec model;
step S3: entity embedding obtained through a Trans model is combined with an entity level type mapping matrix to obtain embedding of a triple entity type;
step S4: connecting all the expression vectors to obtain a final triple entity vector, optimizing a training model by adopting a random gradient descent method, and evaluating the effect;
in step S1, the triple entity embedding includes acquiring triple embedding by using a TransE model and a TransR model, where E, R represents an entity set and a relationship set of the knowledge graph, respectively, and the specific acquisition method includes:
s11: acquiring triple embedding by a TransE model;
s111: randomly generating vector representations of the head entity, the relation and the tail entity of the triad, and respectively recording the vector representations as h, r and t;
s112: generating negative sample data randomly; regarding an originally existing triple in the knowledge graph as a correct triple (h, R, t), randomly replacing a head entity or a tail entity in the correct triple by an entity in an entity set E, and randomly replacing a relation in the correct triple by a relation in a relation set R, specifically:
neg={(h′,r,t)|h′∈E}∪{(h,r′,t)|r′∈R}∪{(h,r,t′)|t′∈E}
where h ' is the negative sample corresponding to h, r ' is the negative sample corresponding to r, and t ' is the negative sample corresponding to t;
s113: optimizing an objective function L (h, r, t) to obtain the embedding of the triple entity based on the TransE model;
wherein gamma is a hyper-parameter, and the boundary of a correct triple and an error triple is measured; d (h + r, t) | | h + r-t | |, d (h + r, t) being the distance measure of h + r and t; pos is the correct triplet in the knowledge-graph;
s12: TransR model acquisition triple embedding
S121: for each relationship, multiplying the transformation matrix Mr with the head entity vector and the relationship entity vector, mapping the head entity vector h and the tail entity vector t to a relationship space, and obtaining an entity vector representation under the relationship space, namely:
hr=hMr,tr=tMr
s122: then, generating negative sampling data; regarding an originally existing triple in the knowledge graph as a correct triple (h, R, t), randomly replacing a head entity or a tail entity in the correct triple by an entity in an entity set E, and randomly replacing a relation in the correct triple by a relation in a relation set R;
s123: finally, optimizing an objective function L (h, r, t) to obtain the embedding of the triple entity based on the TransR model;
wherein, gamma is a hyper-parameter, and the boundary of a correct triple and an error triple is measured, d (h + r, t) | | hr + r-tr |; d (h + r, t) is a distance measure of hr + r and tr, d (h ' + r ', t ') being the same; pos is the correct triplet in the knowledge-graph;
the method for acquiring the triple entity type in step S3 includes:
for a particular triplet (h, r, t), the head entity mapping matrix is calculated as:
wherein, CrhRepresenting a set of relationship types for the head entity given a relationship r, for each entity type c, ciRepresenting the ith type to which entity e belongs,is ciOf the mapping matrix, αiIs ciA corresponding weight;
wherein, CrtFor a given relationship r, a set of relationship types, M, for the tail entitycIs a projection matrix of type c, McIs defined as:
wherein m is a layerThe number of layers of the sub-type,denotes the ith sub-type c(i)The mapping matrix of (2);
finally, M is addedrh、MrtEmbedding multiplication is carried out on the entity type and the triple entity embedding obtained by TransE to obtain embedding of the entity type;
the loss function in step S4 is:
wherein, γ is a hyper-parameter, and measures the boundary of a correct triple and an error triple, T is a positive triple set, and T' is a negative triple set, and is obtained by randomly replacing a head entity or a tail entity or a relationship of the positive triple, that is:
t ' { (h ', R, T) | h ' ∈ E }, { (h, R ', T) | R ' ∈ R }, { (h, R, T ') | T ' ∈ E } d (h + R, T) | | h + γ -T | |, representing a distance metric of h + R and T;
embedding e of triples is obtained by step S1sThe embedding e of the entity description information is obtained through the step S2dThe description e of the entity type information is obtained through step S3tThrough an initialization vectorThe initial vectors are combined into the final model,and evaluating by adopting link prediction and triple classification.
2. The method for learning knowledge graph representation of fused entity descriptions and types according to claim 1, wherein the method for obtaining the triple entity descriptions in step S2 is as follows:
s21: randomly generating an N-dimensional document vector xparagraph-idAnd a word vector x of the one-hot form of each word in the N-dimensional documenti -m,...,i+mWhere i refers to the index of the current headword predicted by the context, and m refers to the window size;
s22: reducing the dimension of the document vector and the word vector with the dimension of N:
vi-m=Vxi-m,vi-m+1=Vxi-m+1,...,vi+m=Vxi+m,vparagraph-id=Vxparagraph-idwherein, V is a unit matrix with N rows and N columns, and N is less than N;
s23: the central word vector y can be obtained through the word vector and the document vectori:
Wherein U is a unit matrix with N rows and N columns,
s24: the central word vector is normalized by the softmax function:
s25: optimizing an objective function;
s26: and (3) minimizing the objective function by using an optimization method of random gradient descent, updating and outputting the vector to obtain the embedding of the entity description.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010623201.2A CN111753101B (en) | 2020-06-30 | 2020-06-30 | Knowledge graph representation learning method integrating entity description and type |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010623201.2A CN111753101B (en) | 2020-06-30 | 2020-06-30 | Knowledge graph representation learning method integrating entity description and type |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111753101A CN111753101A (en) | 2020-10-09 |
CN111753101B true CN111753101B (en) | 2022-06-07 |
Family
ID=72680325
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010623201.2A Active CN111753101B (en) | 2020-06-30 | 2020-06-30 | Knowledge graph representation learning method integrating entity description and type |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111753101B (en) |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112733874B (en) * | 2020-10-23 | 2023-04-07 | 招商局重庆交通科研设计院有限公司 | Suspicious vehicle discrimination method based on knowledge graph reasoning |
CN112380836A (en) * | 2020-11-12 | 2021-02-19 | 华侨大学 | Intelligent Chinese message question generating method |
CN112507130B (en) * | 2020-12-10 | 2024-06-28 | 东南大学 | Triplet credibility assessment method based on multisource knowledge graph |
CN112561064B (en) * | 2020-12-21 | 2023-03-24 | 福州大学 | Knowledge base completion method based on OWKBC model |
CN112632290B (en) * | 2020-12-21 | 2021-11-09 | 浙江大学 | Self-adaptive knowledge graph representation learning method integrating graph structure and text information |
CN113010690B (en) * | 2021-03-29 | 2022-11-18 | 华南理工大学 | Method for enhancing entity embedding based on text information |
CN113590837A (en) * | 2021-07-29 | 2021-11-02 | 华中农业大学 | Deep learning-based food and health knowledge map construction method |
CN113569773B (en) * | 2021-08-02 | 2023-09-15 | 南京信息工程大学 | Interference signal identification method based on knowledge graph and Softmax regression |
CN113535984B (en) * | 2021-08-11 | 2023-05-26 | 华侨大学 | Knowledge graph relation prediction method and device based on attention mechanism |
CN115099504B (en) * | 2022-06-29 | 2024-06-25 | 中南民族大学 | Cultural relic security risk element identification method based on knowledge graph completion model |
CN115168620A (en) * | 2022-09-09 | 2022-10-11 | 之江实验室 | Self-supervision joint learning method oriented to knowledge graph entity alignment |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105630901A (en) * | 2015-12-21 | 2016-06-01 | 清华大学 | Knowledge graph representation learning method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170337481A1 (en) * | 2016-05-17 | 2017-11-23 | Xerox Corporation | Complex embeddings for simple link prediction |
-
2020
- 2020-06-30 CN CN202010623201.2A patent/CN111753101B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105630901A (en) * | 2015-12-21 | 2016-06-01 | 清华大学 | Knowledge graph representation learning method |
Non-Patent Citations (2)
Title |
---|
事件知识图谱构建技术与应用综述;项威;《计算机与现代化》;20200131;第10-16页 * |
知识图谱数据管理研究综述;王鑫等;《软件学报》;20190731;第2139-2171页 * |
Also Published As
Publication number | Publication date |
---|---|
CN111753101A (en) | 2020-10-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111753101B (en) | Knowledge graph representation learning method integrating entity description and type | |
CN110347847A (en) | Knowledge mapping complementing method neural network based | |
CN113535984A (en) | Attention mechanism-based knowledge graph relation prediction method and device | |
CN110941734B (en) | Depth unsupervised image retrieval method based on sparse graph structure | |
CN113177132A (en) | Image retrieval method based on depth cross-modal hash of joint semantic matrix | |
CN107220337B (en) | Cross-media retrieval method based on hybrid migration network | |
CN110647904A (en) | Cross-modal retrieval method and system based on unmarked data migration | |
CN112100403A (en) | Knowledge graph inconsistency reasoning method based on neural network | |
CN113360670B (en) | Knowledge graph completion method and system based on fact context | |
WO2023155508A1 (en) | Graph convolutional neural network and knowledge base-based paper correlation analysis method | |
CN112000689A (en) | Multi-knowledge graph fusion method based on text analysis | |
CN113157919A (en) | Sentence text aspect level emotion classification method and system | |
CN117273134A (en) | Zero-sample knowledge graph completion method based on pre-training language model | |
CN114093445B (en) | Patient screening marking method based on partial multi-marking learning | |
CN112668633B (en) | Adaptive graph migration learning method based on fine granularity field | |
Lonij et al. | Open-world visual recognition using knowledge graphs | |
CN117009545A (en) | Construction method of continuous multi-mode knowledge graph | |
CN116186278A (en) | Knowledge graph completion method based on hyperplane projection and relational path neighborhood | |
CN113159976B (en) | Identification method for important users of microblog network | |
CN115809346A (en) | Small sample knowledge graph completion method based on multi-view semantic enhancement | |
CN116108189A (en) | Quaternion-based knowledge graph embedding method and system | |
CN110457543B (en) | Entity resolution method and system based on end-to-end multi-view matching | |
JP6993250B2 (en) | Content feature extractor, method, and program | |
CN114443851A (en) | Improved knowledge graph generation method based on probability calibration | |
CN113449521B (en) | Label representation method based on measurement emotion learning, terminal equipment and storage medium |
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 |