Knowledge graph completion method, device and equipment, storage medium and vehicle

By searching for multiple paths in the knowledge graph and calculating the semantic similarity of candidate relationships, the problem of low accuracy of knowledge graph completion is solved and the accuracy and consistency of knowledge completion are improved.

CN118733781APending Publication Date: 2024-10-01BEIJING CO WHEELS TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310333218.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2024-10-01

Smart Images

  • Figure CN118733781A_ABST
    Figure CN118733781A_ABST
Patent Text Reader

Abstract

The invention relates to a knowledge graph completion method, device and equipment, a storage medium and a vehicle. According to the embodiment of the invention, the method comprises the steps: obtaining a first target entity, a second target entity and a candidate relation between the first target entity and the second target entity; searching at least two paths between the first target entity and the second target entity in the knowledge graph; calculating the probability of establishment of the candidate relationship between the first target entity and the second target entity based on the semantic similarity between the candidate relationship and the at least two paths; when the probability is greater than a preset threshold value, determining that a candidate relationship is established; the candidate relationship is supplemented into the knowledge graph, the possibility that the candidate relationship between the two entities is established can be predicted according to the association size between the at least two paths and the candidate relationship, the correctness of the supplementary content is evaluated by using the data of the plurality of paths, the conformity of the supplementary content and the actual situation is improved, and the accuracy of the supplementary content is improved. And the accuracy of knowledge completion is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a knowledge graph completion method, device, equipment, storage medium and vehicle. Background Art

[0002] The knowledge graph is a structured semantic knowledge base that can be used to describe concepts in the physical world and their relationships. It effectively processes, handles, and integrates complex document data into simple and clear (entity, relationship, entity) triplets, and finally aggregates a large amount of knowledge to achieve rapid response and reasoning of knowledge.

[0003] At present, in large-scale knowledge graphs, due to the sparseness and missing of data, knowledge is incomplete, and there is a lot of implicit knowledge that has not been discovered, which requires the completion of knowledge graphs. However, the accuracy of related knowledge graph completion methods is low and cannot meet actual needs. Summary of the invention

[0004] In order to solve the above technical problems, the present disclosure provides a knowledge graph completion method, device, equipment, storage medium and vehicle.

[0005] A first aspect of an embodiment of the present disclosure provides a knowledge graph completion method, the method comprising:

[0006] Acquire a first target entity and a second target entity, and a candidate relationship between the first target entity and the second target entity;

[0007] Find at least two paths between the first target entity and the second target entity in the knowledge graph;

[0008] Calculating the probability that the candidate relationship between the first target entity and the second target entity is established based on the magnitude of the semantic similarity between the candidate relationship and the at least two paths;

[0009] When the probability is greater than a preset threshold, it is determined that the candidate relationship is established;

[0010] Supplement candidate relations into the knowledge graph.

[0011] A second aspect of an embodiment of the present disclosure provides a knowledge graph completion device, the device comprising:

[0012] An acquisition module, used to acquire a first target entity and a second target entity, and a candidate relationship between the first target entity and the second target entity;

[0013] A search module, used to search at least two paths between a first target entity and a second target entity in a knowledge graph;

[0014] A calculation module, used to calculate the probability that the candidate relationship between the first target entity and the second target entity is established based on the magnitude of the semantic similarity between the candidate relationship and the at least two paths;

[0015] A determination module, used to determine that a candidate relationship is established when the probability is greater than a preset threshold;

[0016] The supplement module is used to supplement candidate relations into the knowledge graph.

[0017] A third aspect of an embodiment of the present disclosure provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the knowledge graph completion method of the first aspect mentioned above can be implemented.

[0018] The fourth aspect of the embodiments of the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the knowledge graph completion method of the first aspect mentioned above can be implemented.

[0019] A fifth aspect of an embodiment of the present disclosure provides a vehicle, which includes the knowledge graph completion device of the second aspect or the computer device of the third aspect or the computer-readable storage medium of the fourth aspect.

[0020] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:

