Next Article in Journal
A Discrete-Event Mathematical Model for Resource Allocation Optimization: A Case Study of Vehicle Scheduling in a Signal-Free Intersection
Previous Article in Journal
Reliability Analysis and Redundancy Optimization of a Command Post Phased-Mission System
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

ERDERP: Entity and Relation Double Embedding on Relation Hyperplanes and Relation Projection Hyperplanes

School of Mechatronics Engineering, Harbin Institute of Technology, 92 Xidazhi Road, Harbin 150001, China
*
Author to whom correspondence should be addressed.
Mathematics 2022, 10(22), 4182; https://doi.org/10.3390/math10224182
Submission received: 12 September 2022 / Revised: 4 November 2022 / Accepted: 6 November 2022 / Published: 9 November 2022

Abstract

:
Since data are gradually enriched over time, knowledge graphs are inherently imperfect. Thus, knowledge graph completion is proposed to perfect knowledge graph by completing triples. Currently, a family of translation models has become the most effective method for knowledge graph completion. These translation models are modeled to solve the complexity and diversity of entities, such as one-to-many, many-to-one, and many-to-many, which ignores the diversity of relations themselves, such as multiple relations between a pair of entities. As a result, with current translation models, it is difficult to effectively extract the semantic information of entities and relations. To effectively extract the semantic information of the knowledge graph, this paper fundamentally analyzes the complex relationships of the knowledge graph. Then, considering the diversity of relations themselves, the complex relationships are refined as one-to-one-to-many, many-to-one-to-one, one-to-many-to-one, many-to-one-to-many, many-to-many-to-one, one-to-many-to-many, and many-to-many-to-many. By analyzing the complex relationships, a novel knowledge graph completion model, entity and relation double embedding on relation hyperplanes and relation projection hyperplanes (ERDERP), is proposed to extract the semantic information of entities and relations. First, ERDERP establishes a relation hyperplane for each relation and projects the relation embedding into the relation hyperplane. Thus, the semantic information of the relations is extracted effectively. Second, ERDERP establishes a relation projection hyperplane for each relation projection and projects entities into relation projection hyperplane. Thus, the semantic information of the entities is extracted effectively. Moreover, it is theoretically proved that ERDERP can solve antisymmetric problems. Finally, the proposed ERDERP are compared with several typical knowledge graph completion models. The experimental results show that ERDERP is significantly effective in link prediction, especially in relation prediction. For instance, on FB15k and FB15k-237, Hits@1 of ERDERP outperforms TransH at least 30%.

1. Introduction

The knowledge graph was first proposed in 2012 [1]. The goal of knowledge graphs is to build a structured knowledge base to serve artificial intelligence [2,3,4], such as intelligent recommendation systems [5,6], community discovery [7,8], and so on. A large number of knowledge entities exist in real life and the network, and the relations among them are diverse. Knowledge graphs can connect the entities through relations to form a huge semantic network to effectively realize semantic expression intuitively, naturally, and efficiently. Knowledge in a knowledge graph is expressed in the form of head entity, relation, and tail entity (denoted as (h, r, t)). The simple and efficient expression has attracted extensive attention from all walks of life. Thus, knowledge graphs have developed rapidly in recent years. Many classic knowledge graphs are established, such as ConceptNet of MIT Media Lab [9], the world knowledge base Freebase [10], WordNet of Princeton University Cognitive Science Lab [11], and so on.
The knowledge graph has become an important information source in academia and industry. Knowledge graphs have attracted much attention because they can accurately reflect the real world by expressing abstract knowledge well, such as concepts and levels. Therefore, they have been widely used in many fields and extensively and deeply studied. For example, in biomedicine, as an important tool for mining future associations between biomedical concepts, the knowledge graph has attracted much attention [12]. In traditional Chinese medicine, knowledge graphs are used to provide a variety of knowledge services, such as knowledge visualization, knowledge retrieval, and knowledge recommendation [13]. In metallic materials, knowledge graphs based on Wikipedia and DBpedia have become a key tool to provide guidance for material researchers [14]. In geoscience, a geological knowledge graph constructed by combining general terms in the geological dictionary with geological terms improves the performance of the CRF-based Chinese word segmentation model [15].
A complete knowledge graph is of great significance for promoting the development of artificial intelligence and supporting the application of intelligent information services, such as intelligent search [16], intelligent answer system [17], personalized recommendation [18], and so on. However, the knowledge graph is usually incomplete in the construction process, for example, missing entities or relations. To effectively complete a knowledge graph, knowledge representation learning methods are developed. From the perspective of knowledge representation methods, knowledge representation learning can be divided into two stages. At the initial stage of knowledge representation learning, some typical knowledge representation models are established, such as structured embedding (SE) model [19], single-layer model (SLM), neural tensor network [20], semantic matching energy (SME) model [21,22], latent factor model (LFM) [23,24] and matrix factorization model (RESCAL) [25,26]. Facts show that SE, SLM, SME, LFM, neural tensor network and matrix factorization model are weak in accurately learning the semantic information of entities and relations, but the computational complexity is high. Therefore, these typical knowledge representation models are difficult to apply to some practical application scenarios. Therefore, researchers began to explore new knowledge representation learning models. After practical tests, translation models, as typified by TransE [27], have gradually become the mainstream of knowledge representation learning.
The family of translation models is effective for a few optimization parameters, simple model structure, and efficient knowledge graph completion. Since TransE was developed and verified the effectiveness of knowledge graph completion, a large number of researchers focused on translation models to effectively extract the semantic features of entities and relations to solve the complex relationships problems of knowledge graphs, such as one-to-many, many-to-one, and many-to-many. TransE has been continuously improved and many effective translation models have been established, such as TransH [28], TransR [29], TransD [30], TransA [31], TransAt [32], TransMS [33], TransG [34], KG2E [35], PTransE [36], PaSKoGE [37], Boxe [38], and so on. Among them, TransH, TransR and TransD adopt different strategies to project the head entity and tail entity. TransA changes the distance measure function in the loss function to Mahalanobis distance, and learns different weights for each dimension of (h + rt). TransAt conducts presentation learning by introducing an attention mechanism. TransMS applies nonlinear functions to propagate multidirectional semantics. TransG and KG2E use Gaussian distribution to describe entities and relations. PTransE and PaSKoGE consider the semantic information of the path in the translation process. BoxE embeds entities as points, and relations as a set of hyperrectangles (or boxes), which spatially characterize basic logical properties. In addition, some researches focus on representation space. For example, ComplEx models entity and relation embedding from complex space [39], RotatE regards the relation as the rotation from head entity to tail entity in complex space [40], and HAKE maps entities to polar coordinates to learn entity and relation embedding [41].
However, with the current translation models, it is difficult to extract semantic features of relations, and the representation ability of entities and relations by these models needs to be further improved. There may be two reasons. On the one hand, the current translation models are generally applied in entity prediction, usually ignoring the importance of relation prediction. On the other hand, most current translation models are designed to address the complexity and diversity of entities to solve the complex relationships, but the diversity of relations themselves is ignored in the complex relationships. Therefore, the diversity of relations themselves is introduced into the complex relationships of knowledge graphs to highlight the complex relationships. Then, the complex relationships are refined into one-to-one-to-many, many-to-one-to-one, one-to-many-to-one, many-to-one-to-many, many-to-many-to-one, one-to-many-to-many, and many-to-many-to-many, as shown in Figure 1. In reality, the complex relationship proposed in this paper is ubiquitous in real datasets. For example, there are 485,661 triples of 1-1-N, 520,476 triples of N-1-1, 211,457 triples of 1-M-1, and 26,943 triples of N-1-N, and the number of head entities with 1-M-N in FB15K is 10,143. It is intuitively obtained that multiple relations exist between a pair of entities from the refined complex relationship, as shown in Figure 2. However, by presenting the diversity of the relations themselves independently, it is found that using traditional models without considering the diversity of relations themselves makes it difficult to distinguish multiple relations between a pair of entities.
To solve the above issues, this paper proposes an entity and relation double embedding on relation hyperplanes and relation projection hyperplanes model (ERDERP) to effectively extract the semantic information of entities and relations and improve the accuracy of entity prediction and relation prediction. In a knowledge graph, each relation has its own characteristics. First, to solve the diversity of relations, ERDERP establishes a relation hyperplane for each relation and projects the relation embedding into the relation hyperplane to increase the distinguishability of multiple relations. Then, ERDERP can effectively capture the semantic characteristics of relations. Second, to solve the complexity and diversity of entities, ERDERP establishes a relation projection hyperplane for each relation projection (i.e., the projection of relation on the relation hyperplane) and projects entities into relation projection hyperplane to increase the distinguishability of multiple entities. Then, ERDERP can effectively capture the semantic characteristics of entities. Finally, the relation projection is regarded as the translation vector, and the translation process from head entity to tail entity is realized on the relation projection hyperplane. Then, the entity and relation embedding vectors with rich semantic information can be obtained to improve the accuracy of link prediction. Moreover, it is theoretically proved that ERDERP can solve the inference patterns of antisymmetry.
The rest of this paper is organized as follows. Section 2 introduces several typical translation models. The ERDERP model is proposed and detailed described in Section 3. In Section 4, the proposed ERDERP is compared with several typical knowledge representation models in entity prediction and relation prediction. Section 5 gives the conclusion of this paper.

