Knowledge graph representation learning system, method, device and medium

By constructing a relational correlation matrix, sampling correlation path, adding constraint terms and optimization models in the knowledge graph representation learning system, the problem of old knowledge being forgotten in the dynamic knowledge graph is solved, and the effect of maintaining the integrity of old knowledge when learning new knowledge is achieved.

CN119623605AInactive Publication Date: 2025-03-14SHENZHEN WHALE VISION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510153139.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2025-03-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional static knowledge graph representation methods are difficult to deal with dynamically changing knowledge graphs, which leads to the easy forgetting of old knowledge when learning new knowledge and the problem of catastrophic forgetting.

Method used

Through the coordinated work of the relationship matrix construction module, the association path sampling module, the constraint control module and the model optimization module, the new triple set and the target association path are obtained, the training data set is generated, and the knowledge graph representation learning model is trained according to the constraint items to ensure that the old knowledge is retained during the update process.

Benefits of technology

Continue to learn new knowledge in the dynamically changing knowledge graph, while maintaining the integrity of old knowledge, effectively avoiding catastrophic forgetting problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119623605A_ABST
    Figure CN119623605A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a knowledge graph representation learning system and method, equipment and a medium, and belongs to the technical field of knowledge graphs. The system comprises a relation incidence matrix construction module which is used for constructing a relation incidence matrix and determining the correlation degree between the relations of the knowledge graph at the t-1 moment according to the relation incidence matrix; the association path sampling module is used for acquiring a new triple set according to the knowledge graph at the t-1 moment and the knowledge graph at the t moment, and acquiring a target association path according to the new triple set; the constraint control module is used for adding constraint terms to entities and relationships of all old triads in the old triad set; and the model optimization module is used for training a knowledge graph representation learning model according to the training data set and the constraint term. Through the provided scheme, new knowledge can be continuously learned in the dynamically changing knowledge graph, meanwhile, the integrity of old knowledge is kept, and disaster type forgetting is effectively avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of knowledge graph technology, and in particular to a knowledge graph representation learning system, method, device and medium. Background Art

[0002] Knowledge graph is a structured knowledge representation method that uses information such as entities, relationships, and attributes to better manage and understand complex information. As the scale of knowledge graphs expands and the number of application scenarios increases, knowledge graphs need to be dynamically updated. At present, traditional static knowledge graph representation methods are difficult to cope with such dynamic changes, which makes it easy to forget old knowledge when learning new knowledge. Summary of the invention

[0003] In order to solve the above technical problems, the embodiments of the present application provide a knowledge graph representation learning system, method, device and medium.

[0004] In a first aspect, an embodiment of the present application provides a knowledge graph representation learning system, the system comprising: A relationship association matrix construction module is used to construct a relationship association matrix and determine the degree of association between the relationships of the knowledge graph at time t-1 according to the relationship association matrix; An association path sampling module is used to obtain a new triple set according to the knowledge graph at time t-1 and the knowledge graph at time t, and obtain a target association path according to the degree of association between each new triple in the new triple set and the knowledge graph at time t-1; A constraint control module, used to obtain an old triple set according to the knowledge graph at time t-1, and add constraint items to entities and relationships of each old triple in the old triple set; A model optimization module is used to determine the playback data according to the target association path, generate a training data set according to the playback data and the new triple set, and train the knowledge graph representation learning model according to the training data set and the constraints.

[0005] In one embodiment, the relationship association matrix construction module is further used to construct a relationship graph according to the knowledge graph at time t-1, calculate the weights between the relationship vectors according to the relationship graph according to the weight calculation formula, and determine the degree of association between each of the relationships according to the weights; Wherein, the weight calculation formula is:

[0006] is the weight between the relationships, is the i-th relationship vector, is the j-th relationship vector.

[0007] In one embodiment, the association path sampling module is also used to determine the head entity of the new triple set, take the head entity as the sampling starting point, determine the sampling neighbors according to the degree of association between the relationships in the knowledge graph at time t-1, and determine the target association path according to the sampling neighbors and the sampling starting point.