[0021] In the disclosed embodiment, a first target entity and a second target entity, and a candidate relationship between the first target entity and the second target entity are obtained; at least two paths between the first target entity and the second target entity are searched in the knowledge graph; based on the semantic similarity between the candidate relationship and the at least two paths, the probability that the candidate relationship between the first target entity and the second target entity is established is calculated; when the probability is greater than a preset threshold, the candidate relationship is determined to be established; the candidate relationship is supplemented into the knowledge graph, and the association size between the at least two paths and the candidate relationship can be determined according to the semantic similarity between the at least two paths between the two entities and the candidate relationship, and then the possibility of the establishment of the candidate relationship between the two entities is predicted according to the association size between the at least two paths and the candidate relationship, and the correctness of the supplemented content is evaluated using multiple path data, so as to improve the conformity of the supplemented content with the actual situation and the accuracy of knowledge completion. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0024] Figure 1 is a flow chart of a knowledge graph completion method provided by an embodiment of the present disclosure;

[0025] Figure 2 is a flow chart of another knowledge graph completion method provided by an embodiment of the present disclosure;

[0026] Figure 3 is a flow chart of another knowledge graph completion method provided by an embodiment of the present disclosure;

[0027] Figure 4 It is a structural schematic diagram of a knowledge graph completion device provided by an embodiment of the present disclosure;

[0028] Figure 5 It is a structural diagram of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0030] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0031] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0032] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" 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, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0033] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0034] The knowledge graph is a structured semantic knowledge base that can be used to describe concepts in the physical world and their relationships. It effectively processes, handles, and integrates complex document data into simple and clear (entity, relationship, entity) triplets, and finally aggregates a large amount of knowledge to achieve rapid response and reasoning of knowledge.

[0035] At present, in large-scale knowledge graphs, due to the sparseness and missing of data, knowledge is incomplete, and there is a lot of implicit knowledge that has not been discovered, which requires the completion of knowledge graphs. However, the accuracy of related knowledge graph completion methods is low and cannot meet actual needs.

[0036] There are currently two mainstream knowledge completion methods. The first is a method based on knowledge representation, which embeds the relationships between entities in the knowledge graph into a continuous low-dimensional vector space and completes the knowledge by learning the vectorized representation of entities and relationships. However, this method is too dependent on data and does not take into account the existence of path relationships in the graph. Therefore, the accuracy of the prediction results is subject to certain limitations, and it cannot handle multi-step reasoning. The second is a method based on path finding. This method uses random walks to calculate the probability of the existence of relationships between entities based on the characteristics of the directed graph of the knowledge graph for completion. This method can handle multi-step reasoning, but often only considers a single path, which will cause certain information loss.

[0037] In response to the defects of related technologies in knowledge graph completion, the embodiments of the present disclosure provide a knowledge graph completion method, apparatus, device, storage medium and vehicle, which can predict the possibility of the establishment of a candidate relationship between a first target entity and a second target entity based on the correlation between at least two paths between the two entities and the candidate relationship, and use multiple path data to evaluate the correctness of the supplemented content, thereby improving the conformity of the supplemented content with the actual situation and improving the accuracy of knowledge completion.

[0038] The knowledge graph completion method provided by the embodiments of the present disclosure can be executed by a computer device, which can be understood as any device with processing and computing capabilities. The device may include but is not limited to mobile terminals such as smart phones, laptops, personal digital assistants (PDAs), tablet computers (PADs), portable multimedia players (PMPs), vehicle-mounted terminals, wearable devices, etc., as well as fixed electronic devices such as digital TVs, desktop computers, smart home devices, etc.

[0039] In order to better understand the inventive concept of the embodiment of the present disclosure, the technical solution of the embodiment of the present disclosure is described below in conjunction with exemplary embodiments.

[0040] Figure 1 is a flow chart of a knowledge graph completion method provided by an embodiment of the present disclosure, such as Figure 1 As shown, the knowledge graph completion method provided in this embodiment includes steps 110-150:

[0041] Step 110: Acquire a first target entity and a second target entity, and a candidate relationship between the first target entity and the second target entity.

[0042] In the disclosed embodiment, the computer device may obtain the first target entity and the second target entity from the knowledge graph according to the needs of the user, and determine the candidate relationship between the first target entity and the second target entity according to the user's settings.

[0043] Among them, the knowledge graph is a graph-based data structure consisting of nodes (point) and edges (Edge). Each node represents an entity, and each edge represents the relationship between entities. The knowledge graph is essentially a semantic network.

[0044] Entities can be understood as things in the real world, such as people, place names, companies, telephones, animals, etc.; relationships can be used to express a certain connection between different entities.

[0045] Step 120: Search for at least two paths between the first target entity and the second target entity in the knowledge graph.

[0046] The path in the embodiment of the present disclosure can be understood as a path composed of entities and relationships from the first target entity to the second target entity in the knowledge graph.

[0047] In the embodiment of the present disclosure, after obtaining the first target entity and the second target entity, the computer device may search for at least two paths between the first target entity and the second target entity in the knowledge graph.

[0048] In some embodiments, a path search can be performed in the knowledge graph based on a path sorting algorithm to obtain at least two paths between the first target entity and the second target entity. The path sorting algorithm is a number structure algorithm that can be used to analyze complex path network structures and perform path search. The specific principle can be referred to in related technologies and will not be repeated here.

[0049] For example, the first target entity is "Zhang San", the second target entity is "China", and the candidate relationship is "nationality". In the disclosed embodiment, it is necessary to determine whether the triple (Zhang San, nationality, China) holds, that is, whether the candidate relationship between the first target entity and the second target entity holds. The first target entity can be represented as E1, the second target entity can be represented as En, and the candidate relationship is recorded as Rc. First, at least two paths between E1 and En are found. Here, a path sorting algorithm is used to search and obtain the path (L1, L2, ...Ln). Path L1 can be quantified as (E1, R1, ..., Rn, En), E1 represents entity 1 (the first target entity), E2 represents entity 2, R1 represents the relationship between entity 1 and entity 2, En represents entity n (the second target entity), and each path is composed of all entities and relationships on the path.

[0050] Step 130: Calculate the probability that the candidate relationship between the first target entity and the second target entity is established based on the semantic similarity between the candidate relationship and the at least two paths.

[0051] In the embodiment of the present disclosure, after obtaining at least two paths between the first target entity and the second target entity, the computer device can calculate the probability that the candidate relationship between the first target entity and the second target entity is established based on the magnitude of the semantic similarity between the candidate relationship and the at least two paths. The semantic similarity between the candidate relationship and the at least two paths can be understood as the correlation between the semantics expressed by the candidate relationship and the semantics expressed by the at least two paths.

[0052] In some embodiments, based on the semantic similarity between the candidate relationship and at least two paths, calculating the probability that the candidate relationship between the first target entity and the second target entity is established may include steps 1301-1304:

[0053] Step 1301: Calculate the sub-semantic similarity between the candidate relationship and each path.

[0054] In the disclosed embodiment, for each path, the computer device may calculate the sub-semantic similarity between the candidate relationship and the path, and then obtain the sub-semantic similarity between the candidate relationship and each path.

[0055] Step 1302: Based on the correspondence between the sub-semantic similarity and the sub-weight value, determine the sub-weight value corresponding to each path, the sub-weight value is used to represent the association between the path and the candidate relationship, and the correspondence includes a positive correlation between the sub-weight value and the sub-semantic similarity.

[0056] In the disclosed embodiment, the computer device pre-stores the corresponding relationship between the sub-semantic similarity and the sub-weight value, and the sub-weight value can be used to represent the association size between the path and the candidate relationship. The corresponding relationship can be that the sub-weight value is positively correlated with the sub-semantic similarity. The greater the sub-semantic similarity between the candidate relationship and the path, the greater the sub-weight value of the association size between the path and the candidate relationship. The smaller the sub-semantic similarity between the candidate relationship and the path, the smaller the sub-weight value of the association size between the path and the candidate relationship. After obtaining the sub-semantic similarity between the candidate relationship and each path, the computer device can determine the sub-weight value corresponding to each path based on the corresponding relationship between the sub-semantic similarity and the sub-weight value.

