Search

CN-118227800-B - Knowledge graph completion method and system integrating relationship description and relationship transfer

CN118227800BCN 118227800 BCN118227800 BCN 118227800BCN-118227800-B

Abstract

The invention provides a knowledge graph completion method and a system for fusing relationship description and relationship transmission, which relate to the technical field of knowledge graph completion and comprise the steps of obtaining relationship description text information, inputting the relationship description text information into a language model Bert, extracting description vectors of all relationships and forming a relationship matrix; combining entity nodes and a relation matrix, carrying out aggregation operation on neighbor edges through an aggregation function to obtain context transfer information about node neighbor edge sets, repeating the aggregation function and an update function for a plurality of times to obtain final context relation information, constructing a relation path by relation type sequences of all edges in an original path, extracting embedded representation of the context relation information and embedded representation of the relation path, fusing the embedded representation of the context relation information and the embedded representation of the relation path, predicting relation distribution by utilizing the fused embedded representation and determining the relative position of the relation path, and completing complementation of missing relations in the knowledge graph.

Inventors

  • GAO YONGCHAO
  • ZHOU RU
  • QIAN HENG

Assignees

  • 山东省计算中心(国家超级计算济南中心)
  • 齐鲁工业大学(山东省科学院)

Dates

Publication Date
20260505
Application Date
20240322

Claims (7)

  1. 1. The knowledge graph completion method integrating relationship description and relationship transmission is characterized by comprising the following steps of: Acquiring relation description text information of all relations in the knowledge graph, inputting the relation description text information into a language model Bert, extracting description vectors of all the relations, and forming a relation matrix; combining the entity nodes and the relation matrix, carrying out aggregation operation on the neighbor edges through an aggregation function, obtaining a context transfer message about a node neighbor edge set, and repeating the aggregation function and the update function for a plurality of times to obtain final context relation information; In the knowledge graph, each side has a relation type, each entity corresponds to a node in the graph, the side to be aggregated is taken as a target side, a head entity and a tail entity connected with the target side are taken as a transmission center, the side connected with the vertex is a neighbor side, the head entity or the tail entity collects and temporarily stores messages from the neighbor sides, and then the aggregated messages are transmitted back to each neighbor side of the messages; In the knowledge graph, one node is often connected with a plurality of edges, so that influences of neighbor edges with different importance degrees on a target edge are distinguished, and the attention weights of the target edge and the neighbor edges are obtained by calculating the similarity of the neighbor edges and the target edge; Constructing a relationship path by the relationship type sequences of all sides in the original path, extracting the embedded representation of the context relationship information and the embedded representation of the relationship path, fusing the embedded representation of the context relationship information and the embedded representation of the relationship path, and completing the complementation of the missing relationship in the knowledge graph by predicting the relationship distribution and determining the relative position of the relationship path by utilizing the fused embedded representation; For the relation context, calculating final relation messages of a head entity and a tail entity by using a message transmission method, respectively summarizing the context information of the head entity and the tail entity, combining the final relation messages and calculating the final relation messages to obtain the context of the entity pair (h, t) and the context embedded representation of the entity pair (h, t), identifying the most important relation path by using the context information, and then using the attention weight for the average representation of all paths to obtain the relation path embedded representation.
  2. 2. The knowledge graph completion method integrating relationship descriptions and relationship transfer according to claim 1, wherein relationship description text information of the relationships is used as input data of a language model Bert, a specific token [ CLS ] is selected as an initialized representation form of the relationships, semantic information of the whole sentence is captured, the relationship description information is encoded by using the selected token [ CLS ] for each relationship to obtain description vectors, the description vectors contain the semantic information of the relationship, all the relationships in the knowledge graph are traversed, the description vectors are extracted for each relationship, and the description vectors are combined into a relationship matrix.
  3. 3. The knowledge graph completion method of fusion relationship description and relationship transfer according to claim 1, wherein message information of neighbor edges of two nodes connected by one edge is aggregated, a hidden state of the edge is updated by using an update function of the edge to obtain a context message of the transfer relationship, and the aggregation function and the update function are repeated k times to obtain final relationship information and representations respectively serving as a head entity and a tail entity.
  4. 4. The method for complementing a knowledge graph by fusing relationship descriptions and relationship transfer according to claim 1, wherein the corresponding relationship paths in the knowledge graph are represented by the relationship type sequences of all edges in the original path, the set of all relationship paths from the head entity and the tail entity in the knowledge graph is obtained, and independent embedded vectors are allocated to each relationship path.
  5. 5. The knowledge graph completion system integrating relationship description and relationship transmission is characterized by comprising the following components: the relation matrix construction module is used for acquiring relation description text information of all relations in the knowledge graph, inputting the relation description text information into the language model Bert, extracting description vectors of all the relations and forming a relation matrix; The relation transfer module is used for combining the entity nodes and the relation matrix, carrying out aggregation operation on the neighbor edges through an aggregation function, obtaining context transfer information about the node neighbor edge sets, and repeating the aggregation function and the update function for a plurality of times to obtain final context relation information; In the knowledge graph, each side has a relation type, each entity corresponds to a node in the graph, the side to be aggregated is taken as a target side, a head entity and a tail entity connected with the target side are taken as a transmission center, the side connected with the vertex is a neighbor side, the head entity or the tail entity collects and temporarily stores messages from the neighbor sides, and then the aggregated messages are transmitted back to each neighbor side of the messages; In the knowledge graph, one node is often connected with a plurality of edges, so that influences of neighbor edges with different importance degrees on a target edge are distinguished, and the attention weights of the target edge and the neighbor edges are obtained by calculating the similarity of the neighbor edges and the target edge; The prediction completion module is used for constructing a relationship path from the relationship type sequences of all edges in the original path, extracting the embedded representation of the context relationship information and the embedded representation of the relationship path, fusing the embedded representation of the context relationship information and the embedded representation of the relationship path, predicting the relationship distribution by utilizing the fused embedded representation and determining the relative position of the relationship path, and completing the completion of the missing relationship in the knowledge graph; For the relation context, calculating final relation messages of a head entity and a tail entity by using a message transmission method, respectively summarizing the context information of the head entity and the tail entity, combining the final relation messages and calculating the final relation messages to obtain the context of the entity pair (h, t) and the context embedded representation of the entity pair (h, t), identifying the most important relation path by using the context information, and then using the attention weight for the average representation of all paths to obtain the relation path embedded representation.
  6. 6. A non-transitory computer readable storage medium storing computer instructions which, when executed by a processor, implement the knowledge-graph completion method of fusing relationship descriptions and relationship transfer of any of claims 1-4.
  7. 7. An electronic device comprising a processor, a memory and a computer program, wherein the processor is coupled to the memory, the computer program is stored in the memory, and when the electronic device is operated, the processor executes the computer program stored in the memory to cause the electronic device to perform a knowledge graph completion method that implements the fused relationship description and relationship transfer of any one of claims 1-4.

