CN114896422A - Knowledge graph complementing method, device, equipment and medium - Google Patents

Knowledge graph complementing method, device, equipment and medium Download PDF

Info

Publication number
CN114896422A
CN114896422A CN202210675856.3A CN202210675856A CN114896422A CN 114896422 A CN114896422 A CN 114896422A CN 202210675856 A CN202210675856 A CN 202210675856A CN 114896422 A CN114896422 A CN 114896422A
Authority
CN
China
Prior art keywords
matrix
relation
low
relationship
entity
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
CN202210675856.3A
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.)
CETC Information Science Research Institute
Original Assignee
CETC Information Science Research Institute
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 CETC Information Science Research Institute filed Critical CETC Information Science Research Institute
Priority to CN202210675856.3A priority Critical patent/CN114896422A/en
Publication of CN114896422A publication Critical patent/CN114896422A/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
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Algebra (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Computational Linguistics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The disclosure relates to a knowledge graph complementing method, a knowledge graph complementing device, a knowledge graph complementing medium and knowledge graph complementing equipment, wherein the method comprises the following steps: extracting the relation of the knowledge graph to be complemented to obtain a relation matrix; performing matrix decomposition on the relation matrix to obtain a low-rank regular matrix and a sparse matrix; performing complex space decomposition on the low-rank regular matrix to obtain a low-dimensional relation of an entity and a relation, and performing minimum norm processing on the sparse matrix and a target function to obtain a relation profile matrix; and performing entity relationship simulation on the low-dimensional relationship to obtain a score function, and performing relationship completion on the knowledge graph to be completed by fusing the relationship outline matrix with the score function. According to the method, the relation matrix is decomposed into the sum of the low-rank matrix and the sparse matrix, and the decomposed low-rank regular matrix is used for embedding the entity and the relation, so that the dimension of the expression vector of the entity and the relation is lower, and the storage space and the prediction time length of the model are reduced.

Description

Knowledge graph complementing method, device, equipment and medium
Technical Field
The present disclosure relates to the field of knowledge graph completion technologies, and more particularly, to a knowledge graph completion method, apparatus, device, and medium.
Background
Knowledge maps express a large number of relationships among a large number of entities, including equivalence relationships, symmetry relationships, antisymmetric relationships, transitive relationships, and the like. However, the created knowledge graph only connects partial relations among the entities, and the missing entity relations are usually required to be completed.
The core idea of the prior related technology is to embed an entity and a relationship between the entity and a vector space or a matrix space, and simulate the relationship between the entities by using vector operation or vector and matrix operation to realize missing entity relationship completion. Under the assumption of low rank, the entity relationship matrix is subjected to eigenvalue decomposition by using real decomposition and double decomposition technologies, entities are represented in a low-dimensional manner by using an eigenvector matrix, and the relationship between the entities is simulated by using the operation between vectors, so that the completion of the entity missing relationship is realized. In the entity relationship matrix, a segment (i, j) value of 1 indicates that the entity i and the entity j have corresponding relationship, and a segment (i, j) value of-1 indicates that the entity i and the entity j have no corresponding relationship. Among other things, matrix metathesis techniques model the antisymmetric relationship between entities.
However, the above method has the following disadvantages: the entity relationship matrix does not always exhibit a low rank structure, so that the captured entity relationship representation is not always valid based on low rank assumptions.
Disclosure of Invention
The method aims to solve the technical problem that in the technical scheme of the prior art, the entity relationship matrix is not always in a low-rank structure, so that the entity relationship representation captured based on the low-rank assumption is not always effective.
In order to achieve the technical purpose, the present disclosure provides a knowledge graph complementing method, including:
extracting the relation of the knowledge graph to be complemented to obtain a relation matrix;
performing matrix decomposition on the relation matrix to obtain a low-rank regular matrix and a sparse matrix;
performing complex space decomposition on the low-rank regular matrix to obtain a low-dimensional relation of an entity and a relation, and performing minimum norm processing on the sparse matrix and a target function to obtain a relation profile matrix;
and performing entity relationship simulation on the low-dimensional relationship to obtain a score function, and performing relationship completion on the knowledge graph to be completed by fusing the relationship outline matrix with the score function.
Further, the matrix decomposition of the relationship matrix to obtain a low-rank regular matrix and a sparse matrix specifically includes:
set entity setIs { S 1 ,S 2 …,S n Is set as { r } 1 ,r 2 …,r m }; wherein S is 1 ,S 2 …,S n Represents an entity, r 1 ,r 2 …,r m Representing a relationship, n and m being positive integers;
for the relation r, the relation matrix X r ∈R n×n Fragment X ij r 1 denotes the entity S i And entity S j Has a relationship r;
X ij r -1 represents an entity S i And entity S j Is missing for relation r;
will relation matrix X r Decomposed into the sum of a low rank regular matrix and a sparse matrix,
Figure BDA0003696532050000021
wherein the content of the first and second substances,
Figure BDA0003696532050000022
is a low rank regular matrix for capturing an efficient representation of entities and relationships;
Figure BDA0003696532050000023
is a sparse matrix which is used to capture X r And (5) profile structure.
Further, the obtaining of the low-dimensional relationship of the entity and the relationship by performing complex space decomposition on the low-rank regular matrix specifically includes:
embedding entities and relations in a complex space of the low-rank regular matrix, and simulating a symmetric relation and an anti-symmetric relation between the entities through complex vectors;
Figure BDA0003696532050000031
the decomposition form is as follows:
Figure BDA00036965320500000318
Figure BDA0003696532050000032
to represent
Figure BDA0003696532050000033
Real part of (W ∈ C) k×k Is a complex diagonal matrix of the diagonals,
Figure BDA0003696532050000034
is the conjugate matrix of E and is,
Figure BDA0003696532050000035
is that
Figure BDA0003696532050000036
K is a matrix
Figure BDA0003696532050000037
The rank of (d); e is an identity matrix, a row vector of E represents an embedded vector of the entities, and W simulates the relationship between the entities.
Further, before performing complex spatial decomposition on the low-rank regular matrix to obtain a low-dimensional relationship between an entity and a relationship, the method further includes:
and judging whether the relation of the low-rank normal matrix is a symmetrical relation or not, and if the relation of the low-rank normal matrix is the symmetrical relation, degrading the complex space decomposition into real space eigenvalue decomposition.
Further, the obtaining of the relationship profile matrix by performing minimum norm processing on the sparse matrix in combination with the objective function specifically includes:
the following objective functions are combined:
Figure BDA0003696532050000038
wherein the content of the first and second substances,
Figure BDA0003696532050000039
is a matrix
Figure BDA00036965320500000310
L of 1 Norm for ensuring
Figure BDA00036965320500000311
A sparse structure of (a); c 2 (||E|| 2 +||W|| 2 ) Is model regularization, C 1 And C 2 Are two positive parameters;
minimizing the objective function such that
Figure BDA00036965320500000312
Wherein the content of the first and second substances,
Figure BDA00036965320500000313
is a sparse matrix in which the matrix is,
Figure BDA00036965320500000314
to represent
Figure BDA00036965320500000315
The real part of (a) is,
Figure BDA00036965320500000316
is a low rank matrix.
Further, the objective function is optimized and solved through an alternate descent method;
three variables E, W are fixed,
Figure BDA00036965320500000317
two variables of (1), solving the minimum of the objective function with respect to the remaining variables.
To achieve the above technical object, the present disclosure can also provide a knowledge graph complementing device, including:
the matrix extraction module is used for extracting the relation of the knowledge graph to be complemented to obtain a relation matrix;
the matrix decomposition module is used for carrying out matrix decomposition on the relation matrix to obtain a low-rank regular matrix and a sparse matrix;
the matrix calculation module is used for performing complex space decomposition on the low-rank regular matrix to obtain a low-dimensional relation of an entity and a relation, and performing minimum norm processing on the sparse matrix and a target function to obtain a relation profile matrix;
and the map completion module is used for performing entity relationship simulation on the low-dimensional relationship to obtain a score function, and performing relationship completion on the knowledge map to be completed by fusing the relationship outline matrix with the score function.
To achieve the above technical objects, the present disclosure can also provide a computer storage medium having a computer program stored thereon, wherein the computer program is used for implementing the steps of the above-mentioned knowledge-graph complementing method when being executed by a processor.
To achieve the above technical objective, the present disclosure further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned knowledge-graph complementing method when executing the computer program.
The beneficial effect of this disclosure does:
the method breaks the dependence of the existing correlation scheme on the low-rank structure of the relation matrix by decomposing the relation matrix into the sum of the low-rank matrix and the sparse matrix.
According to the method, entity and relation embedding is carried out by using the decomposed low-rank regular matrix, so that the dimension of the expression vector of the entity and the relation is lower, and the storage space and the prediction duration of the model are reduced.
Compared with the existing related scheme, the method disclosed by the invention has wider applicability and is simultaneously suitable for the relation matrix of a low-rank structure and a high-rank structure.
Drawings
Figure 1 shows a flow diagram schematic of the method of embodiment 1 of the present disclosure;
FIG. 2 shows a schematic flow diagram of the method of embodiment 1 of the present disclosure;
FIG. 3 is a schematic diagram showing a process of optimizing a solution objective function by an alternating descent method according to embodiment 1 of the present disclosure;
fig. 4 shows a schematic structural diagram of the apparatus of embodiment 2 of the present disclosure;
fig. 5 shows a schematic structural diagram of embodiment 4 of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
Various structural schematics according to embodiments of the present disclosure are shown in the figures. The figures are not drawn to scale, wherein certain details are exaggerated and possibly omitted for clarity of presentation. The shapes of various regions, layers, and relative sizes and positional relationships therebetween shown in the drawings are merely exemplary, and deviations may occur in practice due to manufacturing tolerances or technical limitations, and a person skilled in the art may additionally design regions/layers having different shapes, sizes, relative positions, as actually required.
In the knowledge graph, the set of entities is { S } 1 ,S 2 …,S n Is set as { r } 1 ,r 2 …,r m }. For the relation r, the relation matrix X r ∈R n×n Fragment X ij r 1 indicates that entity i and entity j have a relationship r; x ij r -1 indicates that entity i and entity j are missing from relation r, which may or may not be a relation; there are numerous fragments that are missing. Knowledge graph completion is to determine the specific relationship of the missing segments.
The core idea of the existing correlation method is to embed entities into a vector space, embed relationships into a vector space or a matrix space, and simulate the relationships between the entities by utilizing inter-vector operations or operations of vectors and matrices. For example, entity S i And entity S j Is e i And e j The embedded matrix of the relationship is M r Entity S i And entity S j The ratio with respect to the relation r is e i T M r e j When e is i T M r e j >0, represents an entity S i And entity S j There is a relationship, otherwise there is no relationship. Entity S i And entity S j Is e i And e j The embedded vector of the relation is m r Entity S i And entity S j The score for the relationship r is | | | e i +m r -e j || 2 Other schemes use different score functions to model the relationships between entities.
Partial scheme assumes entity relationship matrix X r The method has a low-rank structure, and utilizes low-dimensional vectors to embed entities, and is generally realized by adopting a matrix decomposition technology and an eigenvalue decomposition technology. For example, X r =UV,U∈R n×k ,V∈R k×n The row vector of U represents the embedding vector of the entity and the column vector of V represents the embedding vector of the entity.
Further, in order to make a reasonable complement to the antisymmetric relationship, the prior art performs low-rank decomposition on the entity relationship matrix in a complex space. Wherein the antisymmetric relationship is if the entity S i And entity S j Having a relationship r, then an entity S j With entity S i The relationship r must not exist. Specifically, for the anti-symmetric relationship r, the relationship matrix X r Decomposition in complex space
Figure BDA0003696532050000061
W is a diagonal matrix and W is a diagonal matrix,
Figure BDA0003696532050000062
is the conjugate matrix of E and is,
Figure BDA0003696532050000063
is that
Figure BDA0003696532050000064
The transposed matrix of (2). The scheme uses the line vector of E to represent entity embedded vector, and uses E i We j Simulation of a solid entity S i And entity S j Is calculated as a function of the fraction of. Meanwhile, when the relation r is a symmetrical relation, the complex space is decomposedDegenerates to real space decomposition for simulation.
In some relations, the entity incidence matrix does not present a low rank structure, and the correlation scheme based on the low rank assumption cannot effectively represent the entity and the relation. Taking the parent-child relationship as an example, each entity has only one parent, and each parent has only a few children. This makes the parent-child relationship matrix have only a small number of 1 segments and a large number of-1 segments, so the parent-child relationship matrix is a high rank matrix. In order to effectively represent entities and relations and further improve model prediction accuracy, the method disclosed by the invention is provided. Aiming at the defects, the entity association matrix is decomposed into the sum of a low-rank matrix and a sparse matrix, the low-rank matrix is subjected to eigenvalue decomposition on a complex space to capture entity relationship representation, and the outline of the entity relationship matrix is captured by the sparse matrix, so that the precise completion of the missing entity relationship is realized.
The first embodiment is as follows:
as shown in fig. 1 and 2:
a method of knowledge-graph completion, comprising:
s101: extracting the relation of the knowledge graph to be complemented to obtain a relation matrix;
s102: performing matrix decomposition on the relation matrix to obtain a low-rank regular matrix and a sparse matrix;
s103: performing complex space decomposition on the low-rank regular matrix to obtain a low-dimensional relation of an entity and a relation, and performing minimum norm processing on the sparse matrix and a target function to obtain a relation profile matrix;
s104: and performing entity relationship simulation on the low-dimensional relationship to obtain a score function, and performing relationship completion on the knowledge graph to be completed by fusing the relationship outline matrix with the score function.
Further, the matrix decomposition of the relationship matrix to obtain a low-rank regular matrix and a sparse matrix specifically includes:
let entity set be { S 1 ,S 2 …,S n Is set as { r } 1 ,r 2 …,r m }; wherein S is 1 ,S 2 …,S n Represents an entity, r 1 ,r 2 …,r m Representing a relationship, n and m being positive integers;
for the relation r, the relation matrix X r ∈R n×n Fragment X ij r 1 denotes the entity S i And entity S j Has a relationship r;
X ij r -1 represents an entity S i And entity S j Is missing for relation r;
will relation matrix X r Decomposed into the sum of a low rank regular matrix and a sparse matrix,
Figure BDA0003696532050000081
wherein the content of the first and second substances,
Figure BDA0003696532050000082
is a low rank regular matrix for capturing an efficient representation of entities and relationships;
Figure BDA0003696532050000083
is a sparse matrix which is used to capture X r And (5) profile structure.
Wherein the normal matrix means satisfying
Figure BDA0003696532050000084
Matrix B of (a). For the regular matrix B, there are
Figure BDA0003696532050000085
This is true.
Further, the obtaining of the low-dimensional relationship of the entity and the relationship by performing complex space decomposition on the low-rank regular matrix specifically includes:
embedding entities and relations in a complex space of the low-rank regular matrix, and simulating a symmetric relation and an anti-symmetric relation between the entities through complex vectors;
Figure BDA0003696532050000086
decomposition ofThe form is as follows:
Figure BDA0003696532050000087
Figure BDA0003696532050000088
to represent
Figure BDA0003696532050000089
Real part of (W ∈ C) k×k Is a complex diagonal matrix of the diagonals,
Figure BDA00036965320500000810
is the conjugate matrix of E and is,
Figure BDA00036965320500000811
is that
Figure BDA00036965320500000812
K is a matrix
Figure BDA00036965320500000813
The rank of (d); e is an identity matrix, a row vector of E represents an embedded vector of the entities, and W simulates the relationship between the entities.
Further, before performing complex spatial decomposition on the low-rank regular matrix to obtain a low-dimensional relationship between an entity and a relationship, the method further includes:
and judging whether the relation of the low-rank regular matrix is a symmetrical relation or not, and if the relation of the low-rank regular matrix is a symmetrical relation, degrading the complex space decomposition into real space eigenvalue decomposition.
Further, the obtaining of the relationship profile matrix by performing minimum norm processing on the sparse matrix in combination with the objective function specifically includes:
the following objective functions are combined:
Figure BDA0003696532050000091
wherein the content of the first and second substances,
Figure BDA0003696532050000092
is a matrix
Figure BDA0003696532050000093
L of 1 Norm for ensuring
Figure BDA0003696532050000094
A sparse structure of (a); c 2 (||E|| 2 +||W|| 2 ) Is model regularization, C 1 And C 2 Are two positive parameters;
minimizing the objective function such that
Figure BDA0003696532050000095
Wherein the content of the first and second substances,
Figure BDA0003696532050000096
is a sparse matrix in which the matrix is,
Figure BDA0003696532050000097
to represent
Figure BDA0003696532050000098
The real part of (a) is,
Figure BDA0003696532050000099
is a low rank matrix.
Further, as shown in fig. 3:
the objective function is optimized and solved through an alternating descent method;
three variables E, W are fixed,
Figure BDA00036965320500000910
two variables of (1), solving the minimum of the objective function with respect to the remaining variables.
Specifically, the method comprises the following steps:
1. the variable W is fixed to the base station,
Figure BDA00036965320500000911
if not, the sub-targeting function is:
Figure BDA00036965320500000912
the objective function is optimized by adopting a random gradient descent method, and the process is as follows:
is provided with
Figure BDA00036965320500000913
Setting an initial point E 0 The value of the objective function is f (E) 0 ) Derivative is f (E) 0 )′。
Choosing step length c to obtain E 1 =E 0 -cf(E 0 ) ', such that f (E) 1 ) Less than f (E) 0 ) This is true.
By parity of reasoning, an update point E is obtained 2 ,E 3 ,E 4 …, until the objective function value is less than a certain threshold.
The derivative of f (E) is as follows, the function being a function of the variable E,
Figure BDA00036965320500000914
is a constant.
Figure BDA00036965320500000915
Is L 2 The loss is the sum of the squares of n × n fragments.
The section, taking the (i, j) segment as an example only, shows the process of solving for its derivative:
is provided with
Figure BDA00036965320500000916
e il =a il +ib il ,e jl =a jl +ib jl ,W ll =c ll +id ll
Figure BDA0003696532050000101
With respect to the variable (a) i1 ,a i2 ,…,a ik ) Is a derivative of
Figure BDA0003696532050000102
About (b) i1 ,b i2 ,…,b ik ) Is a derivative of
Figure BDA0003696532050000103
The derivative solving process for the remaining variables is the same.
2. The variable E is fixed to the position of the movable body,
Figure BDA0003696532050000104
the function of the sub-targets, unchanged, is,
Figure BDA0003696532050000105
the objective function is optimized by using a random gradient descent method, which is the same as procedure 1.
3. The fixed variables E, W are constant, the sub-objective functions are,
Figure BDA0003696532050000106
the objective function is optimized by Soft threshold operation, which is solved as,
Figure BDA0003696532050000107
where soft (a, b) ═ sign (a) max (| a | -b, 0).
For entity S i And entity S j The result of the relationship prediction is,
Figure BDA0003696532050000108
when in use
Figure BDA0003696532050000109
Representing an entity S i And entity S j There is a relationship, otherwise there is no relationship.
Example two:
as shown in figure 4 of the drawings,
the present disclosure also provides a knowledge graph spectrum complementing device, including:
the matrix extraction module 201 is configured to extract a relationship of the knowledge graph to be complemented to obtain a relationship matrix;
a matrix decomposition module 202, configured to perform matrix decomposition on the relationship matrix to obtain a low-rank regular matrix and a sparse matrix;
the matrix calculation module 203 is configured to perform complex space decomposition on the low-rank regular matrix to obtain a low-dimensional relationship between an entity and a relationship, and perform minimum norm processing on the sparse matrix in combination with a target function to obtain a relationship profile matrix;
and the map completion module 204 is configured to perform entity relationship simulation on the low-dimensional relationship to obtain a score function, and perform relationship completion on the knowledge map to be completed by fusing the relationship profile matrix with the score function.
In the knowledge graph spectrum complementing device of the present disclosure, the matrix extracting module 201 is sequentially connected to the matrix decomposing module 202, the matrix calculating module 203, and the graph spectrum complementing module 204.
Wherein the matrix decomposition module 202 is specifically configured to:
let entity set be { S 1 ,S 2 …,S n Is set as { r } 1 ,r 2 …,r m }; wherein S is 1 ,S 2 …,S n Represents an entity, r 1 ,r 2 …,r m Representing a relationship, n and m being positive integers;
for the relation r, the relation matrix X r ∈R n×n Fragment X ij r 1 denotes the entity S i And entity S j Has a relationship r;
X ij r -1 represents an entity S i And entity S j Is missing for relation r;
will relation matrix X r Decomposed into the sum of a low rank regular matrix and a sparse matrix,
Figure BDA0003696532050000111
wherein the content of the first and second substances,
Figure BDA0003696532050000112
is a low rank regular matrix for capturing an efficient representation of entities and relationships;
Figure BDA0003696532050000113
is a sparse matrix which is used to capture X r And (5) profile structure.
Further, the matrix calculation module 203 is specifically configured to:
embedding entities and relations in a complex space of the low-rank regular matrix, and simulating a symmetric relation and an anti-symmetric relation between the entities through complex vectors;
Figure BDA0003696532050000121
the decomposition form is as follows:
Figure BDA0003696532050000122
Figure BDA0003696532050000123
to represent
Figure BDA0003696532050000124
Real part of (W ∈ C) k×k Is a complex diagonal matrix of the diagonals,
Figure BDA0003696532050000125
is the conjugate matrix of E and is,
Figure BDA0003696532050000126
is that
Figure BDA0003696532050000127
K is a matrix
Figure BDA0003696532050000128
Is determined. The row vector of E represents the embedded vector of the entities, and W models the relationship between the entities.
The matrix calculation module 203 is further specifically configured to:
the following objective functions are combined:
Figure BDA0003696532050000129
wherein the content of the first and second substances,
Figure BDA00036965320500001210
is a matrix
Figure BDA00036965320500001211
L of 1 Norm for ensuring
Figure BDA00036965320500001212
A sparse structure of (a); c 2 (||E|| 2 +||W|| 2 ) Is model regularization, C 1 And C 2 Are two positive parameters;
minimizing the objective function such that
Figure BDA00036965320500001213
Wherein the content of the first and second substances,
Figure BDA00036965320500001214
is a sparse matrix in which the matrix is,
Figure BDA00036965320500001215
represent
Figure BDA00036965320500001216
The real part of (a) is,
Figure BDA00036965320500001217
is a low rank matrix.
Example three:
the present disclosure can also provide a computer storage medium having stored thereon a computer program for implementing the steps of the above-described knowledge-graph complementing method when executed by a processor.
The computer storage medium of the present disclosure may be implemented with a semiconductor memory, a magnetic core memory, a magnetic drum memory, or a magnetic disk memory.
Semiconductor memories are mainly used as semiconductor memory elements of computers, and there are two types, Mos and bipolar memory elements. Mos devices have high integration, simple process, but slow speed. The bipolar element has the advantages of complex process, high power consumption, low integration level and high speed. NMos and CMos were introduced to make Mos memory dominate in semiconductor memory. NMos is fast, e.g. 45ns for 1K bit sram from intel. The CMos power consumption is low, and the access time of the 4K-bit CMos static memory is 300 ns. The semiconductor memories described above are all Random Access Memories (RAMs), i.e. read and write new contents randomly during operation. And a semiconductor Read Only Memory (ROM), which can be read out randomly but cannot be written in during operation, is used to store solidified programs and data. The ROM is classified into a non-rewritable fuse type ROM, PROM, and a rewritable EPROM.
The magnetic core memory has the characteristics of low cost and high reliability, and has more than 20 years of practical use experience. Magnetic core memories were widely used as main memories before the mid 70's. The storage capacity can reach more than 10 bits, and the access time is 300ns at the fastest speed. The typical international magnetic core memory has a capacity of 4 MS-8 MB and an access cycle of 1.0-1.5 mus. After semiconductor memory is rapidly developed to replace magnetic core memory as a main memory location, magnetic core memory can still be applied as a large-capacity expansion memory.
Drum memory, an external memory for magnetic recording. Because of its fast information access speed and stable and reliable operation, it is being replaced by disk memory, but it is still used as external memory for real-time process control computers and medium and large computers. In order to meet the needs of small and micro computers, subminiature magnetic drums have emerged, which are small, lightweight, highly reliable, and convenient to use.
Magnetic disk memory, an external memory for magnetic recording. It combines the advantages of drum and tape storage, i.e. its storage capacity is larger than that of drum, its access speed is faster than that of tape storage, and it can be stored off-line, so that the magnetic disk is widely used as large-capacity external storage in various computer systems. Magnetic disks are generally classified into two main categories, hard disks and floppy disk memories.
Hard disk memories are of a wide variety. The structure is divided into a replaceable type and a fixed type. The replaceable disk is replaceable and the fixed disk is fixed. The replaceable and fixed magnetic disks have both multi-disk combinations and single-chip structures, and are divided into fixed head types and movable head types. The fixed head type magnetic disk has a small capacity, a low recording density, a high access speed, and a high cost. The movable head type magnetic disk has a high recording density (up to 1000 to 6250 bits/inch) and thus a large capacity, but has a low access speed compared with a fixed head magnetic disk. The storage capacity of a magnetic disk product can reach several hundred megabytes with a bit density of 6250 bits per inch and a track density of 475 tracks per inch. The disk set of the multiple replaceable disk memory can be replaced, so that the disk set has large off-body capacity, large capacity and high speed, can store large-capacity information data, and is widely applied to an online information retrieval system and a database management system.
Example four:
the present disclosure also provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps of the above-mentioned knowledge-graph complementing method are implemented.
Fig. 5 is a schematic diagram of an internal structure of the electronic device in one embodiment. As shown in fig. 5, the electronic device includes a processor, a storage medium, a memory, and a network interface connected through a system bus. The computer device comprises a storage medium, an operating system, a database and computer readable instructions, wherein the database can store control information sequences, and the computer readable instructions can enable a processor to realize a knowledge graph completion method when being executed by the processor. The processor of the electrical device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may have stored therein computer readable instructions that, when executed by the processor, may cause the processor to perform a method of knowledge-graph completion. The network interface of the computer device is used for connecting and communicating with the terminal. Those skilled in the art will appreciate that the architecture shown in fig. 5 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
The electronic device includes, but is not limited to, a smart phone, a computer, a tablet, a wearable smart device, an artificial smart device, a mobile power source, and the like.
The processor may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor is a Control Unit of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules (for example, executing remote data reading and writing programs, etc.) stored in the memory and calling data stored in the memory.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connected communication between the memory and at least one processor or the like.
Fig. 5 shows only an electronic device having components, and those skilled in the art will appreciate that the structure shown in fig. 5 does not constitute a limitation of the electronic device, and may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor through a power management device, so that functions such as charge management, discharge management, and power consumption management are implemented through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used to establish a communication connection between the electronic device and other electronic devices.
Optionally, the electronic device may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
Further, the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (9)

