CN111858947A - Automatic knowledge graph embedding method and system - Google Patents

Automatic knowledge graph embedding method and system Download PDF

Info

Publication number
CN111858947A
CN111858947A CN201910344161.5A CN201910344161A CN111858947A CN 111858947 A CN111858947 A CN 111858947A CN 201910344161 A CN201910344161 A CN 201910344161A CN 111858947 A CN111858947 A CN 111858947A
Authority
CN
China
Prior art keywords
scoring function
scoring
training
block matrix
candidate
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
CN201910344161.5A
Other languages
Chinese (zh)
Inventor
姚权铭
张永祺
涂威威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
4Paradigm Beijing Technology Co Ltd
Original Assignee
4Paradigm Beijing Technology Co Ltd
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 4Paradigm Beijing Technology Co Ltd filed Critical 4Paradigm Beijing Technology Co Ltd
Priority to CN201910344161.5A priority Critical patent/CN111858947A/en
Publication of CN111858947A publication Critical patent/CN111858947A/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

An automatic knowledge graph embedding method and system are provided, the method comprising: establishing a unified representation of a scoring function for the knowledge graph embedding model; constructing a scoring function search space based on the unified representation; searching a corresponding scoring function in the scoring function search space aiming at a specific knowledge graph; training an embedded model of the particular knowledge-graph using the searched scoring function; and obtaining an embedded representation of the particular knowledge-graph using the embedded model.

Description

