A link prediction method based on knowledge graph embedding model

By allocating different embedding representation spaces to instances and concepts in the knowledge graph and introducing concept hierarchy parameters, the existing model's problems of insufficient entity embedding and difficulty in hierarchical modeling in sparse graphs are solved, and the representation of the knowledge graph is improved. Learning and link prediction effects.

CN115098699BActive Publication Date: 2024-09-06NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210728837.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-24
Publication Date
2024-09-06
Estimated Expiration
2042-06-24

AI Technical Summary

Technical Problem

When existing knowledge graph embedding models deal with sparse graphs, entity embedding representation learning is insufficient and cannot effectively model the differences and conceptual hierarchies between instances and concepts, which affects the model effect.

Method used

An instance and concept knowledge graph representation model STCI based on space transformation is proposed. By modeling instances and concepts in different embedding representation spaces, and using the transitivity of the subclassof relationship and the cross-view association model, the concept's neighbors are increased. Domain scope parameter to distinguish the hierarchical structure of different concepts.

Benefits of technology

It effectively alleviates the problem of entity embedding representation aggregation, improves the representation learning quality of knowledge graphs, can better handle situations where the same instance belongs to different concepts and concept hierarchies, and improves the accuracy of link prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115098699B
    Figure CN115098699B
Patent Text Reader

Abstract

The present invention discloses a link prediction method based on a knowledge graph embedding model, comprising: obtaining a knowledge graph; separately modeling instanceof triples, modeling subclassof triples in concept triples using the transitivity of subclassof relations, uniformly classifying triples and instance triples in concept triples except subclassof triples as relation triples and modeling; training using a loss function based on marginal parameters as an optimization target; minimizing the loss function using a stochastic gradient descent algorithm, and obtaining hyperparameters of the model after training; inputting relation triples with missing head entities or tail entities into the model, and outputting prediction results. The present invention alleviates the problem of clustering of embedded representations of instances and concepts caused by modeling instances and concepts in the same space, thereby affecting the model effect, and well models the concept hierarchy and transitivity of the isA relationship.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of link prediction, and in particular relates to a link prediction method based on a knowledge graph embedding model. Background Art

[0002] Knowledge graphs describe entities and their relationships in the physical world in the form of triples (h, r, t). Knowledge representation learning is a key technology for the construction and application of knowledge graphs. By representing the semantic information of triples as dense low-dimensional vectors in continuous space, it can support knowledge graph calculation and reasoning while retaining the specific attributes of the original graph. It is an important foundation for supporting downstream tasks of intelligent information service applications such as intelligent search, intelligent question and answer, and personalized recommendation.

[0003] Knowledge representation learning has become a research hotspot in recent years. Researchers have proposed a variety of models to learn the representation of entities and relations in knowledge graphs. TransE, which regards relations as the transformation from the head entity to the tail entity, is regarded as a classic model because of its simplicity and efficiency. Later researchers have successively proposed Trans series improved models such as TransH, models based on semantic matching such as DistMult, and models based on neural networks such as R-GCN. Although these knowledge graph embedding models have achieved good experimental results, due to the sparsity of knowledge graphs, these models are not sufficient for learning the embedding representation of entities. By analyzing the entity distribution in the knowledge graph, it can be seen that the graph as a whole is highly sparse. Long-tail entities that are only connected to one or two other entities occupy most of the knowledge graph entities, so that only a small number of entities with rich adjacency information can be frequently trained by the model and fully learned. Most entities are rarely mentioned in model training, which makes the representation learning of these entities insufficient. Therefore, methods based on auxiliary information such as entity type and entity description are proposed to enhance the representation learning of knowledge graphs, but these models put forward additional requirements on the samples of knowledge graphs.

[0004] For knowledge graphs containing concept and instance triplets, the knowledge graph representation model based on instances and concepts uses the latent semantic connections between concepts and instances in the graph itself to learn its representation, which can alleviate the problem of insufficient learning caused by graph sparsity without increasing the additional requirements of training samples. The latent semantic connection between concepts and instances includes two aspects: on the one hand, concepts provide basic category information for the instances they contain. For example, for a city "instance" A with fewer adjacent samples, since A has the basic category information of the concept "city" like other city instances, its embedded representation will not be too far from the embedded representation of other cities, and its embedded representation can be determined by observing the embedded representation of other cities in the embedded space; on the other hand, instances provide detailed information for their corresponding concepts. For example, the embedded representation of the concept "city" can be roughly determined by observing multiple single city instances in the embedded space. The latest representative research works on knowledge graph representation based on instances and concepts include TransC, JOIE, etc.

