CN115563314A - Knowledge graph representation learning method for multi-source information fusion enhancement - Google Patents

Knowledge graph representation learning method for multi-source information fusion enhancement Download PDF

Info

Publication number
CN115563314A
CN115563314A CN202211512562.5A CN202211512562A CN115563314A CN 115563314 A CN115563314 A CN 115563314A CN 202211512562 A CN202211512562 A CN 202211512562A CN 115563314 A CN115563314 A CN 115563314A
Authority
CN
China
Prior art keywords
vector
entity
triplet
knowledge graph
representation
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.)
Pending
Application number
CN202211512562.5A
Other languages
Chinese (zh)
Inventor
李博涵
吴佳骏
向宇轩
戴天伦
徐一丹
历傲然
王学良
王高旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University of Aeronautics and Astronautics
Original Assignee
Nanjing University of Aeronautics and Astronautics
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Nanjing University of Aeronautics and Astronautics filed Critical Nanjing University of Aeronautics and Astronautics
Priority to CN202211512562.5A priority Critical patent/CN115563314A/en
Publication of CN115563314A publication Critical patent/CN115563314A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Abstract

The invention belongs to the technical field of knowledge graphs, and particularly discloses a knowledge graph representation learning method for enhancing multi-source information fusion. The knowledge graph representation learning method comprises the following steps: step 1, improving the representation of a single entity, and fusing an entity description text to the representation of the entity by using an attention mechanism so as to enhance the semantic expression capability of the entity; step 2, mapping the entity to a hyperbolic space for representation so as to improve the hierarchical representation capability of the entity; step 3, performing information fusion on the entity after text enhancement and the entity after hyperbolic space mapping; and 4, regarding the knowledge graph triples fused with the information as sentences containing contexts, and performing dynamic context representation on the entities so as to improve the capability of the overall model for processing complex relationships. The method strengthens the learning capacity of the representation of the knowledge map, and effectively improves the accuracy of the representation of the knowledge map and the capacity of processing complex relationships.

Description