2. Related Work

The family of translation models is widely used for a few optimization parameters, simple model structure and efficient knowledge graph completion. Mikolov et al. proposed word2vec to learn word representation, and found that there exists translation invariance in word vector space [42]. Inspired by word2vec, through deeply studying the method of embedding entities and relations of multiple relational data into low-dimensional space, Borders et al. proposed the first translation model—TransE [27]. They regarded the triples in knowledge graph as the translation process from head entity into tail entity, and the relation was regarded as the translation between two entities, i.e., h + r = t . However, there are complex relationships between entities, such as one-to-many, many-to-one, and many-to-many. Theoretical analysis and experimental results show that it is difficult to solve complex relationships with TransE. Thus, translation models need to be improved for extracting the semantic features of entities and relations.
To solve the complex relationships of entities and enhance the representation ability of low-dimensional embedding vectors, researchers have made a series of improvements to TransE. Several classical translation models have been proposed. By projecting the head entity and tail entity to the hyperplane of the relation to alleviate the problem of complex relationships, TransH realizes that the same entity has different representations on different relation hyperplanes. However, TransH assumes that relations and entities are in the same semantic space, which limits its representation ability. To solve the problem of TransH, TransR was proposed. It respectively establishes an entity space and a relation space for entities and relation to enhance the representation ability of low-dimensional embedding vectors. Then, a mapping matrix is established for each relation to obtain the projection vectors of head entity and tail entity. Finally, the translation process is realized in the relation space. However, the computational complexity of TransR is increased because of the mapping matrix. Meanwhile, the representation ability of the TransR is limited by using the same mapping matrix in head entity and tail entity. Furthermore, TransD is proposed to solve these problems of TransR. It constructs two different mapping matrices through three special projection vectors to reduce model parameters, which solves the problem of the head entity and tail entity sharing one projection matrix in TransR. Through analysis, the above translation models solve the complex relationships of entities by projecting entities.
However, the above models take the complex relationships of entities as the starting point of research, ignoring the diversity of the relations themselves, which results in difficulty distinguishing multiple relations between a pair of entities for traditional models. In fact, there may be multiple relations between a pair of entities from the refined complex relationships. For example, there are 211,457 triples of 1-M-1. In addition, the above models are applied in entity prediction. However, the application and performance in relation prediction are ignored. Therefore, this paper fundamentally studies translation models, i.e., refining the complex relationships of knowledge graphs to highlight the diversity of the relations themselves and modeling translation models to solve the refined complex relationships to effectively extract the semantic features of entities and relationships. Specifically, the complex relationships are refined into one-to-one-to-many (1-1-N), many-to-one-to-one (N-1-1), one-to-many-to-one (N-1-N), many-to-one-to-many (1-M-1), many-to-many-to-one (N-M-1), one-to-many-to-many (1-M-N), and many-to-many-to-many (N-M-N), as shown in Figure 1. The definitions of the complex relationships are as follows.
  • 1-1-N: Only one relation exists between head entity and tail entity, and one head entity corresponds to multiple tail entities.
  • N-1-1: Only one relation exists between head entity and tail entity, and one tail entity corresponds to multiple head entities.
  • N-1-N: Only one relation exists between head entity and tail entity, and the relation connects multiple head entities and multiple tail entities.
  • 1-M-1: Multiple relations exist between two entities.
  • N-M-1: For tail entity, there are multiple head entities and multiple relations.
  • 1-M-N: For head entity, there are multiple tail entities and multiple relations.
  • N-M-N: For tail entity, there are multiple head entities and multiple relations, and for head entity, there are multiple tail entities and multiple relations.
By definition, the complex relationships are not disjointed. The refined complex relationships reflect the complexity of knowledge graphs. For example, N-M-1 can be regarded as a combination of 1-M-1 and N-1-1. In N-M-1 of Figure 1, for the tail entity “Snake,” using 1-M-1 and N-1-1 alone does not fully describe the complexity relationships of “Snake.” If the head entity “Eagle” of “Snake” is solely focused on, the relationship is 1-M-1. If the relation “IsCompetitorof” is solely focused on, the relationship is N-1-1. Therefore, the combination of 1-M-1 and N-1-1 can fully describe the complex relationship of the tail entity “Snake.” Similarly, 1-M-N can be regarded as a combination of 1-M-1 and 1-1-N, and N-M-N can be regarded as a combination of 1-M-N and N-M-1.
An entity and relation double embedding on relation hyperplanes and relation projection hyperplanes model (ERDERP) is proposed to improve the accuracy of entity prediction and relation prediction. ERDERP first establishes a relation hyperplane for each relation and projects the relation embedding into the relation hyperplane to increase the distance of the multiple relation embedding. Thus, the diversity of relations can be solved and the distinguishability of multiple relations can be enhanced. Second, ERDERP establishes a relation projection hyperplane for each relation projection (i.e., the projection of relation on the relation hyperplane) and projects entities into relation projection hyperplane to increase the distinguishability of multiple entities. Thus, the complexity and diversity of entities can be solved. Finally, the relation projection is regarded as the translation vector, and the translation process from head entity to tail entity is realized on the relation projection hyperplane. Then, the entity and relation embedding vectors with rich semantic information can be obtained. Figure 3 shows the schematic diagram of ERDERP. In Figure 3, r 1 and r 2 are two different relations of a pair of entities. ERDERP first establishes two relation hyperplanes (i.e., α 1 for r 1 and β 1 for r 2 ) and projects the relation to its relation hyperplane to enhance the distinguishability between the two relations. Then ERDERP establishes a relation projections hyperplane (i.e., α 2 or β 2 ) for each relation projection (i.e., r 1 or r 2 ). Thus, the embedding of the two entities can be distinguished.
Table 1 compares the above translation models and the proposed ERDERP. Some information of several typical translation models and the proposed ERDERP in this paper, such as the score function and the parameters complexity, are described in Table 1. From a problem-oriented view, the typical translation models are used to solve the complexity and diversity of entities, such as one-to-many and many-to-one. ERDERP aims to solve the complexity and diversity of entities of entities and the diversity of the relations themselves. The distinguishing feature among translation models is that each has its own score function that shows the transformation method of head entity and tail entity.

3. An Entity and Relation Double Embedding on Relation Hyperplanes and Relation Projection Hyperplanes Model for Knowledge Graph Completion

The refined complex relationships show that the relation is also diversified. However, traditional translation models are modeled to solve the complexity and diversity of entities and do not directly take the diversity of relations themselves into account, resulting in the learned embedding vector of entities and relations not fully containing the semantic information of relations. Thus, the accuracy of link prediction of the translation model needs to be improved. To effectively extract the semantic information of entities and relations and solve the diversity of the relations themselves and the complexity and diversity of entities, a novel knowledge graph completion model, the entity and relation double embedding on relation hyperplanes and relation projection hyperplanes model (ERDERP), is proposed in this section. ERDERP is applied to link prediction, including entity prediction and relation prediction. First, the general concepts and symbols are described, as shown in Table 2.