[0008] In one implementation, the constraint control module is further configured to add a first constraint item to each entity of the old triple, wherein the first constraint item is:

[0009] in, is the first constraint, For the entities, is the first The representation vector of an entity, for The weight of .

[0010] In one implementation, the constraint control module is further configured to add a second constraint item to the relationship between each of the old triples, wherein the second constraint item is:

[0011] in, is the second constraint, For the relationship vector, is the first The representation vector of a relationship, for The weight of .

[0012] In one embodiment, the model optimization module further includes: a model updating submodule; The model update submodule is used to generate a negative data set based on the training data set, and generate multiple negative triple sets based on the negative data set, generate a model update function based on the negative triple sets and the training data set, and update the knowledge graph representation learning model according to the model update function.

[0013] In one embodiment, the model updating submodule is further used to obtain a loss function of the new triple set and the negative triple set, and determine the model updating function according to the loss function, wherein the model updating function is:

[0014] in, is the model update function, is the loss function of the new triple set, is the loss function of the negative triplet set, is the hyperparameter of the edge ranking loss, is the first constraint, is the second constraint, is the new triple set, is the negative triple set, D- is the negative data set, D+ is the training data set.

[0015] In a second aspect, an embodiment of the present application provides a knowledge graph representation learning method, and the knowledge graph representation learning method includes: Constructing a relationship association matrix through a relationship association matrix construction module, and determining the degree of association between the relationships of the knowledge graph at time t-1 according to the relationship association matrix; Obtain a new triple set according to the knowledge graph at time t-1 and the knowledge graph at time t by using an association path sampling module, and obtain a target association path according to the degree of association between each new triple in the new triple set and the knowledge graph at time t-1; Obtaining an old triple set according to the knowledge graph at time t-1 through a constraint control module, and adding constraint items to entities and relationships of each old triple in the old triple set; The playback data is determined according to the target association path through the model optimization module, a training data set is generated according to the playback data and the new triple set, and the knowledge graph representation learning model is trained according to the training data set and the constraint items.

[0016] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is run by the processor, the knowledge graph representation learning method provided in the second aspect is executed.

[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when running on a processor, executes the knowledge graph representation learning method provided in the second aspect.

[0018] The knowledge graph representation learning system, method, device and medium provided by the above-mentioned application, wherein the system includes: a relationship association matrix construction module, which is used to construct a relationship association matrix, and determine the degree of association between the relationships of the knowledge graph at time t-1 according to the relationship association matrix; an association path sampling module, which is used to obtain a new triple set according to the knowledge graph at time t-1 and the knowledge graph at time t, and obtain the target association path according to the degree of association between each new triple in the new triple set and the relationship of the knowledge graph at time t-1; a constraint control module, which is used to obtain an old triple set according to the knowledge graph at time t-1, and add constraints to the entities and relationships of each old triple in the old triple set; a model optimization module, which is used to determine the playback data according to the target association path, generate a training data set according to the playback data and the new triple set, and train the knowledge graph representation learning model according to the training data set and the constraint items. The present application can continuously learn new knowledge in a dynamically changing knowledge graph while maintaining the integrity of old knowledge, effectively avoiding catastrophic forgetting. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and should not be regarded as limiting the scope of protection of the present application. In each of the drawings, similar components are numbered similarly.

[0020] Figure 1 A schematic diagram of the structure of a knowledge graph representation learning system provided in an embodiment of the present application is shown; Figure 2 Another structural schematic diagram of the knowledge graph representation learning system provided by an embodiment of the present application is shown; Figure 3 A schematic diagram of a process of a knowledge graph representation learning method provided in an embodiment of the present application is shown; Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown.

[0021] Icons: 100-knowledge graph representation learning system; 101-relation association matrix building module; 102-association path sampling module; 103-constraint control module; 104-model optimization module; 1041-model update submodule; 400-electronic device; 401-transceiver; 402-processor; 403-memory. DETAILED DESCRIPTION

[0022] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0023] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0024] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present application, are intended only to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations of the foregoing items.