[0057] Step 1303: sum up the sub-weight values ​​corresponding to each path to obtain a total weight value of the association size between at least two paths and the candidate relationship.

[0058] In the disclosed embodiment, after obtaining the sub-weight values ​​corresponding to each path, the computer device may sum the sub-weight values ​​corresponding to each path to obtain a total weight value of the association size between at least two paths and the candidate relationship. The total weight value may represent the association size between at least two paths and the candidate relationship.

[0059] Step 1304: Determine the total weight value as the probability that the candidate relationship is established.

[0060] In the disclosed embodiment, after obtaining the total weight value of the association size between at least two paths and the candidate relationship, the computer device may determine the total weight value as the probability that the candidate relationship between the first target entity and the second target entity is established. In other words, the association size between each path and the candidate relationship may be summarized to obtain the association size between at least two paths and the candidate relationship, and the probability of the candidate relationship being established may be determined by the association size between at least two paths and the candidate relationship.

[0061] Step 140: When the probability is greater than a preset threshold, determine that the candidate relationship is established.

[0062] In the disclosed embodiment, when the probability that the candidate relationship is established is greater than a preset threshold, the computer device can determine that the candidate relationship between the first target entity and the second target entity is established. When the probability that the candidate relationship is established is less than or equal to the preset threshold, the computer device can determine that the candidate relationship between the first target entity and the second target entity is not established. Among them, the preset threshold can be set as needed, or it can be obtained through actual experience summary, and is not specifically limited here.

[0063] Step 150: Add candidate relationships to the knowledge graph.

[0064] In the disclosed embodiment, if a candidate relationship between the first target entity and the second target entity is established, indicating that the candidate relationship meets the standards of the knowledge graph, the computer device can add the candidate relationship to the knowledge graph and associate the first target entity with the second target entity through the candidate relationship.

[0065] In the disclosed embodiment, a first target entity and a second target entity, and a candidate relationship between the first target entity and the second target entity are obtained; at least two paths between the first target entity and the second target entity are searched in the knowledge graph; based on the semantic similarity between the candidate relationship and the at least two paths, the probability that the candidate relationship between the first target entity and the second target entity is established is calculated; when the probability is greater than a preset threshold, the candidate relationship is determined to be established; the candidate relationship is supplemented into the knowledge graph, and the association size between the at least two paths and the candidate relationship can be determined according to the semantic similarity between the at least two paths between the two entities and the candidate relationship, and then the possibility of the establishment of the candidate relationship between the two entities is predicted according to the association size between the at least two paths and the candidate relationship, and the correctness of the supplemented content is evaluated using multiple path data, so as to improve the conformity of the supplemented content with the actual situation and the accuracy of knowledge completion.

[0066] Figure 2 is a flow chart of a knowledge graph completion method provided by an embodiment of the present disclosure, such as Figure 2 As shown, the knowledge graph completion method provided in this embodiment includes steps 210-290:

[0067] Step 210: Acquire a first target entity and a second target entity, and a candidate relationship between the first target entity and the second target entity.

[0068] Step 220: Search for at least two paths between the first target entity and the second target entity in the knowledge graph.

[0069] The steps 210 - 220 in the embodiment of the present disclosure may refer to the contents of the above steps 110 - 120 , which will not be repeated here.

[0070] Step 230: Perform word embedding processing on each path and candidate relationship based on the first network to obtain a path vector corresponding to each path and a relationship vector corresponding to the candidate relationship.

