Knowledge graph fact error detection method, device, electronic device and storage medium
By combining the bidirectional long and short-term memory network and graph attention network to calculate the local part number and global scores, evaluating the confidence of the knowledge graph triplets, the problem of lack of universality in the detection methods in the existing technology is solved, and more accurate error detection is achieved .
Patent Information
- Application Number
- CN202410312411.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-19
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-03-19
AI Technical Summary
The detection method of knowledge graph error data in the prior art lacks universality and cannot effectively evaluate the confidence of the triple from the two aspects of internal structural contradictions and external semantic differences, resulting in inaccurate detection.
The local part number and global score of triplets are calculated using bidirectional long and short-term memory network and graph attention network. The confidence of triplets is judged by confidence score (djoint = dglobal + λdlocal), and the tripartites are evaluated based on local part number and global scores. The internal structural contradictions and external semantic differences of groups.
Improves the universality and accuracy of knowledge graph error detection, and enables more efficient identification of fact error triples, avoiding limitations of predefined rules.
Smart Images

Figure CN118193750B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a knowledge graph fact error detection method, device, electronic device and storage medium. Background Art
[0002] Knowledge graph is a structural graph used to represent the relationship information between entities, which can be applied to the fields of knowledge engineering and artificial intelligence technology. The knowledge content in the knowledge graph is mainly extracted from the Internet corpus in an automatic or semi-automatic way. Due to the noise in these corpora and the imperfection of the extraction algorithm, a large amount of erroneous data will inevitably be introduced. The existence of these erroneous data will have a serious negative impact on the performance of downstream tasks.
[0003] In the prior art, in order to reduce the impact of erroneous data, error detection can be performed on the knowledge graph according to predefined rules, and triples that do not conform to the predefined rules can be determined as erroneous data. However, this method is limited by the coverage and quality of the rules and is not universal. Summary of the invention
[0004] The present invention provides a knowledge graph fact error detection method, device, electronic device and storage medium to solve the problem that the erroneous data detection method in the prior art is not universal.
[0005] The present invention provides a method for detecting factual errors in a knowledge graph, comprising: obtaining a target triple from a knowledge graph to be detected, the target triple comprising a head entity, a tail entity, and an entity association relationship; determining a confidence score of the target triple, the confidence score comprising a local score and a global score, the local score being used to indicate the degree of inconsistency in the internal structure of the target triple, and the global score being used to indicate the degree of difference in external semantics between the head entity and the tail entity in the knowledge graph to be detected; when the confidence score is greater than a preset threshold, determining that the target triple has a factual error.
[0006] According to a method for detecting factual errors in a knowledge graph provided by the present invention, determining the confidence score of the target triplet includes: training a bidirectional long short-term memory network through the knowledge graph to be detected to obtain a triplet local encoder; determining the local information encoding of the target triplet through the triplet local encoder; and determining the local score of the local information encoding based on the square Euclidean distance.
[0007] According to a knowledge graph fact error detection method provided by the present invention, the determination of the confidence score of the target triplet includes: determining a first subgraph including the head entity and a second subgraph including the tail entity from the knowledge graph to be detected; calculating a first global representation vector corresponding to the first subgraph and a second global representation vector corresponding to the second subgraph through a graph attention network; and calculating the cosine similarity between the first global representation vector and the second global representation vector to obtain the global score.
[0008] According to a knowledge graph fact error detection method provided by the present invention, the first global representation vector corresponding to the first subgraph and the second global representation vector corresponding to the second subgraph are calculated through a graph attention network, including: determining the triples to be checked in the target subgraph and the neighbor triples of the triples to be checked; determining the node weights through weighted aggregation processing to obtain the global representation vector of the target subgraph; wherein the target subgraph is one of the first subgraph and the second subgraph.
[0009] According to a knowledge graph fact error detection method provided by the present invention, the determination of the confidence score of the target triplet includes: using formula d joint =d global +λd local Determine the confidence score d of the target triple joint ; where d local represents the local score, d global represents the global score, and λ represents a trade-off parameter.
[0010] The present invention also provides a knowledge graph factual error detection device, comprising: an acquisition module and a processing module; the acquisition module is used to acquire a target triple from the knowledge graph to be detected, the target triple comprising a head entity, a tail entity and an entity association relationship; the processing module is used to determine a confidence score of the target triple, the confidence score comprising a local score and a global score, the local score is used to indicate the degree of inconsistency in the internal structure of the target triple, and the global score is used to indicate the degree of difference in the external semantics of the head entity and the tail entity in the knowledge graph to be detected; when the confidence score is greater than a preset threshold, it is determined that the target triple has a factual error.
[0011] According to a knowledge graph fact error detection device provided by the present invention, the processing module is used to train a bidirectional long short-term memory network through the knowledge graph to be detected to obtain a triple local encoder; determine the local information encoding of the target triple through the triple local encoder; and determine the local score of the local information encoding based on the square Euclidean distance.
[0012] According to a knowledge graph fact error detection device provided by the present invention, the processing module is used to determine a first subgraph including the head entity and a second subgraph including the tail entity from the knowledge graph to be detected; calculate a first global representation vector corresponding to the first subgraph and a second global representation vector corresponding to the second subgraph through a graph attention network; calculate the cosine similarity between the first global representation vector and the second global representation vector to obtain the global score.
[0013] According to a knowledge graph fact error detection device provided by the present invention, the processing module is used to determine the triples to be checked and the neighbor triples of the triples to be checked in the target subgraph; determine the node weights through weighted aggregation processing to obtain the global representation vector of the target subgraph; wherein the target subgraph is one of the first subgraph and the second subgraph.
[0014] According to a knowledge graph fact error detection device provided by the present invention, the processing module is used to joint =d global +λd local Determine the confidence score d of the target triple joint ; where d local represents the local score, d global represents the global score, and λ represents a trade-off parameter.
[0015] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-described knowledge graph fact error detection methods are implemented.
[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described knowledge graph fact error detection methods.
[0017] The knowledge graph factual error detection method, device, electronic device and storage medium provided by the present invention can obtain a target triple from the knowledge graph to be detected, wherein the target triple includes a head entity, a tail entity and an entity association relationship; determine the confidence score of the target triple, wherein the confidence score includes a local score and a global score, wherein the local score is used to indicate the degree of contradiction of the internal structure of the target triple, and the global score is used to indicate the degree of difference of the external semantics of the head entity and the tail entity in the knowledge graph to be detected; when the confidence score is greater than a preset threshold, determine that the target triple has a factual error. Through this scheme, it can be determined whether the target triple has a factual error according to the confidence score of the target triple. Since the confidence score includes a local score and a global score, the confidence of the target triple can be evaluated from two aspects: internal structural contradiction and external semantic difference. In this way, it can not only avoid being restricted by predefined rules and improve the versatility of the detection method, but also more accurately detect triples with factual errors from the knowledge graph. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 It is one of the flow charts of the knowledge graph fact error detection method provided by the present invention;
[0020] Figure 2 This is the second flow chart of the knowledge graph fact error detection method provided by the present invention;
[0021] Figure 3 It is a structural schematic diagram of the knowledge graph fact error detection device provided by the present invention;
[0022] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] It should be noted that, in the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0025] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device 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 device. 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 device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present invention is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0026] In order to clearly describe the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, the words "first", "second", etc. are used to distinguish between the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first", "second", etc. are not limiting the quantity and execution order.
[0027] The embodiments of the present invention describe some exemplary embodiments for the purpose of explanation. It should be understood that the present invention can be implemented in other ways that are not specifically shown in the drawings.
[0028] The above implementation is described in detail below with reference to specific embodiments and drawings.
[0029] like Figure 1 As shown, an embodiment of the present invention provides a knowledge graph fact error detection method, which can be applied to a knowledge graph fact error detection device. The knowledge graph fact error detection method may include S101-S103:
[0030] S101. The knowledge graph fact error detection device obtains the target triple from the knowledge graph to be detected.
[0031] The target triplet includes a head entity, a tail entity, and an entity association relationship.
[0032] It should be noted that the knowledge graph is a semantic network that reveals the relationship between entities. The entity network of the knowledge graph can include multiple intertwined triples. For example, a triple in the knowledge graph can be Su Shi, Brothers, Su Zhe, where the head entity is Su Shi, the tail entity is Su Zhe, and the entity association is Brothers; another triple in the knowledge graph can be Su Shi, Dynasty, Northern Song Dynasty, where the head entity is Su Shi, the tail entity is Northern Song Dynasty, and the entity association is Dynasty.
[0033] It should be noted that the target triple can be any triple in the knowledge graph to be tested that needs to be tested for factual errors. Figure 2 As shown, the target triple can be expressed as (h, r, t), where h represents the head entity X1, t represents the tail entity X2, and r represents the entity association relationship A.
[0034] S102. The knowledge graph fact error detection device determines the confidence score of the target triplet.
[0035] Among them, the above-mentioned confidence score includes a local score and a global score. The local score is used to indicate the degree of contradiction in the internal structure of the target triple, and the global score is used to indicate the degree of difference in the external semantics of the head entity and the tail entity in the knowledge graph to be detected.
[0036] Optionally, the knowledge graph fact error detection device can train a bidirectional long short-term memory network through the knowledge graph to be detected to obtain a triple local encoder; determine the local information encoding of the target triple through the triple local encoder; and determine the local score of the local information encoding based on the square Euclidean distance.
[0037] Specifically, Figure 2 As shown, the knowledge graph fact error detection device can first use a bidirectional long short-term memory network to train on the knowledge graph to be detected, and embed the trained knowledge graph into the model as a triple local encoder. After determining the target triple, the knowledge graph fact error detection device can input the target triple (h, r, t) into the triple local encoder to determine the local information encoding X = [X h ;X r ;X t ]=Bi-LSTM(h,r,t), where Bi-LSTM represents a triplet local encoder, X h , X r , X tare the corresponding embedding representations of the head entity, entity association relationship and tail entity after network coding. Afterwards, the knowledge graph fact error detection device can use the local representation based on triples to capture the internal structural contradictions of the target triples, that is, the local score of the local information encoding can be determined based on the squared Euclidean distance. The local score d local It can be expressed as: local (h, r, t) = ||X h +X r -X t ||2, where || ||2 represents the squared Euclidean distance.
[0038] Optionally, the knowledge graph fact error detection device can determine a first subgraph including the head entity and a second subgraph including the tail entity from the knowledge graph to be detected; calculate a first global representation vector corresponding to the first subgraph and a second global representation vector corresponding to the second subgraph through a graph attention network; calculate the cosine similarity between the first global representation vector and the second global representation vector to obtain the global score.
[0039] Specifically, the knowledge graph fact error detection device can use the dynamic neighbor node selection technology to construct two subgraphs with head and tail balance, and use the dynamic attention mechanism to encode the subgraphs to obtain the global representation of the target triple. Figure 2 As shown, the knowledge graph fact error detection device can use the graph structure information of the knowledge graph to be detected to determine the neighbor nodes of each entity in the target triple, and then adopt a dynamic neighbor selection technology based on symbol similarity and triple representation similarity to screen the first subgraph including the target triple head entity X1 and the second subgraph including the tail entity X2, and then use the graph attention network to calculate the first global representation vector H corresponding to the first subgraph i The second global representation vector T corresponding to the second subgraph i Finally, the cosine similarity between the first global representation vector and the second global representation vector is calculated to obtain the global score. The global score d global It can be expressed as: global =sim(H i , T i ), where sim represents Figure 3 Tuple representing cozine similarity.
[0040] Optionally, the calculating of the first global representation vector corresponding to the first subgraph and the second global representation vector corresponding to the second subgraph through the graph attention network includes: determining the triples to be queried and the neighbor triples of the triples to be queried in the target subgraph; determining the node weights through weighted aggregation processing to obtain the global representation vector of the target subgraph; wherein the target subgraph is one of the first subgraph and the second subgraph.
[0041] Specifically, the triple to be checked is the triple X in the first subgraph i For example, by i Neighbor triples ({X1,X2,...,X m}) Performing weighted aggregation processing can update the first global representation vector. The weight calculation process between node i and node j includes:
[0042] e ij =α T Leaky Re LU(W·[X i ||X j ]);
[0043] Among them, e ij Represents X j For X i The importance of , W and α represent learnable linear matrices, and LeakyReLU represents an improved activation function.
[0044] Optionally, in order to normalize the attention coefficients into a probability distribution so that they can be used to compute an aggregate representation for each node, another activation function, softmax, can be used to normalize the coefficients: The first global representation vector of the first subgraph can be calculated using the sigmoid function, that is Similarly, we can get the second global representation vector T of the second subgraph: i , I will not go into details here.
[0045] Optionally, the knowledge graph fact error detection device can be implemented by formula d joint =d global +λd local Determine the confidence score d of the target triple joint ; where d local represents the local score, d global represents the global score, and λ represents a trade-off parameter for balancing the importance of the local score and the global score.
[0046] Specifically, the local representation based on triples can capture the internal structural contradictions of the target triplet, and the external semantic differences of the target triplet can be explored through two global representations of the same triplet. Finally, combining these two features, the probability that the target triplet contains wrong facts can be obtained through the scoring function.
[0047] S103. The knowledge graph fact error detection device determines that there is a fact error in the target triple when the confidence score is greater than a preset threshold.
[0048] In an embodiment of the present invention, it is possible to determine whether a target triplet has factual errors based on the confidence score of the target triplet. Since the confidence score includes a local score and a global score, the confidence of the target triplet can be evaluated from two aspects: internal structural contradictions and external semantic differences. In this way, it is possible to avoid being restricted by predefined rules and improve the versatility of the detection method, and it is also possible to more accurately detect triples with factual errors from the knowledge graph.
[0049] The above mainly introduces the solution provided by the embodiment of the present invention from the perspective of the method. In order to achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiment disclosed in this article, the embodiment of the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0050] The knowledge graph fact error detection method provided in the embodiment of the present invention can be executed by a knowledge graph fact error detection device, or a control module for knowledge graph fact error detection in the knowledge graph fact error detection device. In the embodiment of the present invention, the knowledge graph fact error detection method is executed by a knowledge graph fact error detection device as an example to illustrate the knowledge graph fact error detection device provided in the embodiment of the present invention.
[0051] It should be noted that the embodiment of the present invention can divide the functional modules of the knowledge graph fact error detection device according to the above method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. Optionally, the division of modules in the embodiment of the present invention is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0052] like Figure 3 As shown, an embodiment of the present invention provides a knowledge graph factual error detection device 300. The knowledge graph factual error detection device 300 includes: an acquisition module 301 and a processing module 302. The acquisition module 301 can be used to acquire a target triple from the knowledge graph to be detected, and the target triple includes a head entity, a tail entity, and an entity association relationship; the processing module 302 is used to determine the confidence score of the target triple, and the confidence score includes a local score and a global score. The local score is used to indicate the degree of contradiction in the internal structure of the target triple, and the global score is used to indicate the degree of difference in the external semantics of the head entity and the tail entity in the knowledge graph to be detected; when the confidence score is greater than a preset threshold, it is determined that the target triple has a factual error.
[0053] Optionally, the processing module 302 is used to train a bidirectional long short-term memory network through the knowledge graph to be detected to obtain a triple local encoder; determine the local information encoding of the target triple through the triple local encoder; and determine the local score of the local information encoding based on the square Euclidean distance.
[0054] Optionally, the processing module 302 is used to determine a first subgraph including the head entity and a second subgraph including the tail entity from the knowledge graph to be detected; calculate a first global representation vector corresponding to the first subgraph and a second global representation vector corresponding to the second subgraph through a graph attention network; calculate the cosine similarity between the first global representation vector and the second global representation vector to obtain the global score.
[0055] Optionally, the above-mentioned processing module 302 is used to determine the triples to be queried and the neighbor triples of the triples to be queried in the target subgraph; determine the node weights through weighted aggregation processing to obtain the global representation vector of the target subgraph; wherein the target subgraph is one of the first subgraph and the second subgraph.
[0056] Optionally, the processing module 302 is used to calculate the joint =d global +θd local Determine the confidence score d of the target triple joint ; where d local represents the local score, d global represents the global score, and λ represents a trade-off parameter.
[0057] In an embodiment of the present invention, it is possible to determine whether a target triplet has factual errors based on the confidence score of the target triplet. Since the confidence score includes a local score and a global score, the confidence of the target triplet can be evaluated from two aspects: internal structural contradictions and external semantic differences. In this way, it is possible to avoid being restricted by predefined rules and improve the versatility of the detection method, and it is also possible to more accurately detect triples with factual errors from the knowledge graph.
[0058] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 complete mutual communication through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the knowledge graph fact error detection method, which includes: obtaining a target triple from the knowledge graph to be detected, wherein the target triple includes a head entity, a tail entity and an entity association relationship; determining a confidence score of the target triple, wherein the confidence score includes a local score and a global score, wherein the local score is used to indicate the degree of contradiction of the internal structure of the target triple, and the global score is used to indicate the degree of difference in the external semantics of the head entity and the tail entity in the knowledge graph to be detected; when the confidence score is greater than a preset threshold, determining that the target triple has a fact error.
[0059] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0060] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the knowledge graph fact error detection method provided by the above methods, and the method includes: obtaining a target triple from the knowledge graph to be detected, and the target triple includes a head entity, a tail entity, and an entity association relationship; determining a confidence score of the target triple, and the confidence score includes a local score and a global score, and the local score is used to indicate the degree of contradiction in the internal structure of the target triple, and the global score is used to indicate the degree of difference in the external semantics of the head entity and the tail entity in the knowledge graph to be detected; when the confidence score is greater than a preset threshold, it is determined that there is a factual error in the target triple.
[0061] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the above-mentioned knowledge graph fact error detection method provided, the method comprising: obtaining a target triple from the knowledge graph to be detected, the target triple comprising a head entity, a tail entity, and an entity association relationship; determining a confidence score of the target triple, the confidence score comprising a local score and a global score, the local score being used to indicate the degree of inconsistency in the internal structure of the target triple, and the global score being used to indicate the degree of difference in the external semantics of the head entity and the tail entity in the knowledge graph to be detected; when the confidence score is greater than a preset threshold, determining that the target triple has a factual error.
[0062] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0063] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0064] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A knowledge graph fact error detection method, characterized in that: include: Obtain a target triple from the knowledge graph to be detected, wherein the target triple includes a head entity, a tail entity, and an entity association relationship; Determine a confidence score of the target triple, wherein the confidence score includes a local score and a global score, wherein the local score is used to indicate the degree of inconsistency of the internal structure of the target triple, and the global score is used to indicate the degree of difference in external semantics between the head entity and the tail entity in the knowledge graph to be detected; In the case where the confidence score is greater than a preset threshold, determining that there is a factual error in the target triplet; The target triplet (h, r, t) is input into the triplet local encoder to determine the local information encoding of the target triplet ,in, represents the triplet local encoder, are respectively corresponding embedding representations of the head entity, the entity association relationship and the tail entity after network coding; and determining the local score of the local information coding based on the squared Euclidean distance; Determine a first subgraph including the head entity and a second subgraph including the tail entity from the knowledge graph to be detected; calculate a first global representation vector corresponding to the first subgraph and a second global representation vector corresponding to the second subgraph through a graph attention network; calculate the cosine similarity between the first global representation vector and the second global representation vector to obtain the global score.
2. The knowledge graph fact error detection method according to claim 1 is characterized in that: Determining the confidence score of the target triplet includes: The three-tuple local encoder is obtained by training a bidirectional long short-term memory network through the knowledge graph to be detected.
3. The knowledge graph fact error detection method according to claim 1 is characterized in that: The calculating, by using a graph attention network, a first global representation vector corresponding to the first subgraph and a second global representation vector corresponding to the second subgraph includes: Determine a triple to be checked and neighbor triples of the triple to be checked in the target subgraph; The node weights are determined by weighted aggregation processing to obtain a global representation vector of a target subgraph; wherein the target subgraph is one of the first subgraph and the second subgraph.
4. The knowledge graph fact error detection method according to any one of claims 1 to 3, characterized in that: Determining the confidence score of the target triplet includes: By formula Determine the confidence score of the target triplet ; in, represents the local score, represents the global score, Represents a trade-off parameter.
5. A knowledge graph fact error detection device, characterized in that: include: Acquisition module and processing module; The acquisition module is used to acquire a target triple from the knowledge graph to be detected, wherein the target triple includes a head entity, a tail entity, and an entity association relationship; The processing module is used to determine the confidence score of the target triple, wherein the confidence score includes a local score and a global score, wherein the local score is used to indicate the degree of contradiction of the internal structure of the target triple, and the global score is used to indicate the degree of difference of the external semantics of the head entity and the tail entity in the knowledge graph to be detected; In the case where the confidence score is greater than a preset threshold, determining that there is a factual error in the target triplet; The processing module is used to input the target triplet (h, r, t) into the triplet local encoder to determine the local information encoding of the target triplet ,in, represents the triplet local encoder, are respectively corresponding embedding representations of the head entity, the entity association relationship and the tail entity after network coding; and determining the local score of the local information coding based on the squared Euclidean distance; The processing module is used to determine a first subgraph including the head entity and a second subgraph including the tail entity from the knowledge graph to be detected; calculate a first global representation vector corresponding to the first subgraph and a second global representation vector corresponding to the second subgraph through a graph attention network; calculate the cosine similarity between the first global representation vector and the second global representation vector to obtain the global score.
6. The knowledge graph fact error detection device according to claim 5, characterized in that: The processing module is used to train a bidirectional long short-term memory network through the knowledge graph to be detected to obtain the triple local encoder.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps in the knowledge graph fact error detection method as described in any one of claims 1 to 4 are implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the knowledge graph fact error detection method as described in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Embedded representation method of knowledge graph and related equipment
CN112148883A
High-quality noise detection method and device based on rule information
CN114860945A
Knowledge graph completion method based on graph attention network
CN114880490A
General sense knowledge graph completion method based on graph attention network and additional information
CN115757829A
Threat intelligence data processing method and computer readable storage medium
CN117668244A