[0025] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.

[0026] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.

[0027] Existing knowledge graph representation learning models usually design specific data importance measurement methods, which sort the old triple data according to their importance and select a small amount of the most important data as playback samples. The importance measurement methods are usually divided into three types: the first is structural importance, which analyzes the structural characteristics of the old triples in the knowledge graph to select the old triple data that has the most extensive impact on parameter updates; the second is connection complexity, which selects the old triple data with the most complex connection features in the knowledge graph; the third is time correlation, which selects the old triple data with the smallest time difference between the knowledge graph and the new data. These selected triple data are merged into the new data set and trained together with the knowledge graph model. However, the main problem with these methods is that they only consider the model parts that will be directly affected by the new triple data, but ignore the model parameters that will be indirectly affected by the complex structure of the knowledge graph, which will cause catastrophic forgetting in the learning process of the knowledge graph representation learning model.

[0028] Based on this, the present application proposes a knowledge graph representation learning system, that is, when training new triple data, the path data of old triples that are highly associated with the new triples are sampled for memory playback to obtain the target association path. Since the target association path contains both the model parts that are directly and indirectly affected by the new triple set, the catastrophic forgetting problem can be more effectively avoided in the process of training the knowledge graph representation learning model.

[0029] Example 1 An embodiment of the present application provides a knowledge graph representation learning system 100.

[0030] See also Figure 1 The knowledge graph representation learning system 100 includes: a relationship association matrix construction module 101, which is used to construct a relationship association matrix and determine the degree of association between the relationships of the knowledge graph at time t-1 according to the relationship association matrix; an association path sampling module 102, which is used to obtain a new triple set according to the knowledge graph at time t-1 and the knowledge graph at time t, and obtain a target association path according to the degree of association between each new triple in the new triple set and the relationship of the knowledge graph at time t-1; a constraint control module 103, which is used to obtain an old triple set according to the knowledge graph at time t-1, and add constraints to the entities and relationships of each old triple in the old triple set; a model optimization module 104, which is used to determine playback data according to the target association path, generate a training data set according to the playback data and the new triple set, and train the knowledge graph representation learning model according to the training data set and the constraints.

[0031] It should be noted that the definition of knowledge graph dynamic change is ,in is the knowledge graph at time t-1, Represent the entities, relations, and triples in the knowledge graph at time t-1. Entities are nodes in the knowledge graph, relations are edges, and triples are basic data units in the knowledge graph, indicating the association between two entities. A triple is represented by p={s,r,o} ,in s,r,o They are the head entity, the relationship and the tail entity respectively. The knowledge graph representation learns the structural information embodied by all triples, and learns a low-dimensional representation vector for each entity and relationship, namely ,in n is the dimension of the vector.

[0032] The new entities, new relations, and new triples brought by the knowledge graph update at time t are . The new triples in usually include four cases: new entity and old relation, old entity and new relation, new entity and new relation, and old entity and old relation. For the first three cases, the relevant entity / relation vectors in the learned knowledge graph are fixed and only new entity / relation vectors are learned, while the last case needs to update the learned entity / relation vectors in combination with the new triple data. Update to To explain the present invention, The entities and relations that appear in the training vector are now needed according to New triples update the trained entity and relation vectors.

[0033] Through the collaborative work of four modules, the present application can fully capture the complex structural information in the knowledge graph, including direct and indirect influences, through the relationship association matrix module and the association path sampling module 102. Through the constraint control module 103 and the model optimization module 104, it is ensured that when learning new data, the old knowledge will not be completely forgotten, but will be reasonably updated and retained. In this way, the present application can continuously learn new knowledge in a dynamically changing knowledge graph while maintaining the integrity and effectiveness of the old knowledge.