[0005] TransC models the semantic connection between instances and concepts by using the relative position relationship between points and balls in the same space. However, TransC does not consider the differences between instances and concepts and models them in the same space, which makes similar instances cluster in the space and affects the effect of the model. There are differences between instances and concepts. Instances are specific, and each instance points to a unique and specific physical object, while concepts are abstractions of a certain type of instances and can be regarded as categories of instances. The two contain different amounts of information about the attributes of things. An instance may belong to multiple concepts, so it has more attribute information than concepts. For example, if a well-known actor is both an instance of the concept "actor" and an instance of "politician", it should have attribute information of the two concepts of "actor" and "politician". Concepts are more general and contain less attribute information than instances. If an instance contains more attribute information, it means that the embedding vector of the instance should require more information. Similar to drawing an abstract person and drawing Mona Lisa, compared to drawing a person, in addition to drawing the basic features of a person such as the basic body shape of a person (such as head, torso, arms, etc.), drawing Mona Lisa also needs to depict some details, such as her unique facial features, clothing, hairstyle, etc. Therefore, describing the portrait of Mona Lisa requires more "strokes" or more information than the portrait of an abstract person. Similarly, if the information required to represent the instance embedding vector is more, the dimension of the embedding vector used to represent the instance should be higher. Conversely, the concept contains less attribute information, and the dimension of its embedding representation vector should be lower. Therefore, we believe that the embedding representation of instances and concepts should belong to embedding representation spaces of different dimensions, and the dimension of the embedding representation space of instances is higher than that of concepts. Similar to the fact that the portrait of Mona Lisa has the basic characteristics of a human portrait, the instance should have all the attribute information of the concept to which it belongs. We believe that after mapping the embedding representation of the instance to the concept embedding representation space, it should be close to the embedding representation of the concept to which it belongs.

[0006] JOIE proposed a cross-view association model to learn the correlation between instances and concepts, but the model cannot handle the situation where the same instance belongs to different concepts, and ignores the hierarchy of concepts and cannot model the transitivity of the isA relationship (instanceof and subclassof are special relationships in the knowledge graph, called isA relationships). For example, a well-known actor is both an instance of the concept "actor" and an instance of the concept "politician". According to JOIE's cross-view model (CT model), the concepts "actor" and "politician" will be modeled as the same embedding representation vector, affecting the modeling effect of the model. Concepts are hierarchical, and concepts at different levels and granularities are connected through the subclassof relationship to form subclassof triples: (fine-grained concept, subclassof, coarse-grained concept). The two triplets (Singer, subclassof, Artist) and (Artist, subclassof, Person) form a tree hierarchy consisting of Singer, Artist, and Person, making these three concepts located at three different levels. However, the JOIE model does not model the hierarchy of concepts. The isA relationship is transitive. From the two triples (PabloAlborán,instanceof,Singer) and (Singer,subclassof,Artist), we can infer (Pablo Alborán,instanceof,Artist). From the two triples (Singer,subclassof,Artist) and (Artist,subclassof,Person), we can infer (Singer,subclassof,Person). However, the JOIE model cannot model the transitivity of the isA relationship. Summary of the invention

[0007] In view of this, the present invention proposes a knowledge graph representation model STCI of instances and concepts based on spatial transformation. On the one hand, it can alleviate the problem of clustering of embedded representations of instances and concepts caused by modeling instances and concepts in the same space, thus affecting the model effect. On the other hand, it can also model the concept hierarchy and the transitivity of isA relationships well.

[0008] The present invention discloses a link prediction method based on space conversion, comprising the following steps:

[0009] Obtain a knowledge graph KG = {C, I, R, S}, where C, I, R, S represent a concept set, an instance set, a relationship set, and a triple set, respectively; the triple set S includes a concept triple in which both the head entity and the tail entity are composed of concepts, an instance triple in which both the head entity and the tail entity are composed of instances, and an instanceof triple in which the head entity and the tail entity are composed of instances and concepts, respectively;

[0010] For instanceof triples, since the head entity and the tail entity cannot be represented in the same embedding space, they are modeled separately. For subclassof triples in concept triples, the transitivity of subclassof relations is used for modeling. Triples other than subclassof triples and instance triples in concept triples are uniformly classified as relation triples and modeled.

[0011] Training is performed using a marginal parameter-based loss function as an optimization objective, wherein the loss function constrains the score of a positive triplet to be at least a marginal parameter γ less than the score of its negative triplet to improve the distinguishability between positive and negative samples;

[0012] A stochastic gradient descent algorithm is used to minimize the loss function. During model training, the L2 norms of all entities and relations in the relation triples, the instanceof triples, and the instances and concepts in the subclassof are constrained to be less than or equal to 1. After the training, the hyperparameters of the model are obtained.

[0013] Input the relation triple (h, r, t) with missing head entity or tail entity into the model, and output the prediction result t given (h, r) or h given (r, t).

[0014] Furthermore, instances and concepts are respectively embedded in the instance representation space and concept embedding representation space Indicates that the instance embedding represents the spatial dimension d e Than the concept embedding representation space dimension d c High, i.e. d e >d c .

[0015] Furthermore, the relation set R is formalized as Among them, r i Indicates instanceof relationship, r s Indicates the subclassof relationship, is the instance relation set, is divided by r s The set of conceptual relations outside the relation divides the triple set S into three disjoint subsets:

[0016] instanceof triple set Where i∈I, its embedding representation c∈C, whose embedding representation n e YesS e size;

[0017] subclassof triple set where c i 、c j ∈C, whose embedding representation c i It is c j Subconcept, n c YesS c size;

[0018] Relation triple set Where h, r, t∈C or h, r, t∈I, and their embedded representations are described by h, r, t respectively. or n r YesS r The size of is the set of instance relation triples, where h e , t e ∈I, yes The size of is a set of concept relation triples, where h c , t c ∈C, yes size.