Knowledge graph representation learning method for multi-source information fusion enhancement
Technical Field
The invention belongs to the technical field of knowledge graphs, and relates to a knowledge graph representation learning method for multi-source information fusion enhancement.
Background
The rapid development of internet science and technology enables information in the internet to grow explosively, how to better utilize knowledge in the internet becomes more and more important, and the knowledge graph representation learning is used for converting the knowledge into a data structure which can be understood and processed by a computer. The learning goal of knowledge graph representation is to represent entities and relations as low-dimensional dense real-valued vectors, and to efficiently compute semantic connections of entities and relations in a low-dimensional space. Compared with the traditional representation learning method, the knowledge graph representation learning method can better calculate due to vector representation, can effectively solve the problem of data coefficient, and improves the performance of knowledge acquisition, fusion and reasoning. Knowledge graph representation learning methods can be broadly divided into two categories: a semantic translation based embedding model and a semantic matching based embedding model. The embedded model based on semantic translation is characterized in that translation invariance of word vectors in a semantic space is utilized to model semantic similarity, and the distance between a vector translated by a head entity according to a relation and a tail entity is calculated to carry out representation learning of a known map. The embedding model based on semantic matching is a method for measuring the reasonability of a fact through a similarity function and calculating the potential semantic similarity of each entity and relation in the same vector space representation to capture knowledge potential semantic information. Because the efficiency and accuracy of the semantic translation model are better, in recent years, much work is done to solve the problem in learning of knowledge graph representation by researching the semantic translation model, and therefore, the embedded model based on semantic translation can be further divided into: an embedding model based on fact triples and a knowledge graph embedding model fusing multi-source information.
Unlike traditional knowledge representation methods, the semantic translation model based on fact triples regards the process of associating the head entity and the tail entity through a relationship as a translation process, and then uses a scoring function to measure the reasonability of each triplet. Because the entity and the relation are mapped to the low latitude dense vector space based on the model of semantic translation, the calculation efficiency is improved in the translation process, compared with the traditional knowledge representation learning method, the method is simple in calculation and high in accuracy, and meanwhile, the method is easier to apply to a larger-scale or more complex knowledge graph, so that the method is concerned by more researchers in recent years. However, since the initial semantic translation model is simple, it cannot model complex relationships in the knowledge graph, and therefore some researchers map entities to a hyperplane or relationship space of relationships for representation learning on the basis of the semantic translation model. In addition, representation learning methods based on semantic translation models are all performed under the traditional euclidean space, but with the development of the knowledge graph representation learning models in recent years, many representation learning methods based on semantic translation models are not limited to the euclidean space, and extend the semantic translation theory to the spherical space, the hyperbolic space and the complex space. Related work has demonstrated that different spaces are different in the emphasis on retention of semantic information in an entity.
The methods can respectively improve the representation capability of the knowledge graph from different mapping spaces, but the methods ignore the structural information of the knowledge graph and rich information of an external corpus. Therefore, some researchers have proposed using information other than triple facts in the knowledge-graph to help build a more accurate knowledge representation model, and these multi-source information include: entity category information, external text corpus information, relationship path information and the like, wherein the information is mainly used for enriching semantic information of entities and relationships, and the multi-source information is sufficiently utilized to reduce the fuzzy degree between the entities and the relationships and further improve the accuracy of inference prediction. At present, with the application and development of neural networks and attention mechanisms in the field of natural language, how to utilize the rich information of the external corpus to improve the learning ability of knowledge graph representation becomes the key point of the current research.
Disclosure of Invention
The invention aims to provide a knowledge graph representation learning method with enhanced multi-source information fusion.
In order to achieve the purpose, the invention adopts the following technical scheme:
the invention provides a knowledge graph representation learning method for multi-source information fusion enhancement, which comprises the steps of firstly, utilizing an attention mechanism to carry out external text enhancement on knowledge graph entities and relations so as to improve semantic information of the knowledge graph entities and relations; then, the characteristics of the self structure can be captured through the hyperbolic space, and the hyperbolic space is utilized to perform low-dimensional knowledge representation so as to provide the expression capability of the knowledge representation; then, fusing external text information and self-structure information captured in the hyperbolic space by utilizing a multi-mode information fusion technology; and finally, by using the position information of the triples and the information enhanced by the multi-source information as constraints, dynamically aggregating the information of each entity in different triples by a double-layer attention network, and calculating the loss value between the correct triples and the predicted triples by cross entropy in the final score calculation process to obtain the final representation of the entities.
The invention has the following advantages:
as described above, the invention relates to a knowledge graph representation learning method for multi-source information fusion enhancement, which utilizes an information fusion technology to fuse external semantic information and hyperbolic spatial information together for knowledge enhancement, and calculates information represented by each entity under the condition of different contexts through a double-layer self-attention network to perform final knowledge graph representation. The invention can further enhance the learning capacity of the knowledge graph representation by comprehensively utilizing the characteristics of different information, effectively improve the accuracy of the knowledge graph representation and the capacity of processing complex relations, and improve the application capacity of the knowledge graph to downstream tasks.
Drawings
Fig. 1 is a flowchart of a knowledge graph representation learning method with multi-source information fusion enhancement according to an embodiment of the present invention.
Fig. 2 is a model framework diagram of a knowledge graph representation learning method of multi-source information fusion enhancement in an embodiment of the present invention.
Fig. 3 is a specific flowchart of multi-source information fusion in the embodiment of the present invention.
FIG. 4 is a comparison graph of the scores of hits @10 of the head entities in the prediction knowledgegraph of the method of the present invention on a reference dataset.
FIG. 5 is a comparison of the scores of MRR, hits 1, hits 3, hits 10 after ablation of different steps on the reference data set by the method of the present invention.
Detailed Description
The invention is described in further detail below with reference to the following figures and detailed description:
as shown in fig. 1 and fig. 2, the learning method for multi-source information fusion enhanced knowledge graph representation includes the following steps:
step 1, linking entity description information in an external corpus with an entity in a knowledge graph through an entity linking tool, and inputting a linked entity description text into a self-attention neural network to obtain a text-enhanced triple vector.
The entities in the knowledge graph can enrich semantic information of the knowledge graph entities and relations through enhancement of entity description texts.
The step 1 specifically comprises the following steps:
step 1.1, an entity linking tool links an entity with entity description information in an external corpus and obtains vector representation of an initial entity description text through a word embedding model.
The external corpus selects a Wikipedia data set, and the knowledge graph data set adopts subsets WN18 and WN18RR of WordNet and subsets FB15k and FB15k-237 of Freebase.
After linking by entity linking tools entity description text set representation is T = { S = { (S) 1 , S 2 ,…, S n }。
Wherein S is n An entity description text representing the nth entity. With S n For example, S n =(w 1 ,w 2 ,…,w n ) Is an entity description text, consisting of a number of words, w n A word vector representing the nth word in the entity description text.
Step 1.2. Adding a word vector w in front of the beginning of the entity description text vector 0 This word vector is noted as the 0 th word vector, and the word vector of the entity description text is calculated starting from the 1 st word of the text.
Will add the word vector w 0 The latter entity describes a text vector, which is input from the attention neural network layer.
And calculating the semanteme among words in the entity description text, and taking the 0 th word vector passing through the attention neural network layer as the final vector representation of the entity described by the entity description text, namely the text enhanced triple vector.
Before the entity description text vector is input from the attention neural network layer, corresponding position information, namely position code w, is added to the word vector of each entity description text i pos Adding a position code w i pos The post-information vector is:
w i 0 = w i ele + w i pos
where table i below represents the ith word vector.
w i 0 Representing the word vector after adding position-coding information, w i ele Representing a word vector, w i pos Indicating a position code.
Inputting the word vector added with the position coding information into a Transformer encoder of an L layer for encoding, wherein the output of each layer is used as the input of the next encoder, and the specific calculation formula is as follows:
w i l =Encoder(w i l-1 )。
wherein, w i l 、w i l-1 Respectively representing the output of the input elements at the l-th layer and the l-1 st layer encoders.
Encoder denotes a transform Encoder, and L denotes the number of encoders.
And finally, taking the output of the 0 th word vector at the L-th encoder as a text enhanced triple vector, namely: v T = w 0 L . Wherein, V T Triple vector, w, representing text enhancement 0 L Representing the output of the 0 th word vector at the lth encoder.
V T =( V T h ,V T t ,V T r ) (ii) a Wherein, V T h 、V T t And V T r Respectively representing head entity vectors, tail entity vectors and relationship vectors of the head entities, the tail entities and the relationships after text enhancement.
The Encoder part adopts a self-attention mechanism, and each input word vector is divided into three identical partial query vectors, key vectors and value vectors for calculating the semanteme among words.
Wherein the query vector and the key vector are used to calculate the weights between words, and the value vector is used to carry out value transfer.
In the embodiment, a plurality of self-attention modules are stacked together to form a multi-head self-attention module, and vectors output by the modules are spliced together and become the length of the final output of the model through linear mapping.
The calculation of the self-attention mechanism can be expressed by the following formula:
Encoder(Q,K,V)=softmax(Q·K T /
Figure 100002_DEST_PATH_IMAGE001
) V, softmax is the activation function.
Wherein Q, K and V respectively represent query vector, key vector and V is value vector, d k Representing the embedded dimensions.
The invention utilizes the deep neural network model to construct the neural network based on the self-attention mechanism, and simultaneously utilizes abundant entities in the external text corpus to describe the text, thereby improving the semantic information of the entities and the relations in the knowledge graph.
And 2, mapping the entities and the relations in the knowledge graph to a hyperbolic space, and capturing the self structural information of the knowledge graph by using the spatial characteristics of the hyperbolic space to obtain a hyperbolic knowledge vector representation, namely a hyperbolic embedded triple vector.
The invention adopts hyperbolic space to carry out knowledge graph representation learning, and has the advantages that:
firstly, the curvature of the hyperbolic space is less than 1, and the hyperbolic space has a larger accommodating space under the condition of the same radius, which shows that the hyperbolic space can represent more semantic information by using the same dimension. Secondly, due to the characteristics of the hyperbolic space, the hyperbolic space can more accurately represent data with a hierarchical structure and a topological structure, and the entities and the relations of the knowledge graph are the data with the hierarchical structure.
The invention captures the self-structure information of the knowledge graph by using small dimensions so as to reduce the embedding dimensions of final entities and relations.
Because the entity is subjected to relationship conversion in the hyperbolic space mapping, high-complexity overhead is caused, the hyperbolic space mapping is just used for mining the structural information of the map, and in order to reduce the overhead, the hyperbolic space mapping is regarded as a translation process and is represented by using a distance and translation calculation function in the hyperbolic space, namely, a hyperbolic TransE method.
The following describes in detail the process of capturing structural information of the knowledge-graph itself by using the spatial characteristics of the hyperbolic space:
entities and relations in the knowledge graph are initialized by using a word embedding model based on a semantic translation method, and then are calculated through a distance and translation formula of a hyperbolic space, and are continuously trained to obtain hyperbolic embedded triple vectors.
And calculating the distance between the vector of the head entity after the translation of the relation and the tail entity in the process of model training.
A positive sample and a negative sample exist in the training process; positive examples represent true-existing fact triples, negative examples represent non-existing fact triples, and negative examples are typically obtained by randomly replacing head or tail entities.
It is desirable during the training process that the distance values of the fact triplets that actually exist be smaller than the fact triplets that do not exist.
And obtaining hyperbolic embedded triple vectors when the loss function is trained to tend to be stable.
The distance d (u, v) of the hyperbolic space is as follows:
d(u,v)=arcosh(1+2|| u-v || 2 /[(1-|| u || 2 ) ·(1-|| v|| 2 )])。
wherein u and v represent two vectors in a hyperbolic space, respectively, for calculating a distance between a head entity and a tail entity in the present invention. The translation formula in hyperbolic space is:
u
Figure 852352DEST_PATH_IMAGE002
v=[1+2(u,v)+ || v|| 2 ·u+(1-|| u || 2 )·v]/[1+2(u,v)+ || v|| 2 ·|| u || 2 ]。
the final scoring function is: s (E) = d (V) H h
Figure 300651DEST_PATH_IMAGE002
V H r , V H t )。
Wherein, V H h 、V H t And V H r Respectively representing head entities, tail entities and vector representations of the relationships in a hyperbolic space.
The loss function is: loss = ∑ Σ (E)∈G(E’)∈G’ [γ+ S(E)- S(E’)] +
Wherein [ ·] + Indicates that the calculation result is largeThe number is taken at 0 and is not used if less than 0.
E is a positive sample, G is a set of positive samples, E 'is a negative sample, G' is a set of negative samples, and γ is a bias function. S (E) represents a value obtained by the scoring function for the positive sample, and S (v') represents a value obtained by the scoring function for the negative sample.
The method constructs a representation learning model based on semantic translation, maps an entity into a hyperbolic space for knowledge map embedding, and utilizes the curvature of the hyperbolic space as-1 and the characteristic of capturing self-generated structure information thereof to enhance the representation capability of the knowledge map.
And 3, carrying out vector splicing on the text-enhanced triplet vectors and the hyperbolic embedded triplet vectors, fusing the spliced entity vectors through a multilayer neural network, and training to obtain the triplet vectors of the fused entity relationship.
As shown in fig. 2, the multi-layer neural network in the present embodiment includes a feedforward neural network and a conversion neural network.
Firstly, carrying out vector splicing on the text-enhanced triplet vectors and the hyperbolic embedded triplet vectors, and taking the spliced triplet vectors as input vectors to obtain self-fused triplet vectors through a feedforward neural network.
The vector has semantic information of entity description and low dimension of hyperbolic space and can capture the feature of self structure information.
The self-fused triplet vectors are then reconstructed from the previously stitched triplet vectors by the transforming neural network.
And finally, calculating the mean square error between the reconstructed triplet vector and the initially spliced triplet vector, and training to obtain an entity relationship expression vector fusing the entity description text and the hyperbolic space information by taking the mean square error as a loss function.
As shown in fig. 3, the input vector is processed in the multi-layer neural network as follows:
let the spliced triplet vector be (V) f h ,V f t ,V f r ) Firstly, the spliced triplesThe vector is obtained as an input vector from a fused triplet vector (V) via a feedforward neural network E h ,V E t ,V E r )。
Wherein, V f h 、V f t 、V f r Respectively representing a head entity vector, a tail entity vector and a relation vector after splicing; v E h 、V E t 、V E r Respectively representing a head entity vector, a tail entity vector and a relation vector generated by the feedforward neural network.
Then self-fused triplet vector (V) E h ,V E t ,V E r ) Reconstructing the previously stitched triplet vector (V ') by a conversion neural network' f h ,V’ f t ,V’ f r )。
Wherein, V' f h ,V’ f t ,V’ f r Respectively representing a head entity vector, a tail entity vector and a relation vector generated by the transforming neural network.
Finally, the reconstructed triple vector (V ') is calculated' f h ,V’ f t ,V’ f r ) Triplet vector (V) concatenated with initial f h ,V f t ,V f r ) Mean square error therebetween, and the mean square error is taken as Loss function Loss f
Therein, loss f =|| V’ f h - V f h || 2 ,||·|| 2 Is a calculated function of the mean square error.
And obtaining the triplet vector of the fused entity relationship by training a multilayer neural network.
For convenience of subsequent description, (h ', t ', r ') is used instead of (V) E h ,V E t ,V E r ) To represent triplets of fused multi-source information. h ', t ' and r ' respectively represent fused multi-source informationAnd then, a head entity vector, a tail entity vector and a relation vector.
According to the method, an automatic information fusion network is constructed, information after text enhancement and information in a hyperbolic space are aggregated, and the fused information is used as constraints for embedding the context of the knowledge graph triples in the following step 4.
And 4, regarding the three-tuple vector of the entity relationship after fusion as a sentence, and dynamically calculating the characteristics of each entity and the relationship under different contexts through a double-layer self-attention network to obtain the final representation of the entity, namely the representation of the knowledge graph vector.
The specific process of the step 4 is as follows:
and regarding the triplet vector of the fused entity relationship as a sentence, hiding the head entity or the tail entity, and calculating information represented by each entity under the condition of different contexts through a double-layer self-attention network to predict the head entity or the tail entity.
And calculating the cross entropy between the predicted entity and the hidden real entity, taking the cross entropy as a loss function, and training a double-layer self-attention network to obtain the final representation of the entity, namely the representation of the knowledge graph vector.
As shown in fig. 2, the two-layer self-attention neural network is composed of a self-attention layer, a summation and homogenization layer, a feedforward neural network layer, and so on. The specific processing process of the input vector in the double-layer self-attention neural network is as follows:
firstly, carrying out position coding on an input vector to obtain a final input sequence, then inputting the input sequence into an attention layer for calculation, wherein the attention layer can decompose each vector of the input sequence into three vectors of Query, key and Value.
The Query vector and the Key vector are used for calculating the weight between words, and the Value vector is used for Value transmission.
And summing and homogenizing the sequence passing through the self-attention layer and the input sequence, inputting the sequence into a feed-forward neural network, and finally outputting the sequence after one-time summing and homogenizing operation.
The feedforward neural network and the homogenization operation are both used for improving the learning capability of the model.
Through the two-layer self-attention neural network layer, vector representation with context information, namely a final predicted value, is obtained.
And then, taking the input vector as prior verification information, taking the predicted value as subsequent verification information, calculating the cross entropy of the input vector and the predicted value to optimize the predicted value, and taking the finally predicted value as a final vector to represent.
Knowledge-graph triples are learned through multi-layered network delivery of information between different contexts.
Taking the header entity as an example, the final representation result is:
h i 0 = h’+ h’ pos
……
h i L = Encoder(h’ i L-1 )。
wherein h is i 0 Is the input vector of the attention layer, h 'is the head entity vector in the fused triplet, h' pos Is the position-coding vector of the head entity, h i L 、h i L-1 Respectively representing the output results of the encoder of the ith word at the L-th layer and the L-1 layer.
P 1 =softmax(W·f(h 1 N ));
……
P n =softmax(W·f(h n N ))。
Wherein, P 1 For the predicted entity obtained after concealing t, P n To hide the predicted entity after h, W is the weight matrix, f (·) is the feed-forward neural network, softmax is the activation function, where n =3.
h 1 N 、h n N Respectively representing a head entity vector of the head entity after the head entity passes through the double-layer attention network and a head entity vector of the tail entity after the tail entity passes through the double-layer attention network, wherein N represents N double-layer neural networks.
X in FIG. 2 1 、X 2 And X 3 Respectively representing the input head entity vector, the relation vector and the tail entity vector. P 1 And P 3 The prediction vectors of the head entity and the tail entity are respectively represented, and N denotes N double-layer neural network stacks.
Loss=-∑ t y t lot pt
Loss denotes the Loss function, y t And pt are the one-hot coding and the predicted coding P1 of the t layer, respectively.
According to the invention, through the double-layer self-attention neural network, the fused knowledge graph triple information is dynamically aggregated, and through calculating the cross entropy between the dynamically calculated triple and the initial triple, the accuracy of the knowledge graph representation learning representation and the capability of processing the complex relation of the knowledge graph are improved.
The technical solution of the present invention will be further described in detail with reference to fig. 4 to 5 and specific examples.
The configuration environment of the embodiment of the invention is as follows:
CPU 8700K main frequency 3.7GHz, ROM 16G, graphic computing card NVIDIA GTX3070Ti, linux Ubuntu 18.04 system, programming language Python 3.6.3, based on Pythrch deep learning framework.
Example one:
first, an entity and entity description information in an external corpus are linked through an entity linking tool. Wherein, the external corpus selects a Wikipedia data set, and the knowledge graph data set adopts WordNet subsets WN18 and WN18RR and Freebase subsets FB15k and FB15k-237. Secondly, embedding and training the description information of each entity by using a coding layer of a Transformer, and representing the first vector of the sentence vector obtained by training as the unique entity vector of the entity after text enhancement. The entity representation and the text enhanced entity representation in the hyperbolic space are trained separately. And performing embedding training in the hyperbolic space on the triples in the knowledge graph by using a distance translation calculation formula of the hyperbolic space. And taking the entity and the relation vector after the entity description text is enhanced and the entity and the relation vector trained in the hyperbolic space as the input of the information fusion network. In the information fusion network, firstly, the entity and the relation vector are spliced, then, the feedforward neural network is used for carrying out the first-step information fusion, the entity relation vector passing through the feedforward neural network is used for generating a spliced vector through a conversion layer network, the mean square error between the entity relation vector and the vector is calculated to be used as a loss function, and the fused entity and relation (triplet) are obtained through training. And finally, regarding the triples after information fusion as sentences composed of three words, and calculating scores between the translated sentences of the sentences by using a double-layer attention network to obtain final knowledge graph triple representation.
Performance verification was performed on FB15k, WN18 datasets and model analysis was performed. In the knowledge-graph link prediction task, the invention performs experimental evaluation on the data set FB15k-237 for different relation modes 1-to-1 relation, 1-to-N relation, N-to-N relation and a benchmark model RotatE model in the knowledge graph, as shown in FIG. 4. The hits @10 evaluation index refers to the proportion of the correct entity in the first ten test triples of the candidate entity list, and the larger the value is, the better the link prediction effect is. As shown in FIG. 4, the hit @10 predicted by the method for the 1-to-1 relationship, the 1-to-N relationship, the N-to-1 relationship and the N-to-N relationship pair-head entity is higher than that of the RotatE model, and the method is more effective in processing the 1-N relationship.
Example two:
according to the implementation method, the contribution degree of each fusion information in the model to the whole model is analyzed, and the contribution degree of the fusion information to the model is analyzed by gradually removing the text-enhanced triple vectors and the hyperbolic embedded triple vectors. The experimental analysis was performed on the FB15k-237 data set, and the experimental results are shown in FIG. 5. The hits @10, hits @1, and hits @3 evaluation indexes in fig. 5 refer to the proportion of the correct entity in all the test triples in the first ten, the first three, and the first ten of the candidate entity list, and the larger the value, the better the link prediction effect is. The MRR in fig. 5 is the average of the reciprocal ranks of all the test samples in the test data set where the correct entity is, and the larger the value, the better the link prediction.
As can be seen from FIG. 5, the evaluation indexes of the method are higher than those of a model without any information fusion, and then hyperbolic space information and fusion description information are respectively added to the model, so that the fact that the information has a promoting effect on the correctness of knowledge graph representation learning is shown, the fact that semantic information is not lost through information fusion is shown, and meanwhile, research also shows that the dynamic context representation of the knowledge graph can be improved by adding external information constraint, and the capability of the knowledge graph for processing complex relationships is improved.
It should be understood, however, that the description herein of specific embodiments is by way of illustration only, and not by way of limitation, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the present invention as defined by the appended claims.

Claims (10)

1. The multi-source information fusion enhanced knowledge graph representation learning method is characterized by comprising the following steps:
step 1, linking entity description information in an external corpus with an entity in a knowledge graph through an entity linking tool, and inputting a linked entity description text into a self-attention neural network to obtain a text-enhanced triplet vector;
mapping the entities and the relations in the knowledge graph to a hyperbolic space, and capturing the self structural information of the knowledge graph by using the spatial characteristics of the hyperbolic space to obtain a knowledge hyperbolic vector representation, namely a hyperbolic embedded triple vector;
step 3, carrying out vector splicing on the triple vector enhanced by the text and the hyperbolic embedded triple vector, fusing the spliced entity vector through a multilayer neural network, and training to obtain a triple vector of the fused entity relationship;
and 4, regarding the three group vector of the fused entity relationship as a sentence, and dynamically calculating the characteristics of each entity and the relationship under different contexts through a double-layer self-attention network to obtain the final representation of the entity, namely the representation of the knowledge graph vector.
2. The multi-source information fusion enhanced knowledge graph representation learning method of claim 1,
the step 1 specifically comprises the following steps:
step 1.1, linking entity description information in an external corpus with an entity in a knowledge graph through an entity linking tool, and embedding a linked entity description text into a model through words to obtain initial vector representation of the entity description text;
step 1.2. Adding a vector w in front of the first word vector of each entity description text 0 Recording the vector as the 0 th word vector; will add the vector w 0 Inputting the subsequent entity description text vector to a self-attention neural network layer;
and calculating the semanteme among words in the entity description text, and taking the 0 th word vector passing through the attention neural network layer as the final vector representation of the entity described by the entity description text, namely the text enhanced triple vector.
3. The multi-source information fusion enhanced knowledge graph representation learning method of claim 2,
in the step 1.2, before the entity description text vector is input from the attention neural network layer, corresponding position codes w are added to the word vector of each entity description text i pos The word vector after adding the position code is as follows:
w i 0 = w i ele + w i pos
wherein, the following table i represents the ith word vector, i is a natural number;
w i 0 representing the word vector after adding position-coding information, w i ele Representing a word vector, w i pos Representing a position code;
adding position-coded word vector w i 0 Inputting the signal into a Transformer coder of an L layer for coding,the output of each layer is used as the input of the next encoder, and the specific calculation formula is as follows:
w i l =Encoder(w i l-1 );
wherein, w i l 、w i l-1 Respectively representing the output of the input elements at the l layer and the l-1 layer encoders;
encoder represents a Transformer Encoder, and L represents the number of encoders;
and finally, taking the output of the 0 th word vector at the L-th encoder as a text enhanced triple vector, namely:
V T = w 0 L
wherein, V T Triple vector, w, representing text enhancement 0 L Represents the output of the 0 th word vector at the lth encoder;
V T =( V T h ,V T t ,V T r ) (ii) a Wherein, V T h 、V T t And V T r Respectively representing head entity vectors, tail entity vectors and relationship vectors of the head entities, the tail entities and the relationships after text enhancement.
4. The multi-source information fusion enhanced knowledge graph representation learning method of claim 3,
in the step 1.2, the Encoder adopts a self-attention mechanism, and the self-attention mechanism divides each input word vector into three identical partial query vectors, key vectors and value vectors for calculating the semanteme between words;
the query vector and the key vector are used for calculating weights among words, and the value vector is used for value transmission;
the calculation of the self-attention mechanism is expressed by the following formula;
Encoder(Q,K,V)=softmax(Q·K T /
Figure DEST_PATH_IMAGE001
)·V,softmax is an activation function;
wherein Q, K and V respectively represent query vector, key vector and V is value vector, d k Representing the embedded dimensions.
5. The multi-source information fusion enhanced knowledge graph representation learning method of claim 1,
the step 2 specifically comprises the following steps:
entities and relations in the knowledge graph are initialized by using a word embedding model based on a semantic translation method, and then are calculated through a distance and translation formula of a hyperbolic space, and are continuously trained to obtain hyperbolic embedded triple vectors.
6. The multi-source information fusion enhanced knowledge graph representation learning method of claim 5,
in step 2, the distance d (u, v) of the hyperbolic space is as follows:
d(u,v)=arcosh(1+2|| u-v || 2 /[(1-|| u || 2 ) ·(1-|| v|| 2 )]);
wherein u and v respectively represent two vectors in a hyperbolic space, and are used for calculating the distance between a head entity and a tail entity;
the translation formula in hyperbolic space is:
u
Figure DEST_PATH_IMAGE002
v=[1+2(u,v)+ || v|| 2 ·u+(1-|| u || 2 )·v]/[1+2(u,v)+ || v|| 2 ·|| u || 2 ];
the final scoring function is: s (E) = d (V) H h
Figure DEST_PATH_IMAGE003
V H r , V H t );
Wherein, V H h 、V H t And V H r Respectively representing head entities, tail entities and relationships in pairsA vector representation of a curved space;
the loss function is: loss = ∑ Σ (E)∈G(E’)∈G’ [γ+ S(E)- S(E’)] +
Wherein [ ·] + The figure is taken when the calculation result is larger than 0, and the figure is not used when the calculation result is smaller than 0;
e is a positive sample, G is a set of positive samples, E 'is a negative sample, G' is a set of negative samples, γ is a bias function; s (E) represents the value of the positive sample by the scoring function, and S (E') represents the value of the negative sample by the scoring function.
7. The multi-source information fusion enhanced knowledge graph representation learning method of claim 1,
in the step 3, the multilayer neural network comprises a feedforward neural network and a conversion neural network;
firstly, carrying out vector splicing on a text-enhanced triplet vector and a hyperbolic embedded triplet vector, and then obtaining an auto-fused triplet vector by taking the spliced triplet vector as an input vector through a feed-forward neural network;
then reconstructing the previously spliced triplet vectors by the self-fused triplet vectors through a conversion neural network;
and finally, calculating the mean square error between the reconstructed triplet vector and the initially spliced triplet vector, taking the mean square error as a loss function, and training a multilayer neural network to obtain the triplet vector of the fused entity relationship.
8. The multi-source information fusion enhanced knowledge graph representation learning method of claim 7,
in step 3, the processing procedure of the input vector in the multilayer neural network is as follows:
let the spliced triplet vector be (V) f h ,V f t ,V f r ) Firstly, the spliced triplet vector is used as an input vector and is obtained through a feedforward neural networkFused triplet vector (V) E h ,V E t ,V E r );
Wherein, V f h 、V f t 、V f r Respectively representing a head entity vector, a tail entity vector and a relation vector after splicing; v E h 、V E t 、V E r Respectively representing a head entity vector, a tail entity vector and a relation vector generated by a feedforward neural network;
then self-fusing the triplet vectors (V) E h ,V E t ,V E r ) Reconstructing the previously stitched triplet vector (V ') by a conversion neural network' f h ,V’ f t ,V’ f r ) (ii) a Wherein, V' f h ,V’ f t ,V’ f r Respectively representing a head entity vector, a tail entity vector and a relation vector generated by the transforming neural network;
finally, the reconstructed triplet vector (V ') is calculated' f h ,V’ f t ,V’ f r ) Triplet vector (V) concatenated with initial f h ,V f t ,V f r ) And taking the mean square error as a loss function;
and obtaining the triplet vector of the fused entity relationship by training a multilayer neural network.
9. The multi-source information fusion enhanced knowledge graph representation learning method of claim 1,
the step 4 specifically comprises the following steps:
regarding the triplet vector of the entity relationship after fusion as a sentence, hiding a head entity or a tail entity, and predicting the head entity or the tail entity by calculating information represented by each entity under the condition of different contexts through a double-layer self-attention network;
and calculating the cross entropy between the predicted entity and the hidden real entity, taking the cross entropy as a loss function, and training a double-layer self-attention network to obtain the final representation of the entity, namely the representation of the knowledge graph vector.
10. The multi-source information fusion enhanced knowledge graph representation learning method of claim 9,
regarding the triplet vector of the fused entity relationship as a triplet sequence, and then inputting the triplet sequence into a double-layer self-attention network, wherein the processing process of the triplet sequence in the double-layer attention network is as follows:
the double-layer self-attention network inputs a head entity vector, a relation vector and a tail entity vector of an input sequence into a Transformer encoder, and learns the semanteme among all vectors in the triple sequence through a self-attention layer of the Transformer encoder;
then, predicting by a last Transformer encoder to obtain a triple sequence;
and finally, calculating the cross entropy of the predicted triple sequence and the input triple sequence, taking the cross entropy as a loss function, and obtaining the final representation of the entity, namely the representation of the knowledge map vector by training the double-layer self-attention network.
CN202211512562.5A 2022-11-30 2022-11-30 Knowledge graph representation learning method for multi-source information fusion enhancement Pending CN115563314A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211512562.5A CN115563314A (en) 2022-11-30 2022-11-30 Knowledge graph representation learning method for multi-source information fusion enhancement

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211512562.5A CN115563314A (en) 2022-11-30 2022-11-30 Knowledge graph representation learning method for multi-source information fusion enhancement

