Knowledge graph updating method and electronic device

By extracting target text from the knowledge graph and matching the similarity of classification vectors, combined with convolutional neural networks and completion rules, the problem of low update efficiency of knowledge graphs is solved, and a more efficient and accurate update process is achieved.

CN114357180BActive Publication Date: 2025-10-28QINGDAO HISENSE TRANS TECH +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111531021.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-14
Publication Date
2025-10-28
Estimated Expiration
2041-12-14

AI Technical Summary

Technical Problem

The current technology for knowledge graphs has low update efficiency, which leads to information loss.

Method used

By extracting triples from the target text and classifying the target vectors of entities, the entity to be updated is determined using similarity and then updated. By combining a pre-trained convolutional neural network and completion rules, the update efficiency and accuracy are improved.

Benefits of technology

It improves the update efficiency and accuracy of knowledge graphs, and enhances the completeness of information and search efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114357180B_ABST
    Figure CN114357180B_ABST
Patent Text Reader

Abstract

This disclosure provides a method and electronic device for updating a knowledge graph. To improve the efficiency of knowledge graph updates, the method includes: responding to a user-sent knowledge graph update request, extracting target text corresponding to the update request to obtain triples; classifying the target vectors of each entity in each triple based on the category of each entity to obtain the category of each target vector; for any given target vector, determining entities in the knowledge graph to be updated that share the same category as the target vector, based on the category of the target vector; using the target vector and the vectors of each updated entity, obtaining the similarity scores between the target vector and the vectors of each updated entity; using the similarity scores, determining the target entities to be updated corresponding to the target vector from the vectors of each entity to be updated corresponding to the target vector; and updating each target updated entity using the entity corresponding to the target vector to obtain the updated knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge graph technology, and in particular to a method for updating a knowledge graph and an electronic device. Background Technology

[0002] The primary purpose of knowledge graphs is to enhance search efficiency and improve user experience in an era of rapid internet development and explosive growth in online data. Leveraging its superior semantic processing technology and interconnectivity, knowledge graphs lay the foundation for intelligent information applications and are widely used in search, question answering, intelligence analysis, and other fields, promoting the development of information technology from information services to knowledge services.

[0003] Currently, knowledge graphs are updated by comparing each entity vector in each triple with all entities in the knowledge graph to be updated, and then updating the entities in the knowledge graph based on the comparison results. This results in low update efficiency for knowledge graphs. Summary of the Invention

[0004] This disclosure provides an exemplary embodiment of a knowledge graph updating method and an electronic device for updating knowledge graphs, thereby solving the problem in the prior art where information is missing from knowledge graphs due to the lack of updates.

[0005] The first aspect of this disclosure provides a method for updating a knowledge graph, the method comprising:

[0006] In response to a knowledge graph update request sent by a user, the target text corresponding to the knowledge graph update request is extracted to obtain each triple;

[0007] The target vectors of each entity in each triplet are classified based on the category of each entity to obtain the category of each target vector;

[0008] For any target vector, based on the category of the target vector, determine each entity in the knowledge graph to be updated that has the same category as the target vector, wherein the knowledge graph to be updated is the knowledge graph corresponding to the knowledge graph update request;

[0009] Using the target vector and the vectors of each entity to be updated, the similarity between the target vector and the vectors of each entity to be updated is obtained respectively;

[0010] Based on the aforementioned similarities, the target entity to be updated corresponding to the target vector is determined from the vectors of the entities to be updated corresponding to the target vector.

[0011] The entities corresponding to the target vectors are used to update the target update entities to obtain the updated knowledge graph.

[0012] In this embodiment, target text corresponding to the knowledge graph update request is extracted to obtain triples. Then, the target vectors of each entity in each triple are classified based on their respective categories. For any given target vector, based on its category, entities in the knowledge graph to be updated that belong to the same category as the target vector are identified. Finally, based on the similarity between the target vector and the vectors of the entities to be updated, the target entities corresponding to the target vector are determined from the vectors of the entities to be updated corresponding to the target vector. The entities corresponding to the target vector are then used to update the target entities, resulting in the updated knowledge graph. Therefore, this embodiment improves the efficiency of knowledge graph updates by determining the similarity between target vectors and entities of the same category and updating them accordingly.

[0013] In one embodiment, before classifying the target vectors of each entity in each triplet based on the category of each entity to obtain the category of each target vector, the method further includes:

[0014] For any entity in each triple, the word2vec model is used to transform the entity into a vector to obtain the first vector corresponding to the entity. The entity is then weighted using the term frequency-inverse document frequency (TF-IDF) model to obtain the weight corresponding to the entity.

[0015] Based on the first vector corresponding to the entity and the weight corresponding to the entity, the second vector of the entity is obtained;

[0016] The attribute information of the entity is extracted using a pre-trained convolutional neural network to obtain the attribute vector corresponding to the attribute information of the entity.

[0017] The second vector of the entity and the attribute vector are concatenated to obtain the target vector of the entity.

[0018] This embodiment obtains the second vector of the entity based on the first vector and the weight of the entity, and extracts features from the attribute information of the entity using a pre-trained convolutional neural network to obtain the attribute vector corresponding to the attribute information of the entity. Then, the second vector of the entity and the attribute vector are concatenated to obtain the target vector of the entity, thereby enriching the target vector of the entity and improving the accuracy of knowledge graph updates.

[0019] In one embodiment, after obtaining the second vector of the entity based on the first vector corresponding to the entity and the weight corresponding to the entity, the method further includes:

[0020] For any entity, the similarity between the entity and the other entities in each triplet is obtained based on the entity's second vector and the second vectors of the other entities in each triplet, excluding the entity itself.

[0021] The similarity between the entity and the other entities is compared with a first preset threshold, other target entities with similarity greater than the first preset threshold are identified, and the other target entities and the entity are added to the target entity set.

[0022] The target entity is obtained by the total number of each entity in each triplet in the target entity set;

[0023] The triples corresponding to other entities in the target entity set, excluding the target entity itself, are updated using the target entity.

[0024] In this embodiment, the similarity between entities determines the updating and replacement of entities with different names of the same type, thereby aligning the entities in each triple and further improving the accuracy of knowledge graph updates.