[0019] Furthermore, for the instanceof triple (i,r i ,c) Modeling is as follows:

[0020] The embedding representations of instance i and concept c are e and o, respectively, in different embedding representation spaces; since instance i has the attribute information of concept c, the embedding representation e of instance i is close to the embedding representation vector o of concept c after mapping, that is: for instanceof triple (i, r i ,c), existence

[0021] f ins (e) → o

[0022] The instanceof triple is a many-to-many relationship, that is, a concept can contain multiple instances, and an instance can belong to multiple concepts. For the case where a concept corresponds to multiple instances, define f ins (e) is a nonlinear affine function, that is:

[0023] f ins (e) = σ(W·e+b)

[0024] in, is the weight matrix, is the bias vector, σ(·) is the nonlinear activation function;

[0025] For the case where the same instance may correspond to multiple different concepts, a learnable parameter δ is added to the embedding representation of each concept c , which represents the delta of o c Neighborhood scope, the embedded representation e of instance i is mapped, and the embedded vector representation o of concept c is δ c Within the scope of the neighborhood, that is:

[0026] ||f ins (e)-o||2≤δ c

[0027] Where ||·||2 is the Euclidean distance formula, δ c The meaning is: after training, the embedding representation e of instance i to which c belongs should be located at the center of the sphere with a radius of δ after mapping. c That is, after training, e will be mapped around the embedding representation of o instead of coinciding with point o, so as to solve the problem that different concepts corresponding to the same instance are clustered after training.

[0028] instanceof triple (i, r e , c) The objective function is defined as:

[0029] F e (e,o)=||f ins (e)-o||2-δ c .

[0030] Furthermore, for the subclassof triple (c i ,r s ,c j ) is modeled as follows:

[0031] Concept c i It is concept c j Subconcept of concept c i With concept c j In the same attribute space, then o i Should be in o j δ j Neighborhood scope; combined with the triple (i, r i , c i ) and (c i , r s , c j), according to the transitivity of the isA relationship, we can infer that (i, r i , c j ), thus, c i All instances belonging to it are embedded in o after mapping. j δ j Neighborhood scope:

[0032] If c i The embedded representations of all instances after mapping are in o j δ j Within the scope of neighborhood action, then o i δ i The neighborhood range is o j δ j Neighborhood scope, thus, the subclassof triple (c i , r c , c j ) is defined as:

[0033] F sub (o i ,o j )=||o i -o j ||2-(δ j -δ i ).

[0034] Furthermore, the relationship triple (h, r, t) is modeled as follows:

[0035] For instance-relation triples and concept triples, the embedding representations h, r, t are learned in the corresponding instance embedding representation space or concept embedding representation space respectively. The classic TransE model is used for modeling, and the objective function is defined as:

[0036] F r =||h+rt||2

[0037] This model can handle the transitivity of the subclassof relation; if there are two positive triple samples (c i , r s , c j ) and (c j , r s , c k ), according to the model, concept c i The embedding representation o i δ i The range of the hypersphere neighborhood is c j The embedding representation o j δ j Within the hypersphere neighborhood, oj δ j The range of the hypersphere neighborhood is o k δ k Within the scope of the hypersphere neighborhood, we can get o i δ i The range of the hypersphere neighborhood is also o k δ k Within the scope of the hypersphere neighborhood, that is, (c i , r s , c k ) is a positive sample; at the same time, through different concept parameters δ c To describe the hierarchical information of the concept, δ c The larger the value, the higher the concept level is, and vice versa.

[0038] Furthermore, a self-adversarial negative sampling method is used to sample negative triplets according to the current embedding model. Specifically, negative triplets are sampled from the following distribution:

[0039]

[0040] Among them, α is the sampling hyperparameter, F(h j ',r,t j ') is a candidate negative sampling triplet (h, r, t) j ',r,t j ') corresponds to the objective function value of the model.

[0041] Further, for instanceof triple set S e Define the loss function L based on the marginal parameter e :

[0042]

[0043] Where [x] + =max(0,x),γ e Used to represent the marginal hyperparameter of instanceof triples. For instanceof triples, ξ e and e ' represents positive triples and negative triples, S e and S e 'Used to describe positive triple sets and negative triple sets;

[0044] Subclass of triple set S c Define the loss function L based on the marginal parameter c :

[0045]

[0046] is the set of instance relation triples Define a loss function based on the margin parameter

[0047]

[0048] is a set of concept relation triples Define a loss function based on the margin parameter

[0049]

[0050] Finally, the overall loss function is defined as a linear combination of these four loss functions:

[0051]

[0052] Among them, β1, β2, β3>0, is L e , L c , as well as Hyperparameters that maintain a balance between

[0053] The beneficial effects of the present invention are as follows:

[0054] A new knowledge graph embedding model is proposed, which utilizes the latent semantic connection between concepts and instances to strengthen the representation learning of knowledge graphs and can effectively alleviate the problem of insufficient learning caused by sample sparsity.

[0055] By learning the embedding representations of concepts and instances in different spaces, the problem of different instances belonging to the same concept clustering in the embedding representation space can be effectively alleviated.

[0056] Adding a learnable parameter with a neighborhood scope to the concept embedding representation can effectively distinguish the hierarchical information of different concepts and alleviate the problem of different concepts corresponding to the same instance agglomerating in the embedding representation space. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 Flow chart of the link prediction method of the present invention;