[0071] In the disclosed embodiment, the computer device can input each path and candidate relationship into the first network, perform word embedding processing on each path and candidate relationship based on the first network, convert the data of each path and the data of the candidate relationship into a vector representation that can be understood by the computer, and obtain the path vector corresponding to each path and the relationship vector corresponding to the candidate relationship. Among them, word embedding can be understood as a type of word representation, and words with similar meanings have similar representations, which can be used to convert text data into a vector representation that can be understood by the computer. Using the word embedding method to represent the entities in each path and the relationship between entities can alleviate the problem of feature space expansion caused by the excessive number of paths, thereby reducing overhead.

[0072] The first network in the embodiment of the present disclosure may include a natural language processing (NLP) model. For details, reference may be made to related technologies of NLP, which will not be described in detail here.

[0073] Step 240: Analyze the first similarity between each path vector and the relationship vector based on the second network to obtain a sub-weight value of the association size between each path and the candidate relationship, where the sub-weight value is positively correlated with the similarity.

[0074] In the embodiment of the present disclosure, after obtaining the path vector and the relationship vector, the computer device can input the path vector corresponding to each path and the relationship vector corresponding to the candidate relationship into the second network, analyze the first similarity between each path vector and the relationship vector based on the second network, assign different weights to each path vector according to the first similarity, and obtain sub-weight values ​​of the association size between each path and the candidate relationship, and the sub-weight values ​​are positively correlated with the similarity.

[0075] The second network in the disclosed embodiment may include an attention mechanism model. The attention mechanism can assign different weights to each part of the model input, extract more critical and important information, and enable the model to make more accurate judgments. For details, please refer to the relevant technologies of the attention mechanism, which will not be repeated here.

[0076] Step 250: Perform weighted sum processing on each path vector and the sub-weight value corresponding to each path vector to obtain a total path vector.

[0077] In the disclosed embodiment, after obtaining the sub-weight values ​​corresponding to each path vector, the computer device may perform weighted sum processing on each path vector and the sub-weight values ​​corresponding to each path vector to obtain a total path vector.

[0078] In some embodiments, each path vector and the sub-weight value corresponding to each path vector may be weighted and summed through the second network to obtain a total path vector.

[0079] Step 260: Analyze the second similarity between the total path vector and the relationship vector based on the third network to obtain a total weight value corresponding to the total path vector, where the total weight value is positively correlated with the second similarity.

[0080] In the disclosed embodiment, the computer device may input the total path vector and the relationship vector into a third network, analyze the second similarity between the total path vector and the relationship vector, assign a weight to the total path vector according to the second similarity, and obtain a total weight value of the association size between at least two paths corresponding to the total path vector and the candidate relationship, wherein the total weight value is positively correlated with the second similarity.

[0081] The third network in the embodiment of the present disclosure may include a fully connected layer network, which can be used to integrate the features extracted previously and output a prediction value. For details, please refer to the relevant technology of the fully connected layer, which will not be repeated here.

[0082] Step 270: Determine the total weight value as the probability that the candidate relationship is established.

[0083] The contents of the embodiment of the present disclosure may refer to the contents of the above step 1304 and will not be repeated here.

[0084] Step 280: When the probability is greater than a preset threshold, determine that the candidate relationship is established.

[0085] Step 290: Add the candidate relationships to the knowledge graph.

[0086] The contents of steps 270-290 in the embodiment of the present disclosure may refer to the contents of steps 140-150 described above, and will not be repeated here.

[0087] Therefore, by using the word embedding method to vectorize the entities in each path and the relationships between entities, the problem of feature space expansion caused by too many paths can be alleviated, thereby reducing overhead. Based on the similarity between each path vector and the relationship vector corresponding to the candidate relationship, the possibility of the candidate relationship between the two entities is predicted, and the correctness of the supplementary content is evaluated using multiple path data, thereby improving the conformity of the supplementary content with the actual situation and the accuracy of knowledge completion.

[0088] Figure 3 is a flow chart of a knowledge graph completion method provided by an embodiment of the present disclosure, such as Figure 3 As shown, the knowledge graph completion method provided in this embodiment includes steps 301-310:

[0089] Step 301: Obtain a first target entity and a second target entity, and a candidate relationship between the first target entity and the second target entity.