[0025] In one embodiment, determining the target entity to be updated corresponding to the target vector from the vectors of each entity to be updated corresponding to the target vector using the similarity scores includes:

[0026] For any target vector, determine the entities to be updated whose similarity is greater than a second preset threshold from the target entities to be updated corresponding to the target vector;

[0027] Each entity to be updated whose similarity is greater than the second preset threshold is identified as the target entity to be updated corresponding to the target vector.

[0028] This embodiment determines, for any given target vector, entities whose similarity to the target vector is greater than a second preset threshold from among the target entities to be updated, and identifies these entities as the target entities to be updated corresponding to the target vector. This makes the identification of target entities to be updated more accurate.

[0029] In one embodiment, after updating the target update entities using the entities corresponding to the target vectors to obtain the updated knowledge graph, the method further includes:

[0030] For any entity relation in the updated knowledge graph, the corresponding completion rule is determined by using the preset correspondence between entity relations and completion rules;

[0031] Based on the completion rules, relationship completion is performed on each entity corresponding to the entity relationship.

[0032] This embodiment uses the completion rules corresponding to the entity relationships in the updated knowledge graph to complete the relationships between the entities. This makes the updated knowledge graph more accurate.

[0033] In one embodiment, the step of performing relation completion on each entity corresponding to the entity relation based on the completion rule includes:

[0034] If the completion rule is the first preset rule, then each first target triplet corresponding to the entity relationship is determined from each triplet in the updated knowledge graph;

[0035] For any first target triplet, using the first specified entity and the first target entity relationship in the first target triplet, a complete entity corresponding to the first specified entity is obtained; wherein, the first target entity relationship is determined based on the first preset rule and the entity relationship, and the first specified entity is the head entity or tail entity in the first target triplet;

[0036] Using the first vector to be completed and the vector of the completed entity, the similarity between the first vector to be completed and the vector of the completed entity is obtained; wherein, the first vector to be completed is obtained based on the relationship between the second specified entity in the triplet and the first target entity, the second specified entity is the head entity or tail entity in the first target triplet, and the first specified entity and the second specified entity are different;

[0037] If the similarity is greater than the third preset threshold, then relationship completion is performed on the second specified entity and the completion entity based on the first target entity relationship.

[0038] In one embodiment, the step of performing relation completion on each entity corresponding to the entity relation based on the completion rule includes:

[0039] If the completion rule is a second preset rule, then each second target triplet corresponding to the entity relationship is determined from each triplet of the updated knowledge graph;

[0040] For any second target triplet, a preset algorithm is used to obtain a second to-be-completed vector corresponding to the tail entity in the second target triplet and the relationship between the second target entity; wherein, the second target entity relationship is determined based on the second preset rule and the entity relationship in the triplet;

[0041] Based on the second vector to be completed and the vector of the head entity in the triplet, the similarity between the second vector to be completed and the vector of the head entity is obtained;

[0042] If the similarity is greater than the fourth preset threshold, then the relationship between the head entity and the tail entity is completed based on the second target entity relationship.

[0043] A second aspect of this disclosure provides an electronic device, including a storage unit and a processor, wherein:

[0044] The storage unit is configured to store the target text corresponding to the knowledge graph update request and the knowledge graph to be updated;

[0045] The processor is configured as follows:

[0046] In response to a knowledge graph update request sent by a user, the target text corresponding to the knowledge graph update request is extracted to obtain each triple;

[0047] The target vectors of each entity in each triplet are classified based on the category of each entity to obtain the category of each target vector;

[0048] For any target vector, based on the category of the target vector, determine each entity in the knowledge graph to be updated that has the same category as the target vector, wherein the knowledge graph to be updated is the knowledge graph corresponding to the knowledge graph update request;

[0049] Using the target vector and the vectors of each entity to be updated, the similarity between the target vector and the vectors of each entity to be updated is obtained respectively;

[0050] Based on the aforementioned similarities, the target entity to be updated corresponding to the target vector is determined from the vectors of the entities to be updated corresponding to the target vector.

[0051] The entities corresponding to the target vectors are used to update the target update entities to obtain the updated knowledge graph.

[0052] In one embodiment, the processor is further configured to:

[0053] Before classifying the target vectors of each entity in each triplet based on the category of each entity to obtain the category of each target vector, for any entity in each triplet, the word2vec model is used to transform the entity into a vector to obtain the first vector corresponding to the entity, and the entity is weighted by the term frequency-inverse document frequency tf-idf model to obtain the weight corresponding to the entity.

[0054] Based on the first vector corresponding to the entity and the weight corresponding to the entity, the second vector of the entity is obtained;

[0055] The attribute information of the entity is extracted using a pre-trained convolutional neural network to obtain the attribute vector corresponding to the attribute information of the entity.

[0056] The second vector of the entity and the attribute vector are concatenated to obtain the target vector of the entity.

[0057] In one embodiment, the processor is further configured to:

[0058] After obtaining the second vector of the entity based on the first vector corresponding to the entity and the weight corresponding to the entity, for any entity, the similarity between the entity and the other entities in each triplet is obtained according to the second vector of the entity and the second vectors of the other entities in each triplet, excluding the entity itself.

[0059] The similarity between the entity and the other entities is compared with a first preset threshold, other target entities with similarity greater than the first preset threshold are identified, and the other target entities and the entity are added to the target entity set.

[0060] The target entity is obtained by the total number of each entity in each triplet in the target entity set;

[0061] The triples corresponding to other entities in the target entity set, excluding the target entity itself, are updated using the target entity.

[0062] In one embodiment, the processor performs the step of determining the target entity to be updated from the vectors of entities to be updated corresponding to the target vector using the similarity scores, specifically configured as follows:

[0063] For any target vector, determine the entities to be updated whose similarity is greater than a second preset threshold from the target entities to be updated corresponding to the target vector;

[0064] Each entity to be updated whose similarity is greater than the second preset threshold is identified as the target entity to be updated corresponding to the target vector.

[0065] In one embodiment, the processor is further configured to:

[0066] After updating the target update entities using the entities corresponding to the target vectors to obtain the updated knowledge graph, for any entity relationship in the updated knowledge graph, the corresponding completion rule is determined using the preset correspondence between entity relationships and completion rules.

[0067] Based on the completion rules, relationship completion is performed on each entity corresponding to the entity relationship.

[0068] In one embodiment, the processor executes the relationship completion based on the completion rules to complete the relationships between the entities corresponding to the entity relationships, specifically configured as follows:

[0069] If the completion rule is the first preset rule, then each first target triplet corresponding to the entity relationship is determined from each triplet in the updated knowledge graph;

[0070] For any first target triplet, using the first specified entity and the first target entity relationship in the first target triplet, a complete entity corresponding to the first specified entity is obtained; wherein, the first target entity relationship is determined based on the first preset rule and the entity relationship, and the first specified entity is the head entity or tail entity in the first target triplet;

[0071] Using the first vector to be completed and the vector of the completed entity, the similarity between the first vector to be completed and the vector of the completed entity is obtained; wherein, the first vector to be completed is obtained based on the relationship between the second specified entity in the triplet and the first target entity, the second specified entity is the head entity or tail entity in the first target triplet, and the first specified entity and the second specified entity are different;

[0072] If the similarity is greater than the third preset threshold, then relationship completion is performed on the second specified entity and the completion entity based on the first target entity relationship.

[0073] In one embodiment, the processor executes the relationship completion based on the completion rules to complete the relationships between the entities corresponding to the entity relationships, specifically configured as follows:

[0074] If the completion rule is a second preset rule, then each second target triplet corresponding to the entity relationship is determined from each triplet of the updated knowledge graph;

[0075] For any second target triplet, a preset algorithm is used to obtain a second to-be-completed vector corresponding to the tail entity in the second target triplet and the relationship between the second target entity; wherein, the second target entity relationship is determined based on the second preset rule and the entity relationship in the triplet;

[0076] Based on the second vector to be completed and the vector of the head entity in the triplet, the similarity between the second vector to be completed and the vector of the head entity is obtained;

[0077] If the similarity is greater than the fourth preset threshold, then the relationship between the head entity and the tail entity is completed based on the second target entity relationship.

[0078] According to a third aspect provided in the embodiments of this disclosure, a computer storage medium is provided, the computer storage medium storing a computer program for performing the method as described in the first aspect. Attached Figure Description

[0079] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0080] Figure 1 This is a schematic diagram illustrating an applicable scenario according to one embodiment of the present disclosure;

[0081] Figure 2 This is one of the flowcharts illustrating a knowledge graph updating method according to an embodiment of the present disclosure;

[0082] Figure 3 This is a schematic diagram of a knowledge graph in a knowledge graph updating method according to an embodiment of the present disclosure;

[0083] Figure 4 This is a flowchart illustrating the process of determining the target vector of each entity according to an embodiment of the present disclosure;

[0084] Figure 5 This is a second schematic flowchart of a knowledge graph updating method according to an embodiment of the present disclosure;

[0085] Figure 6 This is a knowledge graph updating apparatus according to an embodiment of the present disclosure;

[0086] Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. Detailed Implementation

[0087] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0088] In this disclosure, the term "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0089] The application scenarios described in this disclosure are for the purpose of more clearly illustrating the technical solutions of this disclosure and do not constitute a limitation on the technical solutions provided in this disclosure. Those skilled in the art will understand that with the emergence of new application scenarios, the technical solutions provided in this disclosure are also applicable to similar technical problems. In the description of this disclosure, unless otherwise stated, "multiple" means two or more.

[0090] Currently, knowledge graphs are updated by comparing each entity vector in each triple with all entities in the knowledge graph to be updated, and then updating the entities in the knowledge graph based on the comparison results. This results in low update efficiency for knowledge graphs.

[0091] Therefore, this disclosure provides a method for updating a knowledge graph. It determines the target entities to be updated in the knowledge graph corresponding to the target vectors by identifying the categories of each target vector. The updated knowledge graph is then updated using the entities corresponding to the target vectors. This solves the problem of knowledge graph lag, improves the search efficiency of the knowledge graph, and further enhances the updating efficiency by updating the knowledge graph through the categories of each target vector. The solution of this disclosure will be described in detail below with reference to the accompanying drawings.

[0092] like Figure 1 As shown, an application scenario for a knowledge graph update method is presented, which includes multiple terminal devices 110 and a server 120. Figure 1The example uses three terminal devices 110, but the actual number of terminal devices 110 is not limited. Terminal devices 110 can be mobile phones, tablets, and personal computers, etc. Server 120 can be implemented using a single server or multiple servers. Server 120 can be implemented using a physical server or a virtual server.

[0093] In one possible application scenario, if user A sends a knowledge graph update request to server 120 using terminal device 110, server 120 responds to the user's knowledge graph update request by extracting the target text corresponding to the knowledge graph update request to obtain triples; then server 120 classifies the target vectors of each entity in each triple based on the category of each entity to obtain the category of each target vector; for any target vector, based on the category of the target vector, it determines the entities in the knowledge graph to be updated that have the same category as the target vector, wherein... The knowledge graph to be updated is the knowledge graph corresponding to the knowledge graph update request; using the target vector and the vectors of each updated entity, the similarity between the target vector and the vectors of each entity to be updated is obtained; finally, the server 120 uses the similarity to determine the target entity to be updated corresponding to the target vector from the vectors of each entity to be updated corresponding to the target vector, and uses the entity corresponding to the target vector to update each target updated entity to obtain the updated knowledge graph, and sends the updated knowledge graph to the terminal device 110 for display.

[0094] like Figure 2 The diagram shown is a flowchart illustrating the knowledge graph updating method of this disclosure, which may include the following steps:

[0095] Step 201: In response to the knowledge graph update request sent by the user, extract the target text corresponding to the knowledge graph update request to obtain each triple;

[0096] The triple includes a head entity, a tail entity, and an entity relation, where the entity relation is the relationship between the head entity and the tail entity. For example, triple 1 is (object 1, husband, object 2), and triple 2 is (object 3, wife, object 4). In triple 1, the head entity is object 1, the tail entity is object 2, and the entity relation is husband. In triple 2, the head entity is object 3, the tail entity is object 4, and the entity relation is wife.