3.1. An Entity and Relation Double Embedding on Relation Hyperplanes and Relation Projection Hyperplanes Model

The current translation models were proposed to solve the complexity and diversity of entities, such as one-to-many, many-to-one and many-to-many, so as to capture semantic information of entities and relations and improve the accuracy of link prediction. However, the current translation models cannot extract the different features of relations well, which makes it difficult to distinguish relations through the learned relation embedding, and further affects the extraction of entity semantic information. To effectively capture the semantic information of entities and relations, this paper fundamentally studies the translation model, which is different from the starting point of other translation models, i.e., analyzing the TransE model and the complexity and diversity of the entities and the diversity of relations. Then, an entity and relation double embedding on relation hyperplanes and relation projection hyperplanes model (ERDERP) is proposed. The detailed modeling process of ERDERP model is as follows.
For a correct triple (h, r, t), the object of TransE is to minimize the score function h + r t L 1 / L 2 . Results show that TransE significantly improves the performance of link prediction compared with the traditional non-translation models. Under TransE, h + r = t is workable for the triple (h, r, t). Considering the 1-M-1 of complex relationships, the following result can be directly obtained by TransE.
  • i { 1 , 2 , 3 , , m } and ( h , r i , t ) Δ , then the relation embedding vectors of r i satisfy r 1 = r 2 = r 3 = = r m .
The above result shows that through TransE, the embedding vectors of relations between a pair of entities are the same as each other. The result indicates that it is difficult to distinguish the multiple relations between a pair of entities through TransE. Then, RTransE is proposed to solve the above problem (i.e., correctly distinguishing the relations). RTransE enhances the embedding representation of relations by establishing a relation hyperplane for each relation, so as to enhance the distinguishability of multiple relations between a pair of entities. Specifically, the RTransE modeling process is as follows.
In RTransE, for a triple (h, r, t), the embedding vector r is projected into its relation hyperplane, S r , and r is the projected vector of r , where r = r s r T r s r and s r is the unit normal vector of S r . Then, RTransE makes the triplet (h, r, t) satisfy h + r t on the hyperplane S r . Thus, each embedding vector of relation can be the same on the hyperplane and be different on the whole, so as to ensure that the model fully extracts the different features and the same features between relations. Then the multiple relations between a pair of entities can be distinguished, i.e., RTransE can solve 1-M-1. However, RTransE is weak in solving the problems of many-to-one-to-one and one-to-one-many, which is the same as TransE. The following results are directly obtained by using RTransE and TransE.
  • For N-1-1 of complex relationships, i.e., if i { 1 , 2 , 3 , , m } and ( h i , r , t ) Δ , then the tail entity embedding vectors of h i satisfy h 1 = h 2 = h 3 = = h m .
  • For 1-1-N of complex relationships, i.e., if i { 1 , 2 , 3 , , m } and ( h , r , t i ) Δ , then the tail entity embedding vectors of t i satisfy t 1 = t 2 = t 3 = = t m . i { 1 , 2 , 3 , , m } and ( h , r , t i ) Δ , then the tail entity embedding vectors of t i satisfy t 1 = t 2 = t 3 = = t m .
The above result shows that RTransE is weak in solving the complexity and diversity of the entities. To solve the above problems, ERDERP is proposed based on RTransE. ERDERP establishes a relation projection hyperplane for each relation projection (i.e., the projection of relation on the relation hyperplane) and projects entities into the relation projection hyperplane to increase the distinguishability between multiple entities and capture the semantic characteristics of entities. Finally, the relation projection is regarded as the translation vector, and the translation process from head entity to tail entity is realized on the relation projection hyperplane. Thus, ERDERP can solve the problems of N-1-1 and 1-1-N while guaranteeing the distinguishability of multiple relations between a pair of entities. Therefore, ERDERP can effectively extract semantic information of entities and relations.
In detail, for a triple (h, r, t), ERDERP first establishes a relation hyperplane for relation r and projects the relation embedding representation ( r ) into its relation hyperplane ( S r ) to increase the distinguishability of the relations. Then, the head entity and tail entity are projected into the relation projection hyperplane ( W r ) to which the relation projection ( r ) belongs to complete the entity translation process on the relation projection hyperplane ( W r ). Thus, Equation (1) is obtained.
h = h w r T h w r ,   t = t w r T t w r ,   r = r s r T r s r
where s r is the unit normal vector of S r , and w r is the unit normal vector of W r . r is the projection vector of the relation on S r , h is the projection vector of the head entity on W r , and t is the projection vector of the tail entity on W r .
Finally, the score function of ERDERP is proposed, as shown in Equation (2).
f r ( h , t ) = ( h w r T h w r ) + ( r s r T r s r ) ( t w r T t w r ) L 1 / L 2
Equation (2) shows that the score function is a distance function. For correct triples, the score function is expected to be as small as possible to ensure the correct translation. For incorrect triples, the score function is expected to be larger to increase the irrationality of the translation process.
To sum up, the ERDERP captures the complex relationships through two steps. First, it develops a relation hyperplane for each relation. Then, multiple relations between a pair of entities are projected into the relation hyperplane to ensure that the projection of the relations can be the same as each other and remain different as a whole. Therefore, ERDERP can effectively extract the same features and different features of the multiple relations. Moreover, the embedding representations for multiple relations between a pair of entities through ERDERP are different. ERDERP increases the distinguishability of relations and solves the diversity of relations. Second, drawing on the projection mode of TransH, ERDERP develops a relation projection hyperplane for each relation projection. Then, the head entity and tail entity are projected into the relation projection hyperplane, and the translation process is completed on the relation projection hyperplane with the relation projection as the translation. Therefore, ERDERP can effectively extract the same features and different features of the multiple entities. Moreover, the embedding representations for multiple head entities of N-1-1 and multiple tail entities of 1-1-N through ERDERP are different. ERDERP projects entities into the relation projection hyperplane. ERDERP increases the distinguishability of entities and solves the complexity and diversity of entities. Therefore, ERDERP can effectively solve complex relationships in a knowledge graph.
The traditional translation models solved the complexity and diversity of entities by projecting head entities and tail entities, but did not directly solve the diversity of relations themselves, making it difficult to distinguish multiple relationships in the learned embedded representation. The diversity of unsolved relations makes it difficult to improve the accuracy of relation prediction, which further affects the improvement of the accuracy of entity prediction. Compared the traditional translation models, ERDERP can effectively solve the diversity of relations themselves. Theoretically, ERDERP can effectively solve complex relationships in a knowledge graph. Section 3.2 theoretically verifies that ERDERP can effectively solve antisymmetry.

3.2. Theoretical Justifications of the Inference Patterns

In this section, the performance of ERDERP in solving the antisymmetric relationship is verified in theory. The theoretical proof of the antisymmetry of ERDERP is as follows.
Let E represents the entity set, h , t represents the embedding representation of the head entity and tail entity, respectively, and h and t are n-dimensional row vectors by ERDERP. For relation r , if there exits r ( h , t ) , then ( h w r T h w r ) + ( r s r T r s r ) = ( t w r T t w r ) can be obtained by the score function of ERDERP.
Further, the objective is to prove that ( t w r T t w r ) + ( r s r T r s r ) ( h w r T h w r ) when h t if there exits r ( h , t ) . According to ( h w r T h w r ) + ( r s r T r s r ) = ( t w r T t w r ) , Equation (3) can be obtained.
( h w r T h w r ) + ( r s r T r s r ) = ( t w r T t w r ) ( h w r T h w r ) + ( r s r T r s r ) + ( t w r T t w r ) - ( h w r T h w r ) = ( t w r T t w r ) + ( t w r T t w r ) - ( h w r T h w r ) ( t w r T t w r ) + ( r s r T r s r ) = 2 ( t w r T t w r ) - ( h w r T h w r )
Moreover, assume equation ( t w r T t w r ) + ( r s r T r s r ) = ( h w r T h w r ) holds. Then, Equation (4) can be obtained.
( t w r T t w r ) = ( h w r T h w r ) t h = w r T t w r w r T h w r t h = w r T ( t h ) t w r w r w r T ( t h ) = 0
Let us assume that w r = ( a 1 , a 2 , , a n ) T , then w r w r T can be expressed as follows.
a 1 2 a 1 a 2 a 1 a n 1 a 1 a n a 2 a 1 a 2 2 a 2 a n 1 a 2 a n a n 1 a 1 a n 1 a 2 a n 1 2 a n 1 a n a n a 1 a n a 2 a n a n 1 a n 2
Equation (4) indicates that w r w r T ( t h ) = 0 holds for t , h , i.e., t h , w r w r T ( t h ) = 0 . Then, w r = ( a 1 , a 2 , , a n ) T = ( 0 , 0 , , 0 ) T is easily verified. Since w r is the normal vector of the hyperplane corresponding to the projection of relation r, w r ( 0 , 0 , , 0 ) T holds. Therefore, the assumption of ( t w r T t w r ) + ( r s r T r s r ) = ( h w r T h w r ) does not hold. Then, if ( h w r T h w r ) + ( r s r T r s r ) = ( t w r T t w r ) and h t , ( t w r T t w r ) + ( r s r T r s r ) ( h w r T h w r ) holds, i.e., ERDERP can effectively solve the antisymmetric relationship.