Automatic knowledge graph embedding method and system
Technical Field
The present application relates to knowledge graph embedding techniques in the field of artificial intelligence, and more particularly, to an automatic knowledge graph embedding method and system.
Background
With the rapid development of information network technology, various information network data contents present an explosive growth situation. Such content is generally characterized by large scale, heterogeneous diversity and loose organization structure, and provides challenges for people to effectively acquire information and knowledge. Knowledge Graph (KG) is a Knowledge base of semantic network, and can describe Knowledge resources and carriers thereof by using a visualization technology, and mine, analyze, construct, draw and display Knowledge and mutual relations among the Knowledge resources and the carriers.
The knowledge graph is a special graph structure, the entity is used as a node, and the relation is used as a directed edge, which has recently attracted the interest of many people. In the knowledge-graph, each edge is represented as a triple (h, r, t) in the form of (head entity, relationship, tail entity) to indicate that two entities h (i.e., head entity) and t (i.e., tail entity) are connected by a relationship r, e.g., (new york, isLocatedIn, USA) may indicate that new york is located in USA. Many large knowledge maps have been established over the last decades, such as WordNet, Freebase, DBpedia, YAGO. They improve various downstream applications such as structured search, question and answer, and entity recommendations, among others.
In a knowledge graph, one basic problem is how to quantify the similarity of a given triplet (h, r, t) so that subsequent applications can be performed. Recently, Knowledge-map Embedding (KGE) has emerged and developed as a method for this purpose. Knowledge graph embedding aims at finding vector representations (i.e., embedding) of low-dimensional entities and relationships so that their similarity can be quantified. In particular, given a set of observed facts (i.e., triples), knowledge-graph embedding attempts to learn low-dimensional vector representations of entities and relationships in the triples so that the similarity of the triples can be quantified. This similarity can be measured by a scoring Function (Score Function), which can be used to build a model based on a given relationship for measuring similarity between entities. To construct the knowledge-graph embedded model, it is most important to design and select an appropriate scoring function. Since different scoring functions have their own weaknesses and strengths in capturing similarity, the choice of scoring function is crucial to the performance of knowledge-graph embedding.
Generally, the scoring function is designed and selected by a person, and is also the most important perspective of knowledge-graph embedding, which can significantly affect the quality of embedding
To generate high quality embedding, the scoring function should be scalable and expressive. Extensibility means that parameters of the scoring function-based knowledge-graph embedding model should not grow faster than linearly for the number of entities and relationships, while expressiveness requires that the scoring function be able to handle common relationships in the knowledge-graph, i.e., symmetric, antisymmetric, generally asymmetric, and inverse relationships.
However, the performance boost provided by new scoring functions designed by humans is becoming increasingly insignificant. This is primarily because different knowledge-graphs have different patterns in relationships, and thus a scoring function that is adapted to one knowledge-graph may not behave consistently on another knowledge-graph. In addition, how to select the best scoring function for the knowledge-graph itself among many scoring functions has become a very important issue.
Disclosure of Invention
According to an embodiment of the invention, there is provided an automatic knowledge-graph embedding method, the method comprising: establishing a unified representation of a scoring function for the knowledge graph embedding model; constructing a scoring function search space based on the unified representation; searching a corresponding scoring function in the scoring function search space aiming at a specific knowledge graph; training an embedded model of the particular knowledge-graph using the searched scoring function; and obtaining an embedded representation of the particular knowledge-graph using the embedded model.
Optionally, the unified representation of the scoring function may be:
Figure BDA0002041737390000021
Figure BDA0002041737390000022
wherein h, t and r respectively represent embedding vectors of a head entity h, a tail entity t and a relation r between h and t in a triplet (h, r, t) of the knowledge graph, and h, r and t are respectively divided into K sub-embedding vectors h according to the same division mode1To hK、r1To rKAnd t1To tKThe structure function g (r) is a K × K block matrix corresponding to the scoring function f (h, r, t) [ g (r)]ij=diag(aij),[g(r)]ijTo representBlock of ith row and jth column in the block matrix, aij∈{0,±r1,...,±rK1 ≦ i ≦ K, 1 ≦ j ≦ K, and K is a positive integer.
Optionally, the step of searching the corresponding scoring function may comprise: searching for an optimal block matrix structure G in a structure search space G including a plurality of block matrix structures G corresponding to a scoring function search space based on the following expression*And determines a corresponding embedding vector h*、r*And t*
g*∈argg∈GmaxM(F*(h*,r*,t*),Sval)
s.t.F*(h*,r*,t*)=argh,g(r),tmaxM(F(h,r,t),Stra)
Wherein g is a block matrix structure corresponding to a structure function g (r) indicating the distribution of non-zero blocks in the K x K block matrix, F (h, r, t) is a knowledge-graph embedding model, M (F (h, r, t), S) measures performance indicator scores of F (h, r, t) based on a set of triples S, SvalIs a verification set, StraIs a training set, and SvalAnd StraRespectively, a subset of the set of triples of the specific knowledge-graph, F *(h*,r*,t*) Based on a scoring function corresponding to a block matrix structure G in a structure search space G, using a training set StraEmbedding a knowledge graph with the highest performance index score obtained by model training F (h, r, t) into a model and h*、r*And t*Is obtained by the model training and F*(h*,r*,t*) Corresponding embedded vector, g*Is in the structure search space G and in the verification set SvalF with the highest performance index score*(h*,r*,t*) Corresponding block matrix structure, which may be based on the block matrix structure g*And embedding the vector h*、r*And t*Determining said respective scoring function f*(h*,r*,t*)。
Optionally, the scoring function in the scoring function search space may satisfy the following constraints (1) - (4): (1) for an appropriate r, the block matrix g (r) corresponding to the scoring function f (h, r, t) is symmetric or anti-symmetric; (2) no zero rows and/or zero columns in the block matrix g (r); (3) the block matrix g (r) includes all K sub-embedded vectors r of the embedded vector r1To rK(ii) a And (4) no repeated rows and/or columns in the block matrix g (r).
Optionally, the block matrix structure g is searched*May comprise the steps of: determining the number b of non-zero blocks in a block matrix structure to be used, wherein b ═ K, K +2, …, K × K; determining a training scoring function candidate set corresponding to a block matrix structure with the number b of non-zero blocks in the structure search space G; obtaining corresponding F through model training based on the scoring function in the training scoring function candidate set *(h*,r*,t*) (ii) a Will be associated with the verification set SvalF with the highest performance index score*(h*,r*,t*) The corresponding block matrix structure is determined as the optimal block matrix structure g corresponding to the number b of non-zero blocksb(ii) a G to correspond to different non-zero block numbers bbIn the verification set SvalThe structure that achieves the highest performance score is determined as g*
Optionally, the step of determining a candidate set of training scoring function may comprise: if b ═ K, the following operations may be performed: generating a first training scoring function candidate set based on a block matrix structure with K number of non-zero blocks in a structure search space G, wherein the first training scoring function candidate set comprises available candidate scoring functions satisfying constraints (2) - (4), obtaining a performance index score associated with each candidate scoring function by performing model training based on each candidate scoring function in the first training scoring function candidate set, and selecting K in the first training scoring function candidate set based on the score1A scoring function to form a candidate set of expected scoring functions corresponding to the number K of non-zero blocks, where K is1Is a positive integer; if b is greater than K, the following operations may be performed: generating an initial scoring function candidate set corresponding to the number b of the non-zero blocks based on an expected scoring function candidate set corresponding to the number b-2 of the non-zero blocks, wherein the initial scoring function candidate set comprises a plurality of available candidate scoring functions satisfying the constraints (2) - (4), and selecting K from the initial scoring function candidate set according to the ranking from high to low of performance based on the performance estimation of each candidate scoring function in the initial scoring function candidate set 2The candidate scoring function is used as a second training scoring function candidate set, wherein K2Is a positive integer, and K2≤K1Obtaining a performance indicator score associated with each candidate scoring function selected by performing the model training based on the candidate scoring function in the second training scoring function candidate set, according to the performance indicator score at the K2Selecting K from candidate scoring functions1A scoring function to form a candidate set of desired scoring functions corresponding to the number b of non-zero blocks.
Optionally, a predictor may be used to predict each candidate scoring function in the second candidate set of training scoring function to obtain the performance estimate, and determining the candidate set of training scoring function may further comprise: from said K2Each of the candidate scoring functions extracts features and updates the predictor using the extracted feature parameters. The updated predictor is used in the operation of determining a candidate set of training scoring functions corresponding to a block matrix structure with the number of non-zero blocks being b + 2.
Alternatively, the predictor may enable a higher performance ranking of good candidate scoring functions than bad candidate scoring functions, and the predictor may be able to learn based on a small number of samples.
Optionally, the predictor is capable of identifying symmetry and/or antisymmetry of the block matrix g (r) corresponding to the scoring function f (h, r, t) based on the extracted features and giving a low prediction to the scoring function corresponding to a block matrix that does not have symmetry or antisymmetry.
Optionally, the method may further comprise: and training a machine learning model based on the embedded representation of the specific knowledge graph to obtain a target machine learning model for executing at least one of relationship retrieval, semantic retrieval, intelligent recommendation, intelligent question answering, personalized recommendation, anti-fraud and content distribution.
Optionally, the method may further comprise: and executing a prediction task by utilizing the target machine learning model, wherein the prediction task comprises at least one of relationship retrieval, semantic retrieval, intelligent recommendation, intelligent question answering, personalized recommendation, anti-fraud and content distribution.
According to another embodiment of the present invention, there is provided an automatic knowledge-graph embedding system, the system comprising: a construction unit configured to establish a unified representation of a scoring function for a knowledge-graph embedding model and construct a scoring function search space based on the unified representation; a search unit configured to search out a corresponding scoring function in the scoring function search space for a specific knowledge graph; an embedded model training unit configured to train an embedded model of the specific knowledge-graph using the searched scoring function; and a representation unit configured to obtain an embedded representation of the specific knowledge-graph using the embedded model.
Optionally, the search unit may be configured to search the respective scoring function by: searching for an optimal block matrix structure G in a structure search space G including a plurality of block matrix structures G corresponding to a scoring function search space based on the following expression*And determines a corresponding embedding vector h*、r*And t*
g*∈argg∈GmaxM(F*(h*,r*,t*),Sval)
s.t.F*(h*,r*,t*)=argh,g(r),tmaxM(F(h,r,t),Stra)
Wherein g is a block matrix structure corresponding to a structure function g (r) indicating the K x K block momentsThe distribution of non-zero blocks in the matrix, F (h, r, t) is a knowledge-graph embedding model, M (F (h, r, t), S) measures the performance index score of F (h, r, t) based on a set of triplets S, SvalIs a verification set, StraIs a training set, and SvalAnd StraRespectively, a subset of the set of triples of the specific knowledge-graph, F*(h*,r*,t*) Based on a scoring function corresponding to a block matrix structure G in a structure search space G, using a training set StraEmbedding a knowledge graph with the highest performance index score obtained by model training F (h, r, t) into a model and h*、r*And t*Is obtained by the model training and F*(h*,r*,t*) Corresponding embedded vector, g*Is in the structure search space G and in the verification set SvalF with the highest performance index score*(h*,r*,t*) Corresponding block matrix structure, which may be based on the block matrix structure g *And embedding the vector h*、r*And t*Determining said respective scoring function f*(h*,r*,t*)。
Alternatively, the search unit may search the block matrix structure g by*: determining the number b of non-zero blocks in a block matrix structure to be used, wherein b ═ K, K +2, …, K × K;
determining a training scoring function candidate set corresponding to a block matrix structure with the number b of non-zero blocks in the structure search space G; obtaining corresponding F through model training based on the scoring function in the training scoring function candidate set*(h*,r*,t*) (ii) a Will be associated with the verification set SvalF with the highest performance index score*(h*,r*,t*) The corresponding block matrix structure is determined as the optimal block matrix structure g corresponding to the number b of non-zero blocksb(ii) a G to correspond to different non-zero block numbers bbIn the verification set SvalThe structure that achieves the highest performance score is determined asg*
Alternatively, the search unit may determine the training scoring function candidate set by: if b is equal to K, the following operations are carried out: generating a first training scoring function candidate set based on a block matrix structure with K number of non-zero blocks in a structure search space G, wherein the first training scoring function candidate set comprises available candidate scoring functions satisfying constraints (2) - (4), obtaining a performance index score associated with each candidate scoring function by performing model training based on each candidate scoring function in the first training scoring function candidate set, and selecting K in the first training scoring function candidate set based on the score 1A scoring function to form a candidate set of expected scoring functions corresponding to the number K of non-zero blocks, where K is1Is a positive integer; if b is greater than K, the following operations are performed: generating an initial scoring function candidate set corresponding to the number b of the non-zero blocks based on an expected scoring function candidate set corresponding to the number b-2 of the non-zero blocks, wherein the initial scoring function candidate set comprises a plurality of available candidate scoring functions satisfying the constraints (2) - (4), and selecting K from the initial scoring function candidate set according to the high-to-low ranking of the performance based on the performance estimation of each candidate scoring function in the initial scoring function candidate set2The candidate scoring function is used as a second training scoring function candidate set, wherein K2Is a positive integer, and K2≤K1Obtaining a performance indicator score associated with each candidate scoring function selected by performing the model training based on the candidate scoring function in the second training scoring function candidate set, according to the performance indicator score at the K2Selecting K from candidate scoring functions1A scoring function to form a candidate set of desired scoring functions corresponding to the number b of non-zero blocks.
Optionally, the search unit may use a predictor to predict each candidate scoring function in the initial training scoring function candidate set to obtain the performance estimate, and the search unit may predict from the K 2Extracting features from each of the candidate scoring functions and using the extractionTo update the predictor. The updated predictor may be used in the operation of determining a second training scoring function candidate set corresponding to a b +2 number of non-zero blocks block matrix structure.
Optionally, the system may further comprise: a machine learning model training unit configured to train a machine learning model based on the embedded representation of the specific knowledge graph, resulting in a target machine learning model for performing at least one of relational retrieval, semantic retrieval, intelligent recommendation, intelligent question answering, personalized recommendation, anti-fraud, content distribution.
Optionally, the system may further comprise: a prediction unit configured to perform a prediction task using the target machine learning model, wherein the prediction task includes at least one of relationship retrieval, semantic retrieval, intelligent recommendation, intelligent question answering, personalized recommendation, anti-fraud, and content distribution.
According to another embodiment of the present invention, there is provided a computer-readable storage medium storing instructions that, when executed by at least one computing device, cause the at least one computing device to perform the aforementioned automatic knowledge-graph embedding method.
According to another embodiment of the present invention, there is provided a system comprising at least one computing device and at least one storage device storing instructions that, when executed by the at least one computing device, cause the at least one computing device to perform the aforementioned automatic knowledge-graph embedding method.
Advantageous effects
By applying the automatic knowledge-map embedding method and system according to the exemplary embodiments of the present invention, it is possible to automatically search for a scoring function of a given knowledge-map, and also to make it possible to restrict a reduction in training time with respect to the scoring function while accurately obtaining expressiveness of candidate scoring functions.
Drawings
These and/or other aspects and advantages of the present invention will become more apparent and more readily appreciated from the following detailed description of the embodiments of the invention, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a block diagram illustrating an automatic knowledge-graph embedding system according to an exemplary embodiment of the present disclosure;
FIG. 2 is a diagram showing a relationship matrix for four scoring functions;
FIG. 3 is a flowchart illustrating an automatic knowledge-graph embedding method according to an exemplary embodiment of the present disclosure.
Detailed Description
In order that those skilled in the art will better understand the present invention, exemplary embodiments thereof will be described in further detail below with reference to the accompanying drawings and detailed description.
Since the introduction of knowledge graph embedding, various scoring functions are proposed, and the existing manually designed SF is mainly classified into the following three types:
(1) translational Distance Model (TDM): the translation method utilizes a distance-based scoring function. Inspired by analogy words in vocabulary embedding, after translation is performed through a relationship, similarity is measured based on the distance between two entities. TDM-based scoring functions include, for example, TransE and its variants (such as TransH, TransR, TransD, etc.) that model similarity using projected distances in vector space. For example, in TransE, SF is defined by the (negative) distance between h + r and t, i.e., f (h, r, t) | | h + r-t | c1. Other TDM-based scoring functions (e.g., TransH, TransR, and TransD) enhance TransE by introducing additional mapping matrices.
(2) BiLinear model (BLM): the scoring functions in the set explore the similarity of the triples using product-based similarity, which is expressed based on bilinear functions. Typically, they share the form f (h, r, t) ═ hTRt, wherein,
Figure BDA0002041737390000071
is a matrix, referring to the embedding of the relation r. The scoring functions based on the BiLinear model include RESCAL, DistMult, ComplEx, HolE, analog, and recently proposed SimplE, etc., and among the various scoring functions of the BiLinear model, RESCAL directly uses R pairs The embedding of each relationship is modeled; DistMult overcomes the overfitting problem of RESCAL by constraining R to the diagonal; ComplEx allows R and h, t to be ComplEx valued, which enables handling of asymmetric relationships; HolE uses circular correlation instead of dot product operation, but it has been shown to be equivalent to ComplEx. Analog limits R to normal and commutative and is implemented using a weighted combination of DistMult and ComplEx; finally, SimplE handles the inverse relationships using two sets of embeddings for each entity and relationship.
(3) Neural Network Model (NNM): inspired by the success of neural networks in image classification and word representation, NNMs have also been explored as scoring functions, e.g., MLP, NTM, and ConvE, among others. Neural network models aim at the probability of triplets being output based on neural networks that embed entities and relationships as inputs. MLP and NTN are representative neural models that both use a large number of parameters to combine the embedding of entities and relationships. Furthermore, the ConvE model utilizes convolutional neural networks to increase the interaction between the different dimensions of the embedding.
BLM is currently the best performing of the three models described above. TDM expression capability is inferior to BLM, which further leads to poor empirical performance. Furthermore, although NNMs were developed for knowledge graph embedding inspired by the success of deep networks, it is difficult to train them to achieve good performance due to the increased complexity and training difficulty of their models.
While BLM-based scoring functions (e.g., compax and simpel) are very powerful, they combine scalability and expressiveness.
The present application is primarily discussed with respect to a scoring function based on a BLM model, however, it should be understood that the present application is not so limited and that the present application is applicable to any other similarly applicable model.
Before starting the description of the inventive concept below, for the sake of understanding, the various parameters and their expressions used in the present application will be explained first:
for a knowledge graph, its set of entities and relationships are represented by and R, respectively. Triples in the knowledgegraph are represented by (h, R, t), where h e and t e are the indices of the head and tail entities, respectively, and R e R is the index of the relationship.
The parameters of the automated knowledge-graph embedding model are denoted as e (for each entity) and r (for relationships). For simplicity, in the following, the embedding (sometimes also referred to as embedding vector in the following) is represented by a bold form of the corresponding parameter, e.g. h and t are the embedding of h and t, respectively, and indexed from e, r is the embedding of r.
<a,b,c>Is a dot product and for a real-valued vector, it equals adiag (b) cTWhereas for a complex-valued vector it is the Hermitian product. The diagonal matrix diag (b) is composed of the elements in b.
f (h, r, t) is a scoring function that returns a real number value reflecting the similarity of the triples (h, r, t), with higher scores representing more similarity.
FIG. 1 is a block diagram illustrating an automatic knowledge-graph embedding system 100 according to an exemplary embodiment of the present disclosure. Referring to FIG. 1, an automated knowledge-graph embedding system 100 may include a building device 110, a searching device 120, an embedding model training device 130, and a presentation device 140.
In an exemplary embodiment of the present invention, the construction apparatus 110 may be configured to build a unified representation of a scoring function for the knowledgegraph embedding model, and construct a scoring function search space based on the unified representation.
In particular, existing BLM-based scoring functions (e.g., DistMult, compex, analog, and SimpIE) have expressions as shown in table 1.
Figure BDA0002041737390000091
As shown in table 1, for analog and SimpIE, the embedded vector is split into two parts,
Figure BDA0002041737390000092
(for SimpIE), or
Figure BDA0002041737390000093
(pair)In analog),
Figure BDA0002041737390000094
(similarly, the same segmentation is done for the embedded vectors r and t). conj (t) is
Figure BDA0002041737390000095
Complex conjugation of (a).
As can be seen from table 1, there are two major differences between these SFs. First, the embedded vector can be real (e.g., DistMult) or ComplEx (e.g., ComplEx). Second, when the embedded vector is partitioned, different SFs combine the embedded vector in different ways, e.g., analog v.s. When the embedded vector is a complex number, a d-dimensional complex vector may be replaced by using a 2 d-dimensional real vector, for example, setting h to h r+ihiWherein, in the step (A),
Figure BDA0002041737390000096
(similarly, the same setting method applies for the embedded vectors r and t as well), then ComplEx can be expressed as:
Re(<h,r,cnj(t)>)=(hr,rr,tr)+<hi,rr,ti>+<hr,ri,ti>-<hi,ri,tr>。
based on such extension, the embedded vector can be
Figure BDA0002041737390000097
Is divided into h ═ h1;h2;h3;h4](similarly, the embedded vectors r and t are also segmented in the same way), therefore, each scoring function in Table 1 can be recomposed as:
DistMult:f(h,r,t)=<h1,r1,t1>+<h2,r2,t2>+<h3,r3,t3>+<h4,r4,t4>,
ComplEx:f(h,r,t)=<h1,r1,t1>+<h1,r3,t3>+<h3,r1,t3>+<h2,r2,t2>+<h2,r4,t4>+<h4,r2,t4>-<h3,r3,t1>-〈h4,r4,t2>,
Analogy:f(h,r,t)=<h1,r1,t1>+<h2,r2,t2>+<h3,r3,t3>+<h3,r4,t4>+<h4,r3,t4>-<h4,r4,t3>,
SimplE:f(h,r,t)=<h1,r1,t3>+<h2,r2,t4>+<h3,r3,t1>+<h4,r4,t2>.
the above-mentioned recombined form of the scoring function is equivalent to a bilinear function h having a relationship matrix R of a different formTRt。
Setting up
Figure BDA0002041737390000101
Where i ∈ {1, 2, 3, 4}, the form of the relationship matrix R after recombination for each scoring function in table 1 can be as shown in fig. 2.
Fig. 2 is a diagram showing a relationship matrix of four scoring functions.
Specifically, fig. 2 shows a diagram of the relationship matrix after the scoring functions DistMult, ComplEx, analog, and SimpIE in table 1 are reorganized. The relationship matrix is a block matrix having dimensions equal to the number of sub-embedded vectors into which the embedded vector is partitioned, e.g. if the embedded vector is partitioned as described above
Figure BDA0002041737390000102
Is divided into four sub-embedded vectors (i.e., h ═ h)1;h2;h3;h4]) And the embedding vectors r and t are also divided in the same division manner, the block matrix is a 4 × 4 block matrix.
The main difference between the relationship matrices R of the scoring functions DistMult, ComplEx, analog and SimpIE after recombination is that the diagonal matrix is put in place, as shown in (a), (b), (c) and (d) of FIG. 2
Figure BDA0002041737390000103
And
Figure BDA0002041737390000104
the 4 x 4 block matrix in fig. 2 is filled differently in ways (including location and sign). The blank block in the 4 x 4 block matrix is a zero matrix. As can be seen from FIG. 2, the sub-embedding vector r1、r2、r3、r4All appear in the block matrix
Thus, in an exemplary embodiment of the invention, the unified representation f (h, r, t) of the scoring function may be constructed by the construction unit 110 as follows:
Figure BDA0002041737390000105
wherein the embedded vectors h, r and t are divided into K sub-embedded vectors h according to the same division manner1To hK、r1To rKAnd t1To tKThe structure function g (r) is a K × K block matrix corresponding to the scoring function f (h, r, t) [ g (r)]ij=diag(aij),[g(r)]ijBlocks representing the ith row and jth column in the block matrix, aij∈{0,±r1,...,±rK1 ≦ i ≦ K, 1 ≦ j ≦ K, and K is a positive integer.
In the embodiment of the present invention, being divided in the same division manner means that K sub-embedded vectors h obtained by dividing the embedded vectors h, r, and t1To hK、r1To rKAnd t1To tKThe corresponding sub-embedding vectors have the same dimension, i.e., h1、r1And t1Dimension is the same, h2、r2And t2The dimensions are the same, and so on. Furthermore, in embodiments of the present invention, in partitioning, the embedding vectors h, r, and t may be partitioned uniformly (i.e., dimensions of each sub-embedding vector are the same, e.g., sub-embedding vector h 1To hKSame dimension) or may be non-uniformly partitioned (i.e., dimensions of individual sub-embedding vectors are not exactly the same, e.g., sub-embedding vector h1To hKAre not all the same). Further, herein, for convenience of understanding, the description is made with an example in which the embedding vectors h, r, and t are respectively divided into 4 sub-embedding vectors, but it should be understood that they may be divided into any other number of sub-embedding vectors.
After establishing the unified representation f (h, r, t) of the scoring function as above, the construction unit 110 may construct a scoring function search space based on the unified representation. In particular, based on the above unified representation, the main difference between the relationship matrices R due to the different scoring functions is the diagonal matrix diag (a)ij) The way the K × K block matrix is filled is different, so after the embedded vectors h, r and t are partitioned, the non-zero blocks in the K × K block matrix (i.e., the sub-embedded vectors ± r) can be according to the structure function g (r)1,...,±rK) And designing a plurality of candidate scoring functions to form a scoring function search space.
The search unit 120 may search out a corresponding scoring function in the scoring function search space for a particular knowledge-graph.
In the embodiment of the invention, in combination with the above construction method of the scoring function search space, a proper scoring function is searched in the scoring function search space for a specific knowledge graph, and the proper K × K block matrix which can be actually converted into the structural function g (r) of the scoring function is found out to be a proper block matrix structure (i.e. sub-embedded vectors ± r 1,...,±rKDistribution structure in the block matrix) and then based on the blockThe matrix structure determines the corresponding scoring function.
Accordingly, the search unit 120 may first search for an optimal block matrix structure G in a structure search space G including a plurality of block matrix structures G corresponding to the scoring function search space*And determining a corresponding embedding vector h*、r*And t*
For the specific knowledge-graph, the search unit 120 may determine an optimal block matrix structure g according to expression (2) as follows*And a corresponding embedding vector h*、r*And t*
g*∈argg∈GmaxM(F*(h*,r*,t*),Sval)
s.t.F*(h*,r*,t*)=argh,g(r),tmaxM(F(h,r,t),Stra)....(2)
In expression (2) above, g indicates a block matrix structure corresponding to a structure function g (r), indicating the distribution of non-zero blocks in a K × K block matrix of g (r), F (h, r, t) is a knowledge-graph embedding model, M (F (h, r, t), S) measures performance index scores of F (h, r, t) based on a set of triples S, SvalIs a verification set, StraIs a training set, and SvalAnd StraRespectively, a subset of the set of triples of the specific knowledge-graph, F*(h*,r*,t*) Based on a scoring function corresponding to a block matrix structure G in a structure search space G, using a training set StraA knowledge-graph embedded model with the highest performance indicator score obtained by model training F (h, r, t), and h *、r*And t*Is obtained by the model training and F*(h*,r*,t*) Corresponding embedded vector, g*Is in the structure search space G and in the verification set SvalF with the highest performance index score*(h*,r*,t*) Corresponding block matrix structure. In exemplary embodiments of the present invention, existing ones and future ones may be usedVarious suitable model training methods may be present to perform the above-described model training, which are known to those skilled in the art and therefore will not be redundantly described for the sake of brevity.
As shown in expression (2), the above expression (2) actually includes two levels of optimization, and first, a knowledge-graph embedding model of a specific knowledge-graph may be trained based on a scoring function having a matrix structure g of the specific block and on a training set StraTo obtain F*(h*,r*,t*) Then in the verification set SvalThe property M corresponding to the structure g is measured, whereby the structure g having the best properties can be obtained*Determining a block matrix structure of a scoring function of the specific knowledge graph, and embedding a corresponding embedded vector h obtained by training*、r*And t*Determining an embedding vector to use for a scoring function of the particular knowledge-graph.
It should be understood, however, that g has for a 4 x 4 block matrix, for example, when K is 4 (i.e., the embedded vectors h, r, and t are divided into 4 sub-embedded vectors, respectively)
Figure BDA0002041737390000121
There are possible structures (9 choices for each sub-block, i.e., 0, ± r)1,...,±r4) I.e. the structure search space G comprises
Figure BDA0002041737390000122
And (4) a structure. Therefore, when g is found using the above expression (2)*The search process may be quite complex, making it difficult to quickly and easily search for G in the structural search space G*
Therefore, according to an embodiment of the present invention, in order to optimize the process of searching for a block matrix structure, when a scoring function search space is set, the following constraints (1) to (4) may be satisfied by a scoring function in the scoring function search space:
(1) for an appropriate r, the block matrix g (r) corresponding to the scoring function f (h, r, t) is symmetric or anti-symmetric;
(2) no zero rows and/or zero columns in the block matrix g (r);
(3) the block matrix g (r) includes all K sub-embedded vectors r of the embedded vector r1To rK(ii) a And is
(4) There are no repeating rows and/or columns in the block matrix g (r).
That is, in searching a corresponding scoring function for a specific knowledge graph, G can be determined among structures by finding only the structure satisfying the above condition in the structure search space G and substituting the expression (2) into the structures*Without training and calculating all structures in the exhaustive G.
Specifically, the above constraint (1) may be used to judge the expressiveness of the scoring function. Expressive power means the ability of a scoring function to process common relationships in a knowledge graph, common relationships including, for example, symmetric (f (T, r, h) ═ f (h, r, T), g (r) T ═ g (r)), antisymmetric (f (T, r, h) ═ f (h, r, T),
Figure BDA0002041737390000132
) Generally asymmetric (f (t, r, h) ≠ f (h, r, t),
Figure BDA0002041737390000133
) And the inverse relationship (f (t, r, h) ═ f (h, r', t),
Figure BDA0002041737390000134
)。
in addition, the above constraints (2) - (4) can be used to judge the quality of the scoring function. Specifically, for constraint (2), if there are zero rows/columns in the block matrix g (r), then the corresponding dimension in h or t is useless if the entity is only present in the training set StraHead or tail, then the portion of h or t corresponding to zero row/column is never optimized. For constraint (3), if some sub-embedding vectors r are not included in the block matrix g (r)iThen r is corresponding toiWill not be used. Finally, for constraint (4), if two rows/columns have the same content, then the two rows will be equivalent, which will reduce the effectiveness of the embedding parameters.
In the illustrative embodiment of the inventionIn an embodiment, a progressive greedy algorithm may be used to find block matrix structures in the structure search space G that satisfy the constraints described above, substituting them into expression (2) to determine G in these structures*. Hereinafter, for convenience of explanation, explanation is made taking an example in which the embedding vectors h, r, and t are respectively divided into 4 sub-embedding vectors.
Specifically, the progressive greedy algorithm used by the present application involves the following two algorithms.
Algorithm 1: candidate generation
Figure BDA0002041737390000131
And 2, algorithm: progressive greedy search algorithm
Figure BDA0002041737390000141
Briefly, in connection with the above-listed example, for a particular knowledge-graph, the searching unit 120 may first determine the number b of non-zero blocks in the block matrix structure to be used, and then determine the training score function candidate set corresponding to the block matrix structure with the number b of non-zero blocks in the structure search space G using the above algorithm. Then, the search unit 120 may obtain the corresponding F through model training based on the scoring function in the training scoring function candidate set by using the aforementioned expression (1)*(h*,r*,t*) And will be compared with the verification set SvalF with the highest performance index score*(h*,r*,t*) The corresponding block matrix structure is determined as the optimal block matrix structure g corresponding to the number b of non-zero blocksb. Since the number of non-zero blocks in the block matrix structure may be different, for different numbers b of non-zero blocks, corresponding optimal structures may be determined respectively, and the optimal structures in the verification set S may be selectedvalThe structure that achieves the highest performance score is determined as g*
After determining the optimal block matrix structure g*And a corresponding embedding vector h*、r*And t*Thereafter, the search unit 120 may be based on the block matrix structure g*And embedding the vector h *、r*And t*Determining a corresponding scoring function f for the particular knowledge-graph*(h*,r*,t*)。
The process of determining the candidate set of training scoring function will be explained in more detail below in conjunction with algorithm 1 and algorithm 2 above.
When the structure function g (r) is a 4 × 4 block matrix, the number b of non-zero blocks in the block matrix is at least 4 to include r in consideration of the constraints (2) - (4)1To r4All, up to 16. In an embodiment of the present invention, the algorithm may gradually increase the number of non-zero blocks from the number b of non-zero blocks being 4 until a preset maximum number. The preset maximum number may be 4 × 4(═ 16), or may be set to another value that satisfies the algorithm stop condition. Considering the constraint (1), the number b may be increased by 2 at a time to avoid easily falling on the diagonal in the matrix.
Therefore, when b is 4, as shown in algorithm 2, the search unit 120 may generate a first training score function candidate set (i.e., T) based on a block matrix structure with a number of non-zero blocks of 4 in the structure search space G4). The first training scoring function candidate set may include available candidate scoring functions that satisfy constraints (2) - (4). In an embodiment of the present invention, as shown in step 2 of algorithm 2 above, the first training scoring function candidate set may include all scoring functions having a block matrix structure with a number of non-zero blocks of 4. The search unit 120 may obtain a performance indicator score associated with each candidate scoring function by performing model training of expression (1) based on each candidate scoring function in the first training scoring function candidate set (steps 2 and 3 of algorithm 2), and select K in the first training scoring function candidate set based on the score 1The individual scoring functions to form a set of expected scoring functions (i.e., C) corresponding to the number of non-zero blocks 44) (step 4 of Algorithm 2), said K1Is a positive integer.
Then b is increased by 2, and when b is 6, the unit is searched120 may be based on an expectation scoring function candidate set corresponding to a number of non-zero blocks of 4 (i.e., C)4) Algorithm 1 is used to generate an initial scoring function candidate set (i.e., H) corresponding to the number of non-zero blocks of 66) (step 7 of algorithm 2) wherein the candidate scoring functions in the initial candidate set of scoring function also satisfy constraints (2) - (4).
Specifically, in the exemplary embodiment of the present invention, by way of example only, when algorithm 1 is used to generate the above-described initial scoring function candidate set H6If the current initial scoring function candidate set H6Is smaller than a preset value N (N is a positive integer) (step 1 of algorithm 1), then a set C of desired scoring functions corresponding to the number 4 of non-zero blocks available according to algorithm 2 may be obtained4Randomly selecting a scoring function model f4(the number of non-zero blocks in its block matrix structure is 4) (step 2 of Algorithm 1), and then by arbitrarily generating two parameter terms
Figure BDA0002041737390000151
And
Figure BDA0002041737390000152
is added to f4To obtain a scoring function model f 6(the number of non-zero blocks in its block matrix structure is 6) (step 3 of Algorithm 1), if f6Not included in the current training score candidate set H6And with f6The corresponding block matrix g (r) satisfies the above constraints (2) - (4) (step 4 of algorithm 1), then f may be calculated6Add to current initial Scoring function candidate set H6(step 5 of algorithm 1). Such a generation step is repeatedly performed until the initial scoring function candidate set H6Is equal to N.
In an embodiment of the present invention, the search unit 120 may select K in the initial scoring function candidate set in an order of high to low performance based on the performance estimation of each candidate scoring function in the initial scoring function candidate set2With the candidate scoring function as a second training scoring function candidate set (i.e., T)6) Based on the second trainingCandidate scoring functions in the candidate set of scoring function are model-trained by expression (1) to obtain a performance indicator score associated with each candidate scoring function selected (steps 8-10 of algorithm 2), and then ranked at K in order of high to low performance indicator scores2Selecting the highest scoring K of the candidate scoring functions1A scoring function to form a candidate set of expected scoring functions (i.e., C) corresponding to the number of non-zero blocks 6 6) (step 11 of algorithm 2).
The search unit 120 may use a predictor p to predict each candidate scoring function in the initial training scoring function candidate set to obtain a performance estimate for each candidate scoring function to select the K2And (4) scoring the candidate. And, when said K is selected2After each candidate score, a score may be determined from the K2Each of the candidate scoring functions extracts features and updates the predictor using the extracted feature parameters (step 12 of algorithm 2), which may be used in the next operation of determining a candidate set of training scoring functions corresponding to a block matrix structure with a number of non-zero blocks of 8. Further, it should be appreciated that in exemplary embodiments of the present invention, the method of updating the predictor is not limited to the random gradient descent illustrated for use in algorithm 2 above, but may use any suitable method known to those skilled in the art.
In an embodiment of the invention, the predictor p may be designed such that a good performing candidate scoring function gets a higher performance ranking than a bad performing candidate scoring function (principle 1) and is able to learn based on a small number of samples (principle 2).
In particular, for principle 1, this means that the features extracted for the block matrix structure g are strongly related to the quality of the scoring function and should be easy to construct (independent of the value of r). While for principle 2 the number of features should be limited.
Based on the above principle, in an exemplary embodiment of the present invention, the predictor p is capable of identifying symmetry and/or antisymmetry of the block matrix g (r) corresponding to the scoring function f (h, r, t) based on the extracted features, and giving a low prediction to a scoring function corresponding to a block matrix having no symmetry or antisymmetry, i.e., the predictor p is designed to have symmetric-related features (SRF).
In embodiments of the present invention, by way of example only, as shown in FIG. 2, there may be each diagonal function in the block matrix g (r)
Figure BDA0002041737390000161
Dispense the appropriate scalar value upsiloniThen, then
Figure BDA0002041737390000162
And
Figure BDA0002041737390000163
is upsilon in the 1-dimensional degenerate form of1,υ2,υ3,υ4To, for
Figure BDA0002041737390000164
The following assignments were given:
(S1)υ1,υ2,υ3,υ4all having the same absolute value, e.g.
Figure BDA0002041737390000165
(S2) three of the absolute values are the same and the other is not, e.g.
Figure BDA0002041737390000166
(S3) two of them have the same absolute value, and the other two do not, e.g.
Figure BDA0002041737390000167
(S4) two of them have the same absolute value and the other two have the same absolute value, e.g.
Figure BDA0002041737390000173
(S5) all of these scalars v1,v2,v3,v4All having different absolute values, e.g.
Figure BDA0002041737390000174
For (S1) - (S5), a set of assignments may be generated by permuting and flipping the symbols. After deleting equivalent assignments only 45 different groups are sufficient and therefore less complex. Further, based on the specified 4 × 4 matrix, the symmetry and antisymmetric properties of g at each of (S1) - (S5) can be quickly checked. The symmetry and antisymmetry of the block matrix structure g may be determined by
Figure BDA0002041737390000171
(
Figure BDA0002041737390000172
Representing symmetry) and
Figure BDA0002041737390000175
(
Figure BDA0002041737390000176
representing antisymmetric) is effectively verified.
After searching the scoring function for the feature knowledge-graph, the embedded model training unit 130 may train the embedded model of the particular knowledge-graph using the searched scoring function, and the representing unit 140 may obtain the embedded representation of the particular knowledge-graph using the embedded model.
Further, although not shown in fig. 1, the automatic knowledge-graph embedding system 100 according to an exemplary embodiment of the present disclosure may further include: a machine learning model training unit (not shown) for training a machine learning model based on the obtained embedded representation of the specific knowledge graph to obtain a target machine learning model for performing at least one of relationship retrieval, semantic retrieval, intelligent recommendation, intelligent question answering, personalized recommendation, and content distribution; and a prediction unit (not shown) for performing a prediction task using the target machine learning model, wherein the prediction task includes at least one of relationship retrieval, semantic retrieval, intelligent recommendation, intelligent question answering, personalized recommendation, and content distribution.
FIG. 3 is a flowchart illustrating an automatic knowledge-graph embedding method 300 according to an exemplary embodiment of the present disclosure.
As shown in fig. 3, in step S310, a unified representation of the scoring function for the knowledge-graph embedded model may be established by the construction unit 110 described above.
In step S320, the construction unit 110 may further construct a scoring function search space based on the unified representation.
Thereafter, in step S330, the search unit 120 may search out a corresponding scoring function in the scoring function search space for a specific knowledge graph.
The searched scoring function may be used by the embedded model training unit 130 to train the embedded model of the particular knowledge-graph at step 340, and the representing unit 140 may obtain the embedded representation of the particular knowledge-graph using the embedded model at step S350.
The detailed process of the detailed operations performed by the above-mentioned components of the automatic knowledge-graph embedding system 100 according to the exemplary embodiment of the present disclosure has been described in detail above with reference to fig. 1, and therefore, for brevity, will not be described again here.
Furthermore, the automatic knowledge graph embedding method according to the exemplary embodiment of the present disclosure may train a machine learning model based on the embedded representation of the specific knowledge graph obtained in step S350, obtain a target machine learning model for performing at least one of relationship retrieval, semantic retrieval, intelligent recommendation, intelligent question answering, personalized recommendation, and content distribution, and may perform a prediction task using the target machine learning model, wherein the prediction task includes at least one of relationship retrieval, semantic retrieval, intelligent recommendation, intelligent question answering, personalized recommendation, and content distribution.
That is, the automatic knowledge-graph embedding method and system of the exemplary embodiments of the present disclosure may be applied to various fields, such as relationship retrieval, semantic retrieval, smart recommendation, smart question answering, personalized recommendation, anti-fraud, content distribution, and the like.
By way of example only, among the various application scenarios of the automatic knowledge-graph embedding method and system according to the exemplary embodiments of the present disclosure, for example, for retrieval (such as relationship retrieval, semantic retrieval, intelligence, etc.), the relationship between them may be retrieved or the corresponding other entity may be retrieved by inputting two keywords, for example, inputting (beijing china) may retrieve that the relationship between them is "capital" (i.e., beijing is the capital of china), or inputting (mother Zhang three) may retrieve another entity "Liquanling" (mother Zhang three).
For example, for intelligent question-answering, input "where are the capital of china? The user can accurately return to Beijing, so that the intention of the user can be really understood through the knowledge graph.
For example, for anti-fraud, when information about a borrower (entity) is added to the knowledge-graph, it may be determined whether there is a risk of fraud by reading the relationship between the borrower and others in the knowledge-graph, or whether the information they share is consistent.
For example, for intelligent recommendations (e.g., personalized recommendations), similar content may be recommended to entities of triples having similar relationships. For example, for (three students, high and middle) (i.e., three is a student in high and middle), three may be recommended based on information of other students in high and middle in the knowledge-graph.
In the above different applications of the knowledge graph, evaluation indexes for judging whether the knowledge graph has been properly applied are also different. For example, for search applications, the evaluation index is generally the overall rate and accuracy of the search, for anti-fraud, the evaluation index is generally the credit, probability of fraud, etc., and for intelligent question answering and intelligent recommendation, the evaluation index is the satisfaction or accuracy, etc. Therefore, the evaluation index of the knowledge-graph embedded model is generally determined according to different application scenarios of the knowledge-graph embedded model, and a corresponding scoring function is designed accordingly, so that the embedded model which trains a better knowledge graph can be used by utilizing a better scoring function. According to the scoring function searched out according to the exemplary embodiment of the invention, the best scoring function model can be found by automatically combining the evaluation indexes in the searching process, and the inconvenience of manually designing the scoring function is eliminated. In addition, the search space established according to the uniform representation of the scoring function can cover all possible scoring function forms, so that the search range is favorably expanded, and a better scoring function is found for a specific knowledge graph.
By applying the automatic knowledge-graph embedding method and system according to the exemplary embodiments of the present invention, it is possible to automatically search the scoring function of a given knowledge-graph. In addition, since a predictor with specially designed symmetrical correlation characteristics is used for predicting the scoring function in the searching process, poor scoring functions can be avoided from being trained, so that the training time of the scoring function can be reduced while the expressive force of candidate scoring functions can be accurately obtained, and the searching process is accelerated.
Automatic knowledge-graph embedding methods and systems according to exemplary embodiments of the present disclosure have been described above with reference to fig. 1-3. However, it should be understood that: the apparatus and systems shown in the figures may each be configured as software, hardware, firmware, or any combination thereof that performs the specified function. For example, the systems and apparatuses may correspond to an application-specific integrated circuit, a pure software code, or a module combining software and hardware. Further, one or more functions implemented by these systems or apparatuses may also be performed collectively by components in a physical entity device (e.g., a processor, a client, or a server, etc.).
Further, the above method may be implemented by instructions recorded on a computer-readable storage medium, for example, according to an exemplary embodiment of the present application, there may be provided a computer-readable storage medium storing instructions that, when executed by at least one computing device, cause the at least one computing device to perform the steps of: establishing a unified representation of a scoring function for the knowledge graph embedding model; constructing a scoring function search space based on the unified representation; searching a corresponding scoring function in the scoring function search space aiming at a specific knowledge graph; training an embedded model of the particular knowledge-graph using the searched scoring function; and obtaining an embedded representation of the particular knowledge-graph using the embedded model.
The instructions stored in the computer-readable storage medium can be executed in an environment deployed in a computer device such as a client, a host, a proxy device, a server, and the like, and it should be noted that the instructions can also be used to perform additional steps other than the above steps or perform more specific processing when the above steps are performed, and the contents of the additional steps and the further processing are mentioned in the description of the related method with reference to fig. 1 to 3, and therefore will not be described again here to avoid repetition.
It should be noted that the automatic knowledge-graph embedding system according to the exemplary embodiments of the present disclosure may fully rely on the execution of a computer program or instructions to implement the corresponding functions, i.e., each device corresponds to each step in the functional architecture of the computer program, so that the entire system is called by a special software package (e.g., lib library) to implement the corresponding functions.
On the other hand, when the system and apparatus shown in fig. 1 are implemented in software, firmware, middleware or microcode, program code or code segments to perform the corresponding operations may be stored in a computer-readable medium such as a storage medium, so that at least one processor or at least one computing device may perform the corresponding operations by reading and executing the corresponding program code or code segments.
For example, according to an exemplary embodiment of the present application, a system may be provided comprising at least one computing device and at least one storage device storing instructions, wherein the instructions, when executed by the at least one computing device, cause the at least one computing device to perform the steps of: establishing a unified representation of a scoring function for the knowledge graph embedding model; constructing a scoring function search space based on the unified representation; searching a corresponding scoring function in the scoring function search space aiming at a specific knowledge graph; training an embedded model of the particular knowledge-graph using the searched scoring function; and obtaining an embedded representation of the particular knowledge-graph using the embedded model.
In particular, the above-described system may be deployed in a server or client or on a node in a distributed network environment. Further, the system may be a PC computer, tablet device, personal digital assistant, smart phone, web application, or other device capable of executing the set of instructions. In addition, the system may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, mouse, touch input device, etc.). In addition, all components of the system may be connected to each other via a bus and/or a network.
The system here need not be a single system, but can be any collection of devices or circuits capable of executing the above instructions (or sets of instructions) either individually or in combination. The system may also be part of an integrated control system or system manager, or may be configured as a portable electronic device that interfaces with local or remote (e.g., via wireless transmission).
In the system, the at least one computing device may comprise a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. By way of example, and not limitation, the at least one computing device may also include analog processors, digital processors, microprocessors, multi-core processors, processor arrays, network processors, and the like. The computing device may execute instructions or code stored in one of the storage devices, which may also store data. Instructions and data may also be transmitted and received over a network via a network interface device, which may employ any known transmission protocol.
The memory device may be integrated with the computing device, for example, by having RAM or flash memory disposed within an integrated circuit microprocessor or the like. Further, the storage device may comprise a stand-alone device, such as an external disk drive, storage array, or any other storage device usable by a database system. The storage device and the computing device may be operatively coupled or may communicate with each other, such as through I/O ports, network connections, etc., so that the computing device can read instructions stored in the storage device.
While exemplary embodiments of the present application have been described above, it should be understood that the above description is exemplary only, and not exhaustive, and that the present application is not limited to the exemplary embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the present application. Therefore, the protection scope of the present application shall be subject to the scope of the claims.