[0058] Figure 2 Schematic diagram of the positional relationship between the head entity instance and the tail entity concept in the instanceof triple in two embedding representation spaces;

[0059] Figure 3 subclassof triple head entity c i The embedded representation of the instance to which it belongs after mapping in the concept embedding space and the tail entity c jPosition relationship diagram in concept embedding space. DETAILED DESCRIPTION

[0060] The present invention is further described below in conjunction with the accompanying drawings, but the present invention is not limited in any way. Any changes or substitutions made based on the teachings of the present invention belong to the protection scope of the present invention.

[0061] The knowledge graph KG describes entities and their relationships. Due to the differences between instances and concepts in entities, we embed instances and concepts in instance embedding representation space and concept embedding representation space Indicates that the instance embedding represents the spatial dimension d e The dimension d of the concept embedding representation space c To be high, that is, d e >d c . Therefore, we formally describe the knowledge graph as KG = {C, I, R, S}, where C, I, R, and S represent the concept set, instance set, relationship set, and triple set, respectively. The triple set S in the knowledge graph contains three types of triples: concept triples in which both the head entity and the tail entity are composed of concepts, instance triples in which both the head entity and the tail entity are composed of instances, and instanceof triples in which the head entity and the tail entity are composed of instances and concepts, respectively. For instanceof triples, since the head entity and the tail entity cannot be represented in the same embedding space, they need to be modeled separately. For the subclassof triple in the concept triple, the transitivity of the subclassof relationship can be used for modeling. For concept triples (except subclassof triples) and instance triples, since the head entity and the tail entity are represented in a unified embedding representation space, the same method can be used for modeling and they can be uniformly classified as relationship triples.

[0062] Therefore, the relation set R can be formalized as Among them, r i Indicates instanceof relationship, r s Indicates the subclassof relationship, is the instance relation set, is a set of concept relations (except r s Relation). The triple set S can be divided into three disjoint subsets:

[0063] 1.instanceof triple set Where i∈I, its embedding representation c∈C, whose embedding representation n e YesS e size.

[0064] 2.subclassof triple set where c i 、c j ∈C, whose embedding representation c i It is c j Subconcept, n c YesS c size.

[0065] 3. Relation Triple Set Where h, r, t∈C or h, r, t∈I, and their embedded representations are described by bold h, r, t, respectively. or n r YesS r size. is the set of instance relation triples, where h e , t e ∈I, yes size. is a set of concept relation triples, where h c , t c ∈C, yes size.

[0066] Next, we will follow S = {S e ∪S c ∪S r}, model and describe the three types of triples in the knowledge graph.

[0067] The present invention models three types of triples in the knowledge graph: instanceof triples, subclassof triples and relationship triples respectively, and the specific model is described as follows.

[0068] For instanceof triples (i,r i ,c). The embedded representations of instance i and concept c are e and o respectively, and should be in different embedded representation spaces. Since instance i has the attribute information of concept c, the present invention believes that the embedded representation e of instance i should be close to the embedded representation vector o of concept c after mapping, that is: for instanceof triple (i,r i ,c), existence

[0069] f ins (e)→o (1)

[0070] The instanceof triple is a many-to-many relationship, that is, a concept can contain multiple instances, and an instance can belong to multiple concepts. For the case where a concept corresponds to multiple instances, a mapping function f is designed. ins (e) needs to be considered for different e, f ins The value of (e) may be the same. The present invention defines f ins (e) is a nonlinear affine function, that is:

[0071] f ins (e) = σ(W·e+b) (2)

[0072] in, is the weight matrix, is the bias vector, σ(·) is the nonlinear activation function, and the present invention adopts tanh.

[0073] For the case where the same instance may correspond to multiple different concepts, if we directly define o = f ins (e), it is impossible to distinguish the cases where the same instance corresponds to different concepts. To this end, we add a learnable parameter δ to the embedding representation of each concept c , which represents the delta of o c Neighborhood. We believe that the embedded representation e of instance i should be located at δ of the embedded vector representation o of concept c after mapping. c The scope of the neighborhood is:

[0074] ||f ins (e)-o||2≤δ c (3)

[0075] Where ||·||2 is the Euclidean distance formula.

[0076] δ c The meaning can be understood as follows: after training, the embedding representation e of instance i to which c belongs should be located at the center of the sphere with a radius of δ after mapping. c That is, after training, e will be mapped around the embedded representation of o instead of coinciding with point o. This can solve the problem of different concepts corresponding to the same instance clustering after training.

[0077] instanceof triple (i, r e , c) The objective function is defined as:

[0078] F e (e,o)=||f ins (e)-o||2-δ c (4)

[0079] For the subclassof triple (c i ,r s ,c j ), concept c i It is concept j Subconcept of concept c i With concept c j In the same attribute space, then o i Should be in o j Delta j Neighborhood scope. Combined with the triple (i, r i , c i ) and (c i , r s , c j ), according to the transitivity of the isA relationship, we can infer that (i, r i , c j ). From this, we can infer that c i All instances of this are c j An example of this is c i The embedded representations of all instances after mapping should also be in o j δ j Within the scope of the neighborhood, such as Figure 3 As shown:

[0080] It can be seen from the figure that if c i The embedded representations of all instances after mapping are in o j Delta j Within the scope of the neighborhood, then o i δ i The neighborhood range should be o j Delta j Therefore, the present invention subclasses the triple (c i , r c , c j ) is defined as:

[0081] F sub (o i ,o j )=||o i -o j ||2-(δ j -δ i ) (5)

[0082] For relation triples (h, r, t), instance relation triples and concept triples, we learn the embedding representations h, r, t in the corresponding instance embedding representation space or concept embedding representation space. This model adopts the classic TransE model, and the objective function is defined as:

[0083] F r =||h+rt||2 (6)

[0084] After completing the above embedding representation learning, the model can handle the transitivity of the subclassof relationship. If there are 2 positive triple samples (c i , r s , c j ) and (c j , r s , c k ), according to the model, concept c i The embedding representation o i Delta i The range of the hypersphere neighborhood is c j The embedding representation o j Delta j Within the hypersphere neighborhood, o j Delta j The range of the hypersphere neighborhood is o k Delta k Within the scope of the hypersphere neighborhood, it can be concluded that o i Delta i The range of the hypersphere neighborhood is also o k Delta k Within the scope of the hypersphere neighborhood, that is, (c i , r s , c k ) is a positive sample. It can be seen that the model can well model the transitivity of the subclassof relationship. At the same time, different concept parameters δ c To describe the hierarchical information of the concept, δ c The larger the value, the higher the concept level is, and vice versa.

[0085] We use a margin-based ranking loss as the optimization objective for training. The margin parameter is denoted as γ. This function limits the score of a positive triplet to be at least γ less than the score of its negative triplet, which can improve the distinguishability between positive and negative samples.

[0086] Training requires positive and negative sample sets. The existing knowledge graph only contains positive triplets, so we need to generate negative triplets from the positive triplets in the knowledge graph. The commonly used uniformly distributed negative sampling strategy ("unif" strategy) generates negative triplets by randomly replacing h and t in the positive triplets (h, r, t). For example, for an instance-relation triple (h, r, t), its negative triple (h′, r, t) is obtained by randomly selecting an h′ from the instance to replace the original head entity h, and (h′, r, t) does not exist in the KG.

[0087] However, the uniform negative sampling strategy is inefficient because as training progresses, many samples are obviously wrong and do not provide any meaningful information. Therefore, we adopt the self-adversarial negative sampling method in RotatE, which samples negative triplets according to the current embedding model. Specifically, we sample negative triplets from the following distribution:

[0088]

[0089] Among them, α is the sampling hyperparameter, F(h j ',r,t j ') is a candidate negative sampling triplet (h, r, t) j ',r,t j ') corresponds to the objective function value of the model. Self-adversarial negative sampling can be understood as: negative sampling selects negative triplets that are "most similar" to positive triplets for training as much as possible, while the model distinguishes positive and negative triplets as much as possible.

[0090] For instanceof triples, we use ξ e and e ' to represent positive and negative triples, S e and S e ' is used to describe positive triple sets and negative triple sets. We call instanceof triple set S e Define the loss function L based on the marginal parameter e (margin-based ranking loss):

[0091]

[0092] Where [x] + =max(0,x),γ e A marginal hyperparameter used to represent instanceof triples.

[0093] Similarly, we have subclassof triple set S c Define the loss function L based on the marginal parameter c :

[0094]

[0095] We define instance-relation triples as Define a loss function based on the margin parameter

[0096]

[0097] We define a concept relation triple set as Define a loss function based on the margin parameter

[0098]

[0099] Finally, we define the overall loss function as a linear combination of these four loss functions:

[0100]

[0101] Among them, β1, β2, β3>0, is L e , L c , as well as Hyperparameters that maintain a balance between

[0102] We use the classic stochastic gradient descent (SGD) algorithm to minimize the above loss function. When training the model, we enforce the constraints that the L2 norm of all entities and relations in relation triplets, instanceof triplets, and instances and concepts in subclassof is less than or equal to 1, that is, ||h||2≤1, ||r||2≤1, ||t||2≤1, ||e||2≤1, and ||o||2≤1.

[0103] Model parameter complexity: We use N i 、N o Respectively represent the total number of instances and concepts, They represent the number of relations in the instance relation triple set and the number of relations in the concept relation triple set, respectively. e ,d c are the dimensions of instance embedding representation space and concept embedding representation space respectively. For instance relation triples and concept relation triples, TransE modeling is used. The model parameter complexity of instance relation triples and concept relation triples is and Since the number of relations is much smaller than the number of instances or concepts, Ignore here and The model parameter complexity of instance relation triples and concept relation triples can be approximately recorded as O(N i d e ) and O(N o d c ). For instanceof triples, the complexity of the model is O(N i d e +N o d c +d e d c +N o ). For the subclassof triple, the parameter complexity of the model is O(N o d c +N o ). The parameters of the embedding representations of instances and concepts are shared throughout the model, so the overall model parameter complexity is O(N i d e +N o d c +d e d c +N o ). o Relative N o d c It can be ignored and can be approximately written as O(N i d e +N o d c +d e d c ). Since N i >>d e , N o >>d c ,It can be seen that the parameter complexity is approximately proportional to the number of entities.

