CN112711667A - Knowledge graph complex relation reasoning method based on multidirectional semantics - Google Patents
Knowledge graph complex relation reasoning method based on multidirectional semantics Download PDFInfo
- Publication number
- CN112711667A CN112711667A CN202110329759.4A CN202110329759A CN112711667A CN 112711667 A CN112711667 A CN 112711667A CN 202110329759 A CN202110329759 A CN 202110329759A CN 112711667 A CN112711667 A CN 112711667A
- Authority
- CN
- China
- Prior art keywords
- entity
- relation
- relationship
- entities
- vector
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
- G06F16/367—Ontology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Animal Behavior & Ethology (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Machine Translation (AREA)
Abstract
The invention provides a knowledge graph complex relation reasoning method based on multidirectional semantics, which maps entities in a training sample data set of a knowledge graph into two groups of low-dimensional space vector representations; mapping the relation in the training sample data set of the knowledge graph into two groups of low-dimensional space vectors and one-dimensional parameter representation; randomly selecting an entity in a training sample data set of the knowledge graph, replacing the entity of the training sample positive triple and generating training negative sample data; defining a target function in the training process according to the training sample positive triples and the generated training negative samples; respectively bringing entity mapping results and relationship mapping results in the training sample data set into an objective function, and optimizing to obtain vector representation corresponding to each entity or relationship in the knowledge graph; and calculating the distance value between the entity and the relation in the knowledge map triple by using the vector representation obtained by optimization, and carrying out relation reasoning according to the distance value. The invention improves the reasoning effect on the complex relation.
Description
Technical Field
The invention relates to the technical field of knowledge graphs in artificial intelligence, in particular to a method for reasoning complex relationships in knowledge graphs by using an artificial intelligence representation learning method.
Background
With the development of artificial intelligence technology, knowledge maps are more and more concerned by academia and industry, and the knowledge maps play a significant role in the development of artificial intelligence in the future. The knowledge graph takes a triple composed of a head entity, a tail entity and a relationship existing between the head entity and the tail entity as a basic unit, wherein the entities can be entities in the real world, such as specific names, place names, organizations and the like, and can also represent attribute values or concepts of attributes, such as a certain color and the like, and the relationship can be a real relationship between two entities and an entity, such as a couple relationship, an affiliation relationship, or a relationship between an entity and an attribute value, such as age and the like. However, as the internet grows, a large amount of data is generated every moment, wherein a large amount of triple knowledge is generated, so that each entity has a complex relationship with other entities. With the continuous expansion of the scale of the knowledge graph, the complex relationships in the knowledge graph cannot be completed in a manual mode. Therefore, a great deal of related research is generated aiming at the problem of knowledge graph relation reasoning completion. Some researches, which map entities and relationships into low-dimensional vectors and then use the vector relationships to perform reasoning, are known as expression learning methods, such as the relationship reasoning methods of TransE, TransH, and TransR. Although these models show their advantages and innovations in some aspects, they consider only the semantic impact of relationship-inference entities, and do not consider the semantic impact of entities on entities and the semantic impact of entities on relationships when using semantic information for complex relationship inference. For example, when learning semantic expression vectors (human beings, eating and vegetables), semantic information of "human beings" should be influenced by the semantics of "vegetables" and "eating", and similarly, semantic information of "vegetables" should be influenced by the semantics of "human beings" and "eating", so that the learned semantic vector expression entities or relationship semantic information is insufficient, and the inference effect on complex relationships is finally influenced.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a knowledge graph complex relation reasoning method based on multidirectional semantics.
The invention is realized by the following technical scheme.
A knowledge graph complex relation reasoning method based on multidirectional semantics comprises the following steps:
mapping entities in a training sample data set of a knowledge graph into two groups of low-dimensional space vector representations;
mapping the relation in the training sample data set of the knowledge graph into two groups of low-dimensional space vectors and one-dimensional parameter representation;
randomly selecting an entity in a training sample data set of the knowledge graph, replacing the entity of the training sample positive triple and generating training negative sample data;
defining an objective function in the training process according to the training sample positive triples and the generated training negative samplesComprises the following steps:
in the formula (I), the compound is shown in the specification,whereinRepresenting positive tripletsIs used as a function of the distance of (c),representing positive tripletsCorresponding negative example ofA distance function of (d); wherein:
or
Or
In the formula (I), the compound is shown in the specification,the semantic information representation that the representation head entity corresponds to the inherent attribute of the representation head entity and does not influence the semantic information representation of the tail entity or the relationship due to the property of the representation head entity;the semantic information corresponding to the inherent attribute of the representation relationship is represented, and the semantic information corresponding to the inherent attribute of the head entity or the tail entity is not changed;the representation of the semantic information corresponding to the inherent attribute of the tail entity does not influence the semantic information representation of the head entity or the relationship due to the property of the tail entity, and the semantic information corresponding to the inherent attribute of the relationship or the tail entity does not change;representing semantic effects of head entities on relationships and tail entities within triples due to the fact that the head entities have on the relationships and tail entities within triples when the relationships and tail entities are fixedA change in volume;representing semantic influence of the relation on a head entity and a tail entity in the triple, wherein when the head entity and the tail entity are fixed, the influence on the head entity and the tail entity changes along with the change of the relation;representing semantic effects of the tail entities on the relationships and the head entities within the triples due to the relationship and the head entities within the triples, the effects on the relationships and the head entities varying as the tail entities vary when the relationships and the head entities are fixed;the action which is expressed as the relationship is influenced by the passive information of the head entity and the tail entity, and is simultaneously influenced by the inherent attribute of the action to distinguish and express the entity and the relationship;representing a non-linear transformation, corresponding to an attention mechanism;a unit vector representing one m-dimension;is a distance formula;
respectively bringing entity mapping results and relationship mapping results in the training sample data set into an objective function, and optimizing to obtain vector representation corresponding to each entity or relationship in the knowledge graph;
and calculating the distance value between the entity and the relation in the knowledge map triple by using the vector representation obtained by optimization, and carrying out relation reasoning according to the distance value.
Preferably, the mapping entities in the training sample data set of the knowledge-graph into two sets of low-dimensional space vectors comprises:
training with knowledge mapSet of entities in training sample data setThere are n entities, each of whichMapped as a m-dimensional vectorAnd a vector of m dimensions。
Preferably, for a set of entities in a set of training sample data in a knowledge-graphEach entity inMapping as vectorsSum vectorEach is randomly initialized to a vector of m dimensions and constrained to have a modulo length of 1.
Preferably, the mapping the relation in the training sample data set of the knowledge-graph into two sets of low-dimensional space vectors and one-dimensional parametric representation includes:
relation set in training sample data set of knowledge graphThere are t relations, wherein each relationMapping to a vector of m dimensionsA vector of m dimensionsAnd a one-dimensional parameter。
Preferably, for a set of relationships in a set of training sample data in a knowledge-graphEach of the relationships inMapping as vectorsSum vectorRespectively randomly initializing into a vector with m dimensions, limiting the modular length to be 1, and randomly initializing a one-dimensional parameter。
Preferably, the method for generating training negative sample data includes:
for positive triplets in training samplesS(h,r,t)Randomly from a set of entitiesTo select an entityAnd randomly replacing the head entity in the triplethOr tail entitytGenerating a negative sample data set(ii) a Wherein, among others,a relation set in a training sample data set of a knowledge graph is set.
Preferably, the entity mapping result and the relation mapping result in the training sample data set are respectively brought into an objective function, and the entity and the relation in the knowledge graph are trained; after training, a mapping vector corresponding to each entity or relationship is finally obtained, and the possibility of whether the entities meet a certain relationship is obtained by using the mapping vector.
Preferably, the calculating a distance value between an entity and a relationship in a knowledge-graph triplet using the optimized vector representation includes:
after each group of vectors is obtained, a distance function is utilizedCalculating the distance among the head entity h, the relation r and the tail entity t; when the distance value tends to 0, judging the knowledge map triple to be a positive triple, and obtaining the relation shown in the positive triple; and when the distance value tends to infinity, recommending the candidate entities to perform knowledge graph relation completion, and recalculating the distance among the head entity h, the relation r and the tail entity t.
According to another aspect of the invention, there is provided a terminal comprising a memory, a processor and a computer program stored on the memory and operable on the processor, the processor being operable when executing the computer program to perform any of the methods described above.
According to a third aspect of the invention, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, is operable to perform the method of any of the above.
Due to the adoption of the technical scheme, compared with the prior art, the invention has the following beneficial effects:
according to the knowledge graph complex relationship inference method based on the multidirectional semantics, when the semantic vector corresponding to each entity or relationship is learned, the influence of the multidirectional semantics on the entity in the triple is fully considered, and meanwhile, the semantic vector of the relationship is influenced by the semantics of the entity, so that the learned vector can better represent semantic information corresponding to each entity or relationship. The knowledge graph complex relation reasoning method based on the multidirectional semantics can better simulate semantic information of different entities or relations under different triple 'environments', and improves the reasoning effect on complex relations.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments with reference to the following drawings:
FIG. 1 is a flow chart of a knowledge graph complex relationship inference method based on multidirectional semantics in a preferred embodiment of the present invention.
Detailed Description
The following examples illustrate the invention in detail: the embodiment is implemented on the premise of the technical scheme of the invention, and a detailed implementation mode and a specific operation process are given. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention.
An embodiment of the invention provides a knowledge graph complex relationship inference method based on multidirectional semantics, which fully utilizes multidirectional semantic information when learning semantic vectors, better represents semantic information corresponding to entities or relationships, and further improves inference effect on complex relationships in the knowledge graph.
The knowledge graph complex relation inference method based on multidirectional semantics provided by the embodiment can comprise the following steps
Step 1, mapping entities in a training sample data set of a knowledge graph into two groups of low-dimensional space vectors (the low-dimensional space vectors are used for expressing vectors with limited length in the field, such as 200-dimensional vectors) for representation; mapping the relation in the training sample data set of the knowledge graph into two groups of low-dimensional space vectors and one-dimensional parameter representation;
step 2, randomly selecting an entity in the knowledge graph training sample data set, replacing the entity of the training sample positive triple and generating training negative sample data;
step 3, defining an objective function in the training process according to the training sample positive triple and the generated training negative sampleComprises the following steps:
in the formula (I), the compound is shown in the specification,,representing positive tripletsIs used as a function of the distance of (c),representing positive tripletsCorresponding negative example ofA distance function of (d); wherein:
or
Or
In the formula (I), the compound is shown in the specification,the semantic information representation that the head entity corresponds to the inherent attribute of the head entity and the semantic information representation that the tail entity or the relationship is not influenced by the nature of the head entity (such as the 'tiger') inherent attribute is a carnivore, and the semantic information corresponding to the inherent attribute of the relationship (such as 'eating') or the tail entity (such as 'meat') is not changed by the relationship);the semantic information corresponding to the inherent attribute of the relation is represented, and the semantic information corresponding to the inherent attribute of the head entity (such as the tiger) or the tail entity (such as the meat) is not changed due to the semantic information (such as the relation attribute represented by the eating);the semantic information representation that the tail entity corresponds to the inherent attribute of the tail entity is represented, the semantic information representation that the head entity or the relationship is not influenced by the nature of the tail entity, and the semantic information that the inherent attribute of the relationship (such as 'eating') or the tail entity (such as 'meat') corresponds to is not changed by the semantic information;representing semantic effects of the head entity on the relationship and the tail entity in the triplets due to the relationship and the tail entity in the triplets, wherein when the relationship and the tail entity are fixed, the effect on the relationship and the tail entity changes along with the change of the head entity;representing semantic influence of the relation on a head entity and a tail entity in the triple, wherein when the head entity and the tail entity are fixed, the influence on the head entity and the tail entity changes along with the change of the relation;representing semantic effects of the tail entities on the relationships and the head entities within the triples due to the relationship and the head entities within the triples, the effects on the relationships and the head entities varying as the tail entities vary when the relationships and the head entities are fixed;the representation is that because the relationship is an action, the action itself is influenced by the passive information of the leading entity and the trailing entity, and at the same time, the action itself should be influenced by the inherent property of the action itself, so as to distinguish the representation entity and the relationship (for example, a teacher can be an entity, a triple (teacher, teaching, student), or a relationship, a triple (Wang II, teacher, Zhang III));representing a non-linear transformation, corresponding to an attention mechanism;a unit vector representing one m-dimension;represents the Distance formula, Minkowski Distance;
step 4, respectively bringing the entity mapping result and the relation mapping result in the training sample data set into an objective function, and optimizing to obtain vector representation corresponding to each entity or relation in the knowledge graph;
and 5, calculating a distance value between the entity and the relation in the knowledge map triple by using the vector representation obtained by optimization, and carrying out relation reasoning according to the distance value.
As a preferred embodiment, mapping entities in the training sample data set of the knowledge-graph into two sets of vectors of low-dimensional space vectors includes:
set of entities in a set of training sample data for knowledge-graph modelingThere are n entities, each of whichMapping to a vector of m dimensionsAnd a vector of m dimensions。
As a preferred embodiment, for a set of entities in a set of training sample data in a knowledge-graphEach entity inMapping as vectorsSum vectorEach is randomly initialized to a vector of m dimensions and constrained to have a modulo length of 1.
In this step, only random mapping is performed, the corresponding vector cannot represent semantic information of the entity corresponding to the vector, and an accurate vector value is obtained after training.
As a preferred embodiment, mapping the relationship in the training sample data set of the knowledge-graph into two sets of low-dimensional space vectors and one-dimensional parametric representations comprises:
relation set in training sample data set of knowledge graphThere are t relations, wherein each relationIs mapped into oneVector of m dimensionA vector of m dimensionsAnd a one-dimensional parameter。
As a preferred embodiment, for a set of relationships in a set of training sample data in a knowledge-graphEach of the relationships inMapping as vectorsSum vectorRespectively randomly initializing into a vector with m dimensions, limiting the modular length to be 1, and randomly initializing a one-dimensional parameter。
In this step, only random mapping is performed, the corresponding vector cannot represent semantic information of the entity corresponding to the vector, and an accurate vector value is obtained after training.
As a preferred embodiment, a method for generating training negative sample data includes:
for correct triplets in training samplesS(h,r,t)Randomly from a set of entitiesTo select an entityAnd randomly replacing the head entity in the triplethOr tail entitytGenerating a negative sample data set(ii) a Wherein, among others,a relation set in a training sample data set of a knowledge graph is set.
In this step, the training set is known content, and the corresponding vector is obtained by training in this step, so that the corresponding relation is satisfied, thereby determining whether the triplet is established.
As a preferred embodiment, the entity mapping result and the relationship mapping result in the training sample data set are respectively brought into an objective function, and the entity and the relationship in the knowledge graph are trained; after training, a mapping vector corresponding to each entity or relationship is finally obtained, and the possibility of whether the entities meet a certain relationship is obtained by using the mapping vector.
As a preferred embodiment, calculating distance values between entities and relations in the knowledge-graph triples using the optimized vector representation includes:
after each group of vectors is obtained, a distance function is utilizedCalculating the distance among the head entity h, the relation r and the tail entity t; when the distance value tends to 0, judging the knowledge map triple to be a positive triple, and obtaining the relation shown in the positive triple; and when the distance value tends to infinity, recommending the candidate entities to perform knowledge graph relation completion, and recalculating the distance among the head entity h, the relation r and the tail entity t.
In some embodiments of the invention:
the head entity is influenced by the tail entity and the multi-directional semantics of the relation, and finally the corresponding expression vector of the head entity hComprises the following steps:
the tail entity is influenced by the multidirectional semantics of the head entity and the relation, and finally the expression vector corresponding to the tail entity tComprises the following steps:
the head entity is influenced by the tail entity and the multi-directional semantics of the relation, and finally the corresponding expression vector of the head entity hComprises the following steps:
wherein the content of the first and second substances,the method is represented as a nonlinear activation function commonly used by artificial intelligence, such as a nonlinear activation function of tanh, Relu or softmax;representing a Hadamard product (Hadamard product).
wherein the content of the first and second substances,representing the euclidean or manhattan distance.
When the entity h and the entity t satisfy the relation r, the distance obtained by calculating the corresponding vectors of the entity h and the entity t is expectedWhen the entity h and the entity t do not satisfy the relation r, the distance calculated by the corresponding vectors of the entity h and the entity t is expected to be 0Tending to infinity.
The technical solution provided by the present embodiment is further described below with reference to the accompanying drawings.
As shown in fig. 1, the method provided by this embodiment includes the following steps:
(1) initializing entity and relationship vectors:
mapping the entity in the training sample data set of the knowledge graph into two groups of vectors of low-dimensional space vectors, namely an entity setThere are n entities in total, each entityMapping to a vector of m dimensionsAnd a vector of m dimensions(ii) a In step (2), the relation in the training sample data set of the knowledge graph is mapped into two groups of vectors of low-dimensional space vectors and one-dimensional parameter representation, namely a relation setThere are t relations in total, each entityMapping to a vector of m dimensionsA vector of m dimensionsAnd a one-dimensional parameter。
For example: for entity collections in a knowledge graphEach entity in (1)Mapping as vectorsSum vectorRespectively randomly initializing the vectors into m-dimensional vectors, and limiting the modular length of the vectors to be 1; for relation sets in knowledge graphEach relationship inMapping as vectorsSum vectorRespectively randomly initializing into a vector with m dimensions, limiting the modular length to be 1, and randomly initializing a one-dimensional parameter。
(2) Constructing negative samples and defining vector representation mode
For the correct triplet (h, r, t) in the training sample, the set of entities is randomly selected fromRandomly selecting an entity in the database, randomly replacing a head entity h or a tail entity t, and generating a negative sample data set。
(3) Semantic vector representation final computation:
the head entity is influenced by the tail entity and the multi-directional semantics of the relation, and finally the corresponding expression vector of the head entity hComprises the following steps:
the tail entity is influenced by the multidirectional semantics of the head entity and the relation, and finally the expression vector corresponding to the tail entity tComprises the following steps:
the head entity is influenced by the tail entity and the multi-directional semantics of the relation, and finally the corresponding expression vector of the head entity hComprises the following steps:
whereinThe method is represented as a nonlinear activation function commonly used by artificial intelligence, such as a nonlinear activation function of tanh, Relu or softmax;representing a Hadamard product (Hadamard product).
whereinRepresenting the euclidean or manhattan distance. When the entity h and the entity t satisfy the relation r, the distance obtained by calculating the corresponding vectors of the entity h and the entity t is expectedTending to 0, when the entity h and the entity t do not satisfy the relation r, the distance calculated by the corresponding vectors of the entity h and the entity t is expectedTending to infinity.
The trained objective function:
in the formulaWhereinRepresenting positive tripletsThe value of (a) is determined,representing positive tripletsCorresponding negative sampleThe distance value of (2).
In the formula:
or
(4) Model training, solving vector optimal value and (5) carrying out relational reasoning
And optimizing the target value function by using an optimal algorithm to obtain a representation vector corresponding to each entity or relationship, replacing a tail entity or a head entity by using all entities in the entity set, or replacing the relationship by using all the relationships in the relationship set, and calculating a replaced triple distance value according to the distance function, wherein the smaller the value, the higher the possibility that the corresponding triple is the positive case. Thereby obtaining the corresponding recommendation relationship.
Another embodiment of the present invention provides a terminal, which includes a memory, a processor, and a computer program stored on the memory and capable of running on the processor, and the processor, when executing the computer program, can be configured to perform the method of any one of the above embodiments.
Optionally, a memory for storing a program; a Memory, which may include a volatile Memory (RAM), such as a Random Access Memory (SRAM), a Double Data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM), and the like; the memory may also comprise a non-volatile memory, such as a flash memory. The memories are used to store computer programs (e.g., applications, functional modules, etc. that implement the above-described methods), computer instructions, etc., which may be stored in partition in the memory or memories. And the computer programs, computer instructions, data, etc. described above may be invoked by a processor.
The computer programs, computer instructions, etc. described above may be stored in one or more memories in a partitioned manner. And the computer programs, computer instructions, data, etc. described above may be invoked by a processor.
A processor for executing the computer program stored in the memory to implement the steps of the method according to the above embodiments. Reference may be made in particular to the description relating to the preceding method embodiment.
The processor and the memory may be separate structures or may be an integrated structure integrated together. When the processor and the memory are separate structures, the memory, the processor may be coupled by a bus.
A third embodiment of the invention provides a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of any of the above-mentioned embodiments of the invention.
The knowledge graph complex relation inference method based on the multidirectional semantics, provided by the embodiment of the invention, maps the knowledge graph triples to two groups of vectors in a low-dimensional space respectively; wherein a set of vectors is used to represent corresponding intrinsic information, called intrinsic vectors: () The other vector is represented as cross information of semantic information in the triples, which is called a cross vector () (ii) a Using the cross vectors to generate corresponding attention mechanism weight vectors respectively () (ii) a Weighting the proper vector by the generated weight vector (corresponding to step 3 in the embodiment), generating the vector representation of different entities or relations in different triple environments: (,,) (ii) a Then, the head entity, the a relation and the tail entity are utilized to satisfy the Huffman distance calculation of the head entity vector plus the relation vector and the tail entity vector () (ii) a Finally, learning is carried out to obtain corresponding vector representation (corresponding to the step 1 in the concrete implementation), and knowledge graph relation reasoning is carried out by using the Huffman distance. The knowledge graph complex relationship inference method based on multidirectional semantics provided by the embodiment of the invention combines the corresponding semantic information differences (such as the same head entity h and relationship r, and different tail entities t) in different triple environments to obtain different vector representations (,,) The method and the system can better fit with the semantic information of the actual triple, and have higher accuracy on the reasoning task of the complex relation of the knowledge graph.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes and modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention.
Claims (10)
1. A knowledge graph complex relation reasoning method based on multidirectional semantics is characterized by comprising the following steps:
mapping entities in a training sample data set of a knowledge graph into two groups of low-dimensional space vector representations;
mapping the relation in the training sample data set of the knowledge graph into two groups of low-dimensional space vectors and one-dimensional parameter representation;
randomly selecting an entity in a training sample data set of the knowledge graph, replacing the entity of the training sample positive triple and generating training negative sample data;
defining an objective function in the training process according to the training sample positive triples and the generated training negative samplesComprises the following steps:
in the formula (I), the compound is shown in the specification,represents a positive tripletIs used as a function of the distance of (c),representing positive tripletsCorresponding negative example ofA distance function of (d); wherein:
or
Or
In the formula (I), the compound is shown in the specification,the semantic information representation that the representation head entity corresponds to the inherent attribute of the representation head entity and does not influence the semantic information representation of the tail entity or the relationship due to the property of the representation head entity;the semantic information corresponding to the inherent attribute of the representation relationship is represented, and the semantic information corresponding to the inherent attribute of the head entity or the tail entity is not changed;the representation of the semantic information corresponding to the inherent attribute of the tail entity does not influence the semantic information representation of the head entity or the relationship due to the property of the tail entity, and the semantic information corresponding to the inherent attribute of the relationship or the tail entity does not change;representing semantic effects of the head entity on the relationship and the tail entity in the triplets due to the relationship and the tail entity in the triplets, wherein when the relationship and the tail entity are fixed, the effect on the relationship and the tail entity changes along with the change of the head entity;representing semantic influence of the relation on a head entity and a tail entity in the triple, wherein when the head entity and the tail entity are fixed, the influence on the head entity and the tail entity changes along with the change of the relation;representing semantic effects of the tail entities on the relationships and the head entities within the triples due to the relationship and the head entities within the triples, the effects on the relationships and the head entities varying as the tail entities vary when the relationships and the head entities are fixed;the action which is expressed as the relationship is influenced by the passive information of the head entity and the tail entity, and is simultaneously influenced by the inherent attribute of the action to distinguish and express the entity and the relationship;representing a non-linear transformation, corresponding to an attention mechanism;a unit vector representing one m-dimension;is a distance formula;
respectively bringing entity mapping results and relationship mapping results in the training sample data set into an objective function, and optimizing to obtain vector representation corresponding to each entity or relationship in the knowledge graph;
and calculating the distance value between the entity and the relation in the knowledge map triple by using the vector representation obtained by optimization, and carrying out relation reasoning according to the distance value.
2. The method of claim 1, wherein the mapping entities in the training sample data set of the knowledge-graph into two sets of vectors of two sets of low-dimensional space vectors comprises:
3. The method of claim 2, wherein the set of entities in the training sample data set in the knowledge graph is considered to be a set of entities in the knowledge graphEach entity inMapping as vectorsSum vectorEach is randomly initialized to a vector of m dimensions and constrained to have a modulo length of 1.
4. The method of claim 1, wherein the mapping the relationships in the training sample data set of the knowledge-graph into two sets of low-dimensional space vectors and one-dimensional parametric representations comprises:
5. The method of claim 4, wherein the relation set in the training sample data set in the knowledge-graph is considered to be a relation set in the knowledge-graphEach of the relationships inMapping as vectorsSum vectorRespectively randomly initializing into a vector with m dimensions, limiting the modular length to be 1, and randomly initializing a one-dimensional parameter。
6. The method for knowledge-graph complex relationship inference based on multidirectional semantics as claimed in claim 1, wherein the method for generating training negative sample data comprises:
for positive triplets in training samplesS(h,r,t)Randomly from a set of entitiesTo select an entityAnd randomly replacing the head entity in the triplethOr tail entitytGenerating a negative sample data set(ii) a Wherein, among others,a relation set in a training sample data set of a knowledge graph is set.
7. The method for reasoning about complex relationships of a knowledge graph based on multidirectional semantics as claimed in claim 1, wherein entity mapping results and relationship mapping results in a training sample data set are respectively brought into an objective function to train the entities and the relationships in the knowledge graph; after training, a mapping vector corresponding to each entity or relationship is finally obtained, and the possibility of whether the entities meet a certain relationship is obtained by using the mapping vector.
8. The method for inference on complex relations of knowledge-graph based on multidirectional semantics as claimed in claim 1, wherein said calculating distance values between entities and relations in the triples of knowledge-graph using vector representation obtained by optimization comprises:
after each group of vectors is obtained, a distance function is utilizedCalculating the distance among the head entity h, the relation r and the tail entity t; when the distance value tends to 0, judging the knowledge map triple to be a positive triple, and obtaining the relation shown in the positive triple; and when the distance value tends to infinity, recommending the candidate entities to perform knowledge graph relation completion, and recalculating the distance among the head entity h, the relation r and the tail entity t.
9. A terminal comprising a memory, a processor and a computer program stored on the memory and operable on the processor, wherein the computer program, when executed by the processor, is operable to perform the method of any of claims 1 to 8.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, is adapted to carry out the method of any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110329759.4A CN112711667B (en) | 2021-03-29 | 2021-03-29 | Knowledge graph complex relation reasoning method based on multidirectional semantics |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110329759.4A CN112711667B (en) | 2021-03-29 | 2021-03-29 | Knowledge graph complex relation reasoning method based on multidirectional semantics |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112711667A true CN112711667A (en) | 2021-04-27 |
CN112711667B CN112711667B (en) | 2021-07-06 |
Family
ID=75550325
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110329759.4A Active CN112711667B (en) | 2021-03-29 | 2021-03-29 | Knowledge graph complex relation reasoning method based on multidirectional semantics |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112711667B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113569773A (en) * | 2021-08-02 | 2021-10-29 | 南京信息工程大学 | Interference signal identification method based on knowledge graph and Softmax regression |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106528609A (en) * | 2016-09-28 | 2017-03-22 | 厦门理工学院 | Vector constraint embedded transformation knowledge graph inference method |
US20180247209A1 (en) * | 2017-02-28 | 2018-08-30 | Accenture Global Solutions Limited | Interpretation of predictive models using semantic grouping |
US20190362246A1 (en) * | 2018-05-23 | 2019-11-28 | Salesforce.Com, Inc. | Multi-hop knowledge graph reasoning with reward shaping |
CN110647620A (en) * | 2019-09-23 | 2020-01-03 | 中国农业大学 | Knowledge graph representation learning method based on confidence hyperplane and dictionary information |
CN110909172A (en) * | 2019-10-22 | 2020-03-24 | 中国船舶重工集团公司第七0九研究所 | Knowledge representation learning method based on entity distance |
CN111260064A (en) * | 2020-04-15 | 2020-06-09 | 中国人民解放军国防科技大学 | Knowledge inference method, system and medium based on knowledge graph of meta knowledge |
-
2021
- 2021-03-29 CN CN202110329759.4A patent/CN112711667B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106528609A (en) * | 2016-09-28 | 2017-03-22 | 厦门理工学院 | Vector constraint embedded transformation knowledge graph inference method |
US20180247209A1 (en) * | 2017-02-28 | 2018-08-30 | Accenture Global Solutions Limited | Interpretation of predictive models using semantic grouping |
US20190362246A1 (en) * | 2018-05-23 | 2019-11-28 | Salesforce.Com, Inc. | Multi-hop knowledge graph reasoning with reward shaping |
CN110647620A (en) * | 2019-09-23 | 2020-01-03 | 中国农业大学 | Knowledge graph representation learning method based on confidence hyperplane and dictionary information |
CN110909172A (en) * | 2019-10-22 | 2020-03-24 | 中国船舶重工集团公司第七0九研究所 | Knowledge representation learning method based on entity distance |
CN111260064A (en) * | 2020-04-15 | 2020-06-09 | 中国人民解放军国防科技大学 | Knowledge inference method, system and medium based on knowledge graph of meta knowledge |
Non-Patent Citations (2)
Title |
---|
KAI NIE 等: ""Knowledge Reasoning Method for Military Decision Support Knowledge Graph Mixing Rule and Graph Neural Networks Learning together"", 《2020 CHINESE AUTOMATION CONGRESS (CAC)》 * |
张仲伟 等: ""基于神经网络的知识推理研究综述"", 《计算机工程与应用》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113569773A (en) * | 2021-08-02 | 2021-10-29 | 南京信息工程大学 | Interference signal identification method based on knowledge graph and Softmax regression |
CN113569773B (en) * | 2021-08-02 | 2023-09-15 | 南京信息工程大学 | Interference signal identification method based on knowledge graph and Softmax regression |
Also Published As
Publication number | Publication date |
---|---|
CN112711667B (en) | 2021-07-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6961727B2 (en) | Generate a copy of interest | |
CN111160409A (en) | Heterogeneous neural network knowledge reorganization method based on common feature learning | |
CN111950594A (en) | Unsupervised graph representation learning method and unsupervised graph representation learning device on large-scale attribute graph based on sub-graph sampling | |
CN107544960B (en) | Automatic question-answering method based on variable binding and relation activation | |
CN109241290A (en) | A kind of knowledge mapping complementing method, device and storage medium | |
CN112926655B (en) | Image content understanding and visual question and answer VQA method, storage medium and terminal | |
CN115186097A (en) | Knowledge graph and reinforcement learning based interactive recommendation method | |
CN112860847B (en) | Video question-answer interaction method and system | |
CN112417289A (en) | Information intelligent recommendation method based on deep clustering | |
CN108171328A (en) | A kind of convolution algorithm method and the neural network processor based on this method | |
CN110737730A (en) | Unsupervised learning-based user classification method, unsupervised learning-based user classification device, unsupervised learning-based user classification equipment and storage medium | |
CN114333027A (en) | Cross-domain new facial expression recognition method based on joint and alternative learning framework | |
CN114817568A (en) | Knowledge hypergraph link prediction method combining attention mechanism and convolutional neural network | |
CN112256971A (en) | Sequence recommendation method and computer-readable storage medium | |
CN113987196A (en) | Knowledge graph embedding compression method based on knowledge graph distillation | |
CN112711667B (en) | Knowledge graph complex relation reasoning method based on multidirectional semantics | |
CN111488460B (en) | Data processing method, device and computer readable storage medium | |
CN114971066A (en) | Knowledge tracking method and system integrating forgetting factor and learning ability | |
CN114022687B (en) | Image description countermeasure generation method based on reinforcement learning | |
Bourel et al. | Boosting diversity in regression ensembles | |
CN113409157B (en) | Cross-social network user alignment method and device | |
CN115510932A (en) | Model training method and device, electronic equipment and storage medium | |
CN116738983A (en) | Word embedding method, device and equipment for performing financial field task processing by model | |
CN112183580A (en) | Small sample classification method based on dynamic knowledge path learning | |
JP7283836B2 (en) | Meta-knowledge fine-tuning method and platform for multitasking language models |
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 |