Publications (1)

Publication Number Publication Date
CN115563314A true CN115563314A (en) 2023-01-03

Family

ID=84770872

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211512562.5A Pending CN115563314A (en) 2022-11-30 2022-11-30 Knowledge graph representation learning method for multi-source information fusion enhancement

Country Status (1)

Country Link
CN (1) CN115563314A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116151635A (en) * 2023-04-19 2023-05-23 深圳市迪博企业风险管理技术有限公司 Optimization method and device for decision-making of anti-risk enterprises based on multidimensional relation graph
CN116186295A (en) * 2023-04-28 2023-05-30 湖南工商大学 Attention-based knowledge graph link prediction method, attention-based knowledge graph link prediction device, attention-based knowledge graph link prediction equipment and attention-based knowledge graph link prediction medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116151635A (en) * 2023-04-19 2023-05-23 深圳市迪博企业风险管理技术有限公司 Optimization method and device for decision-making of anti-risk enterprises based on multidimensional relation graph
CN116151635B (en) * 2023-04-19 2024-03-08 深圳市迪博企业风险管理技术有限公司 Optimization method and device for decision-making of anti-risk enterprises based on multidimensional relation graph
CN116186295A (en) * 2023-04-28 2023-05-30 湖南工商大学 Attention-based knowledge graph link prediction method, attention-based knowledge graph link prediction device, attention-based knowledge graph link prediction equipment and attention-based knowledge graph link prediction medium