[0104] Most of the datasets used in previous work mainly consist of FB15K, which only contains instances, and WN18, which only contains concepts, while the datasets YAGO39K and M-YAGO39K used in TransC do not contain concept relationship triples, so they are not suitable for evaluating our model. This paper adopts two datasets proposed in JOIE: YAGO26K-906 extracted from YAGO and DB111K-174 extracted from DBpedia. The basic statistical information of the experimental dataset is shown in Table 1:

[0105] Table 1 Statistics of the two datasets YAGO26K-906 and DB111K-174

[0106] Dataset YAGO26K-906 DB111K-174 Number of instances 5 5 Concept Number 6 6 Number of instance relationships 7 7 Concept Relation Number 8 8 Triple 12 12 Number of triple instances 5 5 Number of triple concepts 7 7 Number of triple instance relations 4 4 Number of triple concept relations 3 3

[0107] The main task of link prediction is to predict t given (h, r), or h given (r, t) for a relation triplet (h, r, t) with a missing head entity or tail entity. This test task focuses on ranking the candidate entity set in the knowledge graph, rather than directly obtaining the best answer, to test the quality of embedding representation learning. In our experiments, this task is divided into two subtasks, namely link prediction for instance relation triples and link prediction for concept relation triples, and we perform these two subtasks on two datasets.

[0108] 1) Experimental design. First, following the setting method of the widely used benchmark dataset TransE, we divide the triple set into training set, validation set and test set, accounting for about 85%, 5% and 10% respectively. For each test triple (h, r, t), replace the tail entity t with each entity x in the knowledge graph to obtain a set of candidate triples (h, r, x) (corrupted triple), calculate the score of the objective function F(h, r, x) of this set of candidate triples, and sort this set of scores in ascending order to obtain the ranking of the test triple (h, r, t) among all candidate triples. Similarly, the ranking of the objective function scores of the set of candidate triples (x, r, t) obtained after replacing the head entity h of the test triple (h, r, t) can also be obtained. Like TransE, we use two evaluation metrics in this task: one is the mean of the reciprocal rankings of all test triples (MRR), and the other is the ratio of the number of test triples ranked not greater than N to the total number of test triples (Hits@N). The better the model effect, the greater the MRR value and Hits@N value. In addition, we use the "Filter" setting, that is, if a candidate triple exists in the knowledge graph (that is, the candidate triple is actually correct), then it is reasonable for its objective function score to be lower than the original test triple score. In order to eliminate the influence of this interference factor, before obtaining the ranking score of each test triple, the above-mentioned "interfering" candidate triple is removed from the training set, validation set, and test set to ensure that the candidate triple does not belong to any data set.

[0109] 2) Experimental implementation. During training, the learning rate λ used in the stochastic gradient descent method is {0.0005, 0.001, 0.01, 0.1}, and the marginal hyperparameter γ e ,γ c ,γ r e ,γ rc The value range is {0.1, 0.2, 0.5, 1, 2}, and the embedding represents the spatial dimension d c The value range is {25,50,75,100}, d e The value range is {125, 250, 500, 1000}, and the weights β1, β2, and β3 are {0.5, 1, 2} respectively. The optimal parameters are determined by the Hits@10 of the validation set. "unif" is used to represent the traditional strategy of replacing the head entity or the tail entity with equal probability, and "self-adv" is used to represent the use of the self-adversarial negative sampling sampling strategy, and the self-adversarial negative sampling parameter α∈{0.5, 1.0}. The optimal parameter configurations of the models for both datasets are: λ=0.0005, d c =100,d e =1000,γ e =0.5,γ c =0.2,γ r e =1.0,γ r c =1.0, β1=1, β2=1, β3=2, batch=100, and the self-adversarial sampling parameter α under the “self-adv” strategy=1. The model is iteratively trained for 1000 rounds on each dataset. To ensure fairness, we choose TransE as the in-view model in JOIE.

[0110] Table 2: Link prediction results. The best results are shown in bold.

[0111]

[0112] The experimental results are shown in Table 2. From Table 2, we can see that STCI outperforms other baseline models in almost all evaluation indicators. The specific analysis is as follows:

[0113] Compared with TransE, DissMult and HolE, STCI can learn the unique features of instances and concepts when learning the embedding of entities by utilizing the potential semantic connection between instances and concepts. STCI is equivalent to adding additional features to the embedding representation learning of knowledge graphs, which makes the learning effect of the STCI model better.

[0114] Compared with TransC, STCI outperforms these models on average in MRR. This is because compared with TranC, STCI models instances and concepts in different embedding representation spaces, thus avoiding the problem of limited learning effect caused by different instances corresponding to the same concept being clustered in space. The experimental results prove the effectiveness of modeling instances and concepts in different embedding representation spaces.

[0115] Compared with JOIE, STCI outperforms these models on average in MRR. This is because compared with JOIE, STCI adds a neighborhood scope parameter to the concept embedding representation, which can model the transitivity of the isA relationship and can model the situation where the same instance belongs to different concepts. Experimental results show that STCI better learns the potential semantic connection between instances and concepts.

[0116] In the two negative sampling strategies of "self-adv" and "unif", the "self-adv" model outperforms the "unif" model. The experimental results show the effectiveness of the "self-adv" self-adversarial negative sampling strategy for the STCI model.