[0090] Step 302: Search for at least two paths between the first target entity and the second target entity in the knowledge graph.

[0091] Step 303: Based on the first network, each path and candidate relationship is subjected to word embedding processing to obtain a path vector corresponding to each path and a relationship vector corresponding to the candidate relationship.

[0092] Steps 301-303 in the embodiment of the present disclosure may refer to the contents of the above-mentioned steps 210-230, which will not be repeated here.

[0093] Step 304: For the path vector corresponding to each path, input the path vector into the fourth network, and based on the fourth network, add the vectors of the related entities connected to each entity in the path to the path vector.

[0094] In the embodiment of the present disclosure, for each path vector corresponding to the path, the computer device may input the path vector into the fourth network, and based on the fourth network, add the vectors of the related entities connected to each entity in the path to the path vector. The related entities connected to the entity may include related entities connected to the entity forwardly and related entities connected to the entity reversely.

[0095] For example, the first target entity is "Zhang San", the second target entity is "China", and the candidate relationship is "nationality". The vector of the related entity "basketball" connected to "Zhang San" can be added to the path vector.

[0096] The fourth network in the embodiment of the present disclosure may include a bidirectional long short-term memory (BiLSTM) model. The BiLSTM model can obtain the forward and reverse information in each path, that is, the vectors of related entities connected to each entity in the path, and add the vectors of related entities connected to each entity in each path to the path vector corresponding to the path, so that each path vector contains the forward and reverse information of each entity, that is, the sequence information.

[0097] In this way, the information contained in the path vector of each path can be made richer and more complete, providing more data support for the subsequent judgment of the establishment of candidate relationships, and further improving the accuracy of knowledge graph completion.

[0098] Step 305: Analyze the first similarity between each path vector and the relationship vector based on the second network to obtain a sub-weight value of the association size between each path and the candidate relationship, where the sub-weight value is positively correlated with the similarity.

[0099] Step 306: Perform weighted sum processing on each path vector and the sub-weight value corresponding to each path vector to obtain a total path vector.

[0100] Step 307: Analyze the second similarity between the total path vector and the relationship vector based on the third network to obtain a total weight value corresponding to the total path vector, where the total weight value is positively correlated with the second similarity.

[0101] Step 308: Determine the total weight value as the probability that the candidate relationship is established.

[0102] The contents of the embodiment of the present disclosure may refer to the contents of the above step 1304 and will not be repeated here.

[0103] Step 309: When the probability is greater than a preset threshold, determine that the candidate relationship is established.

[0104] Step 310: Add candidate relationships to the knowledge graph.

[0105] The contents of steps 309-310 in the embodiment of the present disclosure may refer to the contents of steps 140-150 described above, and will not be repeated here.

[0106] Therefore, by adopting the word embedding method to represent the entities in each path and the relationship between entities by vector, and adding the vectors of related entities connected to each entity in each path to the path vector, the possibility of the candidate relationship between the first target entity and the second target entity being established is predicted according to the similarity between each path vector and the relationship vector corresponding to the candidate relationship. This can make the information contained in the path vector of each path richer and more complete, provide more data support for judging the establishment of candidate relationships, improve the conformity of supplementary content with actual conditions, and further improve the accuracy of knowledge graph completion.

[0107] Figure 4 is a schematic diagram of the structure of a knowledge graph completion device provided by an embodiment of the present disclosure, and the device can be understood as the above-mentioned computer device or some functional modules in the above-mentioned computer device. Figure 4 As shown, the knowledge graph completion 400 device may include:

[0108] An acquisition module 410 is used to acquire a first target entity and a second target entity, and a candidate relationship between the first target entity and the second target entity;

[0109] A search module 420, configured to search in the knowledge graph for at least two paths between the first target entity and the second target entity;

[0110] A calculation module 430, configured to calculate a probability that a candidate relationship between the first target entity and the second target entity is established based on the semantic similarity between the candidate relationship and the at least two paths;

[0111] A determination module 440 is used to determine that a candidate relationship is established when the probability is greater than a preset threshold;