[0034] In one embodiment, the relationship association matrix construction module 101 is further used to construct a relationship graph according to the knowledge graph at time t-1, calculate the weights between the relationship vectors according to the relationship graph according to the weight calculation formula, and determine the degree of association between the relationships according to the weights; Wherein, the weight calculation formula is:

[0035] is the weight between the relationships, is the i-th relationship vector, is the j-th relationship vector.

[0036] It should be noted that, in order to obtain complex association information between knowledge graph relations, the relationship association matrix construction module 101 is used to determine the degree of correlation between relations. Considering the complex interaction between relations, the association characteristics between relations are analyzed based on the structural information embodied by the triples in the knowledge graph.

[0037] Specifically, build a relationship diagram ,in It is a node in the relationship graph, representing the set of all relationships in the knowledge graph. It is an edge with weights between relations, indicating that two relations are in the knowledge graph. The degree of association expressed in the structure. and relationship Whether there is an edge between them depends on whether Whether there are entities with a number greater than the threshold number in the knowledge graph. The number of entities is obtained by obtaining the number of entities that have two relationships in the knowledge graph at the same time according to the knowledge graph.

[0038] thus, is the adjacency matrix, Represents two relationships and There is no edge between them, that is, the degree of association is very low. Represents that there is an edge between two relations and the weight is w .in, w Indicates the degree of correlation between two relations in the mapping space.

[0039] In the embodiment of the present application, the adjacency matrix is ​​normalized ,in for The number of edges each relationship has. By normalizing the adjacency matrix, we can ensure that some edges with excessive weights are not too prominent, so that the knowledge graph representation learning model ignores other edges. is the degree matrix, diag() represents the diagonal of the degree matrix, where Represents the degree of the first node, and so on.

[0040] The present application limits the update range of old knowledge by adding constraints to the entities and relations of each old triple in the old triple set, which helps to balance the integration of new and old knowledge and avoid excessive modification of old knowledge.

[0041] In one embodiment, the association path sampling module 102 is also used to determine the head entity of the new triple set, take the head entity as the sampling starting point, determine the sampling neighbors according to the degree of association between the relationships in the knowledge graph at time t-1, and determine the target association path according to the sampling neighbors and the sampling starting point.

[0042] It should be noted that, after acquiring the new triplet set, the associated path sampling module 102 p ={s,r,o} From the knowledge graph Path sampling is performed on the tuple to obtain the highly correlated triplet paths that need to be replayed.

[0043] Specifically, the head entity is in the knowledge graph The neighbors of the head entity are sampled from the old triples. The neighbors of the head entity are represented as , the adoption probability of the neighbor is defined according to the relationship r in the old triplet as ,in, , Represent the neighbor entities and corresponding relationships of the entity respectively, represents the set of neighbors of an entity, Prob represents the sampling probability.

[0044] And sample neighbors with this probability Get an old triple . Then the header entity s Updated to , the relationship r Updated to , and the next round of sampling is carried out in sequence. The sampling process continues until the path reaches the target length or the entity in the new triple has no neighbors for sampling, and finally an association path containing multiple new triples is obtained, which is the target association path. All new triples contained in the target association path are added to the playback data, and the same sampling process is carried out starting with the tail entity. Finally, after sampling all the new triples contained in the new triple set, the playback data and the new triple set are merged for continuous training of the model to avoid catastrophic forgetting.

[0045] In one implementation, the constraint control module 103 is further configured to add a first constraint item to each entity of the old triple, wherein the first constraint item is:

[0046] in, is the first constraint, For the entities, is the first The representation vector of an entity, for The weight of .

[0047] In one implementation, the constraint control module 103 is further configured to add a second constraint item to the relationship between each of the old triples, wherein the second constraint item is:

[0048] in, is the second constraint, For the relationship vector, is the first The representation vector of a relationship, for The weight of .

[0049] For entities Add the first constraint as ,in for The weight of and are neighbor entities, indicating updates For the entire knowledge graph The degree of influence, when The richer the connections, the better The stronger the update restriction is. , add a second constraint, where ( is the i-th diagonal element of the relation adjacency matrix), indicating the update The degree of impact on other relationships.