3.3. Model Training

In the training of ERDERP, a margin-based objective function is proposed by introducing the maximum interval method to accurately extract semantic information of entities and relations, as shown in Equation (5).
L = ( h , r , t ) Δ ( h , r , t ) Δ ( h , r , t ) max ( f r ( h , t ) + γ f r ( h , t ) , 0 )
where max ( x , 0 ) denotes the maximum between x and 0, f r ( h , t ) denotes the value of the correct triplet (h, r, t) using the score function, f r ( h , t ) denotes the value of the incorrect triplet ( h , r , t ) using the score function, γ is a margin hyperparameter and γ > 0 , Δ is the set of correct triples, and Δ ( h , r , t ) is the set of incorrect triples, which is generated by ( h , r , t ) . Δ ( h , r , t ) is shown in Equation (6).
Δ ( h , r , t ) = { ( h , r , t ) | h E } { ( h , r , t ) | t E }
For a correct triplet, the corresponding incorrect triplets set is generated in two steps. (1) Randomly select an entity from the entity set to replace the head entity of the correct triplet. (2) Randomly select an entity from the entity set to replace the tail entity of the correct triplet. In fact, the head entity and tail entity should be replaced with different probabilities to avoid the situation that the generated incorrect triples are the correct triples in the knowledge graph. On the one hand, one relation generally corresponds to multiple head entities and multiple tail entities, and on the other hand, the number of head entities and tail entities corresponding to a relation are generally different. TransH shows that the head entity tended to give more chance to be replaced if the relation is one-to-many and the tail entity is given more chance to be replaced if the relation is many-to-one.
Therefore, Bernoulli distribution in TransH is adopted to generate the incorrect triples. For a correct triple (h, r, t), the incorrect triples are generated in three steps. (1) Count all triples containing r and calculate the average number of tail entities per head entity, denoted as tph. (2) Count all triples containing r and calculate the average number of head entities per tail entity, denoted as hpt. (3) Replace the head entity in the triplet (h, r, t) with a probability of t p h t p h + h p t or replace the tail entity in the triplet (h, r, t) with a probability of h p t t p h + h p t . This method of generating incorrect triples improves the quality of incorrect triples and provides support for improving the knowledge representation ability of the translation model.
Through the above analysis, the training process of ERDERP is shown in Figure 4.

4. Experiments

In this section, the proposed ERDERP model is compared with several comparison models in link prediction (i.e., entity prediction and relation prediction). In the experiments, the PyTorch framework and Adam optimization method are adopted to train the translation models. Section 4.1 introduces the datasets used in the experiments. Section 4.2 develops the model evaluation. Section 4.3 details the experimental design and analysis of experimental results.

4.1. Experimental Datasets

Four public datasets of knowledge graph completion were used in the experiment, including two subsets of WordNet, WN18 [27] and WN18RR [43], and two subsets of Freebase—FB15K [27] and FB15K-237 [44]. Detailed information of the five datasets is shown in Table 3, including the size of relations, the size of entities, the size of training samples, the size of validation samples, and the size of test samples.

4.2. Model Evaluation

Two aspects are considered to evaluate the presentation capability of the models. One is to evaluate the entity prediction accuracy, i.e., predict tail entity or head entity for a given triplet (h, r, ?) or (?, r, t). The other is to evaluate the relation prediction accuracy, i.e., predict relation for a given triplet (h, ?, t). Mean Rank and Hits@10 are adopted as the metrics of entity prediction accuracy. Mean Rank and Hits@N are adopted as the metrics of relation prediction accuracy. Note that Hits@10 is a special case of Hits@N, where N = 10.
Mean Rank: The following describes the calculation process of Mean Rank in detail with the prediction tail entity as an example. First, for a test triple ( h , r , t ) , an incorrect triplet set is obtained by replacing tail entity with all entities in the knowledge graph. Second, the score of each incorrect triplet is obtained by the score function f r ( h , t ) . Third, the score sequence is obtained by sorting the scores in ascending order. Finally, the position rank of the tail entity in ( h , r , t ) in the score sequence is extracted. In the same way, the position rank of head entity in ( h , r , t ) is obtained. Then, the average rank of the head entity and tail entity of all test triples is taken as the Entity Mean Rank, as shown in Equation (7). Similarly, the average rank of the relation of all test triples is taken as the Relation Mean Rank, as shown in Equation (8).
Entity   M e a n   R a n k = ( h , r , t ) T t R a n k ( ( t , f r ( h , t ) ) , S t ) + ( h , r , t ) T t R a n k ( ( h , f r ( h , t ) ) , S h ) 2 | T t |
R e l a t i o n   M e a n   R a n k = ( h , r , t ) T t R a n k ( ( r , f r ( h , t ) ) , S r ) | T t |
where R a n k ( x , X ) denotes the position of the element x in X . S t is the score sequence of the tail entity in ( h , r , t ) , S h is the score sequence of the head entity in ( h , r , t ) , and S r is the score sequence of the relation in ( h , r , t ) , which are shown in Equation (9). T t denotes the test triple set. | T t | is the size of the test triple set.
S t = sort { ( t , f r ( h , t ) ) | t E } ,   S h = sort { ( h , f r ( h , t ) ) | h E } ,   S r = sort { ( r , f r ( h , t ) ) | r R }
where sort { ( x , y ) n } illustrates that the set is sorted in ascending order by the value of y . E is the entity set of the knowledge graph, and R is the relation set of the knowledge graph.
Hits@N: For the above ascending sequence, the count has 1 added if the correct tail entity/head entity/relation of the test triplet is in the top N. Then, Hits@N is given by averaging the counts of all test triplets, which is shown in Equations (10) and (11).
E n t i t y   H i t s @ N = ( h , r , t ) T t s N ( R a n k ( ( t , f r ( h , t ) ) , S t ) ) + ( h , r , t ) T t s N ( R a n k ( ( h , f r ( h , t ) ) , S h ) ) 2 | T t |
Relation   H i t s @ N = ( h , r , t ) T t s N ( R a n k ( ( r , f r ( h , t ) ) , S r ) ) | T t |
where s N is a counting function, as shown in Equation (12). In addition, the other parameters refer to Equations (8) and (9).
s N ( R a n k ( x , X ) ) = { 1 ,     i f       R a n k ( x , X ) N 0 ,     i f       R a n k ( x , X ) > N
where R a n k ( x , X ) denotes the position of the element x in X , and N is a positive integer.
The above calculation method of Mean Rank and Hits@N is called the “raw” setting. In fact, an incorrect triplet generated may be a triplet in the knowledge graph, so it is not wrong to rank it before the original correct triplet. To eliminate this factor, those incorrect triplets, which exist in either training, validation, or test sets, are removed before obtaining the rank of each test triple. The above setting is called “Filt.” The score function f r ( h , t ) is essentially a distance function. Thus, a lower f r ( h , t ) illustrates that the translation model is more effective, and vice versa, i.e., the translation model with lower Mean Rank and higher Hits@N is more effective.

4.3. Link Prediction Experiments

The link prediction experiments consist of three parts. The first part is the parameter range and optimal parameter selection for the proposed model, the second part is the analysis of the experimental results of entity prediction, and the last part is the analysis of the experimental results of relation prediction.

4.3.1. Optimal Parameter Selection

The optimal optimization selection is divided two parts. The first part is the optimal parameter selection for ERDERP in the entity prediction based on WN18 and FB15K. The second part is the optimal parameter selection for ERDERP, TransD and TransH in the relation prediction based on WN18RR, FB15K and FB15K-237. The two parts are described in detail below.
In the optimal parameter selection of entity prediction, the learning rate ( l r ), the margin ( γ ), the embedding dimension ( k ), the batch size ( B ), and the epoch ( e ) are the hyperparameters that ERDERP needs to be optimized. The hyperparameter optimization spaces of ERDERP on WN18 and FB15K are shown in Table 4.
Through multiple experiments, the optimal parameters of ERDERP on WN18 and FB15K are shown in Table 5.
In the optimal parameter selection of relation prediction, the relation prediction accuracy of TransH and ERDERP are mainly compared in relation prediction, and the PyTorch framework and Adam algorithm are adopted to train ERDERP, TransD and TransH. The datasets of WN18RR, FB15K and FB15K-237 are adopted as the experimental data. The learning rate ( l r ), the margin ( γ ), the embedding dimension ( k ), the weight ( C ), a hyperparameter to measure the importance of the soft constraints in TransH), the batch size ( B ) and the epoch ( e ) are the hyperparameters that TransH, TransD and ERDERP needs to be optimized. The hyperparameter optimization spaces of the three datasets are shown in Table 6.
Through multiple experiments, the optimal parameters of ERDERP, TransD and TransH of the three datasets are shown in Table 7.