[0097] It should be noted that both header and footer entities are entities. The entities mentioned below include both header and footer entities. Furthermore, the target text extraction method in this embodiment is a method existing in the art, and this embodiment does not limit the target file extraction method.

[0098] Step 202: Classify the target vectors of each entity in each triplet based on the category of each entity to obtain the category of each target vector;

[0099] The entity category is obtained after extracting the target file.

[0100] Step 203: For any target vector, based on the category of the target vector, determine each entity in the knowledge graph to be updated that has the same category as the target vector, wherein the knowledge graph to be updated is the knowledge graph corresponding to the knowledge graph update request;

[0101] Step 204: Using the target vector and the vectors of each entity to be updated, obtain the similarity between the target vector and the vectors of each entity to be updated; wherein, the similarity between the target vector and the vector for any entity to be updated can be determined by formula (1):

[0102]

[0103] Where P represents the similarity. Let be the target vector. The vector of the entity to be updated.

[0104] Step 205: Based on the aforementioned similarities, determine the target entity to be updated corresponding to the target vector from the vectors of each entity to be updated corresponding to the target vector;

[0105] In one embodiment, the target entity to be updated corresponding to the target vector is determined in the following manner:

[0106] For any target vector, identify each entity to be updated from the target entities to be updated corresponding to the target vector that has a similarity greater than a second preset threshold; and determine each entity to be updated that has a similarity greater than the second preset threshold as the target entity to be updated corresponding to the target vector.

[0107] For example, if the target vector is object 1, and if object 2, object 3, and object 4 are determined to be entities to be updated that have a similarity to object 1 greater than a second preset threshold, then object 2, object 3, and object 4 are determined to be target entities to be updated corresponding to object 1.

[0108] Step 206: Update the target update entities using the entities corresponding to the target vectors to obtain the updated knowledge graph.

[0109] For example, such as Figure 3As shown, the triples in the knowledge graph to be updated are: (object1, teammate, object9), (object2, teammate, object8), (object8, teammate, object3), (object3, teammate, object6), and (object9, teammate, object8). Taking the previous example, the target entities to be updated corresponding to object1 are object2, object3, and object4. Then, the triples corresponding to the updated knowledge graph are: (object1, teammate, object9), (object1, teammate, object8), (object8, teammate, object1), (object1, teammate, object6), and (object9, teammate, object8).

[0110] To make the updated knowledge graph more accurate, in one embodiment, such as Figure 4 The diagram shown illustrates the process for determining the target vector for each entity, which may include the following steps:

[0111] Step 401: For any entity in each triplet, the entity is vectorized using the word2vec model to obtain the first vector corresponding to the entity, and the entity is weighted using the term frequency-inverse document frequency (TF-IDF) model to obtain the weight corresponding to the entity.

[0112] The word2vec model is a general term for vocabulary representation methods, mainly including two models: the Continuous Bag-Of-Words (CBOW) model and Skip-gram. The specific model used can be set according to the actual situation, and this embodiment does not limit it.

[0113] Step 402: Based on the first vector corresponding to the entity and the weight corresponding to the entity, obtain the second vector of the entity;

[0114] In one embodiment, if the first vector corresponding to the entity includes multiple sub-vectors, then the weight corresponding to the entity includes the weights corresponding to the multiple sub-vectors. For any sub-vector, the sub-vector is multiplied by the weight corresponding to the sub-vector to obtain an intermediate vector. Then, the intermediate vectors are added together to obtain the second vector of the entity.

[0115] For example, if the entity is "Company 1", since this entity includes multiple words, the first vector corresponding to this entity consists of multiple sub-vectors. That is, "first" corresponds to one sub-vector, and "company" corresponds to one sub-vector. The second vector corresponding to the entity "Company 1" is obtained by weighted summing of each sub-vector with its corresponding weight.

[0116] If the first vector corresponding to the entity includes a sub-vector, and the corresponding weight includes a weight, then the first vector is multiplied by the weight to obtain the second vector corresponding to the entity.

[0117] It should be noted that the weights of the sub-vectors in the first vector in this embodiment are obtained through the tf-idf model.

[0118] Step 403: Extract features from the attribute information of the entity using a pre-trained convolutional neural network to obtain the attribute vector corresponding to the attribute information of the entity;

[0119] The attribute information includes attribute name and attribute value. In this embodiment, a pre-trained convolutional neural network is used to extract features from the attribute name and attribute value to obtain the attribute name vector and the attribute value vector. The attribute name vector and the attribute value vector are then concatenated to obtain the attribute vector corresponding to the attribute information.

[0120] It should be noted that the method of concatenating attribute vectors in this embodiment can be set according to actual needs, and this embodiment does not limit it.

[0121] Step 404: Concatenate the second vector of the entity and the attribute vector to obtain the target vector of the entity.

[0122] Specifically, the second vector and the attribute vector are concatenated end to end to obtain the target vector of the entity.

[0123] To save computational resources, in one embodiment, after executing step 402, for any entity, the similarity between the entity and the other entities in each triplet is obtained based on the entity's second vector and the second vectors of the other entities in each triplet. The similarity between the entity and the other entities is compared with a first preset threshold to determine other target entities with similarity greater than the first preset threshold, and the other target entities and the entity are added to the target entity set. The target entity is obtained by the total number of each entity in the target entity set in each triplet. The triplets corresponding to the other entities in the target entity set are updated using the target entity.

[0124] In this embodiment, the similarity between the entity and the other entities can be determined according to formula (1).

[0125] To make the updated knowledge graph more accurate, in one embodiment, after executing step 206, for any entity relationship in the updated knowledge graph, the corresponding completion rule is determined using the preset correspondence between entity relationships and completion rules; based on the completion rule, relationship completion is performed on each entity corresponding to the entity relationship.

[0126] In one embodiment, based on the completion rule, performing relationship completion on each entity corresponding to the entity relationship may include the following two methods:

[0127] Method 1: If the completion rule is a first preset rule, then from each triplet in the updated knowledge graph, determine each first target triplet corresponding to the entity relationship; for any first target triplet, use the first specified entity and the first target entity relationship in the first target triplet to obtain the completed entity corresponding to the first specified entity; wherein, the first target entity relationship is determined based on the first preset rule and the entity relationship, and the first specified entity is the head entity or tail entity in the first target triplet; use the first vector to be completed and the vector of the completed entity to obtain the similarity between the vector of the first vector to be completed and the vector of the completed entity; wherein, the first vector to be completed is obtained based on the second specified entity and the first target entity relationship in the triplet, the second specified entity is the head entity or tail entity in the first target triplet, and the first specified entity and the second specified entity are not the same; if the similarity is greater than a third preset threshold, then perform relationship completion on the second specified entity and the completed entity based on the first target entity relationship.

[0128] The first preset rule includes a transitive rule and a substitution rule. If the first preset rule is a transitive rule, then the first target entity relationship is determined to be the same as the entity relationship in the first target triplet. If the first preset rule is a substitution rule, then the first target entity relationship corresponding to the entity relationship in the first target triplet is determined by using the preset correspondence between the entity relationships in the first target triplet and the first target entity relationship.

[0129] The following sections will provide a detailed explanation of the completion methods for these two rules:

[0130] (1) Transit Rule: Taking the entity relationship as "teammate" as an example, if the first target triples for the entity relationship "teammate" are: (object1, teammate, object2), (object2, teammate, object3), (object3, teammate, object4)... because it is a transitive rule, the first target entity relationship is "teammate". Taking the triple (object2, teammate, object3) as an example, the first specified entity is object3, then the vector corresponding to object3 plus the vector corresponding to teammate equals the vector to complete the entity. And the first specified vector is object1, then the vector corresponding to object1 is the first vector to be completed. If the similarity between the first vector to be completed and the vector to be completed is greater than the third preset threshold, then object1 and object3 are completed using teammate to obtain a new triple (object3, teammate, object1).

[0131] (2) Replacement Rule: Taking the entity relationship as "child" as an example, if the first target triplet for the entity relationship as "child" is (object1, child, object2), (object2, child, object3)... because it is a replacement rule, and because the replacement rule pre-determines the correspondence between the entity relationship and the first target entity relationship, the following explanation is based on the first target entity relationship as "grandchild". The first specified entity is object1, then the vector corresponding to object1 plus the vector corresponding to the grandchild equals the vector to complete the entity. And the first specified vector is object3, then the vector corresponding to object3 is the first vector to be completed. If the similarity between the first vector to be completed and the vector to complete the entity is greater than the third preset threshold, then object1 and object3 are completed using the grandchild relationship to obtain a new triplet (object1, grandchild, object3).

[0132] Method 2: If the completion rule is the second preset rule, then from each triple of the updated knowledge graph, determine each second target triple corresponding to the entity relationship; for any second target triple, use a preset algorithm to obtain the second vector to be completed corresponding to the tail entity and the second target entity relationship in the second target triple; wherein, the second target entity relationship is determined based on the second preset rule and the entity relationship in the triple; based on the second vector to be completed and the vector of the head entity in the triple, obtain the similarity between the second vector to be completed and the vector of the head entity; if the similarity is greater than the fourth preset threshold, then perform relationship completion on the head entity and the tail entity based on the second target entity relationship.

[0133] The second rule includes both an inverse rule and a symmetric rule. If the second preset rule is an inverse rule, then the second target entity relationship corresponding to the entity relationship in the second target triplet is determined using the preset correspondence between the entity relationships in the second target triplet and the second target entity relationship. If the second preset rule is a symmetric rule, then the entity relationship in the second target triplet is determined as the second target entity relationship.

[0134] The opposite rule and the symmetry rule will be introduced and explained below:

[0135] (1) Opposite Rule: Taking the entity relationship as wife as an example, if the first target triplet of the entity relationship as wife is (object 1, wife, object 2), (object 3, wife, object 4)... because it is an opposite rule, the second target entity relationship is husband. The vector corresponding to object 2 plus the vector corresponding to husband equals the second vector to be completed. If the similarity between the second vector to be completed and the vector of object 1 is greater than the fourth preset threshold, then object 2 and object 1 are completed using the husband to obtain a new triplet (object 2, husband, object 1).

[0136] (2) Symmetry rule: Taking the entity relationship "teammate" as an example, the second target entity relationship is determined to be "teammate". If the second target triplet corresponding to the teammate is (object1, teammate, object2), (object2, teammate, object3), etc., taking the triplet (object1, teammate, object2) as an example, the vector corresponding to object2 plus the vector corresponding to teammate equals the second vector to be completed. If the similarity between the second vector to be completed and the vector of object1 is greater than the fourth preset threshold, then object2 and object1 are completed using the teammate relationship to obtain a new triplet (object2, teammate, object1).

[0137] To further understand the technical solution of this disclosure, the following is in conjunction with... Figure 5 A detailed explanation may include the following steps:

[0138] Step 501: In response to the knowledge graph update request sent by the user, extract the target text corresponding to the knowledge graph update request to obtain each triple;

[0139] Step 502: For any entity in each triplet, the entity is vectorized using the word2vec model to obtain the first vector corresponding to the entity, and the entity is weighted using the term frequency-inverse document frequency (TF-IDF) model to obtain the weight corresponding to the entity.

[0140] Step 503: Based on the first vector corresponding to the entity and the weight corresponding to the entity, obtain the second vector of the entity;

[0141] Step 504: Extract features from the attribute information of the entity using a pre-trained convolutional neural network to obtain the attribute vector corresponding to the attribute information of the entity;

[0142] Step 505: Concatenate the second vector of the entity and the attribute vector to obtain the target vector of the entity;

[0143] Step 506: Classify the target vectors of each entity in each triplet based on the category of each entity to obtain the category of each target vector;

[0144] Step 507: For any target vector, based on the category of the target vector, determine each entity to be updated that has the same category as the target vector in the knowledge graph to be updated, wherein the knowledge graph to be updated is the knowledge graph corresponding to the knowledge graph update request;

[0145] Step 508: Using the target vector and the vectors of each updated entity, obtain the similarity between the target vector and the vectors of each entity to be updated;