[0117] The Hits@1 index of STCI in some cases is slightly worse than that of the "DistMult" model and the "HolE" model. The reason may be that we determine the best experimental configuration parameters based on Hits@10, which is not necessarily the optimal parameter configuration on Hits@1, which may lead to a relatively low Hits@1 value of STCI.

[0118] In general, STCI is an effective knowledge graph embedding learning representation method, which benefits each other when learning instance embedding representation and concept embedding representation, making the STCI model produce better results in link prediction tasks.

[0119] The beneficial effects of the present invention are as follows:

[0120] A new knowledge graph embedding model is proposed, which utilizes the latent semantic connection between concepts and instances to strengthen the representation learning of knowledge graphs and can effectively alleviate the problem of insufficient learning caused by sample sparsity.

[0121] By learning the embedding representations of concepts and instances in different spaces, the problem of different instances belonging to the same concept clustering in the embedding representation space can be effectively alleviated.

[0122] Adding a learnable parameter with a neighborhood scope to the concept embedding representation can effectively distinguish the hierarchical information of different concepts and alleviate the problem of different concepts corresponding to the same instance agglomerating in the embedding representation space.

[0123] The learning of instance embedding representation and concept embedding representation benefits each other, making the STCI model produce better results in link prediction tasks.

[0124] The word "preferred" as used in the present invention is intended to be used as an example, instance or illustration. Any aspect or design of the present invention described as "preferred" is not necessarily to be construed as being more advantageous than other aspects or designs. On the contrary, the use of the word "preferred" is intended to present concepts in a specific way. The term "or" as used in this application is intended to mean an inclusive "or" rather than an exclusive "or". That is, unless otherwise specified or clear from the context, "X uses A or B" means any one of the naturally included arrangements. That is, if X uses A; X uses B; or X uses both A and B, then "X uses A or B" is satisfied in any of the aforementioned examples.

[0125] Moreover, although the present disclosure has been shown and described with respect to one or implementations, those skilled in the art will think of equivalent variations and modifications based on the reading and understanding of this specification and the accompanying drawings. The present disclosure includes all such modifications and variations, and is limited only by the scope of the appended claims. In particular, with respect to the various functions performed by the above-mentioned components (such as elements, etc.), the terms used to describe such components are intended to correspond to any component (unless otherwise indicated) that performs the specified function of the component (such as it is functionally equivalent), even if the structure is not equivalent to the disclosed structure of the function in the exemplary implementation of the present disclosure shown in the present invention. In addition, although the specific features of the present disclosure have been disclosed with respect to only one of several implementations, such features can be combined with one or other features of other implementations that may be desired and advantageous for a given or specific application. Moreover, insofar as the terms "including", "having", "containing" or their variations are used in specific embodiments or claims, such terms are intended to be included in a manner similar to the term "comprising".

[0126] The functional units in the embodiments of the present invention may be integrated into a processing module, or each unit may exist physically separately, or multiple or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc. The above-mentioned devices or systems may execute the storage method in the corresponding method embodiment.

[0127] To sum up, the above embodiment is an implementation mode of the present invention, but the implementation mode of the present invention is not limited by the embodiment. Any other changes, modifications, substitutions, combinations, and simplifications that deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. A link prediction method based on a knowledge graph embedding model, applied to the field of intelligent search, characterized in that: The following steps are involved: Obtain a knowledge graph KG={C, I, R, S}, where C, I, R, and S represent a concept set, an instance set, a relationship set, and a triple set, respectively; the triple set S includes a concept triple in which both the head entity and the tail entity are composed of concepts, an instance triple in which both the head entity and the tail entity are composed of instances, and an instanceof triple in which the head entity and the tail entity are composed of instances and concepts, respectively; For instanceof triples, since the head entity and the tail entity cannot be represented in the same embedding space, they are modeled separately. For subclassof triples in concept triples, the transitivity of subclassof relations is used for modeling. Triples other than subclassof triples and instance triples in concept triples are uniformly classified as relation triples and modeled. Training is performed using a marginal parameter-based loss function as an optimization objective, wherein the loss function constrains the score of a positive triplet to be at least a marginal parameter γ less than the score of its negative triplet to improve the distinguishability between positive and negative samples; A stochastic gradient descent algorithm is used to minimize the loss function. During model training, the L2 norms of all entities and relations in the relation triples, the instanceof triples, and the instances and concepts in the subclassof are constrained to be less than or equal to 1. After the training, the hyperparameters of the model are obtained. Input the relation triple (h, r, t) with missing head or tail entity into the model, and output the prediction result t given (h, r) or h given (r, t); Instances and concepts are respectively embedded in the instance representation space R and concept embedding representation space R Indicates that the instance embedding represents the spatial dimension d e Than the concept embedding representation space dimension d c High, i.e. d e > d c ; is the instanceof triple set S e Define the loss function L based on the marginal parameter e : ; Where [ x ] + = max ( 0, x ), γ e Used to represent the marginal hyperparameter of instanceof triples. For instanceof triples, ξ e and e ' represents positive triples and negative triples, S e and S e 'Used to describe positive triple sets and negative triple sets; Subclass of triple set S c Define the loss function L based on the marginal parameter c : ; is the set of instance relation triples Define a loss function based on the margin parameter : ; is a set of concept relation triples Define a loss function based on the margin parameter : ; Finally, the overall loss function is defined as a linear combination of these four loss functions: ; in, β 1 , β 2 , β 3 > 0, yes L e , L c , as well as Hyperparameters that maintain a balance between 2. According to claim 1, a link prediction method based on a knowledge graph embedding model is characterized in that: The relation set R is formalized as ,in, r i Indicates the instanceof relationship. r s Indicates the subclassof relationship, is the instance relation set, Except r s The set of conceptual relations outside the relation divides the triple set S into three disjoint subsets: instanceof triple set , where i∈I and its embedding representation e∈R , c∈C, whose embedding represents o∈ R , n e YesS e size; subclassof triple set , where c i , c j ∈C, whose embedding represents o i , o j ∈ R , c i It is c j Subconcept, n c YesS c size; Relation triple set , where h, r, t ∈ C or h, r, t ∈ I, and their embedded representations are described by h, r, t, respectively, h, r, t∈R or h, r, t∈R , n r YesS r The size of is the set of instance relation triples, , where h e , t e ∈I,r e ∈ , yes The size of is a set of concept relation triples, , where h c , t c ∈C,r c ∈ , yes size.