4.3.2. Analysis of the Experimental Results of Entity Prediction

WN18 and FB15K are adopted as the experimental data in the entity prediction experiments. To validate the link prediction performance of the proposed ERDERP, unstructured [21], RESCAL [25], SE [19], SME (Linear) [21], SME (Bilinear) [21], LFM [23], TransE [27], TransH [28], TransR [29], CTransR [29] and TransD [30] models are adopted as the comparison models. To quantify the accuracy of link prediction, the Raw Entity Mean Rank, Filt Entity Mean Rank, Raw Entity Hits@10 and Filt Entity Hits@10 are adopted in the entity prediction experiments.
The optimal hyperparameters in Table 5 are adopted to train ERDERP. The entity prediction experimental results of the ERDERP and the comparison models on WN18 and FB15K are shown in Table 8.
As shown in Table 8, the experimental results show that compared with the unstructured, RESCAL, SE, SME (linear), SME (bilinear), LFM, TransE, TransH, TransR, and CTransR models, the proposed ERDERP achieves the best entity prediction accuracy overall on WN18 and FB15K and its performance is equivalent to that of TransD. Moreover, the parameter complexity of TransD is much higher than that of ERDERP, as shown in Table 1. Therefore, the proposed ERDERP outperforms TransD in entity prediction of WN18 and FB15K, i.e., the proposed ERDERP is more effective in entity prediction of WN18 and FB15K.
On WN18, the entity prediction accuracy of ERDERP is significantly better than that of TransH and other the non-translation models. Compared with TransR, CTransR, and TransD, ERDERP achieves the best results at Hits@10, which indicates that the head/tail entity of most test triplets are in the top 10 in the head/tail entity scoring sequence. However, ERDERP performs poorly at Mean Rank, which may be because the head/tail entities of a few test triplets are in a larger position in the head/tail entity scoring sequence. ERDERP is improved on TransH. Moreover, the experimental results illustrate that compared with TransH, ERDERP can effectively realize entity prediction in the dataset with sample relations. For example, compared with TransH, Raw Mean Rank and Filt Mean Rank increased by 142.8 and 122. Raw Hits@10 and Filt Hits@10 increased by 6.9% and 10.9%. The results show that by considering the diversity of the relations, ERDERP can effectively handle simple relations, so as to effectively complete entity prediction.
On FB15K, ERDERP outperforms unstructured, RESCAL, SE, SME (linear), SME (bilinear), LFM, TransE, TransH, TransR and CtransR in entity prediction accuracy and its entity prediction accuracy is equivalent to that of TransD. ERDERP outperforms TransD at Mean Rank and TransD outperforms ERDERP at Hits@10. Overall, ERDERP achieves the same performance as TransD on a few parameters. Compared with TransH, TransR and CtransR, ERDERP achieves great improvement in all aspects, especially compared with TransH. Raw Mean Rank and Filt Mean Rank increased by 23 and 33. Raw Hits@10 and Filt Hits@10 increased by 3.4% and 6.7%. The experimental results show that the proposed ERDERP model can effectively realize entity prediction on the dataset with complex relationships, i.e., ERDERP is effective in solving the complex relationship problem of the knowledge graph.
On the one hand, there is a lack of effective methods to completely separate datasets based on the refined complex relations in this paper. On the other hand, the traditional complex relationships can be regarded as the complexity and diversity of entities. Therefore, 1-N, N-1, N-N are mainly adopted to verify the ability of ERDERP in extracting the features of the complexity and diversity of entities. Then, ERDERP and the comparison models are respectively adopted to predict head entity and tail entity on 1-to-1, 1-to-N, N-to-1 and N-to-N of FB15K. The experimental results are shown in Table 9.
Table 9 illustrates that compared with unstructured, SE, SME (linear), SME (bilinear), TransE, and TransH, ERDERP achieves the best prediction accuracy of head entity and tail entity in the complex relationships of a knowledge graph. Compared with TransR, ERDERP is more effective on N-to-1 of the head entity prediction and 1-to-N of the tail entity prediction, with a significant increase of 15.4% and 11.9%, respectively. In other aspects, the effects of TransR and ERDERP are similar. Therefore, ERDERP outperforms TransR in entity prediction, as shown in Table 8. Moreover, compared with TransH, the head entity prediction accuracy of ERDERP on 1-to-1, 1-to-N, N-to-1, and N-to-N increased by 11.3%, −1.3%, 20.8%, and 5.8%, respectively, while the tail entity prediction accuracy of ERDERP on 1-to-1, 1-to-N, N-to-1, and N-to-N was 13.6%, 11.9%, 10.5%, 2.3%, and 6.1%. The experimental results show that ERDERP can effectively improve entity prediction in datasets with simple relationships and solve the complex relationships of knowledge graphs.
The experimental results of entity prediction illustrate that it is believed that the entities and relations embedding vectors of ERDERP contain rich semantic information by considering the diversity of the relations themselves and that ERDERP has a significant effect on improving entity prediction accuracy. The results show that ERDERP can effectively solve the simple relationships and complex relationships of knowledge graphs. On the other hand, to verify that the relation embedding vector of ERDERP contains the diversity information of the relation, ERDERP, TransD and TransH are used in the relation prediction experiments on various datasets.

4.3.3. Analysis of the Experimental Results of Relation Prediction