[0146] Step 509: For any target vector, determine the entities to be updated whose similarity is greater than the second preset threshold from the target entities to be updated corresponding to the target vector;

[0147] Step 510: Determine each entity to be updated with a similarity greater than the second preset threshold as the target entity to be updated corresponding to the target vector;

[0148] Step 511: Update the target update entities using the entities corresponding to the target vectors to obtain the updated knowledge graph;

[0149] Step 512: For any entity relation in the updated knowledge graph, determine the completion rule corresponding to the entity relation using the preset correspondence between entity relations and completion rules;

[0150] Step 513: Based on the completion rules, perform relationship completion for each entity corresponding to the entity relationship.

[0151] Based on the same disclosed concept, the knowledge graph updating method described above can also be implemented by a knowledge graph updating device. The effect of this knowledge graph updating device is similar to that of the aforementioned method, and will not be repeated here.

[0152] Figure 6 This is a schematic diagram of the structure of a knowledge graph updating apparatus according to an embodiment of the present disclosure.

[0153] like Figure 6As shown, the knowledge graph updating device 600 of this disclosure may include an extraction module 610, a classification module 620, a target entity to be updated determination module 630, a similarity determination module 640, a target entity to be updated determination module 650, and an updating module 660.

[0154] Extraction module 610 is used to extract target text corresponding to the knowledge graph update request sent by the user in response to the user's request, and obtain each triplet.

[0155] The classification module 620 is used to classify the target vectors of each entity in each triplet based on the category of each entity, so as to obtain the category of each target vector;

[0156] The entity to be updated determination module 630 is used to determine, for any target vector, each entity to be updated that has the same category as the target vector in the knowledge graph to be updated, based on the category of the target vector, wherein the knowledge graph to be updated is the knowledge graph corresponding to the knowledge graph update request;

[0157] The similarity determination module 640 is used to obtain the similarity between the target vector and the vectors of each entity to be updated using the target vector and the vectors of each entity to be updated.

[0158] The target entity to be updated determination module 650 is used to determine the target entity to be updated corresponding to the target vector from the vectors of each entity to be updated corresponding to the target vector through the similarity scores.

[0159] The first update module 660 is used to update each target update entity using the entity corresponding to the target vector to obtain the updated knowledge graph.

[0160] In one embodiment, the apparatus further includes:

[0161] The target vector determination module 670 is used to classify the target vectors of each entity in each triplet based on the category of each entity to obtain the category of each target vector. Before classifying the target vectors of each entity in each triplet, the module performs vector transformation on the entity using the word2vec model to obtain the first vector corresponding to the entity. The module then performs weighting on the entity using the term frequency-inverse document frequency (TF-IDF) model to obtain the weight corresponding to the entity.

[0162] Based on the first vector corresponding to the entity and the weight corresponding to the entity, the second vector of the entity is obtained;

[0163] The attribute information of the entity is extracted using a pre-trained convolutional neural network to obtain the attribute vector corresponding to the attribute information of the entity.

[0164] The second vector of the entity and the attribute vector are concatenated to obtain the target vector of the entity.

[0165] In one embodiment, the apparatus further includes:

[0166] The second update module 680 is used to obtain the second vector of an entity based on the first vector corresponding to the entity and the weight corresponding to the entity, and then, for any entity, obtain the similarity between the entity and the other entities in each triplet based on the second vector of the entity and the second vectors of the other entities in each triplet, respectively.

[0167] The similarity between the entity and the other entities is compared with a first preset threshold, other target entities with similarity greater than the first preset threshold are identified, and the other target entities and the entity are added to the target entity set.

[0168] The target entity is obtained by the total number of each entity in each triplet in the target entity set;

[0169] The triples corresponding to other entities in the target entity set, excluding the target entity itself, are updated using the target entity.

[0170] In one embodiment, the target entity to be updated determination module 650 is specifically used for:

[0171] For any target vector, determine the entities to be updated whose similarity is greater than a second preset threshold from the target entities to be updated corresponding to the target vector;

[0172] Each entity to be updated whose similarity is greater than the second preset threshold is identified as the target entity to be updated corresponding to the target vector.

[0173] In one embodiment, the apparatus further includes:

[0174] The relation completion module 690, after updating the target update entities by using the entities corresponding to the target vectors to obtain the updated knowledge graph, determines the completion rule corresponding to any entity relation in the updated knowledge graph by using the preset correspondence between entity relations and completion rules.

[0175] Based on the completion rules, relationship completion is performed on each entity corresponding to the entity relationship.

[0176] In one embodiment, the relation completion module 690 is specifically used for:

[0177] If the completion rule is the first preset rule, then each first target triplet corresponding to the entity relationship is determined from each triplet in the updated knowledge graph;

[0178] For any first target triplet, using the first specified entity and the first target entity relationship in the first target triplet, a complete entity corresponding to the first specified entity is obtained; wherein, the first target entity relationship is determined based on the first preset rule and the entity relationship, and the first specified entity is the head entity or tail entity in the first target triplet;

[0179] Using the first vector to be completed and the vector of the completed entity, the similarity between the first vector to be completed and the vector of the completed entity is obtained; wherein, the first vector to be completed is obtained based on the relationship between the second specified entity in the triplet and the first target entity, the second specified entity is the head entity or tail entity in the first target triplet, and the first specified entity and the second specified entity are different;

[0180] If the similarity is greater than the third preset threshold, then relationship completion is performed on the second specified entity and the completion entity based on the first target entity relationship.

[0181] In one embodiment, the relation completion module 690 is specifically used for:

[0182] If the completion rule is a second preset rule, then each second target triplet corresponding to the entity relationship is determined from each triplet of the updated knowledge graph;

[0183] For any second target triplet, a preset algorithm is used to obtain a second to-be-completed vector corresponding to the tail entity in the second target triplet and the relationship between the second target entity; wherein, the second target entity relationship is determined based on the second preset rule and the entity relationship in the triplet;

[0184] Based on the second vector to be completed and the vector of the head entity in the triplet, the similarity between the second vector to be completed and the vector of the head entity is obtained;

[0185] If the similarity is greater than the fourth threshold, then the relationship between the head entity and the tail entity is completed based on the second target entity relationship.