3. According to claim 1, a link prediction method based on a knowledge graph embedding model is characterized in that: For instanceof triples (i, r i , c) modeled as follows: The embedding representations of instance i and concept c are e and o, respectively, in different embedding representation spaces; since instance i has the attribute information of concept c, the embedding representation e of instance i is close to the embedding representation vector o of concept c after mapping, that is: for instanceof triple (i, r i , c ), there exists f ins ( e ) → o instanceof triples are many-to-many relationships, that is, a concept can contain multiple instances, and an instance can belong to multiple concepts. For the case where a concept corresponds to multiple instances, define f ins (e) is a nonlinear affine function, that is: f ins ( e ) = σ ( W · e + b ) ; Where W∈ R is the weight matrix, b∈R is the bias vector, σ( · ) is the nonlinear activation function; For the case where the same instance may correspond to multiple different concepts, a learnable parameter δ is added to the embedding representation of each concept c , which represents the delta of o c Neighborhood scope, the embedded representation e of instance i is mapped, and the embedded vector representation o of concept c is δ c Neighborhood scope, that is: || f ins ( e ) - o ||2≤ δ c ; Where || · ||2 is the Euclidean distance formula, δ c The meaning is: after training, the embedding representation e of instance i to which c belongs should be located at the center of the sphere with a radius of δ after mapping. c That is, after training, e will be mapped around the embedding representation of o instead of coinciding with point o, so as to solve the problem that different concepts corresponding to the same instance are clustered after training. instanceof triple (i, r e , c) The objective function is defined as: F e ( e, o ) = || f ins ( e ) - o || 2 - δ c 。 4. According to claim 1, a link prediction method based on a knowledge graph embedding model is characterized in that: For the subclassof triple (c i , r s , c j ) is modeled as follows: Concept c i It is concept j Subconcept of concept c i With concept c j In the same attribute space, then o i Should be in o j Delta j Neighborhood scope; combined with triples (i, r i , c i ) and ( c i , r s , c j ), according to the transitivity of the isA relationship, we can infer that (i, r i , c j ), thus, c i All instances belonging to it are embedded in o after mapping. j δ j Neighborhood scope: If c i The embedded representations of all instances after mapping are in o j δ j Within the scope of the neighborhood, then o i δ i The neighborhood range is o j δ j Neighborhood scope, thus, the subclassof triple (c i , r c , c j ) is defined as: sub ( o i , o j ) = || o i − o j ||2 − ( δ j − δ i ) .

5. According to claim 1, a link prediction method based on a knowledge graph embedding model is characterized in that: The relationship triple (h, r, t) is modeled as follows: For instance-relation triples and concept triples, we learn the embedding representations h, r, t in the corresponding instance embedding representation space or concept embedding representation space respectively. We use the classic TransE model to model the relationship, and the objective function is defined as: F r = || h + r - t || 2 ; This model can handle the transitivity of the subclassof relation; if there are two positive triple samples (c i , r s , c j ) and (c j , r s , c k ), according to the model, concept c i The embedding representation o i δ i The range of the hypersphere neighborhood is c j The embedding representation o j δ j Within the hypersphere neighborhood, o j δ j The range of the hypersphere neighborhood is o k δ k Within the scope of the hypersphere neighborhood, we can get o i δ i The range of the hypersphere neighborhood is also o k δ k Within the scope of the hypersphere neighborhood, that is, (c i , r s , c k ) is a positive sample; at the same time, through different concept parameters δ c To describe the hierarchical information of the concept, δ c The larger the value, the higher the concept level is, and vice versa.

6. A link prediction method based on a knowledge graph embedding model according to claim 1, characterized in that: A self-adversarial negative sampling method is used to sample negative triplets according to the current embedding model. Specifically, negative triplets are sampled from the following distribution: ; in, α is the sampling hyperparameter, F(h j ', r, t j ' ) for ( h ,r ,t ) A candidate negative sampling triplet of ( h j ', r, t j ' ) The value of the objective function of the corresponding model.