[0050] In this embodiment, in the process of updating the vector representations of entities and relations of old triples, constraints are added to the entities and relations of old triples to control the parameter updating process, so as to further reduce the probability of catastrophic forgetting.

[0051] In one embodiment, if Figure 2 As shown, the model optimization module 104 further includes: a model updating submodule 1041; The model update submodule 1041 is used to generate a negative data set based on the training data set, generate multiple negative triple sets based on the negative data set, generate a model update function based on the negative triple sets and the training data set, and update the knowledge graph representation learning model according to the model update function.

[0052] In one embodiment, the model updating submodule 1041 is further used to obtain the loss function of the new triple set and the negative triple set, and determine the model updating function according to the loss function, and the model updating function is:

[0053] in, is the model update function, is the loss function of the new triple set, is the loss function of the negative triplet set, is the hyperparameter of the edge ranking loss, is the first constraint, is the second constraint, is the new triple set, is the negative triple set, D- is the negative data set, D+ is the training data set.

[0054] It should be noted that after obtaining the playback data, the playback data and the new triple set are combined to form a training data set for the training of the knowledge graph representation model. At the same time, in order to improve the training effect of the model, negative sampling is used to improve the representation ability of the model. Specifically, a negative data set is generated based on the training data set using random perturbations, that is, for the new triple set , randomly One of them is replaced by another entity or relation, and the negative triples formed are Does not exist in the knowledge graph.

[0055] For each new triple set Generate a certain number of negative triples , and finally form a negative data set, combine the negative data set and the training data set to obtain the model update function.

[0056] By merging the playback data and the new triple set, this application can enable the knowledge graph representation learning model to make full use of old knowledge when learning new data and avoid catastrophic forgetting. By generating negative data, the generalization ability and robustness of the knowledge graph representation learning model are enhanced, and the performance of the knowledge graph representation learning model in connection prediction tasks is improved. By adjusting hyperparameters, the performance of the knowledge graph representation learning model is further optimized and the stability of the knowledge graph representation learning model is improved.

[0057] It is further explained that this application uses the industry-standard FB15K dataset to verify the effectiveness of the proposed method in knowledge graph representation learning. The verification indicators are MR (Mean Rank) and Hits@N in the connection prediction. Among them, MRR (Mean Reciprocal Rank) is used to measure the average position of the prediction result in the sorted list, and Hits@N is to check whether the correct answer is in the top N positions of the candidate answers. For example, Hits@1 is to see whether the correct answer is ranked first; Hits@3 is to see whether the correct answer is ranked in the top 3; Hits@10 is to see whether the correct answer is ranked in the top 10. The higher this indicator is, the stronger the model's ability to rank the correct answer in the front position when predicting. In this experiment, Hits@1, Hits@3 and Hits@10 were specifically selected as evaluation indicators.

[0058] Experimental results show that the proposed method achieves the best results in the connection prediction task in the learning of knowledge graph representation model. Compared with the existing ABIE method based on anchor entity discovery and the DKGE-LFS method based on attention entity background embedding, this method has a significant advantage in accuracy.

[0059] At the same time, compared with the AIR method based on structure and feature analysis of triple importance, the associated triples found by this method are also better in terms of effect. The specific learning effect is shown in Table 1.

[0060] Table 1: Knowledge graph representation learning effect display table.

[0061]

[0062] The knowledge graph representation learning system 100 provided in this embodiment includes: a relationship association matrix construction module 101, which is used to construct a relationship association matrix, and determine the degree of association between the relationships of the knowledge graph at time t-1 according to the relationship association matrix; an association path sampling module 102, which is used to obtain a new triple set according to the knowledge graph at time t-1 and the knowledge graph at time t, and obtain a target association path according to the degree of association between each new triple in the new triple set and the relationship of the knowledge graph at time t-1; a constraint control module 103, which is used to obtain an old triple set according to the knowledge graph at time t-1, and add constraints to the entities and relationships of each old triple in the old triple set; a model optimization module 104, which is used to determine playback data according to the target association path, generate a training data set according to the playback data and the new triple set, and train the knowledge graph representation learning model according to the training data set and the constraints. The present application can continuously learn new knowledge in a dynamically changing knowledge graph while maintaining the integrity of old knowledge, effectively avoiding catastrophic forgetting.