1. A method for supplementing a knowledge graph, comprising:
extracting the relation of the knowledge graph to be complemented to obtain a relation matrix;
performing matrix decomposition on the relation matrix to obtain a low-rank regular matrix and a sparse matrix;
performing complex space decomposition on the low-rank regular matrix to obtain a low-dimensional relation of an entity and a relation, and performing minimum norm processing on the sparse matrix and a target function to obtain a relation profile matrix;
and performing entity relationship simulation on the low-dimensional relationship to obtain a score function, and performing relationship completion on the knowledge graph to be completed by fusing the relationship outline matrix with the score function.
2. The method according to claim 1, wherein the matrix decomposition of the relation matrix to obtain a low-rank regular matrix and a sparse matrix specifically comprises:
let entity set be { S 1 ,S 2 ...,S n Is set as { r } 1 ,r 2 ...,r m }; wherein S is 1 ,S 2 ...,S n Represents an entity, r 1 ,r 2 ...,r m Representing a relationship, n and m being positive integers;
for the relation r, the relation matrix X r ∈R n×n Fragment X ij r 1 denotes the entity S i And entity S j Has a relationship r;
X ij r -1 represents an entity S i And entity S j Is missing for relation r;
will relation matrix X r Decomposed into the sum of a low rank regular matrix and a sparse matrix,
Figure FDA0003696532040000011
wherein the content of the first and second substances,
Figure FDA0003696532040000012
is a low rank regular matrix for capturing an efficient representation of entities and relationships;
Figure FDA0003696532040000013
is a sparse matrix which is used to capture X r And (5) profile structure.
3. The method of claim 2, wherein the performing complex spatial decomposition on the low-rank regular matrix to obtain a low-dimensional relationship of entities and relationships specifically comprises:
embedding entities and relations in a complex space of the low-rank regular matrix, and simulating a symmetric relation and an anti-symmetric relation between the entities through complex vectors;
Figure FDA0003696532040000014
the decomposition form is as follows:
Figure FDA0003696532040000015
Figure FDA0003696532040000021
to represent
Figure FDA0003696532040000022
Real part of (W ∈ C) k×k Is a complex diagonal matrix of the diagonals,
Figure FDA0003696532040000023
is the conjugate matrix of E and is,
Figure FDA0003696532040000024
is that
Figure FDA0003696532040000025
K is a matrix
Figure FDA0003696532040000026
The rank of (d); e is an identity matrix, a row vector of E represents an embedded vector of the entities, and W simulates the relationship between the entities.
4. The method of claim 3, wherein the complex spatial decomposition of the low rank regular matrix to obtain the low dimensional relationship of entities and relationships further comprises:
and judging whether the relation of the low-rank regular matrix is a symmetrical relation or not, and if the relation of the low-rank regular matrix is a symmetrical relation, degrading the complex space decomposition into real space eigenvalue decomposition.
5. The method according to claim 3, wherein the obtaining of the relationship profile matrix by performing the minimum norm processing on the sparse matrix in combination with the objective function specifically comprises:
the following objective functions are combined:
Figure FDA0003696532040000027
wherein the content of the first and second substances,
Figure FDA0003696532040000028
is a matrix
Figure FDA0003696532040000029
L of 1 Norm for ensuring
Figure FDA00036965320400000210
A sparse structure of (a); c 2 (||E|| 2 +||W|| 2 ) Is model regularization, C 1 And C 2 Are two positive parameters;
minimizing the objective function such that
Figure FDA00036965320400000211
Wherein the content of the first and second substances,
Figure FDA00036965320400000212
is a sparse matrix in which the matrix is,
Figure FDA00036965320400000213
to represent
Figure FDA00036965320400000214
The real part of (a) is,
Figure FDA00036965320400000215
is a low rank matrix.
6. The method of claim 5, wherein the objective function is optimized to solve for the objective function by an alternating descent method;
three variables E, W are fixed,
Figure FDA00036965320400000216
two variables of (1), solving the minimum of the objective function with respect to the remaining variables.
7. A knowledge graph complementing device, comprising:
the matrix extraction module is used for extracting the relation of the knowledge graph to be complemented to obtain a relation matrix;
the matrix decomposition module is used for carrying out matrix decomposition on the relation matrix to obtain a low-rank regular matrix and a sparse matrix;
the matrix calculation module is used for performing complex space decomposition on the low-rank regular matrix to obtain a low-dimensional relation of an entity and a relation, and performing minimum norm processing on the sparse matrix and a target function to obtain a relation profile matrix;
and the map completion module is used for performing entity relationship simulation on the low-dimensional relationship to obtain a score function, and performing relationship completion on the knowledge map to be completed by fusing the relationship outline matrix with the score function.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps corresponding to the knowledge-graph complementing method of any one of claims 1 to 6 when executing the computer program.
9. A computer storage medium having computer program instructions stored thereon for performing the steps corresponding to the knowledge-graph complementation method of any of claims 1-6 when executed by a processor.
CN202210675856.3A 2022-06-15 2022-06-15 Knowledge graph complementing method, device, equipment and medium Pending CN114896422A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210675856.3A CN114896422A (en) 2022-06-15 2022-06-15 Knowledge graph complementing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210675856.3A CN114896422A (en) 2022-06-15 2022-06-15 Knowledge graph complementing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN114896422A true CN114896422A (en) 2022-08-12