[0112] The supplement module 450 is used to supplement the candidate relations into the knowledge graph.

[0113] Optionally, the search module 420 may include:

[0114] The path search submodule is used to perform path search in the knowledge graph based on a path sorting algorithm to obtain at least two paths between the first target entity and the second target entity.

[0115] Optionally, the calculation module 430 may include:

[0116] The first calculation submodule is used to calculate the sub-semantic similarity between the candidate relationship and each path;

[0117] A first determination submodule is used to determine the sub-weight value corresponding to each path based on the corresponding relationship between the sub-semantic similarity and the sub-weight value, the sub-weight value is used to represent the association size between the path and the candidate relationship, and the corresponding relationship includes a positive correlation between the sub-weight value and the sub-semantic similarity;

[0118] A summing submodule is used to sum the sub-weight values ​​corresponding to each path to obtain a total weight value of the association between at least two paths and the candidate relationship;

[0119] The second determination submodule is used to determine the total weight value as the probability that the candidate relationship is established.

[0120] Optionally, the first determining submodule may include:

[0121] A word embedding unit, used to perform word embedding processing on each path and candidate relationship based on the first network, to obtain a path vector corresponding to each path and a relationship vector corresponding to the candidate relationship;

[0122] The first analysis unit is used to analyze the first similarity between each path vector and the relationship vector based on the second network, and obtain a sub-weight value of the association size between each path and the candidate relationship, where the sub-weight value is positively correlated with the first similarity.

[0123] Optionally, the above-mentioned summation submodule may include:

[0124] A weighted processing unit, used for performing weighted sum processing on each path vector and the sub-weight value corresponding to each path vector to obtain a total path vector;

[0125] The second analysis unit is used to analyze the second similarity between the total path vector and the relationship vector based on the third network to obtain a total weight value corresponding to the total path vector, and the total weight value is positively correlated with the second similarity.

[0126] Optionally, the first determining submodule may include:

[0127] The adding unit is used for inputting the path vector corresponding to each path into the fourth network, and adding the vectors of the related entities connected to each entity in the path to the path vector based on the fourth network.

[0128] The knowledge graph completion device provided in the embodiments of the present disclosure can implement the method of any of the above embodiments, and its execution method and beneficial effects are similar, which will not be repeated here.

[0129] The embodiments of the present disclosure also provide a computer device, which includes a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method of any of the above embodiments can be implemented, and its execution method and beneficial effects are similar and will not be repeated here.

[0130] Figure 5 is a schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure, such as Figure 5 As shown, the computer device 500 may include a processor 510 and a memory 520, wherein the memory 520 stores a computer program 521, and when the computer program 521 is executed by the processor 510, the method provided by any of the above embodiments can be implemented, and its execution method and beneficial effects are similar, which will not be repeated here.

[0131] Of course, to simplify, Figure 5 Only some of the components related to the present invention in the computer device 500 are shown, and components such as a bus, an input / output interface, an input device, and an output device are omitted. In addition, according to specific application conditions, the computer device 500 may also include any other appropriate components.

[0132] An embodiment of the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method of any of the above embodiments can be implemented. The execution method and beneficial effects are similar and will not be repeated here.

[0133] The above-mentioned computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0134] The computer program may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the disclosed embodiments, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer device, partially on the user's device, as a separate software package, partially on the user's computer device and partially on a remote computer device, or entirely on a remote computer device or server.

[0135] An embodiment of the present disclosure provides a vehicle, which includes the knowledge graph completion device in the above embodiment or the computer device in the above embodiment or the computer-readable storage medium in the above embodiment, and can implement the method of any of the above embodiments. The execution method and beneficial effects are similar and will not be repeated here.

[0136] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0137] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0138] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Citation Information

Patent Citations

  • Knowledge graph completion method and device, equipment and storage medium

    CN112035672A

  • Knowledge graph relation completion method for numerical control machine tool equipment maintenance

    CN113190686A

  • Knowledge graph completion method based on path and graph context

    CN115795042A