Knowledge graph embedding method based on structure and semantic fusion
By constructing a triple entity embedding fusion model, which combines the structural and semantic information of knowledge graphs, the compatibility and efficiency issues of traditional knowledge graph embedding methods are solved, achieving more accurate representation of entity semantic relationships and improving the feature representation capability and prediction accuracy of knowledge graphs.
Patent Information
- Application Number
- CN202511539659.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-27
- Publication Date
- 2026-01-23
AI Technical Summary
Traditional knowledge graphs suffer from compatibility and computational efficiency issues when combined with machine learning models, making it difficult to meet the efficiency requirements of practical applications. Furthermore, existing knowledge graph embedding methods struggle to accurately represent the semantic relationships of entities.
By constructing a triplet entity embedding fusion model, including a projection module, a semantic embedding module, and an embedding vector fusion module, and combining the structural and semantic information of entities, positive and negative triplets are used for training to update entity and relation embedding vectors, thereby improving the feature representation capability of knowledge graphs.
It improves the feature representation capabilities of knowledge graph embedding, enhances the semantic information representation of entities, and improves the accuracy of link prediction and triple classification, especially performing excellently in the processing of complex relationships.
Smart Images

Figure CN121390262A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of big data technology, and more specifically, relates to a knowledge graph embedding method based on the fusion of structure and semantics. Background Technology
[0002] A knowledge graph (KG) is a graph-based method for representing knowledge, consisting of nodes and directed edges. Nodes represent entities in the real world, and directed edges represent relationships between entities. In this graph, each directed edge connects a head entity and a tail entity, forming a triple (head entity, relation, tail entity), reflecting the semantic associations between entities. Although knowledge graphs have shown great potential in many fields, traditional knowledge representation methods still have limitations when combined with machine learning models. On the one hand, symbolic logic-based representation methods are difficult to be effectively compatible with neural network models; on the other hand, when dealing with large-scale knowledge graphs, storage and reasoning processes often involve high computational costs, making it difficult to meet the efficiency requirements of practical applications.
[0003] To address this, Knowledge Graph Embedding (KGE) maps entities and relations in a knowledge graph (KG) to a low-dimensional continuous vector space, preserving the structural and semantic information of the KG. This process not only improves computational efficiency and reduces storage overhead but also provides an efficient processing method for knowledge representation and reasoning. KGE's advantage lies in its ability to support various downstream tasks while maintaining the integrity of the KG's structure and semantic information, thus greatly promoting its practical application in fields such as artificial intelligence, data mining, and intelligent applications. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a knowledge graph embedding method based on the fusion of structure and semantics. This method fuses the structural embedding vectors and semantic embedding vectors of entities in the knowledge graph to achieve semantic enhancement of the entity embedding vectors, thereby improving the feature representation capability of knowledge graph embedding.
[0005] To achieve the above-mentioned objectives, the knowledge graph embedding method based on structural and semantic fusion of the present invention includes the following steps:
[0006] S1: Memorizing Knowledge Graphs ,in Represents the set of entities in a knowledge graph, containing Different entities, Represents the set of relations in a knowledge graph, containing Different kinds of relationships, A set of triples representing a knowledge graph, where each triple is represented as... ,in , These represent the head entity and the tail entity, respectively. , Simultaneously, obtain the text description of each entity;
[0007] S2: Construct a triple entity embedding fusion model, including a projection module, a semantic embedding module, and an embedding vector fusion module, wherein:
[0008] The projection module is used to take each relationship Setting the projection matrix triplet Middle head entity Tail-end entity The embedding vector is projected from the entity space to the relation space to obtain the head entity. Tail-end entity Structure embedding vector , And send it to the embedded vector fusion module:
[0009] ,
[0010] ,
[0011] in, , Represents a triplet Middle head entity Tail-end entity Embedded vectors in entity space , They represent Dimensional entity space and dimensional relational space;
[0012] The semantic embedding module is used to handle triples separately. Middle head entity Tail-end entity The text description is semantically encoded to obtain a semantic embedding vector. , And send it to the embedded vector fusion module;
[0013] The embedded vector fusion module is used to process the head entity separately. Tail-end entity The structural embedding vector and the semantic embedding vector are fused to obtain the fused embedding vector. , ;
[0014] S3: Initialize entity embedding vectors in the knowledge graph and relation embedding vector , , ;
[0015] S4: Sample from the knowledge graph These triples constitute the set of positive examples for this round. Simultaneously generate Triples that do not belong to the knowledge graph constitute the negative example set for this round. ;
[0016] S5: Set the positive examples for this round. and negative example set Each triplet Input the triple entity embedding model to obtain the head entity. Tail-end entity fused embedding vector , , based on the fused embedding vector of head and tail entities , and relation embedding vectors Calculate each triplet Scoring function ;
[0017] S6: Calculate the loss function for this round using the following formula. :
[0018] ,
[0019] in, Indicates the interval hyperparameter;
[0020] S7: Update the entity embedding vectors in the knowledge graph according to the loss function. and relation embedding vector And the parameters of the triple entity embedding fusion model;
[0021] S8: Determine whether the iteration termination condition has been met. If it has, the knowledge graph embedding ends; otherwise, return to step S4.
[0022] This invention presents a knowledge graph embedding method based on structural and semantic fusion. It constructs a triplet entity embedding fusion model comprising a projection module, a semantic embedding module, and an embedding vector fusion module. In each iteration, positive and negative triplets are sampled. The triplet entity embedding fusion model is used to fuse the structural and semantic embedding vectors of the head and tail entities in each triplet to obtain a fused embedding vector. Then, a scoring function for each triplet is calculated, followed by the loss function for this iteration. Finally, the entity embedding vectors and relation embedding vectors in the knowledge graph, as well as the parameters of the triplet entity embedding fusion model, are updated until the iteration termination condition is met.
[0023] This invention addresses the challenge of accurately representing the semantic relationships of entities by relying solely on structural information. It extracts semantic information from the entity text description, establishes semantic interaction between triples and entity text description, enhances the semantic information of entities, and thereby improves the feature representation capability of knowledge graph embedding. Attached Figure Description
[0024] Figure 1 This is a flowchart illustrating a specific implementation of the knowledge graph embedding method based on structural and semantic fusion of the present invention.
[0025] Figure 2 This is a structural diagram of the triplet entity embedding fusion model in this invention;
[0026] Figure 3 This is a structural diagram of the semantic embedding module in this embodiment. Detailed Implementation
[0027] The specific embodiments of the present invention will now be described with reference to the accompanying drawings to enable those skilled in the art to better understand the invention. It should be particularly noted that in the following description, detailed descriptions of known functions and designs that might obscure the main content of the invention will be omitted here.
[0028] Example
[0029] Figure 1 This is a flowchart illustrating a specific implementation of the knowledge graph embedding method based on structural and semantic fusion of the present invention. Figure 1 As shown, the knowledge graph embedding method based on structural and semantic fusion of the present invention includes the following steps:
[0030] S101: Obtain knowledge graph information:
[0031] Memorizing Knowledge Graphs ,in Represents the set of entities in a knowledge graph, containing Different entities, Represents the set of relations in a knowledge graph, containing Different kinds of relationships, A set of triples representing a knowledge graph, where each triple is represented as... ,in , These represent the head entity and the tail entity, respectively. , At the same time, obtain the text description of each entity.
[0032] S102: Constructing a triplet entity embedding fusion model:
[0033] Figure 2 This is a structural diagram of the triplet entity embedding fusion model in this invention. For example... Figure 2 As shown, the triplet entity embedding fusion model in this invention includes a projection module, a semantic embedding module, and an embedding vector fusion module. Each module will be described in detail below.
[0034] The projection module is used to take each relationship Setting the projection matrix triplet Middle head entity Tail-end entity The embedding vector is projected from the entity space to the relation space to obtain the head entity. Tail-end entity Structure embedding vector , And send it to the embedded vector fusion module:
[0035] ,
[0036] ,
[0037] in, , Represents a triplet Middle head entity Tail-end entity Embedded vectors in entity space , They represent Dimensional entity space and A relational space of dimensions.
[0038] In this embodiment, the projection matrix The following formula is used to calculate:
[0039] ,
[0040] in, Represents a learnable matrix. Indicates a pre-defined relationship The sparsity factor can be used to control the sparsity of the transfer matrix. In this embodiment, the sparsity factor... The number of entity pairs connected by the relation is determined by the following formula:
[0041]
[0042] in, Representing relations Number of connected entity pairs This represents the maximum number of entity pairs connected by all relations. The hyperparameters used to calculate sparsity are... .
[0043] By dynamically adjusting the sparse structure of the relation projection matrix, the problems of overfitting simple relations and underfitting complex relations that may be caused by the assumption of homogeneity in relation distribution can be effectively mitigated.
[0044] The semantic embedding module is used to handle triples separately. Middle head entity Tail-end entity The text description is semantically encoded to obtain a semantic embedding vector. , And send it to the embedded vector fusion module.
[0045] The specific structure of the semantic embedding module can be set according to actual needs. Figure 3 This is a structural diagram of the semantic embedding module in this embodiment. For example... Figure 3 As shown, in this embodiment, the semantic embedding module includes a word embedding module, a bidirectional long short-term memory network, a self-attention aggregation layer, and an activation function layer, wherein:
[0046] The word embedding module is used to obtain word embedding sequences from text descriptions. And sent to the bidirectional long short-term memory network, where the first row vectors Indicates the first in the text description Word embedding vectors of each word , Indicates the number of words in the text description, superscript This indicates transposition. The method for generating the word embedding sequence in this embodiment is as follows:
[0047] Word embedding is performed on each word in the text description to obtain a sequence of word vectors. , Indicates the first in the text description The word vectors of each word are generated. Then, position embedding is performed on each word to obtain a sequence of position vectors. , Indicates the first in the text description The position vectors of each word are used to generate a word embedding sequence for the text description. superscript This indicates transpose.
[0048] Bidirectional long short-term memory networks are used for word embedding sequences Hidden feature extraction is performed to obtain the hidden feature sequence. And sent to the self-attention aggregation layer, where the first row vectors Word embedding vector The corresponding hidden feature vectors. The bidirectional structure of the bidirectional long short-term memory network can effectively utilize the contextual information in the text description to extract more accurate semantic features.
[0049] The self-attention aggregation layer is used to extract hidden feature sequences using a self-attention mechanism. Corresponding self-attention vector Then the self-attention vector As weights for the hidden feature sequence Each hidden feature vector Perform weighted summation to obtain aggregated features. And send it to the activation function layer.
[0050] The activation function layer is used to aggregate features using a preset activation function. The process is then performed to obtain the final semantic embedding vector.
[0051] The embedded vector fusion module is used to process the head entity separately. Tail-end entity The structural embedding vector and the semantic embedding vector are fused to obtain the fused embedding vector. , .
[0052] In knowledge graphs, triples and entity descriptions have varying degrees of importance and contribution to entity representation across different scenarios. To dynamically balance the influence of these two information sources, this embodiment introduces a gating mechanism. The core idea of this gating mechanism is to use a learnable control vector. This controls the contribution levels of different information sources. Therefore, the specific method of embedding vector fusion in this embodiment is as follows:
[0053] Set learnable vectors The gate vector is obtained by processing with the softmax function. Then, the fused embedding vector is calculated using the following formula:
[0054] ,
[0055] ,
[0056] in, It represents the Hadama accumulation.
[0057] Intuitively, when the gate vector When the value approaches 0, the fused embedding vector is forced to ignore the triplet structure information and only present the entity description information. When the gated vector... When the value is close to 1, the fused embedding vector mainly depends on the triplet structure information.
[0058] S103: Initialize the embedding vector:
[0059] Initialize entity embedding vectors in the knowledge graph and relation embedding vector , , In practical applications, the embedding vector can be initialized randomly or set based on historical experience.
[0060] S104: Sampling positive and negative examples:
[0061] Sampling from the knowledge graph These triples constitute the set of positive examples for this round. Simultaneously generate Triples that do not belong to the knowledge graph constitute the negative example set for this round. .
[0062] Knowledge graphs typically contain only correct triples and lack incorrect triples. Therefore, in this embodiment, negative triples are obtained by transforming positive triples, that is, by randomly replacing the head entity, relation, or tail entity in the positive triple. If the resulting triple does not belong to the knowledge graph, it is used as a negative triple; otherwise, the triple is ignored, and the random replacement operation is performed again.
[0063] S105: Calculate the triplet scoring function:
[0064] Set the positive examples for this round and negative example set Each triplet Input the triple entity embedding model to obtain the head entity. Tail-end entity fused embedding vector , , based on the fused embedding vector of head and tail entities , and relation embedding vectors Calculate each triplet Scoring function .
[0065] Scoring functions can generally be divided into two main categories: distance-based scoring functions and semantic matching-based loss functions. This embodiment uses translational distance as the scoring function, and the calculation formula is as follows:
[0066] ,
[0067] in, This indicates the search for the 1 / 2 norm.
[0068] The validity of a given triple can be measured by a scoring function. The higher the value of the scoring function, the more likely the triple is to be true; conversely, the lower the value, the less likely the triple is to be true.
[0069] S106: Calculate the loss function:
[0070] The loss function for this round is calculated using the following formula. :
[0071] ,
[0072] in, The interval hyperparameter represents the minimum interval between the score function values of positive and negative triplet pairs.
[0073] The training objective is to minimize the score of positive triples and maximize the score of negative triples, while ensuring that the difference between them is at least [value missing]. .
[0074] S107: Update embedding vectors and model parameters:
[0075] Update the entity embedding vectors in the knowledge graph based on the loss function. and relation embedding vector And the parameters of the triple entity embedding fusion model.
[0076] S108: Determine if the iteration termination condition has been met. If it has, the knowledge graph embedding ends; otherwise, return to step S104. The iteration termination condition can be set according to actual needs, generally set to reaching the maximum number of iterations or the convergence of the embedding vector.
[0077] To better illustrate the technical solution of this invention, specific examples are used to experimentally verify the invention. The benchmark datasets used in this embodiment include FB15K, FB15K-237, WN18, and WN18RR. FB15K and FB15K-237 are subsets extracted from the large-scale knowledge graph FreeBase, containing entities and relations from the real world. WN18 and WN18RR are subsets extracted from the WordNet knowledge base, consisting of English phrases and semantic relations. Entities in these datasets all have corresponding brief descriptive information, which is readily available. To eliminate the influence of reversible relations in the datasets, this embodiment mainly focuses on experiments with the FB15K-237 and WN18RR datasets, which do not include reverse relations. The experimental datasets are divided into training, validation, and test sets. Table 1 shows the number of triples in the training, test, and validation sets in this embodiment.
[0078]
[0079] Table 1
[0080] In this embodiment, representative baseline and frontier models are used as comparison methods to conduct comparative experiments with the present invention. The comparison methods include:
[0081] TransE, see the document "Bordes A, Usunier N, Garcia-Duran A, et al. Translating embeddings for modeling multi-relational data[J]. Advances inneural information processing systems, 2013, 26.";
[0082] TransH, see literature, "Wang Z, Zhang J, Feng J, et al. Knowledge graphembedding by translating on hyperplanes[C] / / Proceedings of the AAAIconference on artificial intelligence. 2014, 28(1).";
[0083] TransR, see the document "Lin Y, Liu Z, Sun M, et al. Learning entity andrelation embeddings for knowledge graph completion[C] / / Proceedings of the AAAI conference on artificial intelligence. 2015, 29(1).";
[0084] DisMult, see the document "Yang B, Yih W, He X, et al. Embedding entities and relations for learning and inference in knowledge bases[J]. arXiv preprintarXiv:1412.6575, 2014.";
[0085] TranSarse,Introduction, “Ji G, Liu K, He S, et al.
[0086] ConvE, in proceedings “Dettmers T, Minervini P, Stenetorp P, et al.Convolutional 2d knowledge graph embeddings[C] / / Proceedings of the AAAIconference on artificial intelligence. 2018, 32.”;
[0087] ConvKB, published in “A novel embedding model for knowledge base completion based on convolutional neuralnetwork[J]. arXiv preprint arXiv:1712.02121, 2017.”
[0088] RPJE, published “Niu G, Zhang Y, Li B, et al. Rule-guided compositional representation learning on knowledge graphs[C] / / Proceedings of the AAAI Conference on Artificial Intelligence. 2020, 34(03): 2950-2958.”;
[0089] MADLINK, see the document "Biswas R, Sack H, Alam M. MADLINK: Attentivemultihop and entity descriptions for link prediction in knowledge graphs[J].Semantic Web, 2024, 15(1): 83-106.";
[0090] EDMSConvKE, see the document "Yin P, Zhao E. A knowledge graph completion modelbased on weighted fusion description information and transform of thedimension and the scale[J]. Applied Intelligence, 2025, 55(5): 1-15.".
[0091] In this embodiment, link prediction task and triplet classification task are used as the main evaluation applications for the experiment.
[0092] (1) Link prediction task
[0093] The purpose of link prediction is to infer the value of a given triplet. The missing parts can be divided into entity prediction and relationship prediction. Link prediction typically ranks a series of candidate entities or relationships rather than directly providing a single best answer. The evaluation metrics used in this embodiment include top n hit rate (Hits @ n), mean rank (MR), and mean reciprocal rank (MRR). These metrics help measure the effectiveness of the model. Table 2 shows the link prediction results in this embodiment.
[0094]
[0095] Table 2
[0096] Based on the experimental results shown in Table 2, the following conclusions can be drawn: (1) In terms of MRR, the present invention is significantly better than all baseline models, which proves the usability and robustness of the model. Specifically, the MRR of the present invention is 0.450 on the FB15K-237 dataset and 0.515 on the WN18RR dataset. Both of these values are higher than other models, which shows that the present invention has high accuracy in link prediction tasks. (2) Compared with TransE, DisMult, ConvE and ConvKB, which only consider the structural information of knowledge graph triples, the present invention also performs better in terms of metrics, which shows that fusing the textual description information of entities can improve the representation ability of entity semantic relations. (3) On FB15K-237, the present invention does not perform as well as EDMSConvKE in terms of Hits@10. This may be because fusing entity description information does not consider the features of entities and relations at different scales. (4) Compared with other models that integrate entity text descriptions, such as MADLINK and EDMSConvKE, the performance metrics on the WN18RR dataset are improved. This indicates that the bidirectional attention mechanism can effectively model long-distance dependencies and enhance the model's adaptability to different types of relationships. In summary, this invention, by integrating entity descriptions, can more effectively capture the relationships between entities, thereby improving the expressive power of the knowledge graph.
[0097] To further analyze the prediction performance of relationships with different levels of complexity, this embodiment predicts the head and tail entities under the Hits@10 task on the FB15K dataset. Relationships are categorized into four different types: 1-1, 1-N, N-1, and NN, representing the number of head and tail entities connected through that relationship. Table 3 shows the link prediction results for relationships with different levels of complexity in this embodiment.
[0098]
[0099] Table 3
[0100] Table 3 shows that for simple 1-1 relationships, the present invention significantly outperforms typical knowledge graph representation methods, but the improvement is not significant for some improved models. This may be because 1-1 relationships are relatively simple, with specific path rules, and most models can handle this type of relationship well. For 1-N relationship categories, the present invention performs worse than RPJE in predicting tail entities, possibly due to training set sample errors. For N-1 and NN relationship categories, the present invention achieves the highest performance. These results indicate that fusing entity description and type information can reduce the ambiguity of entity representation and help to better model complex relationships.
[0101] (2) Triple classification task
[0102] The triplet classification task aims to determine the classification of a given triplet. Whether a relationship is correct or not can be considered a binary classification task. In this embodiment, a specific threshold is set for each relationship. threshold It is obtained by training on the validation set and maximizing classification accuracy. If the distance score of the triple is less than this threshold... If the triple is correct, it is considered correct; otherwise, it is considered incorrect. The final evaluation criterion is the average of all relation evaluation metrics. This embodiment uses the same experimental setup as the link prediction task. The experimental results for triple classification on two datasets are compared: one relying solely on triple structure information, the other on RPJE which incorporates relation paths, and the third on MADLINK which incorporates text entity descriptions. Table 4 shows the triple classification results in this embodiment.
[0103] Model FB15-237 WN18RR TransE 75.6% 74.0% DisMult 73.9% 80.4% ConvE 78.2% 78.3% ConvKB 80.1% 79.1% RPJE 82.1% 80.3% MADLINK 82.8% 81.2% This invention 88.5% 85.1%
[0104] Table 4
[0105] The results in Table 4 show that this invention outperforms other benchmark models in the triple classification task. Compared with RPJR, the accuracy is improved by 6.4% and 4.8% on the two datasets, respectively. Compared with MADLINK, the accuracy is improved by 5.7% and 3.9% on the two datasets, respectively. This indicates that fusing entity description information has a better promoting effect on knowledge graph representation learning, enabling more accurate identification of triples and thus improving the performance of knowledge reasoning.
[0106] Although the illustrative specific embodiments of the present invention have been described above to enable those skilled in the art to understand the invention, it should be understood that the invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the invention as defined and determined by the appended claims, and all inventions utilizing the concept of the present invention are protected.
Claims
1. A knowledge graph embedding method based on structural and semantic fusion, characterized in that... include: S1: Memorizing Knowledge Graphs ,in Represents the set of entities in a knowledge graph, containing Different entities, Represents the set of relations in a knowledge graph, containing Different kinds of relationships, A set of triples representing a knowledge graph, where each triple is represented as... ,in , These represent the head entity and the tail entity, respectively. , Simultaneously, obtain the text description of each entity; S2: Construct a triple entity embedding fusion model, including a projection module, a semantic embedding module, and an embedding vector fusion module, wherein: The projection module is used to take each relationship Setting the projection matrix triplet Middle head entity Tail-end entity The embedding vector is projected from the entity space to the relation space to obtain the head entity. Tail-end entity Structure embedding vector , And send it to the embedded vector fusion module: , , in, , Represents a triplet Middle head entity Tail-end entity Embedded vectors in entity space , They represent Dimensional entity space and dimensional relational space; The semantic embedding module is used to handle triples separately. Middle head entity Tail-end entity The text description is semantically encoded to obtain a semantic embedding vector. , And send it to the embedded vector fusion module; The embedded vector fusion module is used to process the head entity separately. Tail-end entity The structural embedding vector and the semantic embedding vector are fused to obtain the fused embedding vector. , ; S3: Initialize entity embedding vectors in the knowledge graph and relation embedding vector , , ; S4: Sample from the knowledge graph These triples constitute the set of positive examples for this round. Simultaneously generate Triples that do not belong to the knowledge graph constitute the negative example set for this round. ; S5: Set the positive examples for this round. and negative example set Each triplet Input the triple entity embedding model to obtain the head entity. Tail-end entity fused embedding vector , , based on the fused embedding vector of head and tail entities , and relation embedding vectors Calculate each triplet Scoring function ; S6: Calculate the loss function for this round using the following formula. : ; in, Indicates the interval hyperparameter; S7: Update the entity embedding vectors in the knowledge graph according to the loss function. and relation embedding vector And the parameters of the triple entity embedding fusion model; S8: Determine whether the iteration termination condition has been met. If it has, the knowledge graph embedding ends; otherwise, return to step S4.
2. The knowledge graph embedding method according to claim 1, characterized in that, The projection matrix The calculation method is as follows: , in, Represents a learnable matrix. Indicates a pre-defined relationship The sparsity factor is calculated using the following formula: , in, Representing relations Number of connected entity pairs This represents the maximum number of entity pairs connected by all relations. The hyperparameters used to calculate sparsity are denoted as . .
3. The knowledge graph embedding method according to claim 1, characterized in that, The semantic embedding module in step S2 includes a word embedding module, a bidirectional long short-term memory network, a self-attention aggregation layer, and an activation function layer, wherein: The word embedding module is used to obtain word embedding sequences from text descriptions. And sent to the bidirectional long short-term memory network, where the first row vectors Indicates the first in the text description Word embedding vectors of each word , Indicates the number of words in the text description, superscript Indicates transpose; Bidirectional long short-term memory networks are used for word embedding sequences Hidden feature extraction is performed to obtain the hidden feature sequence. And sent to the self-attention aggregation layer, where the first row vectors Word embedding vector The corresponding hidden feature vector; The self-attention aggregation layer is used to extract hidden feature sequences using a self-attention mechanism. Corresponding self-attention vector Then the self-attention vector As weights for the hidden feature sequence Each hidden feature vector Perform weighted summation to obtain aggregated features. And send it to the activation function layer; The activation function layer is used to aggregate features using a preset activation function. The process is then performed to obtain the final semantic embedding vector.
4. The knowledge graph embedding method according to claim 3, characterized in that, The method for generating the word embedding sequence is as follows: Word embedding is performed on each word in the text description to obtain a sequence of word vectors. , Indicates the first in the text description The word vectors of each word are generated; then, position embedding is performed on each word to obtain a sequence of position vectors. , Indicates the first in the text description The position vectors of each word are used to generate a word embedding sequence for the text description. .
5. The knowledge graph embedding method according to claim 1, characterized in that, The specific method for embedding vector fusion in step S2 is as follows: Set learnable vectors The gate vector is obtained by processing with the softmax function. Then, the fused embedding vector is calculated using the following formula: , , in, It represents the Hadama accumulation.
6. The knowledge graph embedding method according to claim 1, characterized in that, The method for generating negative examples in step S4 is as follows: randomly replace the head entity, relation, or tail entity in the positive example triple. If the resulting triple does not belong to the knowledge graph, it is used as a negative example triple; otherwise, the triple is ignored, and the random replacement operation is performed again.
7. The knowledge graph embedding method according to claim 1, characterized in that, The scoring function in step S5 The calculation formula is as follows: , in, This indicates the search for the 1 / 2 norm.