[0186] After introducing a knowledge graph updating method and apparatus according to an exemplary embodiment of the present disclosure, an electronic device according to another exemplary embodiment of the present disclosure will be introduced next.

[0187] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."

[0188] In some possible implementations, the electronic device according to this disclosure may include at least one processor and at least one computer storage medium. The computer storage medium stores program code that, when executed by the processor, causes the processor to perform steps in the knowledge graph updating method according to various exemplary embodiments of this disclosure described above. For example, the processor may perform actions such as... Figure 2 Steps 201-206 are shown in the diagram.

[0189] Refer to the following Figure 7 To describe an electronic device 700 according to such an embodiment of the present disclosure. Figure 7 The electronic device 700 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.

[0190] like Figure 7 As shown, the electronic device 700 is manifested in the form of a general electronic device. The components of the electronic device 700 may include, but are not limited to: at least one processor 701, at least one computer storage medium 702, and a bus 703 connecting different system components (including the computer storage medium 702 and the processor 701).

[0191] Bus 703 represents one or more of several bus architectures, including computer storage media bus or computer storage media controller, peripheral bus, processor, or local bus using any of the various bus architectures.

[0192] Computer storage medium 702 may include readable media in the form of volatile computer storage media, such as random access computer storage medium (RAM) 721 and / or cache storage medium 722, and may further include read-only computer storage medium (ROM) 723.

[0193] The computer storage medium 702 may also include a program / utility 725 having a set (at least one) of program modules 724, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0194] Electronic device 700 can also communicate with one or more external devices 704 (e.g., keyboard, pointing device, etc.), and with one or more devices that enable a user to interact with electronic device 700, and / or with any device that enables electronic device 700 to communicate with one or more other electronic devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 705. Furthermore, electronic device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 706. As shown, network adapter 706 communicates with other modules used in electronic device 700 via bus 703. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 700, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0195] In some possible implementations, aspects of the knowledge graph updating method provided in this disclosure can also be implemented as a program product comprising program code that, when run on a computer device, causes the computer device to perform the steps in the knowledge graph updating method according to various exemplary embodiments of this disclosure as described above.

[0196] The program product may take the form of any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access computer storage media (RAM), read-only computer storage media (ROM), erasable programmable read-only computer storage media (EPROM or flash memory), optical fibers, portable compact disk read-only computer storage media (CD-ROM), optical computer storage media, magnetic computer storage media, or any suitable combination thereof.

[0197] The updated program product of the knowledge graph according to the embodiments of this disclosure can be in the form of a portable compact disc read-only computer storage medium (CD-ROM) and include program code, and can run on an electronic device. However, the program product of this disclosure is not limited thereto. In this document, the readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0198] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0199] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0200] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's electronic device, partially on the user's device, as a standalone software package, partially on the user's electronic device and partially on a remote electronic device, or entirely on a remote electronic device or server. In cases involving remote electronic devices, the remote electronic device can be connected to the user's electronic device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external electronic device (e.g., via the Internet using an Internet service provider).

[0201] It should be noted that although several modules of the apparatus have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules described above can be embodied in one module. Conversely, the features and functions of one module described above can be further divided and embodied by multiple modules.

[0202] Furthermore, although the operations of the methods disclosed herein are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0203] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk computer storage media, CD-ROMs, optical computer storage media, etc.) containing computer-usable program code.

[0204] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0205] These computer program instructions may also be stored in a computer-readable computer storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable computer storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0206] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0207] Obviously, those skilled in the art can make various modifications and variations to this disclosure without departing from its spirit and scope. Therefore, if such modifications and variations fall within the scope of the claims of this disclosure and their equivalents, this disclosure is also intended to include such modifications and variations.

Claims

1. A method for updating a knowledge graph, characterized in that, The method includes: In response to a knowledge graph update request sent by a user, the target text corresponding to the knowledge graph update request is extracted to obtain each triple; The target vectors of each entity in each triplet are classified based on the category of each entity to obtain the category of each target vector; For any target vector, based on the category of the target vector, determine each entity in the knowledge graph to be updated that has the same category as the target vector, wherein the knowledge graph to be updated is the knowledge graph corresponding to the knowledge graph update request; Using the target vector and the vectors of each entity to be updated, the similarity between the target vector and the vectors of each entity to be updated is obtained respectively; Based on the aforementioned similarities, the target entity to be updated corresponding to the target vector is determined from the vectors of the entities to be updated corresponding to the target vector. The updated knowledge graph is obtained by updating the entities corresponding to the target vectors. For any entity relation in the updated knowledge graph, the corresponding completion rule is determined by using the preset correspondence between entity relations and completion rules; If the completion rule is a first preset rule, then from each triplet in the updated knowledge graph, determine each first target triplet corresponding to the entity relationship; for any first target triplet, use the first specified entity and the first target entity relationship in the first target triplet to obtain the completed entity corresponding to the first specified entity; wherein, the first target entity relationship is determined based on the first preset rule and the entity relationship, and the first specified entity is the head entity or tail entity in the first target triplet; use the first vector to be completed and the vector of the completed entity to obtain the similarity between the first vector to be completed and the vector of the completed entity; wherein, the first vector to be completed is based on the second specified entity and the first target entity relationship in the triplet. The target entity relationship is obtained whereby the second designated entity is either the head or tail entity in the first target triplet, and the first designated entity and the second designated entity are not the same. If the similarity is greater than a third preset threshold, then relationship completion is performed on the second designated entity and the completed entity based on the first target entity relationship. The first preset rule includes a transitive rule and a replacement rule. If the first preset rule is a transitive rule, then the first target entity relationship is determined to be the same as the entity relationship in the first target triplet. If the first preset rule is a replacement rule, then the first target entity relationship corresponding to the entity relationship in the first target triplet is determined by using the preset correspondence between the entity relationships in the first target triplet and the first target entity relationship.