The hyperparameters in Table 7 were respectively used to train TransH, TransD and ERDERP to carry out comparative experiments of relation prediction on WN18RR, FB15K and FB15K-237. In addition, Filt Mean Rank, Filt Hits@1, Filt Hits@3 and Filt Hits@10 were adopted as the evaluation indices for the accuracy of relation prediction. The experimental results of relation prediction are shown in Table 10.
Table 10 shows that in terms of relation prediction, compared with TransH and TransD, ERDERP achieves the best results in all evaluation indicators of the three datasets. On the three datasets, WN18RR contains 11 relations, FB15K 1345 relations and FB15K-237 237 relations. Compared with TransH, the more relations the dataset contains, the more the relation prediction accuracy is improved by ERDERP at Mean Rank. For example, Mean Rank increases by 3 on WN18RR, by 26 on FB15K-237, and 106 on FB15K. Compared with TransD, ERDERP improves the Mean Rank by 1/0.2/0.8 on WN18RR/FB15K-237/FB15K.
In terms of Hits@N, the relation prediction accuracy of ERDERP on WN18RR, FB15K and FB15K-237 is significantly higher than that of TransH and TransD, which may be because TransH and TransD did not directly solve the complexity of the relations, which makes it difficult to extract the semantic features of the relations. Compared with TransH, Hits@1/Hits@3/Hits@10 of ERDERP respectively increased by 0.7%/24.3%/36.1% on WN18RR, 34.2%/32.2%/27.9% on FB15K, and 43.5%/43.7%/39.7 on FB15K-237. Compared with TransD, Hits@1/Hits@3/Hits@10 of ERDERP respectively increased by 5.5%/8.5%/0% on WN18RR, 2.1%/1.4%/0.7% on FB15K, and 2%/0.7%/0.1% on FB15K-237.
The experimental results of relation prediction show that compared with TransH and TransD, ERDERP shows excellent performance on datasets with fewer and more relations. Therefore, ERDERP can effectively realize relation prediction because it can directly handle the diversity of relations.
The above experimental results of link prediction show that ERDERP significantly improves relation prediction accuracy and entity prediction accuracy by considering the diversity of the relations and allocating a relation subspace to each relation. ERDERP can effectively realize the link prediction of datasets with fewer and more relations, i.e., ERDERP can effectively solve the complex relationships of knowledge graphs. The relation prediction accuracy of ERDERP is significantly higher than that of TransH on datasets with more relations. In real life, the relations between entities are more complex and diverse. Therefore, the proposed ERDERP can provide technical support for actual link prediction.

5. Conclusions

Currently, TransE and other translation models are widely used in knowledge graph completion technology. To improve the accuracy of entity prediction, the traditional translation models are oriented to solve the complex relationships of knowledge graphs, such as one-to-many, many-to-one, and many-to-many. However, few researchers consider the diversity of the relations and study relation prediction. Therefore, we studied the diversity of the relations, and the diversity of the relations was integrated into the complex relationships of the knowledge graph. Then, the complex relationships of the knowledge graph were refined as one-to-one-to-many, many-to-one-to-one, one-to-many-to-one, many-to-one-to-many, many-to-many-to-one, one-to-many-to-many, and many-to-many-to-many. By presenting the diversity of the relations themselves independently, it was found that with traditional models, without considering the diversity of relations themselves, it is difficult to effectively extract the semantic features of the relations. Then, to effectively extract the semantic information of entities and relations and improve the accuracy of link prediction, we studied the translation model, i.e., analyzing the complex relationships of the knowledge graph and TransE. Then, an entity and relation double embedding on relation hyperplanes and relation projection hyperplanes (ERDERP) model was proposed. First, ERDERP establishes a relation hyperplane for each relation to solve the diversity of relations and increase the distinguishability between multirelations. Second, ERDERP establishes a relation projection hyperplane for each relation projection to solve the complexity and diversity of entities and increase the distinguishability between multiple entities. Thus, the entity and relation embedding vectors with rich semantic information can be obtained. Moreover, it is theoretically proved that ERDERP can solve antisymmetry. Finally, ERDERP is compared with several typical knowledge graph completion models on several typical datasets. The experimental results show that the proposed ERDERP significantly improves the link prediction accuracy, especially in relation prediction. For example, compared with TransH, Hits@1 of ERDERP increased by at least 30% on FB15K and FB15K-237. The results verify that considering the diversity of the relations has a significant effect in link prediction.
ERDERP has strong extensibility. Other translation models can also solve the diversity of the relations by allocating a subspace to each relation. Therefore, combining the ideas proposed in this paper with other translation models to improve entity prediction accuracy and relation prediction accuracy is our future research direction. In addition, providing theoretical justifications of other inference patterns for ERDERP would also be worth researching in the future.

Author Contributions

Conceptualization, L.L., F.G. and J.L.; methodology, L.L. and J.L.; software, J.L. and C.T.; validation, J.L., L.Z., C.T. and H.G.; formal analysis, L.Z. and C.T.; investigation, H.G.; writing—original draft preparation, J.L.; writing—review and editing, J.L., L.Z. and F.G.; visualization, J.L.; supervision, L.L. and F.G.; project administration, L.L.; funding acquisition, L.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the National Natural Science Foundation of China (grant number: U2133202). The APC was funded by Harbin Institute of Technology.

Data Availability Statement