Similar Documents

Publication Publication Date Title
CN110298037B (en) Convolutional neural network matching text recognition method based on enhanced attention mechanism
CN109033068B (en) Method and device for reading and understanding based on attention mechanism and electronic equipment
CN112347268A (en) Text-enhanced knowledge graph joint representation learning method and device
WO2023160472A1 (en) Model training method and related device
CN115563314A (en) Knowledge graph representation learning method for multi-source information fusion enhancement
CN112256866B (en) Text fine-grained emotion analysis algorithm based on deep learning
CN114841151B (en) Medical text entity relation joint extraction method based on decomposition-recombination strategy
CN115759092A (en) Network threat information named entity identification method based on ALBERT
CN113987187A (en) Multi-label embedding-based public opinion text classification method, system, terminal and medium
CN113704437A (en) Knowledge base question-answering method integrating multi-head attention mechanism and relative position coding
CN116975350A (en) Image-text retrieval method, device, equipment and storage medium
Gao et al. REPRESENTATION LEARNING OF KNOWLEDGE GRAPHS USING CONVOLUTIONAL NEURAL NETWORKS.
CN112989803A (en) Entity link model based on topic vector learning
CN111666375A (en) Matching method of text similarity, electronic equipment and computer readable medium
CN116956228A (en) Text mining method for technical transaction platform
CN114239575B (en) Statement analysis model construction method, statement analysis method, device, medium and computing equipment
CN115510230A (en) Mongolian emotion analysis method based on multi-dimensional feature fusion and comparative reinforcement learning mechanism
CN115545038A (en) Aspect emotion analysis method for optimizing grid label
CN115062123A (en) Knowledge base question-answer pair generation method of conversation generation system
CN114881038A (en) Chinese entity and relation extraction method and device based on span and attention mechanism
CN114004220A (en) Text emotion reason identification method based on CPC-ANN
CN114510569A (en) Chemical emergency news classification method based on Chinesebert model and attention mechanism
CN113255360A (en) Document rating method and device based on hierarchical self-attention network
CN114757183B (en) Cross-domain emotion classification method based on comparison alignment network
CN115358239B (en) Named entity and relationship recognition method 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