2. The method according to claim 1, characterized in that, Before classifying the target vectors of each entity in each triplet based on the category of each entity to obtain the category of each target vector, the method further includes: For any entity in each triple, the word2vec model is used to transform the entity into a vector to obtain the first vector corresponding to the entity. The entity is then weighted using the term frequency-inverse document frequency (TF-IDF) model to obtain the weight corresponding to the entity. Based on the first vector corresponding to the entity and the weight corresponding to the entity, the second vector of the entity is obtained; The attribute information of the entity is extracted using a pre-trained convolutional neural network to obtain the attribute vector corresponding to the attribute information of the entity. The second vector of the entity and the attribute vector are concatenated to obtain the target vector of the entity.

3. The method according to claim 2, characterized in that, After obtaining the second vector of the entity based on the first vector corresponding to the entity and the weight corresponding to the entity, the method further includes: For any entity, the similarity between the entity and the other entities in each triplet is obtained based on the entity's second vector and the second vectors of the other entities in each triplet, excluding the entity itself. The similarity between the entity and the other entities is compared with a first preset threshold, other target entities with similarity greater than the first preset threshold are identified, and the other target entities and the entity are added to the target entity set. The target entity is obtained by the total number of each entity in each triplet in the target entity set; The triples corresponding to other entities in the target entity set, excluding the target entity itself, are updated using the target entity.

4. The method according to claim 1, characterized in that, The step of determining the target entity to be updated from the vectors of each entity to be updated corresponding to the target vector using the similarity scores includes: For any target vector, determine the entities to be updated whose similarity is greater than a second preset threshold from the target entities to be updated corresponding to the target vector; Each entity to be updated whose similarity is greater than the second preset threshold is identified as the target entity to be updated corresponding to the target vector.

5. The method according to claim 1, characterized in that, The method further includes: If the completion rule is the second preset rule, then each second target triplet corresponding to the entity relationship is determined from each triplet of the updated knowledge graph; For any second target triplet, a preset algorithm is used to obtain a second to-be-completed vector corresponding to the tail entity in the second target triplet and the relationship between the second target entity; wherein, the second target entity relationship is determined based on the second preset rule and the entity relationship in the triplet; Based on the second vector to be completed and the vector of the head entity in the triplet, the similarity between the second vector to be completed and the vector of the head entity is obtained; If the similarity is greater than the fourth preset threshold, then the relationship between the head entity and the tail entity is completed based on the second target entity relationship.

6. An electronic device, characterized in that, Includes storage units and a processor, wherein: The storage unit is configured to store the target text corresponding to the knowledge graph update request and the knowledge graph to be updated; The processor is configured as follows: In response to a knowledge graph update request sent by a user, the target text corresponding to the knowledge graph update request is extracted to obtain each triple; The target vectors of each entity in each triplet are classified based on the category of each entity to obtain the category of each target vector; For any target vector, based on the category of the target vector, determine each entity in the knowledge graph to be updated that has the same category as the target vector, wherein the knowledge graph to be updated is the knowledge graph corresponding to the knowledge graph update request; Using the target vector and the vectors of each entity to be updated, the similarity between the target vector and the vectors of each entity to be updated is obtained respectively; Based on the aforementioned similarities, the target entity to be updated corresponding to the target vector is determined from the vectors of the entities to be updated corresponding to the target vector. The updated knowledge graph is obtained by updating the entities corresponding to the target vectors. For any entity relation in the updated knowledge graph, the corresponding completion rule is determined by using the preset correspondence between entity relations and completion rules; If the completion rule is a first preset rule, then from each triplet in the updated knowledge graph, determine each first target triplet corresponding to the entity relationship; for any first target triplet, use the first specified entity and the first target entity relationship in the first target triplet to obtain the completed entity corresponding to the first specified entity; wherein, the first target entity relationship is determined based on the first preset rule and the entity relationship, and the first specified entity is the head entity or tail entity in the first target triplet; use the first vector to be completed and the vector of the completed entity to obtain the similarity between the first vector to be completed and the vector of the completed entity; wherein, the first vector to be completed is based on the second specified entity and the first target entity relationship in the triplet. The target entity relationship is obtained whereby the second designated entity is either the head or tail entity in the first target triplet, and the first designated entity and the second designated entity are not the same. If the similarity is greater than a third preset threshold, then relationship completion is performed on the second designated entity and the completed entity based on the first target entity relationship. The first preset rule includes a transitive rule and a replacement rule. If the first preset rule is a transitive rule, then the first target entity relationship is determined to be the same as the entity relationship in the first target triplet. If the first preset rule is a replacement rule, then the first target entity relationship corresponding to the entity relationship in the first target triplet is determined by using the preset correspondence between the entity relationships in the first target triplet and the first target entity relationship.

7. The electronic device according to claim 6, characterized in that, The processor is also configured to: Before classifying the target vectors of each entity in each triplet based on the category of each entity to obtain the category of each target vector, for any entity in each triplet, the word2vec model is used to transform the entity into a vector to obtain the first vector corresponding to the entity, and the entity is weighted by the term frequency-inverse document frequency tf-idf model to obtain the weight corresponding to the entity. Based on the first vector corresponding to the entity and the weight corresponding to the entity, the second vector of the entity is obtained; The attribute information of the entity is extracted using a pre-trained convolutional neural network to obtain the attribute vector corresponding to the attribute information of the entity. The second vector of the entity and the attribute vector are concatenated to obtain the target vector of the entity.

8. The electronic device according to claim 7, characterized in that, The processor is also configured to: After obtaining the second vector of the entity based on the first vector corresponding to the entity and the weight corresponding to the entity, for any entity, the similarity between the entity and the other entities in each triplet is obtained according to the second vector of the entity and the second vectors of the other entities in each triplet, excluding the entity itself. The similarity between the entity and the other entities is compared with a first preset threshold, other target entities with similarity greater than the first preset threshold are identified, and the other target entities and the entity are added to the target entity set. The target entity is obtained by the total number of each entity in each triplet in the target entity set; The triples corresponding to other entities in the target entity set, excluding the target entity itself, are updated using the target entity.

Citation Information

Patent Citations

  • Database construction method of power information operation and maintenance system based on knowledge map

    CN109033284A

  • Data processing method and device, electronic equipment and storage medium

    CN109597856A

  • Parameter-shared knowledge graph completion deduction method and device

    CN110851615A

  • Data processing method, device and equipment and storage medium

    CN112149400A