There are no publicly archived datasets generated during the study.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Singhal, A. Introducing the knowledge graph: Things, not strings. Off. Google Blog 2012, 5, 16. [Google Scholar]
  2. Roopak, N.; Deepak, G. OntoKnowNHS: Ontology driven knowledge centric novel hybridised semantic scheme for image recommendation using knowledge graph. In Iberoamerican Knowledge Graphs and Semantic Web Conference; Springer: Cham, Switzerland, 2021; pp. 138–152. [Google Scholar]
  3. Fu, S.; Zhang, Y.; Lin, L.; Zhao, M.; Zhong, S.S. Deep residual LSTM with domain-invariance for remaining useful life prediction across domains. Reliab. Eng. Syst. Saf. 2021, 216, 108012. [Google Scholar] [CrossRef]
  4. Li, L.; Li, H.; Kou, G.; Yang, D.; Hu, W.; Peng, J.; Li, S. Dynamic Camouflage Characteristics of a Thermal Infrared Film Inspired by Honeycomb Structure. J. Bionic Eng. 2022, 19, 458–470. [Google Scholar] [CrossRef]
  5. Ye, Q.; Hsieh, C.Y.; Yang, Z.; Kang, Y.; Chen, J.; Cao, D.; He, S.; Hou, T. A unified drug–target interaction prediction framework based on knowledge graph and recommendation system. Nat. Commun. 2021, 12, 6775. [Google Scholar] [CrossRef] [PubMed]
  6. Xie, L.; Hu, Z.; Cai, X.; Zhang, W.; Chen, J. Explainable recommendation based on knowledge graph and multi-objective optimization. Complex Intell. Syst. 2021, 7, 1241–1252. [Google Scholar] [CrossRef]
  7. Yin, C.; Zhang, B.; Liu, W.; Du, M.; Luo, N.; Zhai, X.; Ba, T. Geographic Knowledge Graph Attribute Normalization: Improving the Accuracy by Fusing Optimal Granularity Clustering and Co-Occurrence Analysis. ISPRS Int. J. Geo-Inf. 2022, 11, 360. [Google Scholar] [CrossRef]
  8. Bharadwaj, A.G.; Starly, B. Knowledge graph construction for product designs from large CAD model repositories. Adv. Eng. Inform. 2022, 53, 101680. [Google Scholar] [CrossRef]
  9. Liu, H.; Singh, P. ConceptNet—A practical commonsense reasoning tool-kit. BT Technol. J. 2004, 22, 211–226. [Google Scholar] [CrossRef]
  10. Bollacker, K.; Evans, C.; Paritosh, P.; Sturge, T.; Taylor, J. Freebase: A collaboratively created graph database for structuring human knowledge. In Proceedings of the 2008 ACM SIGMOD International Conference on Management of Data, Vancouver, BC, Canada, 9–12 June 2008; pp. 1247–1250. [Google Scholar]
  11. Miller, G.A. WordNet: A lexical database for English. Commun. ACM 1995, 38, 39–41. [Google Scholar] [CrossRef]
  12. Lever, J.; Gakkhar, S.; Gottlieb, M.; Rashnavadi, T.; Lin, S.; Siu, C.; Smith, M.; Jones, M.R.; Krzywinski, M.; Jones, S.J. A collaborative filtering-based approach to biomedical knowledge discovery. Bioinformatics 2018, 34, 652–659. [Google Scholar] [CrossRef] [Green Version]
  13. Yu, T.; Li, J.; Yu, Q.; Tian, Y.; Shun, X.; Xu, L.; Zhu, L.; Gao, H. Knowledge graph for TCM health preservation: Design, construction, and applications. Artif. Intell. Med. 2017, 77, 48–52. [Google Scholar] [CrossRef] [PubMed]
  14. Zhang, X.; Liu, X.; Li, X.; Pan, D. MMKG: An approach to generate metallic materials knowledge graph based on DBpedia and Wikipedia. Comput. Phys. Commun. 2017, 211, 98–112. [Google Scholar] [CrossRef]
  15. Wang, C.; Ma, X.; Chen, J.; Chen, J. Information extraction and knowledge graph construction from geoscience literature. Comput. Geosci. 2018, 112, 112–120. [Google Scholar] [CrossRef]
  16. Wu, X.; Tang, Y.; Zhou, C.; Zhu, G.; Song, J.; Liu, G. An Intelligent Search Engine Based on Knowledge Graph for Power Equipment Management. In Proceedings of the 2022 5th International Conference on Energy, Electrical and Power Engineering (CEEPE), Chongqing, China, 22–24 April 2022; pp. 370–374. [Google Scholar]
  17. Shi, M. Knowledge graph question and answer system for mechanical intelligent manufacturing based on deep learning. Math. Probl. Eng. 2021, 2021, 6627114. [Google Scholar] [CrossRef]
  18. Hui, B.; Zhang, L.; Zhou, X.; Wen, X.; Nian, Y. Personalized recommendation system based on knowledge embedding and historical behavior. Appl. Intell. 2022, 52, 954–966. [Google Scholar] [CrossRef]
  19. Bordes, A.; Weston, J.; Collobert, R.; Bengio, Y. Learning structured embeddings of knowledge bases. In Proceedings of the AAAI Conference on Artificial Intelligence, San Francisco, CA, USA, 7–11 August 2011; Volume 25. [Google Scholar]
  20. Socher, R.; Chen, D.; Manning, C.D.; Ng, A. Reasoning with neural tensor networks for knowledge base completion. In Proceedings of the Advances in Neural Information Processing Systems, Lake Tahoe, NV, USA, 5–10 December 2013; pp. 926–934. [Google Scholar]
  21. Bordes, A.; Glorot, X.; Weston, J.; Bengio, Y. A semantic matching energy function for learning with multi-relational data. Mach. Learn. 2014, 94, 233–259. [Google Scholar] [CrossRef] [Green Version]
  22. Bordes, A.; Glorot, X.; Weston, J.; Bengio, Y. Joint learning of words and meaning representations for open-text semantic parsing. In Proceedings of the 15th International Conference on Artificial Intelligence and Statistics, Canary Islands, Spain, 21–23 April 2012; Volume 22, pp. 127–135. [Google Scholar]
  23. Jenatton, R.; Roux, N.; Bordes, A.; Obozinski, G.R. A latent factor model for highly multi-relational data. In Proceedings of the Advances in Neural Information Processing Systems 25 (NIPS 2012), Lake Tahoe, NV, USA, 3–6 December 2012; pp. 3176–3184. [Google Scholar]
  24. Sutskever, I.; Salakhutdinov, R.R.; Tenenbaum, J.B. Modelling relational data using bayesian clustered tensor factorization. In Proceedings of the 22nd International Conference on Neural Information Processing Systems, Vancouver, BC, Canada, 7–10 December 2009; pp. 1821–1828. [Google Scholar]
  25. Nickel, M.; Tresp, V.; Kriegel, H.P. A three-way model for collective learning on multi-relational data. In Proceedings of the 28th International Conference on Machine Learning, Bellevue, WA, USA, 28 June–2 July 2011; pp. 809–816. [Google Scholar]
  26. Nickel, M.; Tresp, V.; Kriegel, H.P. Factorizing yago: Scalable machine learning for linked data. In Proceedings of the 21st International Conference on World Wide Web, Lyon, France, 16–20 April 2012; pp. 271–280. [Google Scholar]
  27. Bordes, A.; Usunier, N.; Garcia-Duran, A.; Weston, J.; Yakhnenko, O. Translating embeddings for modeling multi-relational data. In Proceedings of the Neural Information Processing Systems (NIPS), Lake Tahoe, NV, USA, 5 December 2013; pp. 1–9. [Google Scholar]
  28. Wang, Z.; Zhang, J.; Feng, J.; Chen, Z. Knowledge graph embedding by translating on hyperplanes. In Proceedings of the AAAI Conference on Artificial Intelligence, Québec City, QC, Canada, 27–31 July 2014; Volume 28. [Google Scholar]
  29. Lin, Y.; Liu, Z.; Sun, M.; Liu, Y.; Zhu, X. Learning entity and relation embeddings for knowledge graph completion. In Proceedings of the AAAI Conference on Artificial Intelligence, Austin, TX, USA, 25–30 January 2015; Volume 29. [Google Scholar]
  30. Ji, G.; He, S.; Xu, L.; Liu, K.; Zhao, J. Knowledge graph embedding via dynamic mapping matrix. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing, Beijing, China, 26–31 July 2015; Volume 1, pp. 687–696. [Google Scholar]
  31. Xiao, H.; Huang, M.; Hao, Y.; Zhu, X. TransA: An adaptive approach for knowledge graph embedding. arXiv 2015, arXiv:1509.05490. [Google Scholar]
  32. Ji, S.; Pan, S.; Cambria, E.; Marttinen, P.; Philip, S.Y. A survey on knowledge graphs: Representation, acquisition, and applications. IEEE Trans. Neural Netw. Learn. Syst. 2021, 33, 494–514. [Google Scholar] [CrossRef] [PubMed]
  33. Yang, S.; Tian, J.; Zhang, H.; Yan, J.; He, H.; Jin, Y. TransMS: Knowledge Graph Embedding for Complex Relations by Multidirectional Semantics. In Proceedings of the 28th International Joint Conference on Artificial Intelligence, Macao, China, 10–16 August 2019; pp. 1935–1942. [Google Scholar]
  34. Xiao, H.; Huang, M.; Hao, Y.; Zhu, X. TransG: A generative mixture model for knowledge graph embedding. arXiv 2015, arXiv:1509.05488. [Google Scholar]
  35. He, S.; Liu, K.; Ji, G.; Zhao, J. Learning to represent knowledge graphs with gaussian embedding. In Proceedings of the 24th ACM International on Conference on Information and Knowledge Management, Melbourne, Australia, 19–23 October 2015; pp. 623–632. [Google Scholar]
  36. Lei, Z.; Sun, Y.; Nanehkaran, Y.A.; Yang, S.; Islam, M.S.; Lei, H.; Zhang, D. A novel data-driven robust framework based on machine learning and knowledge graph for disease classification. Future Gener. Comput. Syst. 2020, 102, 534–548. [Google Scholar] [CrossRef]
  37. Jia, Y.; Wang, Y.; Jin, X.; Cheng, X. Path-specific knowledge graph embedding. Knowl.-Based Syst. 2018, 151, 37–44. [Google Scholar] [CrossRef]
  38. Abboud, R.; Ceylan, I.; Lukasiewicz, T.; Salvatori, T. Boxe: A box embedding model for knowledge base completion. Adv. Neural Inf. Process. Syst. 2020, 33, 9649–9661. [Google Scholar]
  39. Trouillon, T.P.; Bouchard, G.M. Complex Embeddings for Simple Link Prediction. U.S. Patent Application 15/156,849, 23 November 2017. [Google Scholar]
  40. Sun, Z.; Deng, Z.H.; Nie, J.Y.; Tang, J. Rotate: Knowledge graph embedding by relational rotation in complex space. arXiv 2019, arXiv:1902.10197. [Google Scholar]
  41. Zhang, Z.; Cai, J.; Zhang, Y.; Wang, J. Learning hierarchy-aware knowledge graph embeddings for link prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, New York, NY, USA, 9–11 February 2020; Volume 34, pp. 3065–3072. [Google Scholar]
  42. Mikolov, T.; Sutskever, I.; Chen, K.; Corrado, G.S.; Dean, J. Distributed representations of words and phrases and their compositionality. Adv. Neural Inf. Process. Syst. 2013, 26, 3111–3119. [Google Scholar]
  43. Dettmers, T.; Minervini, P.; Stenetorp, P.; Riedel, S. Convolutional 2D knowledge graph embeddings. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, New Orleans, LA, USA, 2–7 February 2018. [Google Scholar]
  44. Toutanova, K.; Chen, D. Observed versus latent features for knowledge base and text inference. In Proceedings of the 3rd Workshop on Continuous Vector Space Models and Their Compositionality, Beijing, China, 26–31 July 2015; pp. 57–66. [Google Scholar]