Family

ID=82729212

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210675856.3A Pending CN114896422A (en) 2022-06-15 2022-06-15 Knowledge graph complementing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114896422A (en)

Similar Documents

Publication Publication Date Title
US10694345B2 (en) Automated determination of networks motifs
CN113219341B (en) Model generation and battery degradation estimation device, method, medium, and apparatus
CN112308313A (en) Method, device, medium and computer equipment for continuous point addressing of school
CN111950621A (en) Target data detection method, device, equipment and medium based on artificial intelligence
CN112306835A (en) User data monitoring and analyzing method, device, equipment and medium
CN113504935A (en) Software development quality evaluation method and device, electronic equipment and readable storage medium
CN111538852B (en) Multimedia resource processing method, device, storage medium and equipment
CN116431878A (en) Vector retrieval service method, device, equipment and storage medium thereof
CN115018588A (en) Product recommendation method and device, electronic equipment and readable storage medium
CN113255682B (en) Target detection system, method, device, equipment and medium
CN112396547B (en) Course recommendation method, device, equipment and medium based on unsupervised learning
CN113591881A (en) Intention recognition method and device based on model fusion, electronic equipment and medium
Shahroodi et al. Swordfish: A Framework for Evaluating Deep Neural Network-based Basecalling using Computation-In-Memory with Non-Ideal Memristors
CN114896422A (en) Knowledge graph complementing method, device, equipment and medium
CN106708445A (en) Link selection method and device
CN113516368A (en) Method, device, equipment and medium for predicting uncertainty risk of city and community
CN113902121A (en) Method, device, equipment and medium for checking battery degradation presumption device
CN115188430A (en) Drug screening model construction method and device, screening method, device and medium
CN115424042A (en) Network sparsification method, device, medium and equipment based on interlayer feature similarity
CN108510071B (en) Data feature extraction method and device and computer readable storage medium
CN112232115A (en) Calculation factor implantation method, medium and equipment
CN114882489B (en) Method, device, equipment and medium for horizontally correcting rotating license plate
CN113473135A (en) Intra-frame prediction method, device and medium for non-linear texture
CN112685189A (en) Method, device, equipment and medium for realizing data processing
CN117061749A (en) Multi-transformation coding and decoding method, system, medium and equipment

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