[0063] Example 2 In addition, if Figure 3 As shown, an embodiment of the present application provides a knowledge graph representation learning method.

[0064] S301, constructing a relationship association matrix through the relationship association matrix construction module 101, and determining the degree of association between the relationships of the knowledge graph at time t-1 according to the relationship association matrix.

[0065] S302, obtaining a new triple set according to the knowledge graph at time t-1 and the knowledge graph at time t through the association path sampling module 102, and obtaining a target association path according to the degree of association between each new triple in the new triple set and the knowledge graph at time t-1.

[0066] S303, obtaining an old triple set according to the knowledge graph at time t-1 through the constraint control module 103, and adding constraint items to the entities and relations of each old triple in the old triple set.

[0067] S304, determining the playback data according to the target association path through the model optimization module 104, generating a training data set according to the playback data and the new triple set, and training the knowledge graph representation learning model according to the training data set and the constraint items.

[0068] The knowledge graph representation learning method provided in this embodiment can be applied to the knowledge graph representation learning system 100 provided in Example 1. To avoid repetition, it will not be repeated here.

[0069] The knowledge graph representation learning method provided in this embodiment can continuously learn new knowledge in a dynamically changing knowledge graph while maintaining the integrity of old knowledge, effectively avoiding catastrophic forgetting.

[0070] Example 3 In addition, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, it executes the knowledge graph representation learning method provided in Example 2.

[0071] For details, see Figure 4 The electronic device 400 includes: a transceiver 401, a bus interface and a processor 402, wherein the processor 402 is used to: construct a relationship association matrix through a relationship association matrix construction module 101, and determine the degree of association between the relationships of the knowledge graph at time t-1 according to the relationship association matrix; obtain a new triple set according to the knowledge graph at time t-1 and the knowledge graph at time t through an association path sampling module 102, and obtain a target association path according to the degree of association between each new triple in the new triple set and the knowledge graph at time t-1; obtain an old triple set according to the knowledge graph at time t-1 through a constraint control module 103, and add constraints to the entities and relationships of each old triple in the old triple set; determine playback data according to the target association path through a model optimization module 104, generate a training data set according to the playback data and the new triple set, and train the knowledge graph representation learning model according to the training data set and the constraints.

[0072] In the embodiment of the present application, the electronic device 400 further includes a memory 403. Figure 4 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically connecting various circuits of one or more processors represented by processor 402 and memory represented by memory 403. The bus architecture may also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 401 may be a plurality of components, i.e., including a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. The processor 402 is responsible for managing the bus architecture and general processing, and the memory 403 may store data used by the processor 402 when performing operations.

[0073] The electronic device 400 provided in the embodiment of the present application can execute the steps of the knowledge graph representation learning method provided in the above method embodiment 2, which will not be repeated here to avoid repetition.

[0074] The electronic device provided in this embodiment can continuously learn new knowledge in a dynamically changing knowledge graph while maintaining the integrity of old knowledge, effectively avoiding catastrophic forgetting.

[0075] Example 4 The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the knowledge graph representation learning method provided in Example 2 is implemented.

[0076] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0077] The computer-readable storage medium provided in this embodiment can implement the knowledge graph representation learning method provided in Example 2. To avoid repetition, it will not be repeated here.

[0078] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or terminal including the element.

[0079] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0080] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A knowledge graph representation learning system, characterized in that: The system comprises: A relationship association matrix construction module is used to construct a relationship association matrix and determine the degree of association between the relationships of the knowledge graph at time t-1 according to the relationship association matrix; An association path sampling module is used to obtain a new triple set according to the knowledge graph at time t-1 and the knowledge graph at time t, and obtain a target association path according to the degree of association between each new triple in the new triple set and the knowledge graph at time t-1; A constraint control module, used to obtain an old triple set according to the knowledge graph at time t-1, and add constraint items to entities and relationships of each old triple in the old triple set; A model optimization module is used to determine the playback data according to the target association path, generate a training data set according to the playback data and the new triple set, and train the knowledge graph representation learning model according to the training data set and the constraints.

2. The knowledge graph representation learning system according to claim 1, characterized in that: The relationship association matrix construction module is further used to construct a relationship graph according to the knowledge graph at time t-1, calculate the weights between the relationship vectors according to the relationship graph according to the weight calculation formula, and determine the degree of association between the relationships according to the weights; Wherein, the weight calculation formula is: is the weight between the relationships, is the i-th relationship vector, is the j-th relationship vector.

3. The knowledge graph representation learning system according to claim 1, characterized in that: The association path sampling module is also used to determine the head entity of the new triple set, take the head entity as the sampling starting point, determine the sampling neighbors according to the degree of association between the relationships in the knowledge graph at time t-1, and determine the target association path according to the sampling neighbors and the sampling starting point.

4. The knowledge graph representation learning system according to claim 1, characterized in that: The constraint control module is further used to add a first constraint item to the entity of each old triple, and the first constraint item is: in, is the first constraint, For the entities, is the first The representation vector of an entity, for The weight of .

5. The knowledge graph representation learning system according to claim 4, characterized in that: The constraint control module is further used to add a second constraint item to the relationship between each of the old triples, and the second constraint item is: in, is the second constraint, For the relationship vector, is the first The representation vector of a relationship, for The weight of .

6. The knowledge graph representation learning system according to claim 1, characterized in that: The model optimization module also includes: a model updating submodule; The model update submodule is used to generate a negative data set based on the training data set, and generate multiple negative triple sets based on the negative data set, generate a model update function based on the negative triple sets and the training data set, and update the knowledge graph representation learning model according to the model update function.

7. The knowledge graph representation learning system according to claim 6, characterized in that: The model updating submodule is further used to obtain the loss function of the new triple set and the negative triple set, and determine the model updating function according to the loss function, wherein the model updating function is: in, is the model update function, is the loss function of the new triple set, is the loss function of the negative triplet set, is the hyperparameter of the edge ranking loss, is the first constraint, is the second constraint, is the new triple set, is the negative triple set, D- is the negative data set, D+ is the training data set.

8. A knowledge graph representation learning method, characterized in that: Applied to the knowledge graph representation learning system according to any one of claims 1 to 7, the method comprising: Constructing a relationship association matrix through a relationship association matrix construction module, and determining the degree of association between the relationships of the knowledge graph at time t-1 according to the relationship association matrix; Obtain a new triple set according to the knowledge graph at time t-1 and the knowledge graph at time t by using an association path sampling module, and obtain a target association path according to the degree of association between each new triple in the new triple set and the knowledge graph at time t-1; Obtaining an old triple set according to the knowledge graph at time t-1 through a constraint control module, and adding constraint items to entities and relationships of each old triple in the old triple set; The playback data is determined according to the target association path through the model optimization module, a training data set is generated according to the playback data and the new triple set, and the knowledge graph representation learning model is trained according to the training data set and the constraint items.

9. An electronic device, characterized in that: It includes a memory and a processor, the memory stores a computer program, and the computer program executes the knowledge graph representation learning method described in claim 8 when the processor is running.

10. A computer-readable storage medium, characterized in that: It stores a computer program, which, when running on a processor, executes the knowledge graph representation learning method described in claim 8.

Citation Information

Patent Citations

  • Course knowledge graph joint embedding method introducing semantic constraint conditions

    CN114282006A

  • Method for constructing knowledge graph based on large language model and vector library

    CN119129722A

  • Knowledge graph completion method for online incremental learning scene

    CN119226523A