Figure 1. Examples of complex relationships.
Figure 1. Examples of complex relationships.
Mathematics 10 04182 g001
Figure 2. An example of 1-M-N and N-M-1 in FB15K.
Figure 2. An example of 1-M-N and N-M-1 in FB15K.
Mathematics 10 04182 g002
Figure 3. The schematic diagram of ERDERP.
Figure 3. The schematic diagram of ERDERP.
Mathematics 10 04182 g003
Figure 4. Training process of ERDERP.
Figure 4. Training process of ERDERP.
Mathematics 10 04182 g004
Table 1. Score functions and analysis of the parameter complexity of several translation models ( n e represents the number of entities. n r represents the number of relations. k and n are the dimensions of the embedding space for entities and relations, respectively. d represents the number of relation clusters).
Table 1. Score functions and analysis of the parameter complexity of several translation models ( n e represents the number of entities. n r represents the number of relations. k and n are the dimensions of the embedding space for entities and relations, respectively. d represents the number of relation clusters).
Model Score   Function   f r ( h , t ) Parameters
TransE h + r t L 1 / L 2 , h , t , r k O ( n e k + n r k )
TransH ( h w r T h w r ) + d r ( t w r T t w r )
h , t , d r , w r k
O ( n e k + 2 n r k )
TransR ( h M r ) + r ( t M r )
h , t k , r n , M r k × n
O ( n e k + n r ( k + 1 ) n )
CTransR h M r + r c h M r 2 2 + α r c r 2 2
h , t k , r , r c n , M r k × n
O ( n e k + n r ( k + d ) n )
TransD h M r , h + r t M r , t 2 2
h , t k , r n , M r , h , M r , t k × n
O ( 2 n e k + 2 n r n )
ERDERP
(our)
( h w r T h w r ) + ( r s r T r s r ) ( t w r T t w r )
h , t , r , w r , s r k
O ( n e k + 3 n r k )
Table 2. The general concepts and symbols in this paper.
Table 2. The general concepts and symbols in this paper.
Concept or SymbolMeaning
(h, r, t)Triple in knowledge graph.
( h ,   r ,   t ) The embedding vector of (h, r, t).
h, r, tHead entity, relation and tail entity in (h, r, t), respectively.
h , r , t The embedding vector of h, r, t, respectively.
E The entity set of knowledge graph.
Δ The triple set of knowledge graph.
( h , r , t ) Δ (h, r, t) is a triple in Δ .
Δ ( h , r , t ) The incorrect triple set generated by (h, r, t).
( h , r , t ) Δ ( h , r , t ) ( h , r , t ) is a triple in Δ ( h , r , t ) .
Table 3. Details of the experimental data.
Table 3. Details of the experimental data.
DatasetRelationEntityTriples
TrainValidTest
WN181840,943141,44250005000
WN18RR1140,94386,83530343134
FB15K134514,951483,14250,00059,071
FB15K-23723714,541271,11517,53520,466
Table 4. The hyperparameter optimization spaces of ERDERP on WN18 and FB15K.
Table 4. The hyperparameter optimization spaces of ERDERP on WN18 and FB15K.
Hyperparameters l r γ k B e
WN18{0.01, 0.001}{1, 2, 4, 6}{50, 100}{1200, 2400, 4800}500
FB15K{0.01, 0.001}{1, 1.5, 2, 2.5}{50, 100}{1200, 2400, 4800}500
Table 5. The optimal hyperparameters of ERDERP on WN18 and FB15K.
Table 5. The optimal hyperparameters of ERDERP on WN18 and FB15K.
Hyperparameters l r γ k B e
WN180.00121001200500
FB15K0.00012.51002400500
Table 6. Hyperparameter optimization spaces of ERDERP and TransH of the four datasets.
Table 6. Hyperparameter optimization spaces of ERDERP and TransH of the four datasets.
Hyperparameters l r γ k C B e
WN18RR{0.01, 0.001}{0.5, 1, 2, 4}{50, 100}{0.25, 0.5, 1}{1200, 2400, 4800}500
FB15K{0.01, 0.001}{1, 1.5, 2, 2.5}{50, 100}{0.25, 0.5, 1}{1200, 2400, 4800}500
FB15K-237{0.01, 0.001}{0.5, 1, 2, 4}{50, 100}{0.25, 0.5, 1}{1200, 2400, 4800}500
Table 7. Optimal configurations of ERDERP, TransD and TransH of each dataset.
Table 7. Optimal configurations of ERDERP, TransD and TransH of each dataset.
Hyperparameters l r γ k C B e
WN18RRTransH0.0011500.52400500
TransD0.014100-2400500
ERDERP0.0014100-4800500
FB15KTransH0.0012500.254800500
TransD0.012.5100-2400500
ERDERP0.0012.5100-1200500
FB15K-237TransH0.0012500.254800500
TransD0.0014100-4800500
ERDERP0.014100-4800500
Table 8. Entity prediction results.
Table 8. Entity prediction results.
DatasetWN18FB15k
MetricMean RankHits@10Mean RankHits@10
Raw.FiltRawFilt.Raw.FiltRaw.Filt
Unstructured31530435.338.210749794.56.3
RESCAL1180116337.252.882868328.444.1
SE101198568.580.527316228.839.8
SME54553365.174.127415430.740.8
SME52650954.761.328415831.341.3
LFM46945671.481.628316426.033.1
TransE26325175.489.224312534.947.1
TransH400.83887382.32128745.764.4
TransR23822579.892.01987748.268.7
CTransR23121879.492.31997548.470.2
TransD22421279.692.21949153.477.3
ERDERP25824679.993.21895449.171.1
Table 9. Decomposition experimental results for complex relationships.
Table 9. Decomposition experimental results for complex relationships.
TasksPredict Head (Filt Hits@10)Predict Tail (Filt Hits@10)
Relation Category1-to-11-to-NN-to-1N-to-N1-to-11-to-NN-to-1N-to-N
Unstructured34.52.56.16.634.34.21.96.6
SE35.662.617.237.534.914.668.341.3
SME(Linear)35.153.719.040.332.714.961.643.3
SME(Bilinear)30.969.619.938.628.213.176.041.8
TransE43.765.718.247.243.719.766.750.0
TransH66.887.628.764.565.539.883.367.2
TransR78.889.234.169.279.237.490.472.1
ERDERP78.186.349.570.379.151.785.673.3
Table 10. Relation prediction results of TransH, TransD, and ERDERP on three datasets.
Table 10. Relation prediction results of TransH, TransD, and ERDERP on three datasets.
DatasetWN18RRFB15KFB15K-237
TransHMean Rank511128
Hits@143.240.743.4
Hits@354.055.650.5
Hits@1063.866.457.0
TransDMean Rank35.42.3
Hits@138.272.884.9
Hits@369.886.493.5
Hits@1099.993.696.6
ERDERPMean Rank24.62.1
Hits@143.774.986.9
Hits@378.387.894.2
Hits@1099.994.396.7
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Lin, L.; Liu, J.; Guo, F.; Tong, C.; Zu, L.; Guo, H. ERDERP: Entity and Relation Double Embedding on Relation Hyperplanes and Relation Projection Hyperplanes. Mathematics 2022, 10, 4182. https://doi.org/10.3390/math10224182

AMA Style

Lin L, Liu J, Guo F, Tong C, Zu L, Guo H. ERDERP: Entity and Relation Double Embedding on Relation Hyperplanes and Relation Projection Hyperplanes. Mathematics. 2022; 10(22):4182. https://doi.org/10.3390/math10224182

Chicago/Turabian Style

Lin, Lin, Jie Liu, Feng Guo, Changsheng Tong, Lizheng Zu, and Hao Guo. 2022. "ERDERP: Entity and Relation Double Embedding on Relation Hyperplanes and Relation Projection Hyperplanes" Mathematics 10, no. 22: 4182. https://doi.org/10.3390/math10224182

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop