A knowledge graph completion method, device and medium for enhancing triple embedding
By applying the feature perception mechanism and similar triple embedding interactions of graph attention network and Transformer model in the knowledge graph, the problem of insufficient embedding quality in the prior art is solved, and the completion effect of the knowledge graph is significantly improved.
Patent Information
- Application Number
- CN202411945668.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-04
AI Technical Summary
The existing knowledge graph embedding methods are difficult to fully reflect the embedding characteristics of the actual objects and relationships between and within the samples, resulting in insufficient embedding quality and limiting the completion effect of the knowledge graph.
A knowledge graph completion method based on large-models is adopted to generate initial embedding representations through graph attention networks, and feature perception mechanisms and embedding interactions between similar triples are applied in the Transformer model to improve the embedding quality within and between triples.
The embedding quality is significantly optimized and the completion effect of the knowledge graph is improved, especially in large-scale and dynamically changing knowledge graphs, improving the prediction accuracy of missing relationships and entities.
Smart Images

Figure CN119761484A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge engineering technology, and specifically to a knowledge graph completion method, device and medium for enhancing triple embedding. Background Art
[0002] Knowledge graphs have become extremely common in existing applications, and have demonstrated great potential and practical value in many fields. For example, in search engines, knowledge graphs can provide users with more accurate and rich search results through semantic understanding and association reasoning; in recommendation systems, they can combine user behavior and interests to generate personalized recommendations, significantly improving user experience. In addition, in intelligent question-answering systems, knowledge graphs support contextual understanding and accurate answering capabilities, providing users with efficient question-answering services. However, existing knowledge graphs generally have problems with missing and incomplete information, which seriously limits their practical application effects in complex scenarios. Therefore, the completion of knowledge graphs is particularly important.
[0003] Knowledge graph completion is an important topic in knowledge graph research, which aims to fill in the missing information in the knowledge graph through algorithms, including undefined entities, relationships and attributes. The effectiveness of knowledge graph completion is crucial to improving the integrity and practical application value of the knowledge graph, especially when facing large-scale and dynamically changing knowledge graphs. Current knowledge graph embedding methods usually use graph neural networks to aggregate the neighborhood nodes of the central node to generate embeddings, but this method has two shortcomings: first, between samples, due to the lack of interaction between similar triples, it is difficult to fully reflect the embedding characteristics of entities and relationships; second, within the sample, the interaction between nodes and relationships within the triples is missing, making it impossible for the embedding to accurately reveal the deep connection between node features and relationship features. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a knowledge graph completion method, device and medium for enhancing triple embedding, focusing on enhancing the connection between similar triples and improving the perception of internal features of triples, greatly optimizing the embedding quality and improving the overall completion effect of the knowledge graph.
[0005] In order to solve the technical problem, the technical solution adopted by the present invention is: a knowledge graph completion method based on large model enhancement, comprising the following steps: S01. Build a knowledge graph KG=(E,R,S) by performing entity recognition and relationship extraction on knowledge. Knowledge refers to the related knowledge in question-answering system and semantic search. Entity refers to the text data obtained from natural language text using named entity recognition tools. E is the entity set, R is the relationship set, and S is the triple set in the knowledge graph, which is also the positive sample set. The negative sample set is generated by randomly replacing the head entity or the tail entity. , negative samples are not included in the positive sample set S; S02, using graph attention network to obtain the initial graph embedding representation of the knowledge graph; S03, enhancing the embedding within the triplet sample, applying the feature perception mechanism to the initial graph embedding representation generated in step S02, improving the quality of the internal embedding of the triplet through the Transformer model, and finally obtaining the triplet embedding representation enhanced within the sample; The Transformer model includes multiple self-attention layers and feed-forward networks. The initial graph embedding representation is input into the Transformer's self-attention layer. In the self-attention layer, the attention weights between the parts in the triple are first calculated, and then the enhanced embedding representation of each part is obtained. S04. Enhance the embedding between triple samples. Based on the embedding interaction between similar triplets, improve the embedding quality between samples, including the organization of similar samples and the design of loss function. For each triple (h, r, t), first calculate its similarity with other triples in the knowledge graph to determine the similarity between the triple and each triple in the knowledge graph. Then select similar samples. From the calculated similarities, select the first m triplets whose similarity is greater than the set threshold n to form a similar sample set S. mn , the set contains the same head entity-relation pair, head entity-tail entity pair, or head entity-tail entity pair as the triple (h, r, t); The loss function is composed of the score difference between positive and negative samples and the penalty term of similarity distance. The loss function is optimized during the training process of the Transformer model, and the final knowledge graph triple embedding is obtained as And enhanced node embedding and relation embedding ; S05. Reasoning: Use the trained graph attention network and Transformer model to reason about the given triples. The given triples are completed triples to determine whether they are real links, thereby completing the knowledge graph.
[0006] Furthermore, step S02 is specifically as follows: S21. Use the open source bge encoding model to encode all entities and relationships in the knowledge graph: , in Encode the entity. , M is the number of entities in the entity set E, D is the dimension of embedding, Encode the relationship, , N is the number of relations in the relation set R, and D is the dimension of embedding; S22. Use the graph attention network to embed each triple (h, r, t) as a whole. First, calculate the node features for each node h, r, t of the triple and its neighboring nodes: , in , , They are head entity embedding, relation embedding, and tail entity embedding respectively; S23. Use graph neural network to perform weighted aggregation on neighborhood nodes to generate enhanced embedding of nodes: , Among them, GAT is a graph neural network. is the embedding representation of the head entity h neighborhood nodes, is the number of neighboring nodes of the head entity h, is the embedding representation of the neighborhood nodes of relation r, is the number of neighboring nodes of relation r, is the embedding representation of the neighborhood nodes of the tail entity t, is the number of neighboring nodes of the tail entity t; Through this step, we can get the triple embedding after graph encoding. .
[0007] Furthermore, the following operations are performed on the input through the Transformer's self-attention layer: , Where X is the input of the self-attention layer. For the first self-attention layer, its input is the triple embedding output by the graph neural network. , the input of other self-attention layers is the output of the previous self-attention layer, , , is the weight matrix of the linear operation of the attention module, Q, K, and V are the results of the linear operation of the input. is the embedding dimension of the matrix vector K, T is the transpose operation, softmax is the normalization function, and LN is the regularization function; The enhanced embedding representation of each part of the triplet is obtained through calculations in multiple self-attention layers: , in They are the embeddings of the enhanced head entity, relation, and tail entity within the triple sample, respectively.
[0008] Furthermore, in step S04, the loss function is expressed as: , in is the negative sample set, is the triplet in the negative sample set, is the negative sample set, is the triplet in the positive sample set, , Use the positive and negative sample pairs generated in step S04, L is the loss function, λ is the hyperparameter, is the score function, d is the sample (h, r, t) and the similar sample set S mn The distance between the triples in .
[0009] Furthermore, step S05 is specifically as follows: The triplet (h, r, t) to be inferred is input into the graph attention network, which is first embedded and transformed, and then the corresponding triplet embedding representation is obtained through intra-sample enhancement and inter-sample enhancement of the triplet. , using the score function to calculate The score is used to evaluate the authenticity of the triple to be inferred. The higher the score, the greater the possibility of the triple.
[0010] Furthermore, the calculation formula of the distance d is: , in for The corresponding enhanced embedding representation is, is a similar sample set and S mn The corresponding enhanced embedding representation is, represents the L2 norm.
[0011] Furthermore, the calculation formula of the score function is: , represents the L1 norm.
[0012] Furthermore, the calculation formula of the score function is: , represents the L1 norm.
[0013] The present invention also discloses a knowledge graph completion device for enhanced triple embedding, comprising a processor and a memory storing program instructions, wherein the processor is configured to execute the knowledge graph completion method for enhanced triple embedding as described above when running the program instructions.
[0014] The present invention also discloses a storage medium storing program instructions, which, when run, execute the knowledge graph completion method for enhancing triple embedding as described above.
[0015] Beneficial effects of the present invention: The present invention proposes a knowledge graph completion method for enhancing triple embedding, which improves the embedding quality by enhancing the interaction of triples inside and outside the sample. This method first organizes positive and negative samples to generate an overall graph embedding, and then performs a preliminary enhancement of the triple embedding through an attention mechanism. Furthermore, this paper applies a feature perception mechanism within the triple to improve the internal embedding quality, and introduces a similarity enhancement mechanism between triples to optimize the embedding of similar triples. Finally, by combining the score function and the distance penalty term, the knowledge graph completion method of this paper effectively improves the prediction accuracy of missing relations and entities. The enhanced triple embedding method proposed in the present invention effectively improves the embedding quality of the knowledge graph through the interaction within and between samples, and further enhances the reasoning ability of the model by optimizing the score function and the penalty term of the similarity distance. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flowchart of the method is shown in FIG. Figure 2 Schematic diagram of the device described in Example 2. DETAILED DESCRIPTION The present invention will be further described below in conjunction with the accompanying drawings and specific implementations.
[0017] Example 1 This embodiment discloses a knowledge graph completion method for enhancing triple embedding, which is used for gas user data management. With the rapid development of the gas industry, gas companies are faced with a large amount of equipment, user, service and operation and maintenance data. Traditional gas data management methods usually have problems such as data dispersion and information islands, which limit the effective integration and utilization of data. As an effective knowledge management method, knowledge graph technology can integrate data from different sources and construct a graph structure with clear relationships from several triples (h, r, t) such as (gas company, provided, equipment data), (equipment, management, user data), (operation and maintenance personnel, association, fault record), thereby providing strong support for applications such as intelligent decision-making, fault prediction, and operation and maintenance optimization. However, since data in the gas field is often missing or incomplete, traditional knowledge graph methods often face the problem of missing links during application. Therefore, knowledge graph completion and link prediction have important practical significance in the gas industry.
[0018] This method improves the effect of knowledge graph completion by enhancing the interaction of triples inside and outside the sample to improve the embedding quality. This method first organizes positive and negative samples to generate the overall graph embedding, and then performs preliminary enhancement of triple embedding through the attention mechanism. Furthermore, this paper applies a feature-aware mechanism inside the triple to improve the internal embedding quality, and introduces a similarity enhancement mechanism between triples to optimize the embedding of similar triplets. Finally, by combining the score function and the distance penalty term, the knowledge graph completion method in this paper effectively improves the prediction accuracy of missing relations and entities.
[0019] like Figure 1 As shown, the method comprises the following steps: S01. Build a knowledge graph KG=(E,R,S) by performing entity recognition and relationship extraction on knowledge. Knowledge refers to the related knowledge in question-answering system and semantic search. Entity refers to the text data obtained from natural language text using named entity recognition tools. E is the entity set, R is the relationship set, and S is the triple set in the knowledge graph, which is also the positive sample set. The negative sample set is generated by randomly replacing the head entity or the tail entity. , negative samples are not included in the positive sample set S. The triple in the knowledge graph is represented as (h, r, t) ∈ S, where h ∈ E, r ∈ R, and t ∈ E. The task of knowledge graph completion is to predict the missing links in the graph, including the cases of missing head entities (?, r, t), missing relations (h, ?, t), and missing tail entities (h, r, ?), to fill in the missing parts of the knowledge graph.
[0020] S02. Use the graph attention network to obtain the initial graph embedding representation of the knowledge graph. The specific steps are as follows: S21. Use the open source bge encoding model to encode all entities and relationships in the knowledge graph: , in Encode the entity. , M is the number of entities in the entity set E, D is the dimension of embedding, Encode the relationship, , N is the number of relations in the relation set R, and D is the dimension of embedding.
[0021] S22. Use the Graph Attention Network (GAT) to embed each triple (h, r, t) as a whole. First, calculate the node features for each node h, r, t of the triple and its neighboring nodes: , in , , They are head entity embedding, relation embedding and tail entity embedding respectively. , , .
[0022] S23. Use graph neural network to perform weighted aggregation on neighborhood nodes to generate enhanced embedding of nodes: , Among them, GAT is a graph neural network. is the embedding representation of the head entity h neighborhood nodes, is the number of neighboring nodes of the head entity h, is the embedding representation of the neighborhood nodes of relation r, is the number of neighboring nodes of relation r, is the embedding representation of the neighborhood nodes of the tail entity t, is the number of neighboring nodes of the tail entity t. Through this step, the triple embedding after graph encoding is obtained. .
[0023] S03, enhancing the embedding within the triplet sample, applying the feature perception mechanism to the initial graph embedding representation generated in step S02, improving the quality of the internal embedding of the triplet through the Transformer model, and finally obtaining the triplet embedding representation enhanced within the sample.
[0024] The Transformer model includes multiple self-attention layers and feed-forward networks. When processing the embedding of triples, the triples are As input, it is embedded into the self-attention layer of the Transformer. In the self-attention layer, the attention weights between the parts in the triple are first calculated, and then the enhanced embedding representation of each part is obtained. In the self-attention mechanism, the attention weights between the parts in the triplet are first calculated. Suppose the input triplet is embedded as , the attention of each part is calculated by the following steps: , Where X is the input of the self-attention layer. For the first self-attention layer, its input is the triple embedding output by the graph neural network. , the input of other self-attention layers is the output of the previous self-attention layer, , , is the weight matrix of the linear operation of the attention module, Q, K, and V are the results of the linear operation of the input. is the embedding dimension of the matrix vector K, T is the transpose operation, softmax is the normalization function, and LN is the regularization function.
[0025] The enhanced embedding representation of each part of the triplet is obtained through calculations in multiple self-attention layers: , in They are the embeddings of the enhanced head entity, relation, and tail entity within the triple sample, respectively.
[0026] S04. Enhance the embedding between triplet samples. Based on the embedding interaction between similar triplets, improve the embedding quality between samples, including the organization of similar samples and the design of loss function.
[0027] For each triple (h, r, t), first calculate its similarity with other triples in the knowledge graph, and determine the similarity between the triple and each triple in the knowledge graph through the similarity. Then select similar samples and select the first m triplets whose similarity is greater than the set threshold n from the calculated similarity to form a similar sample set S mn , which contains the same head entity-relation pair, head entity-tail entity pair, or head entity-tail entity pair as the triple (h, r, t).
[0028] For sample (h, r, t) and similar sample set S mn The similarity distance is calculated as follows: , in for The corresponding enhanced embedding representation is, is a similar sample set and S mn The corresponding enhanced embedding representation is, represents the L2 norm.
[0029] The loss function is composed of the score difference between positive and negative samples and the penalty term of similarity distance. The loss function is optimized during the training process of the Transformer model, and the final knowledge graph triple embedding is obtained as And enhanced node embedding and relation embedding .
[0030] For triples, the designed score function is as follows: , Represents the L1 norm. This score function is used to evaluate the scores of positive and negative samples. The loss function consists of the score difference between positive and negative samples and the penalty term of similarity distance, which is defined as follows: , in is the negative sample set, is the triplet in the negative sample set, is the positive sample set, is the triplet in the positive sample set, , Use the positive and negative sample pairs generated in step S04, L is the loss function, and λ is a hyperparameter used to adjust the weight of the similarity distance penalty term in the loss function. is the score function, d is the sample (h, r, t) and the similar sample set S mn The final knowledge graph triple embedding is , and enhanced node embedding and relation embedding ,in , .
[0031] S05. Reasoning: Use the trained graph attention network and Transformer model to reason about the given triples. The given triples are completed triples to determine whether they are real links, thereby completing the knowledge graph.
[0032] Step S05 is specifically as follows: The triplet (h, r, t) to be inferred is input into the graph attention network, which is first embedded and transformed, and then the corresponding triplet embedding representation is obtained through intra-sample enhancement and inter-sample enhancement of the triplet. , using the score function to calculate The score function is calculated as: , Represents the L1 norm. This score is used to evaluate the authenticity of the triple to be inferred. The higher the score, the greater the possibility of the triple. Through the above reasoning process, the model will provide a reliable judgment for the given triple.
[0033] The enhanced triple embedding method proposed in this invention effectively improves the embedding quality of the knowledge graph through the interaction within and between samples, and further strengthens the reasoning ability of the model by optimizing the score function and the penalty term of similarity distance.
[0034] Example 2 The present disclosure provides a knowledge graph completion device 300 for enhancing triple embedding. Figure 2 As shown, it includes a processor (processor) 304 and a memory (memory) 301. Optionally, the device may also include a communication interface (Communication Interface) 302 and a bus 303. Among them, the processor 304, the communication interface 302, and the memory 301 can communicate with each other through the bus 303. The communication interface 302 can be used for information transmission. The processor 304 can call the logical instructions in the memory 301 to execute the knowledge graph completion method of the enhanced triple embedding of the above embodiment.
[0035] In addition, the logic instructions in the memory 301 described above can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0036] The memory 301 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 304 executes the function application and data processing by running the program instructions / modules stored in the memory 301, that is, the knowledge graph completion method for enhancing triple embedding in the above embodiment is implemented.
[0037] The memory 301 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 301 may include a high-speed random access memory and may also include a non-volatile memory.
[0038] Example 3 An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the knowledge graph completion method for enhancing triple embedding.
[0039] The computer-readable storage medium mentioned above may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0040] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and other media that can store program codes, or a transient storage medium.
[0041] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the scope of protection. As used in the description in the text, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of one or more associated listings. In addition, when used in this application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, method or device including the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0042] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. The technicians may clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
Claims
1. A knowledge graph completion method for enhancing triple embedding, characterized by: The following steps are involved: S01. Build a knowledge graph KG=(E,R,S) by performing entity recognition and relationship extraction on knowledge. Knowledge refers to the related knowledge in question-answering system and semantic search. Entity refers to the text data obtained from natural language text using named entity recognition tools. E is the entity set, R is the relationship set, and S is the triple set in the knowledge graph, which is also the positive sample set. The negative sample set is generated by randomly replacing the head entity or the tail entity. , negative samples are not included in the positive sample set S; S02, using graph attention network to obtain the initial graph embedding representation of the knowledge graph; S03, enhancing the embedding within the triplet sample, applying the feature perception mechanism to the initial graph embedding representation generated in step S02, improving the quality of the internal embedding of the triplet through the Transformer model, and finally obtaining the triplet embedding representation enhanced within the sample; The Transformer model includes multiple self-attention layers and feed-forward networks. The initial graph embedding representation is input into the Transformer's self-attention layer. In the self-attention layer, the attention weights between the parts in the triple are first calculated, and then the enhanced embedding representation of each part is obtained. S04. Enhance the embedding between triple samples. Based on the embedding interaction between similar triplets, improve the embedding quality between samples, including the organization of similar samples and the design of loss function. For each triple (h, r, t), first calculate its similarity with other triples in the knowledge graph to determine the similarity between the triple and each triple in the knowledge graph. Then select similar samples and select the first m triplets whose similarity is greater than the set threshold n from the calculated similarity to form a similar sample set S mn , the set contains the same head entity-relation pair, head entity-tail entity pair, or head entity-tail entity pair as the triple (h, r, t); The loss function is composed of the score difference between positive and negative samples and the penalty term of similarity distance. The loss function is optimized during the training process of the Transformer model, and the final knowledge graph triple embedding is obtained as And enhanced node embedding and relation embedding ; S05. Reasoning: Use the trained graph attention network and Transformer model to reason about the given triples. The given triples are completed triples to determine whether they are real links, thereby completing the knowledge graph.
2. The knowledge graph completion method for enhancing triple embedding according to claim 1 is characterized by: Step S02 is specifically as follows: S21. Use the open source bge encoding model to encode all entities and relationships in the knowledge graph: , in Encode the entity. , M is the number of entities in the entity set E, D is the dimension of embedding, Encode the relationship, , N is the number of relations in the relation set R, and D is the dimension of embedding; S22. Use the graph attention network to embed each triple (h, r, t) as a whole. First, calculate the node features for each node h, r, t of the triple and its neighboring nodes: , in , , They are head entity embedding, relation embedding, and tail entity embedding respectively; S23. Use graph neural network to perform weighted aggregation on neighborhood nodes to generate enhanced embedding of nodes: , Among them, GAT is a graph neural network. is the embedding representation of the head entity h neighborhood nodes, is the number of neighboring nodes of the head entity h, is the embedding representation of the neighborhood nodes of relation r, is the number of neighboring nodes of relation r, is the embedding representation of the neighborhood nodes of the tail entity t, is the number of neighboring nodes of the tail entity t; Through this step, we can get the triple embedding after graph encoding. .
3. The knowledge graph completion method for enhancing triple embedding according to claim 2 is characterized by: The following operations are performed on the input of the Transformer's self-attention layer: , Where X is the input of the self-attention layer. For the first self-attention layer, its input is the triple embedding output by the graph neural network. , the input of other self-attention layers is the output of the previous self-attention layer, , , is the weight matrix of the linear operation of the attention module, Q, K, and V are the results of the linear operation of the input. is the embedding dimension of the matrix vector K, T is the transpose operation, softmax is the normalization function, and LN is the regularization function; The enhanced embedding representation of each part of the triplet is obtained through calculations in multiple self-attention layers: , in They are the embeddings of the enhanced head entity, relation, and tail entity within the triple sample, respectively.
4. The knowledge graph completion method for enhancing triple embedding according to claim 1 is characterized in that: In step S04, the loss function is expressed as: , in is the negative sample set, is the triplet in the negative sample set, is the negative sample set, is the triplet in the positive sample set, , Use the positive and negative sample pairs generated in step S04, L is the loss function, λ is the hyperparameter, is the score function, d is the sample (h, r, t) and the similar sample set S mn The distance between the triples in .
5. The knowledge graph completion method for enhancing triple embedding according to claim 1, characterized in that: Step S05 is specifically as follows: The triplet (h, r, t) to be inferred is input into the graph attention network, which is first embedded and transformed, and then the corresponding triplet embedding representation is obtained through intra-sample enhancement and inter-sample enhancement of the triplet. , using the score function to calculate The score is used to evaluate the authenticity of the triple to be inferred. The higher the score, the greater the possibility of the triple.
6. The knowledge graph completion method for enhancing triple embedding according to claim 4 is characterized by: The calculation formula of distance d is: , in for The corresponding enhanced embedding representation is, is a similar sample set and S mn The corresponding enhanced embedding representation is, represents the L2 norm.
7. The knowledge graph completion method for enhancing triple embedding according to claim 4 is characterized in that: The calculation formula of the score function is: , represents the L1 norm.
8. The knowledge graph completion method for enhancing triple embedding according to claim 5, characterized in that: The calculation formula of the score function is: , represents the L1 norm.
9. A knowledge graph completion device for enhancing triple embedding, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the knowledge graph completion method with enhanced triple embedding as described in any one of claims 1 to 8 when running the program instructions.
10. A storage medium storing program instructions, characterized in that: When the program instructions are run, they execute the knowledge graph completion method with enhanced triple embedding as described in any one of claims 1 to 8.
Citation Information
Cited By
Reservoir emergency plan big language model review method fusing knowledge graph
CN120407756A