Description

Knowledge graph completion method and system integrating relationship description and relationship transfer Technical Field The disclosure relates to the technical field of knowledge graph completion, in particular to a knowledge graph completion method and a knowledge graph completion system for fusing relationship description and relationship transmission. Background The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art. A knowledge graph is a structured data model for representing knowledge that presents relationships between things in the form of a graph. Knowledge maps are typically made up of entities, which represent individuals or concepts in the real world, relationships, which represent links between entities, and attributes, which describe the characteristics of the entities. In the construction process of knowledge graphs in the medical field of social networks or smart cities, the knowledge graphs are incomplete due to the limitation of data sources, difficulty in information acquisition and inconsistency of data. Knowledge graph completion can be divided into three types according to different model methods. The translation distance-based knowledge graph completion method utilizes a representation learning technology to map entities and relations into a low-dimensional continuous vector space, obtains low-dimensional dense vector representation, and adopts distance measurement to evaluate the association degree between the entities. The tensor decomposition-based knowledge graph completion method generally represents entities and relationships in a knowledge graph as tensors, and then decomposes the tensors into low-rank sub-tensors by using a tensor decomposition technology to capture potential semantic information between the entities and the relationships. By learning the obtained low-rank tensor, the missing triples or relations in the knowledge graph can be predicted. In addition, the neural network is widely applied to the completion task of the knowledge graph, and the powerful feature extraction capability and the effective aggregation capability of the neighborhood information enable the neural network to better represent the entity and the relationship, so that the completion performance of the knowledge graph is improved. Most of the current knowledge graph completion tasks face the challenge of improving performance by utilizing multi-source information, and in order to solve the problem, a plurality of knowledge graph completion technologies are presented. Most current knowledge-graph completion models rely on knowledge-graph triple structures to obtain entity and relationship representations, easily ignoring many information from other sources, such as entity description information, relationship description information, and attribute information. Entity description information and relationship description information in a knowledge graph are usually unstructured natural language text and contain rich semantic information, and a traditional neural network model is difficult to handle the complexity well. While some models attempt to integrate information from other sources, such as entity descriptions, relationship descriptions, and attribute information, how to make efficient use of such information is a complex problem. If a model of entity description information and relationship description information is extracted through a convolutional neural network (Convolutional Neural Network, CNN) and a Long-Short-Term Memory (LSTM), but the method has limited acquisition of potential semantic information, complex association and semantic information between description information cannot be fully captured, and performance of a knowledge graph completion task cannot be remarkably improved. Disclosure of Invention In order to solve the problems, the disclosure provides a knowledge graph completion method and a knowledge graph completion system for fusing relationship description and relationship transfer, semantic information of a relationship is extracted through the relationship description information, the relationship description information is encoded by utilizing a pretrained language model Bert, relationship context information and a relationship path are generated through an obtained relationship matrix, and the relationship context information and the relationship path are combined, so that richer semantic information is obtained, and the completion performance is improved. According to some embodiments, the present disclosure employs the following technical solutions: a knowledge graph completion method integrating relationship description and relationship transfer comprises the following steps: Acquiring relation description text information of all relations in the knowledge graph, inputting the relation description text information into a language model Bert, extracting description