Claims (10)

1. An automatic knowledge-graph embedding method, the method comprising:
establishing a unified representation of a scoring function for the knowledge graph embedding model;
constructing a scoring function search space based on the unified representation;
Searching a corresponding scoring function in the scoring function search space aiming at a specific knowledge graph;
training an embedded model of the particular knowledge-graph using the searched scoring function; and
obtaining an embedded representation of the particular knowledge-graph using the embedded model.
2. The method of claim 1, wherein the unified representation of the scoring function is:
Figure FDA0002041737380000011
wherein h, t and r respectively represent embedding vectors of a head entity h, a tail entity t and a relation r between h and t in a triplet (h, r, t) of the knowledge graph, and h, r and t are respectively divided into K sub-embedding vectors h according to the same division mode1To hK、r1To rKAnd t1To tK
Structure of the productThe function g (r) is a K block matrix corresponding to the scoring function f (h, r, t) [ g (r)]ij=diag(aij),[g(r)]ijBlocks representing the ith row and jth column in the block matrix, aij∈{0,±r1,...,±rK1 ≦ i ≦ K, 1 ≦ j ≦ K, and K is a positive integer.
3. The method of claim 2, wherein the step of searching the respective scoring functions comprises:
searching for an optimal block matrix structure G in a structure search space G including a plurality of block matrix structures G corresponding to a scoring function search space based on the following expression*And determines a corresponding embedding vector h *、r*And t*
g*∈argg∈GmaxM(F*(h*,r*,t*),Sval)
s.t.F*(h*,r*,t*)=argh,g(r),tmaxM(F(h,r,t),Stra)
Wherein g is a block matrix structure corresponding to a structure function g (r) indicating the distribution of non-zero blocks in the K x K block matrix, F (h, r, t) is a knowledge-graph embedding model, M (F (h, r, t), S) measures performance indicator scores of F (h, r, t) based on a set of triples S, SvalIs a verification set, StraIs a training set, and SvalAnd StraRespectively, a subset of the set of triples of the specific knowledge-graph, F*(h*,r*,t*) Based on a scoring function corresponding to a block matrix structure G in a structure search space G, using a training set StraEmbedding a knowledge graph with the highest performance index score obtained by model training F (h, r, t) into a model and h*、r*And t*Is obtained by the model training and F*(h*,r*,t*) Corresponding embedded vector, g*Is in the structure search space G and in the verification set SvalF with the highest performance index score*(h*,r*,t*) A corresponding block matrix structure;
based on the block matrix structure g*And embedding the vector h*、r*And t*Determining said respective scoring function f*(h*,r*,t*)。
4. The method of claim 3, wherein the scoring function in the scoring function search space satisfies the following constraints (1) - (4):
(1) for an appropriate r, the block matrix g (r) corresponding to the scoring function f (h, r, t) is symmetric or anti-symmetric;
(2) No zero rows and/or zero columns in the block matrix g (r);
(3) the block matrix g (r) includes all K sub-embedded vectors r of the embedded vector r1To rK(ii) a And is
(4) There are no repeating rows and/or columns in the block matrix g (r).
5. The method of claim 4, wherein the block matrix structure g is searched*Comprises the following steps:
the number b of non-zero blocks in the block matrix structure to be used is determined, where b ═ K, K +2, …, K × K,
determining a training scoring function candidate set corresponding to a block matrix structure with the number b of non-zero blocks in the structure search space G;
obtaining corresponding F through model training based on the scoring function in the training scoring function candidate set*(h*,r*,t*);
Will be associated with the verification set SvalF with the highest performance index score*(h*,r*,t*) The corresponding block matrix structure is determined as the optimal block matrix structure g corresponding to the number b of non-zero blocksb
G to correspond to the number b of different non-zero blocksbIn the verification set SvalThe structure that achieves the highest performance score is determined as g*
6. The method of claim 5, wherein determining a candidate set of training scoring function comprises:
if b is equal to K, the following operations are carried out:
generating a first training scoring function candidate set based on a block matrix structure of a number K of non-zero blocks in the structure search space G, wherein the first training scoring function candidate set includes available candidate scoring functions satisfying constraints (2) - (4),
Obtaining a performance indicator score associated with each candidate scoring function by performing the model training based on each candidate scoring function in the first training scoring function candidate set,
selecting K in a first training scoring function candidate set based on the score1A scoring function to form a candidate set of expected scoring functions corresponding to the number K of non-zero blocks, where K is1Is a positive integer;
if b is greater than K, the following operations are performed:
generating an initial scoring function candidate set corresponding to the number b of non-zero blocks based on the desired scoring function candidate set corresponding to the number b-2 of non-zero blocks, wherein the initial scoring function candidate set includes a plurality of available candidate scoring functions that satisfy constraints (2) - (4),
selecting K in the initial scoring function candidate set according to the ranking of the performance from high to low based on the performance estimation of each candidate scoring function in the initial scoring function candidate set2The candidate scoring function is used as a second training scoring function candidate set, wherein K2Is a positive integer, and K2≤K1
Obtaining a performance indicator score associated with each candidate scoring function selected by performing the model training based on the candidate scoring functions in the second training scoring function candidate set,
Scoring at said K according to a performance index2Selecting K from candidate scoring functions1A scoring function to form a number of non-zero blocksThe amount b corresponds to the candidate set of expectation scoring functions.
7. The method of claim 6, wherein the performance estimate is obtained using a predictor to predict each candidate scoring function in an initial scoring function candidate set, and
the operation of determining a candidate set of training scoring function further comprises:
from said K2Each candidate scoring function of the candidate scoring functions extracts features and updates the predictor using the extracted feature parameters,
wherein the updated predictor is used in the operation of determining a training scoring function candidate set corresponding to a block matrix structure with the number of non-zero blocks being b + 2.
8. An automated knowledge-graph embedding system, the system comprising:
a construction unit configured to establish a unified representation of a scoring function for a knowledge-graph embedding model and construct a scoring function search space based on the unified representation;
a search unit configured to search out a corresponding scoring function in the scoring function search space for a specific knowledge graph;
an embedded model training unit configured to train an embedded model of the specific knowledge-graph using the searched scoring function; and
A representation unit configured to obtain an embedded representation of the particular knowledge-graph using the embedded model.
9. A computer-readable storage medium storing instructions that, when executed by at least one computing device, cause the at least one computing device to perform the method of any of claims 1 to 7.
10. A system comprising at least one computing device and at least one storage device storing instructions that, when executed by the at least one computing device, cause the at least one computing device to perform the method of any of claims 1 to 7.
CN201910344161.5A 2019-04-26 2019-04-26 Automatic knowledge graph embedding method and system Pending CN111858947A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910344161.5A CN111858947A (en) 2019-04-26 2019-04-26 Automatic knowledge graph embedding method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910344161.5A CN111858947A (en) 2019-04-26 2019-04-26 Automatic knowledge graph embedding method and system

Publications (1)

Publication Number Publication Date
CN111858947A true CN111858947A (en) 2020-10-30

Family

ID=72951718

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910344161.5A Pending CN111858947A (en) 2019-04-26 2019-04-26 Automatic knowledge graph embedding method and system

Country Status (1)

Country Link
CN (1) CN111858947A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112765287A (en) * 2021-02-05 2021-05-07 中国人民解放军国防科技大学 Method, device and medium for mining character relation based on knowledge graph embedding
CN113377964A (en) * 2021-06-30 2021-09-10 武汉大学 Knowledge graph link prediction method, device, equipment and storage medium
CN113626612A (en) * 2021-08-13 2021-11-09 第四范式(北京)技术有限公司 Prediction method and system based on knowledge graph reasoning
CN115631008A (en) * 2021-07-16 2023-01-20 腾讯科技(深圳)有限公司 Commodity recommendation method, commodity recommendation device, commodity recommendation equipment and commodity recommendation medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112765287A (en) * 2021-02-05 2021-05-07 中国人民解放军国防科技大学 Method, device and medium for mining character relation based on knowledge graph embedding
CN112765287B (en) * 2021-02-05 2022-04-19 中国人民解放军国防科技大学 Method, device and medium for mining character relation based on knowledge graph embedding
CN113377964A (en) * 2021-06-30 2021-09-10 武汉大学 Knowledge graph link prediction method, device, equipment and storage medium
CN115631008A (en) * 2021-07-16 2023-01-20 腾讯科技(深圳)有限公司 Commodity recommendation method, commodity recommendation device, commodity recommendation equipment and commodity recommendation medium
CN115631008B (en) * 2021-07-16 2024-02-13 腾讯科技(深圳)有限公司 Commodity recommendation method, device, equipment and medium
CN113626612A (en) * 2021-08-13 2021-11-09 第四范式(北京)技术有限公司 Prediction method and system based on knowledge graph reasoning

Similar Documents

Publication Publication Date Title
US11669744B2 (en) Regularized neural network architecture search
CN111858947A (en) Automatic knowledge graph embedding method and system
US20240211751A1 (en) Attention-based decoder-only sequence transduction neural networks
WO2018145604A1 (en) Sample selection method, apparatus and server
JP2022058915A (en) Method and device for training image recognition model, method and device for recognizing image, electronic device, storage medium, and computer program
CN111506714A (en) Knowledge graph embedding based question answering
US20190164084A1 (en) Method of and system for generating prediction quality parameter for a prediction model executed in a machine learning algorithm
US20210232929A1 (en) Neural architecture search
CN108959474B (en) Entity relation extraction method
WO2023124005A1 (en) Map point of interest query method and apparatus, device, storage medium, and program product
WO2020224220A1 (en) Knowledge graph-based question answering method, electronic device, apparatus, and storage medium
WO2020215694A1 (en) Chinese word segmentation method and apparatus based on deep learning, and storage medium and computer device
CN115146068B (en) Method, device, equipment and storage medium for extracting relation triples
JP2023536773A (en) Text quality evaluation model training method and text quality determination method, device, electronic device, storage medium and computer program
CN112905809B (en) Knowledge graph learning method and system
CN112420125A (en) Molecular attribute prediction method and device, intelligent equipment and terminal
CN110837567A (en) Method and system for embedding knowledge graph
CN112667797B (en) Question-answer matching method, system and storage medium for self-adaptive transfer learning
JP7504192B2 (en) Method and apparatus for searching images - Patents.com
US20230070966A1 (en) Method for processing question, electronic device and storage medium
US20230297625A1 (en) Utilizing a graph neural network to generate visualization and attribute recommendations
CN113010687B (en) Exercise label prediction method and device, storage medium and computer equipment
CN115169433A (en) Knowledge graph classification method based on meta-learning and related equipment
WO2022188080A1 (en) Image classification network model training method, image classification method, and related device
CN111506742A (en) Method and system for constructing multivariate relational knowledge base

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