Knowledge completion method and device, equipment, storage medium and product

By identifying indirect association information of target entities in a knowledge graph and using a pre-defined reasoning rule base and language model for completion, the inefficiency problem in existing technologies is solved, achieving more efficient and accurate knowledge completion.

CN121998045APending Publication Date: 2026-05-08BEIJING QIHOOD TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING QIHOOD TECHNOLOGY CO LTD
Filing Date
2024-11-01
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing knowledge graph completion methods are inefficient, especially those that rely on the symmetry of relationships, which require pre-defining symmetric relationships, making them time-consuming and limited.

Method used

By identifying indirect relationships between target entities in a knowledge graph, knowledge completion is performed using a pre-defined reasoning rule base and a language model. This includes identifying indirect relationships, retrieving candidate direct relationships from the pre-defined reasoning rule base, and inputting them into the pre-defined language model to complete the knowledge graph.

Benefits of technology

It improves the accuracy and efficiency of knowledge completion, can accurately predict the direct relationship information between target entities, and enhances the knowledge graph completion capability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121998045A_ABST
    Figure CN121998045A_ABST
Patent Text Reader

Abstract

The invention discloses a knowledge completion method and device, equipment, a storage medium and a product, and relates to the technical field of artificial intelligence, and the knowledge completion method comprises the steps: determining indirect association information between target entities in a knowledge graph; retrieving in a preset inference rule base based on the indirect association information to obtain candidate direct relationship information corresponding to the target entity, the preset inference rule base including indirect relationships and direct relationships between entities in the knowledge graph; and inputting the candidate direct relationship information into a preset language model to obtain direct relationship information between the target entities, and complementing the knowledge graph based on the direct relationship information. Compared with the existing mode of determining the missing entity relationship in the knowledge graph by using the symmetry of the relationship, the mode of the application performs detection enhancement according to the preset inference rule base, can accurately predict the direct relationship information between the target entities, and improves the knowledge completion accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to knowledge completion methods, apparatus, devices, storage media, and products. Background Technology

[0002] In the library and information science field, a knowledge graph, also known as a knowledge domain visualization or knowledge domain mapping map, is a series of various graphs that display the development process and structural relationships of knowledge. Current knowledge graphs suffer from incomplete knowledge, specifically, a relationship that should exist between two entities but is not reflected in the graph. To address this, knowledge graph completion is necessary. However, existing completion methods rely on the symmetry of relationships (friendships, colleague relationships), which requires pre-defining symmetrical relationships, is limited in number, and is extremely time-consuming. Therefore, improving the efficiency of knowledge graph completion has become a pressing technical problem. Summary of the Invention

[0003] The main purpose of this application is to provide a knowledge completion method, apparatus, device, storage medium, and product, which aims to solve the technical problem of low efficiency in existing knowledge graph completion methods.

[0004] To achieve the above objectives, this application proposes a knowledge completion method, which includes:

[0005] Determine the indirect relationships between target entities in the knowledge graph;

[0006] Based on the indirect association information, a search is performed in a preset reasoning rule base to obtain candidate direct relationship information corresponding to the target entity. The preset reasoning rule base includes indirect and direct relationships between entities in the knowledge graph.

[0007] The candidate direct relationship information is input into a preset language model to obtain the direct relationship information between the target entities, and the knowledge graph is completed based on the direct relationship information.

[0008] Optionally, the step of determining the indirect association information between target entities in the knowledge graph includes:

[0009] Determine the association path information between target entities in the knowledge graph;

[0010] The associated path information is preprocessed to obtain the indirect association information between the target entities.

[0011] Optionally, the step of preprocessing the association path information to obtain the indirect association information between the target entities includes:

[0012] The associated entities in the associated path information are symbolized to obtain symbolic associated information;

[0013] The symbolic association information is pruned to obtain the indirect association information between the target entities.

[0014] Optionally, the step of pruning the symbolic association information to obtain indirect association information between the target entities includes:

[0015] The number of connection paths between the target entities is determined based on the symbolic association information;

[0016] Based on the number of connection paths, the symbolic association information is pruned to obtain the indirect association information between the target entities.

[0017] Optionally, before the step of retrieving candidate direct relationship information corresponding to the target entity based on the indirect association information in a preset reasoning rule base, the method further includes:

[0018] The connected graph in the knowledge graph is determined by a pre-defined connected graph discovery algorithm;

[0019] The connected graph is preprocessed to obtain the indirect and direct relationships between the entities corresponding to the connected graph;

[0020] A pre-defined reasoning rule base is constructed based on the indirect and direct relationships.

[0021] Optionally, the step of constructing a preset reasoning rule base based on the indirect relationship and the direct relationship includes:

[0022] An input template is constructed based on the indirect relationship, the direct relationship, and the preset prompt template;

[0023] The input template is input into a preset language model to obtain a preset reasoning rule base output by the preset language model.

[0024] Optionally, the step of preprocessing the connected graph to obtain the indirect and direct relationships between entities corresponding to the connected graph includes:

[0025] The connected graph is pruned to obtain a first connected graph;

[0026] The frequency of each connected component in the first connected graph is counted, and duplicates in the first connected graph are removed based on the frequency to obtain the second connected graph;

[0027] Based on the second connected graph, determine the indirect and direct relationships between the entities corresponding to the connected graph.

[0028] Optionally, the step of counting the frequency of each connected component in the first connected graph and removing duplicates from the first connected graph based on the frequency to obtain the second connected graph includes:

[0029] Each connected graph in the first connected graph is symbolized to obtain a symbolized connected graph;

[0030] The frequency of the symbolic connected graph is counted, and duplicates are removed from the symbolic connected graph based on the frequency to obtain a second connected graph.

[0031] Optionally, after the step of constructing a preset reasoning rule base based on the indirect relationship and the direct relationship, the method further includes:

[0032] The preset reasoning rule base is stored in the ES database or the Faiss vectorized database.

[0033] Optionally, the step of inputting the candidate direct relationship information into a preset language model to obtain the direct relationship information between the target entities includes:

[0034] Determine the condition body corresponding to the candidate direct relationship information;

[0035] The input data is obtained by concatenating the candidate direct relationship information, the condition body, and the indirect association information;

[0036] The input data is input into a preset language model to obtain the direct relationship information between the target entities.

[0037] Optionally, the step of retrieving candidate direct relationship information corresponding to the target entity based on the indirect association information in a preset reasoning rule base includes:

[0038] Based on the indirect association information, a search is performed in a preset reasoning rule base to obtain conditional body information similar to the indirect association information;

[0039] The conditional body information is sorted according to similarity scores, and candidate direct relationship information corresponding to the target entity is determined based on the sorting results.

[0040] Furthermore, to achieve the above objectives, this application also proposes a knowledge completion device, which includes:

[0041] The determination module is used to determine the indirect association information between target entities in the knowledge graph;

[0042] The retrieval module is used to perform a retrieval in a preset reasoning rule base based on the indirect association information to obtain candidate direct relationship information corresponding to the target entity. The preset reasoning rule base includes indirect and direct relationships between entities in the knowledge graph.

[0043] The knowledge completion module is used to input the candidate direct relationship information into a preset language model to obtain the direct relationship information between the target entities, and to complete the knowledge graph based on the direct relationship information.

[0044] Optionally, the determining module is further configured to determine the association path information between target entities in the knowledge graph;

[0045] The associated path information is preprocessed to obtain the indirect association information between the target entities.

[0046] Optionally, the determining module is further configured to perform symbolic processing on the associated entities in the associated path information to obtain symbolic associated information;

[0047] The symbolic association information is pruned to obtain the indirect association information between the target entities.

[0048] Optionally, the determining module is further configured to determine the number of connection paths between the target entities based on the symbolic association information;

[0049] Based on the number of connection paths, the symbolic association information is pruned to obtain the indirect association information between the target entities.

[0050] Optionally, the retrieval module is further configured to determine the connected graph in the knowledge graph using a preset connected graph discovery algorithm;

[0051] The connected graph is preprocessed to obtain the indirect and direct relationships between the entities corresponding to the connected graph;

[0052] A pre-defined reasoning rule base is constructed based on the indirect and direct relationships.

[0053] Optionally, the retrieval module is further configured to construct an input template based on the indirect relationship, the direct relationship, and the preset prompt template;

[0054] The input template is input into a preset language model to obtain a preset reasoning rule base output by the preset language model.

[0055] Optionally, the retrieval module is further configured to prune the connected graph to obtain a first connected graph;

[0056] The frequency of each connected component in the first connected graph is counted, and duplicates in the first connected graph are removed based on the frequency to obtain the second connected graph;

[0057] Based on the second connected graph, determine the indirect and direct relationships between the entities corresponding to the connected graph.

[0058] Optionally, the retrieval module is further configured to perform symbolization processing on each connected graph in the first connected graph to obtain a symbolized connected graph;

[0059] The frequency of the symbolic connected graph is counted, and duplicates are removed from the symbolic connected graph based on the frequency to obtain a second connected graph.

[0060] Optionally, the retrieval module is further configured to store the preset reasoning rule base in an ES database or a Faiss vectorized database.

[0061] Optionally, the knowledge completion module is further configured to determine the condition body corresponding to the candidate direct relationship information;

[0062] The input data is obtained by concatenating the candidate direct relationship information, the condition body, and the indirect association information;

[0063] The input data is input into a preset language model to obtain the direct relationship information between the target entities.

[0064] Optionally, the retrieval module is further configured to perform a retrieval in a preset reasoning rule base based on the indirect association information to obtain conditional body information similar to the indirect association information;

[0065] The conditional body information is sorted according to similarity scores, and candidate direct relationship information corresponding to the target entity is determined based on the sorting results.

[0066] In addition, to achieve the above objectives, this application also proposes a knowledge completion device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the knowledge completion method as described above.

[0067] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the knowledge completion method described above.

[0068] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the knowledge completion method described above.

[0069] This application determines indirect association information between target entities in a knowledge graph; based on the indirect association information, it searches a preset inference rule base to obtain candidate direct relationship information corresponding to the target entities. The preset inference rule base includes indirect and direct relationships between entities in the knowledge graph; the candidate direct relationship information is input into a preset language model to obtain direct relationship information between the target entities, and the knowledge graph is completed based on the direct relationship information. Because this application determines the direct relationship information between target entities in a knowledge graph based on a preset inference rule base and a preset language model that includes indirect and direct relationships between entities in the knowledge graph, and completes the knowledge graph based on the direct relationship information, compared to existing methods that use the symmetry of relationships to determine missing entity relationships in a knowledge graph, the above method of this application, based on a preset inference rule base for detection enhancement, can accurately predict the direct relationship information between target entities and improve the accuracy of knowledge completion. Attached Figure Description

[0070] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0071] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0072] Figure 1 This is a flowchart illustrating an embodiment of the knowledge completion method in this application.

[0073] Figure 2 This is a flowchart illustrating Embodiment 2 of the knowledge completion method in this application.

[0074] Figure 3 This is a flowchart illustrating Embodiment 3 of the knowledge completion method in this application.

[0075] Figure 4 This is a schematic diagram of the module structure of the knowledge completion device in an embodiment of this application;

[0076] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the knowledge completion method in the embodiments of this application.

[0077] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0078] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0079] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0080] The main solution of this application embodiment is: to determine the indirect association information between target entities in the knowledge graph; to search in a preset reasoning rule base based on the indirect association information to obtain candidate direct relationship information corresponding to the target entities, wherein the preset reasoning rule base includes indirect and direct relationships between entities in the knowledge graph; to input the candidate direct relationship information into a preset language model to obtain direct relationship information between the target entities, and to complete the knowledge graph based on the direct relationship information.

[0081] This application determines the direct relationship information between target entities in a knowledge graph based on a pre-defined inference rule base and a pre-defined language model, which includes both indirect and direct relationships between entities in the knowledge graph. It then uses this direct relationship information to complete the knowledge graph. Compared to existing methods that utilize the symmetry of relationships to determine missing entity relationships in a knowledge graph, this application's method, based on a pre-defined inference rule base for enhanced detection, can accurately predict the direct relationship information between target entities, thus improving the accuracy of knowledge completion.

[0082] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or knowledge completion device capable of performing the above functions. The following description uses a knowledge completion device as an example to illustrate this embodiment and the subsequent embodiments.

[0083] Based on this, the embodiments of this application provide a knowledge completion method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the knowledge completion method of this application in Implementation Example 1.

[0084] In this embodiment, the knowledge completion method includes steps S10 to S30:

[0085] Step S10: Determine the indirect association information between target entities in the knowledge graph;

[0086] It should be noted that the target entity may include at least two entities whose direct relationship needs to be determined. In this embodiment, the entity is the node in the knowledge graph. The indirect association information may be the connection path information between the target entities in the knowledge graph.

[0087] Step S20: Based on the indirect association information, a search is performed in the preset reasoning rule base to obtain the candidate direct relationship information corresponding to the target entity. The preset reasoning rule base includes the indirect and direct relationships between entities in the knowledge graph.

[0088] It should be noted that the candidate direct relationship information can be the direct association edge information corresponding to entities with indirect relationships similar to the indirect association information in the preset inference rule base. For example, the preset inference rule base includes the indirect relationship a3 and direct relationship a4 between entities a1 and a2, and the indirect relationship b3 and direct relationship b4 between entities b1 and b2. When searching in the preset inference rule base based on the indirect association information, if the indirect relationship a3 between entities a1 and a2 is similar to the indirect association information of the target entity, then the candidate direct relationship information can be the direct relationship a4 between entities a1 and a2, and the connection path information between entities a1 and a2, i.e., the indirect relationship b3.

[0089] Step S30: Input the candidate direct relationship information into a preset language model to obtain the direct relationship information between the target entities, and complete the knowledge graph based on the direct relationship information.

[0090] It should be noted that inputting the candidate direct relationship information into the preset language model can involve concatenating the direct relationships, connection paths, and indirect association information between target entities from the candidate direct relationship information and then inputting them into the preset language model to obtain the direct relationship information between the target entities output by the preset language model. When the direct relationship information contains a unique direct relationship between target entities predicted by the preset language model, the knowledge graph is completed based on the direct relationship in the direct relationship information. When the direct relationship information contains multiple direct relationships between target entities predicted by the preset language model, one or more direct relationships with higher probabilities are selected to complete the knowledge graph based on the probability corresponding to each direct relationship. The direct relationship can be a direct relationship edge between target entities, that is, the target entities are connected by only one relationship edge. In some cases, if a direct relationship edge between target entities cannot be predicted, the direct relationship can be the connection path information with the fewest paths between target entities.

[0091] Furthermore, in order to accurately determine the direct relationship between target entities, step S30 may include: determining the condition body corresponding to the candidate direct relationship information;

[0092] The input data is obtained by concatenating the candidate direct relationship information, the condition body, and the indirect association information;

[0093] The input data is input into a preset language model to obtain the direct relationship information between the target entities.

[0094] It should be noted that the condition body can be indirect relationship information between entities stored in a preset inference rule base. When constructing the preset inference rule base, indirect relationships between entities are used as the condition body, and direct relationships between entities are used as the conclusion. The difference is that the indirect relationships in the preset inference rule base symbolize entities; for example, the general indirect relationship between entity 1 and entity 2 can be represented as: entity 1-relationship 1-entity 3-relationship 2-entity 4-relationship 3-entity 2. The preset inference rule base can store entity 1-relationship 1-relationship 2-relationship 3-entity 2. The input data obtained by concatenating the candidate direct relationship information, the condition body, and the indirect relationship information can be obtained by concatenating the condition body, the indirect relationship information, and the direct relationships in the candidate direct relationship information. The preset language model predicts the potential relationship categories between target entities based on the input data, i.e., the direct relationship information between target entities, where the direct relationship information includes at least one direct relationship.

[0095] This embodiment determines the indirect association information between target entities in a knowledge graph; based on the indirect association information, it searches a preset inference rule base to obtain candidate direct relationship information corresponding to the target entities. The preset inference rule base includes indirect and direct relationships between entities in the knowledge graph; the candidate direct relationship information is input into a preset language model to obtain direct relationship information between the target entities, and the knowledge graph is completed based on the direct relationship information. Since this embodiment determines the direct relationship information between target entities in a knowledge graph based on a preset inference rule base and a preset language model that includes indirect and direct relationships between entities in the knowledge graph, and completes the knowledge graph based on the direct relationship information, compared to existing methods that use the symmetry of relationships to determine missing entity relationships in a knowledge graph, the above method in this embodiment uses a preset inference rule base for detection enhancement, which can accurately predict the direct relationship information between target entities and improve the accuracy of knowledge completion.

[0096] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 , Figure 2 This is a flowchart illustrating an embodiment of the knowledge completion method of this application. Before step S20, the following steps are also included:

[0097] Step S101: Determine the connected graph in the knowledge graph using a preset connected graph discovery algorithm;

[0098] It should be understood that in graph theory, a connected graph is based on the concept of connectivity. In an undirected graph G, if there is a path connecting vertex i to vertex j (and of course, there must also be a path from j to i), then i and j are said to be connected. If G is a directed graph, then all edges in the path connecting i and j must be in the same direction. If any two vertices in a graph are connected, then the graph is called a connected graph. If this graph is directed, it is called a strongly connected graph.

[0099] It should be noted that the preset connected graph discovery algorithm can be an algorithm for determining the connected graph in the knowledge graph.

[0100] In practice, the knowledge graph is stored in a graph database, and a pre-defined connected graph discovery algorithm is used to find all connected graphs within it.

[0101] Step S102: Preprocess the connected graph to obtain the indirect and direct relationships between the entities corresponding to the connected graph;

[0102] It should be noted that the preprocessing of the connected graph can include pruning, deduplication, and separation. For example, pruning can involve removing connected graphs with a total number of paths greater than a preset threshold, such as removing connected graphs with more than 20 paths. Deduplication can involve removing connected graphs where the number of nodes, relation edges, and relation edges are all the same. For example: connected... Figure 1 :(Old Liu)-son-(Middle Liu)-nephew-(Young Liu); Connecting Figure 2 If the connection is: (Old Li) - son - (Middle Li) - nephew - (Young Li), then the above connection is valid. Figure 1 and connectivity Figure 2 For a connected graph where the number of nodes, relation edges, and related edges are all equal, any one of the connected graphs can be removed. The separation process can involve identifying and separating multi-hop paths and direct relation edges in the connected graph. For example, connecting... Figure 3 If the possible connections are: (Old Ming) - Son - (Middle Ming) - Nephew - (Young Ming), (Old Ming) - Grandfather - (Young Ming), then the connections are complete. Figure 3 The indirect relationship between the corresponding entities is: son - () - nephew, and the direct relationship is grandfather.

[0103] Furthermore, in order to avoid the connected graph being too large and affecting the prediction efficiency of the model, step S102 may include: pruning the connected graph to obtain a first connected graph;

[0104] The frequency of each connected component in the first connected graph is counted, and duplicates in the first connected graph are removed based on the frequency to obtain the second connected graph;

[0105] Based on the second connected graph, determine the indirect and direct relationships between the entities corresponding to the connected graph.

[0106] It should be noted that the pruning process performed on the connected graph to obtain the first connected graph can be achieved by determining the total number of paths in the connected graph and removing connected graphs whose total number of paths exceeds a preset threshold. The process of counting the frequency of each connected graph in the first connected graph and deduplicating the first connected graph based on the frequency to obtain the second connected graph can be achieved by removing connected graphs whose frequency is lower than a preset frequency threshold.

[0107] Considering that some connected graphs differ only in entity names, while having the same connection relationships and number of paths, to avoid data redundancy, this embodiment calculates the frequency of each connected graph in the first connected graph and deduplicates the first connected graph based on the frequency to obtain the second connected graph. The steps include:

[0108] Each connected graph in the first connected graph is symbolized to obtain a symbolized connected graph;

[0109] The frequency of the symbolic connected graph is counted, and duplicates are removed from the symbolic connected graph based on the frequency to obtain a second connected graph.

[0110] It should be noted that the symbolization process for each connected graph in the first connected graph can be to symbolize the entities in the first connected graph and only retain the relation edges. For example, if the first connected graph is (Old Ming)-Son-(Middle Ming)-Nephew-(Little Ming), symbolizing the first connected graph would result in a symbolized connected graph such as ()-Son-()-Nephew-(). Then, the frequency of occurrence of the symbolized connected graphs is counted. Connected graphs with lower occurrence frequencies are considered to have lower confidence and are removed. Finally, the symbolized connected graphs are deduplicated to obtain the second connected graph.

[0111] Step S103: Construct a preset reasoning rule base based on the indirect relationship and the direct relationship.

[0112] It should be noted that constructing a preset inference rule base based on the indirect and direct relationships can involve storing the indirect relationships as condition bodies and the direct relationships as conclusions in a database to obtain the preset inference rule base. The preset inference rule base can be stored in an Elasticsearch database or a Faiss vectorized database.

[0113] Furthermore, in order to improve the efficiency of knowledge completion, step S103 may include: constructing an input template based on the indirect relationship, the direct relationship, and the preset prompt template;

[0114] The input template is input into a preset language model to obtain a preset reasoning rule base output by the preset language model.

[0115] It should be noted that the preset prompt template can be an AI prompt word template, for example: generating inference rules based on the following indirect and direct relationships, where indirect relationship: XX, direct relationship: XX. The step of inputting the input template into a preset language model to obtain the preset inference rule library output by the preset language model can be achieved by concatenating the obtained indirect and direct relationships between entities with the preset prompt template and then inputting them into the preset language model to obtain the inference rules output by the preset language model, and constructing the preset inference rule library based on these inference rules. For example, given target entity ent1 - Lao Ming and target entity ent2 - Xiao Ming, there is a connected graph between ent1 and ent2 (ent1 can directly point to ent2 and there is also an indirect multi-hop path connecting ent1 and ent2); the input multi-hop path is: (Lao Ming) - Son - (Zhong Ming) - Nephew - (Xiao Ming); the direct connection edge is (Lao Ming) - Grandfather - (Xiao Ming), and the preset language model needs to generate the following inference rule: if(ent1) - Son - () - Nephew - (ent2), then(ent1) - Grandfather - (ent2), where (ent1) - Son - () - Nephew - (ent2) is the condition body, and (ent1) - Grandfather - (ent2) is the conclusion. The condition body and conclusion can be stored accordingly to construct a preset inference rule base.

[0116] In practical implementation, given a knowledge graph kg and a text language model LLM, the goal is to obtain a reasoning rule base R. Specifically, this includes: storing the knowledge graph kg in a graph database and using a connected graph discovery algorithm to find all connected graphs G0; considering that some connected graphs G0 are too large, pruning them by removing connected graphs with a total number of paths > N (e.g., N is 20), resulting in G1; separating the connected graph G1 to obtain multi-hop paths and direct relation edges, symbolizing one end of the entity as ent1 and the other end as ent2, and so on. All entities are symbolized as parentheses (), while the names of the relation edges are preserved, resulting in G2. The frequency of each connected graph is counted and retained, and connected graphs with frequencies lower than N are filtered out. Then, G2 is deduplicated, for example, N is set to 10, which is a low confidence level, resulting in G3. G3 is processed, with the output direct relation edges as the key, and sorted according to the frequency of each multi-hop path, resulting in G4. G4 is traversed, and each multi-hop relation edge and direct relation edge of G4 is assembled into a prompt, which is fed into the text language model LLM to summarize and inductively derive inference rules, which are then stored in the inference rule base R.

[0117] Furthermore, based on the above, in order to improve the retrieval efficiency of searching in the preset reasoning rule base based on the indirect association information, step S10 may include: determining the association path information between target entities in the knowledge graph;

[0118] The associated path information is preprocessed to obtain the indirect association information between the target entities.

[0119] It should be noted that the determination of the association path information between target entities in the knowledge graph can be achieved through a full-path algorithm, finding all multi-hop paths between target entities, i.e., indirect association information. The preprocessing of the association path information can include pruning, symbolization, and other similar procedures.

[0120] Furthermore, to improve retrieval efficiency, the step of preprocessing the association path information to obtain the indirect association information between the target entities includes:

[0121] The associated entities in the associated path information are symbolized to obtain symbolic associated information;

[0122] The symbolic association information is pruned to obtain the indirect association information between the target entities.

[0123] It should be noted that the associated entity can be an entity in the associated path information. Symbolic processing of the associated entities in the associated path information can involve replacing the associated entities with preset symbols, for example: retaining only the relationship edges in the associated path information, deleting the entities in the associated path information, or representing them with the same symbol. Pruning the symbolized associated information can involve removing associated paths in the symbolized associated information where the total number of paths exceeds a preset number. The preprocessing steps for the associated path information can refer to the preprocessing steps for the connected graph described above in this embodiment, and will not be repeated here.

[0124] This embodiment determines the connected graph in the knowledge graph through a preset connected graph discovery algorithm; preprocesses the connected graph to obtain the indirect and direct relationships between the entities corresponding to the connected graph; and constructs a preset inference rule base based on the indirect and direct relationships. This embodiment, by preprocessing the connected graph in the knowledge graph to obtain the indirect and direct relationships between the entities corresponding to the connected graph, constructs a preset inference rule base based on the indirect and direct relationships. During knowledge completion, the direct relationships between target entities can be determined based on the preset inference rule base, improving the efficiency of knowledge completion.

[0125] Based on the above embodiments of this application, in the third embodiment of this application, the same or similar content as the above embodiments can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 , Figure 3 This is a flowchart illustrating Embodiment 3 of the knowledge completion method for this application. Step S30 further includes the following steps:

[0126] Step S301: Based on the indirect association information, search in the preset reasoning rule base to obtain conditional body information similar to the indirect association information;

[0127] It should be noted that the condition body information can be the indirect relationships between entities similar to the indirect association information stored in the preset reasoning rule base. The condition body information may include the path of the retrieved indirect relationship, the entity relationship, and the similarity to the indirect association information of the target entity.

[0128] Step S302: Sort the conditional body information according to the similarity score, and determine the candidate direct relationship information corresponding to the target entity based on the sorting result.

[0129] It should be noted that determining the candidate direct relationship information corresponding to the target entity based on the ranking result can be achieved by selecting a preset number of entity relationships with high similarity as candidate direct relationships corresponding to the target entity, or by selecting entity relationships with similarity greater than a preset similarity threshold as candidate direct relationships corresponding to the target entity. The preset number and the preset similarity threshold can be pre-set values.

[0130] This embodiment retrieves conditional body information similar to the indirect association information from a preset inference rule base; it then sorts the conditional body information according to similarity scores and determines candidate direct relationship information corresponding to the target entity based on the sorting results. This embodiment determines candidate direct relationships between target entities based on a preset inference rule base, which improves the accuracy of target entity relationship prediction and thus enhances the efficiency of knowledge completion.

[0131] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the knowledge completion method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0132] This application also provides a knowledge completion device; please refer to... Figure 4 The knowledge completion device includes:

[0133] Module 10 is used to determine the indirect association information between target entities in the knowledge graph;

[0134] The retrieval module 20 is used to perform a retrieval in a preset reasoning rule base based on the indirect association information to obtain candidate direct relationship information corresponding to the target entity. The preset reasoning rule base includes indirect and direct relationships between entities in the knowledge graph.

[0135] The knowledge completion module 30 is used to input the candidate direct relationship information into a preset language model to obtain the direct relationship information between the target entities, and to complete the knowledge graph based on the direct relationship information.

[0136] This embodiment determines the indirect association information between target entities in a knowledge graph; based on the indirect association information, it searches a preset inference rule base to obtain candidate direct relationship information corresponding to the target entities. The preset inference rule base includes indirect and direct relationships between entities in the knowledge graph; the candidate direct relationship information is input into a preset language model to obtain direct relationship information between the target entities, and the knowledge graph is completed based on the direct relationship information. Since this embodiment determines the direct relationship information between target entities in a knowledge graph based on a preset inference rule base and a preset language model that includes indirect and direct relationships between entities in the knowledge graph, and completes the knowledge graph based on the direct relationship information, compared to existing methods that use the symmetry of relationships to determine missing entity relationships in a knowledge graph, the above method in this embodiment uses a preset inference rule base for detection enhancement, which can accurately predict the direct relationship information between target entities and improve the accuracy of knowledge completion.

[0137] Based on the above-described embodiments of the knowledge completion device of this application, a second embodiment of the knowledge completion device of this application is proposed.

[0138] In this embodiment, the determining module 10 is further configured to determine the association path information between target entities in the knowledge graph;

[0139] The associated path information is preprocessed to obtain the indirect association information between the target entities.

[0140] Furthermore, the determining module 10 is also used to perform symbolic processing on the associated entities in the associated path information to obtain symbolic associated information;

[0141] The symbolic association information is pruned to obtain the indirect association information between the target entities.

[0142] Furthermore, the determining module 10 is also used to determine the number of connection paths between the target entities based on the symbolic association information;

[0143] Based on the number of connection paths, the symbolic association information is pruned to obtain the indirect association information between the target entities.

[0144] Furthermore, the retrieval module 20 is also used to determine the connected graph in the knowledge graph through a preset connected graph discovery algorithm;

[0145] The connected graph is preprocessed to obtain the indirect and direct relationships between the entities corresponding to the connected graph;

[0146] A pre-defined reasoning rule base is constructed based on the indirect and direct relationships.

[0147] Furthermore, the retrieval module 20 is also used to construct an input template based on the indirect relationship, the direct relationship, and the preset prompt template;

[0148] The input template is input into a preset language model to obtain a preset reasoning rule base output by the preset language model.

[0149] Furthermore, the retrieval module 20 is also used to prune the connected graph to obtain a first connected graph;

[0150] The frequency of each connected component in the first connected graph is counted, and duplicates in the first connected graph are removed based on the frequency to obtain the second connected graph;

[0151] Based on the second connected graph, determine the indirect and direct relationships between the entities corresponding to the connected graph.

[0152] Furthermore, the retrieval module 20 is also used to perform symbolization processing on each connected graph in the first connected graph to obtain a symbolized connected graph;

[0153] The frequency of the symbolic connected graph is counted, and duplicates are removed from the symbolic connected graph based on the frequency to obtain a second connected graph.

[0154] Furthermore, the retrieval module 20 is also used to store the preset reasoning rule base into an ES database or a Faiss vectorized database.

[0155] Furthermore, the knowledge completion module 30 is also used to determine the condition body corresponding to the candidate direct relationship information;

[0156] The input data is obtained by concatenating the candidate direct relationship information, the condition body, and the indirect association information;

[0157] The input data is input into a preset language model to obtain the direct relationship information between the target entities.

[0158] Furthermore, the retrieval module 20 is also used to perform a retrieval in a preset reasoning rule base based on the indirect association information to obtain conditional body information similar to the indirect association information;

[0159] The conditional body information is sorted according to similarity scores, and candidate direct relationship information corresponding to the target entity is determined based on the sorting results.

[0160] The knowledge completion device provided in this application, employing the knowledge completion method described in the above embodiments, can solve the technical problem of low efficiency in existing knowledge graph completion methods. Compared with the prior art, the beneficial effects of the knowledge completion device provided in this application are the same as those of the knowledge completion method described in the above embodiments, and other technical features in the knowledge completion device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0161] This application provides a knowledge completion device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the knowledge completion method in Embodiment 1 above.

[0162] The following is for reference. Figure 5 The diagram illustrates a structural schematic suitable for implementing the knowledge completion device in the embodiments of this application. The knowledge completion device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The knowledge completion device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0163] like Figure 5As shown, the knowledge completion device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the knowledge completion device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the knowledge completion device to communicate wirelessly or wiredly with other devices to exchange data. Although a knowledge completion device with various systems is shown in the figure, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented alternatively.

[0164] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0165] The knowledge completion device provided in this application, employing the knowledge completion method described in the above embodiments, can solve the technical problem of low efficiency in existing knowledge graph completion methods. Compared with the prior art, the beneficial effects of the knowledge completion device provided in this application are the same as those of the knowledge completion method described in the above embodiments, and other technical features of this knowledge completion device are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0166] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0167] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0168] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the knowledge completion method in the above embodiments.

[0169] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0170] The aforementioned computer-readable storage medium may be included in the knowledge completion device; or it may exist independently and not be assembled into the knowledge completion device.

[0171] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the knowledge completion device, cause the knowledge completion device to perform the aforementioned knowledge completion method.

[0172] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0173] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0174] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0175] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., computer programs) for executing the above-described knowledge completion method, thereby solving the technical problem of low efficiency in existing knowledge graph completion methods. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the knowledge completion method provided in the above embodiments, and will not be repeated here.

[0176] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the knowledge completion method described above.

[0177] The computer program product provided in this application can solve the technical problem of low efficiency in existing knowledge graph completion methods. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the knowledge completion method provided in the above embodiments, and will not be repeated here.

[0178] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

[0179] This application discloses A1. A knowledge completion method, the method comprising the following steps:

[0180] Determine the indirect relationships between target entities in the knowledge graph;

[0181] Based on the indirect association information, a search is performed in a preset reasoning rule base to obtain candidate direct relationship information corresponding to the target entity. The preset reasoning rule base includes indirect and direct relationships between entities in the knowledge graph.

[0182] The candidate direct relationship information is input into a preset language model to obtain the direct relationship information between the target entities, and the knowledge graph is completed based on the direct relationship information.

[0183] A2. The knowledge completion method as described in A1, wherein the step of determining the indirect association information between target entities in the knowledge graph includes:

[0184] Determine the association path information between target entities in the knowledge graph;

[0185] The associated path information is preprocessed to obtain the indirect association information between the target entities.

[0186] A3. The knowledge completion method as described in A2, wherein the step of preprocessing the associated path information to obtain the indirect association information between the target entities includes:

[0187] The associated entities in the associated path information are symbolized to obtain symbolic associated information;

[0188] The symbolic association information is pruned to obtain the indirect association information between the target entities.

[0189] A4. The knowledge completion method as described in A3, wherein the step of pruning the symbolic association information to obtain the indirect association information between the target entities includes:

[0190] The number of connection paths between the target entities is determined based on the symbolic association information;

[0191] Based on the number of connection paths, the symbolic association information is pruned to obtain the indirect association information between the target entities.

[0192] A5. The knowledge completion method as described in A1, prior to the step of retrieving candidate direct relationship information corresponding to the target entity based on the indirect association information in a preset reasoning rule base, further includes:

[0193] The connected graph in the knowledge graph is determined by a pre-defined connected graph discovery algorithm;

[0194] The connected graph is preprocessed to obtain the indirect and direct relationships between the entities corresponding to the connected graph;

[0195] A pre-defined reasoning rule base is constructed based on the indirect and direct relationships.

[0196] A6. The knowledge completion method as described in A5, wherein the step of constructing a preset reasoning rule base based on the indirect relationship and the direct relationship includes:

[0197] An input template is constructed based on the indirect relationship, the direct relationship, and the preset prompt template;

[0198] The input template is input into a preset language model to obtain a preset reasoning rule base output by the preset language model.

[0199] A7. The knowledge completion method as described in A5, wherein the step of preprocessing the connected graph to obtain the indirect and direct relationships between entities corresponding to the connected graph includes:

[0200] The connected graph is pruned to obtain a first connected graph;

[0201] The frequency of each connected component in the first connected graph is counted, and duplicates in the first connected graph are removed based on the frequency to obtain the second connected graph;

[0202] Based on the second connected graph, determine the indirect and direct relationships between the entities corresponding to the connected graph.

[0203] A8. The knowledge completion method as described in A7, wherein the step of counting the frequency of each connected graph in the first connected graph and removing duplicates from the first connected graph based on the frequency to obtain the second connected graph includes:

[0204] Each connected graph in the first connected graph is symbolized to obtain a symbolized connected graph;

[0205] The frequency of the symbolic connected graph is counted, and duplicates are removed from the symbolic connected graph based on the frequency to obtain a second connected graph.

[0206] A9. The knowledge completion method as described in A5, after the step of constructing a preset reasoning rule base based on the indirect relationship and the direct relationship, further includes:

[0207] The preset reasoning rule base is stored in the ES database or the Faiss vectorized database.

[0208] A10. The knowledge completion method as described in any one of A1-A9, wherein the step of inputting the candidate direct relationship information into a preset language model to obtain the direct relationship information between the target entities includes:

[0209] Determine the condition body corresponding to the candidate direct relationship information;

[0210] The input data is obtained by concatenating the candidate direct relationship information, the condition body, and the indirect association information;

[0211] The input data is input into a preset language model to obtain the direct relationship information between the target entities.

[0212] A11. The knowledge completion method as described in any one of A1-A9, wherein the step of retrieving candidate direct relationship information corresponding to the target entity based on the indirect association information in a preset reasoning rule base includes:

[0213] Based on the indirect association information, a search is performed in a preset reasoning rule base to obtain conditional body information similar to the indirect association information;

[0214] The conditional body information is sorted according to similarity scores, and candidate direct relationship information corresponding to the target entity is determined based on the sorting results.

[0215] This application discloses B12. A knowledge completion device, the knowledge completion device comprising:

[0216] The determination module is used to determine the indirect association information between target entities in the knowledge graph;

[0217] The retrieval module is used to perform a retrieval in a preset reasoning rule base based on the indirect association information to obtain candidate direct relationship information corresponding to the target entity. The preset reasoning rule base includes indirect and direct relationships between entities in the knowledge graph.

[0218] The knowledge completion module is used to input the candidate direct relationship information into a preset language model to obtain the direct relationship information between the target entities, and to complete the knowledge graph based on the direct relationship information.

[0219] B13. The knowledge completion device as described in B12, wherein the determining module is further configured to determine the association path information between target entities in the knowledge graph;

[0220] The associated path information is preprocessed to obtain the indirect association information between the target entities.

[0221] B14. The knowledge completion device as described in B13, wherein the determining module is further configured to perform symbolic processing on the associated entities in the associated path information to obtain symbolic associated information;

[0222] The symbolic association information is pruned to obtain the indirect association information between the target entities.

[0223] B15. The knowledge completion device as described in B14, wherein the determining module is further configured to determine the number of connection paths between the target entities based on the symbolic association information;

[0224] Based on the number of connection paths, the symbolic association information is pruned to obtain the indirect association information between the target entities.

[0225] B16. The knowledge completion device as described in B12, wherein the retrieval module is further configured to determine the connected graph in the knowledge graph through a preset connected graph discovery algorithm;

[0226] The connected graph is preprocessed to obtain the indirect and direct relationships between the entities corresponding to the connected graph;

[0227] A pre-defined reasoning rule base is constructed based on the indirect and direct relationships.

[0228] B17. The knowledge completion device as described in B16, wherein the retrieval module is further configured to construct an input template based on the indirect relationship, the direct relationship, and the preset prompt template;

[0229] The input template is input into a preset language model to obtain a preset reasoning rule base output by the preset language model.

[0230] This application discloses C18. A knowledge completion device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the knowledge completion method as described in any one of A1 to 11.

[0231] This application discloses D19. A storage medium, which is a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, it implements the steps of the knowledge completion method as described in any one of A1 to A11.

[0232] This application discloses E20. A computer program product comprising a computer program that, when executed by a processor, implements the steps of the knowledge completion method as described in any one of A1 to A11.

Claims

1. A knowledge completion method, characterized in that, The method includes the following steps: Determine the indirect relationships between target entities in the knowledge graph; Based on the indirect association information, a search is performed in a preset reasoning rule base to obtain candidate direct relationship information corresponding to the target entity. The preset reasoning rule base includes indirect and direct relationships between entities in the knowledge graph. The candidate direct relationship information is input into a preset language model to obtain the direct relationship information between the target entities, and the knowledge graph is completed based on the direct relationship information.

2. The knowledge completion method as described in claim 1, characterized in that, The step of determining the indirect association information between target entities in the knowledge graph includes: Determine the association path information between target entities in the knowledge graph; The associated path information is preprocessed to obtain the indirect association information between the target entities.

3. The knowledge completion method as described in claim 2, characterized in that, The step of preprocessing the associated path information to obtain the indirect association information between the target entities includes: The associated entities in the associated path information are symbolized to obtain symbolic associated information; The symbolic association information is pruned to obtain the indirect association information between the target entities.

4. The knowledge completion method as described in claim 3, characterized in that, The step of pruning the symbolic association information to obtain the indirect association information between the target entities includes: The number of connection paths between the target entities is determined based on the symbolic association information; Based on the number of connection paths, the symbolic association information is pruned to obtain the indirect association information between the target entities.

5. The knowledge completion method as described in claim 1, characterized in that, Before the step of retrieving candidate direct relationship information corresponding to the target entity based on the indirect association information in a preset reasoning rule base, the method further includes: The connected graph in the knowledge graph is determined by a pre-defined connected graph discovery algorithm; The connected graph is preprocessed to obtain the indirect and direct relationships between the entities corresponding to the connected graph; A pre-defined reasoning rule base is constructed based on the indirect and direct relationships.

6. The knowledge completion method as described in claim 5, characterized in that, The step of constructing a preset reasoning rule base based on the indirect relationship and the direct relationship includes: An input template is constructed based on the indirect relationship, the direct relationship, and the preset prompt template; The input template is input into a preset language model to obtain a preset reasoning rule base output by the preset language model.

7. A knowledge completion device, characterized in that, The knowledge completion device includes: The determination module is used to determine the indirect association information between target entities in the knowledge graph; The retrieval module is used to perform a retrieval in a preset reasoning rule base based on the indirect association information to obtain candidate direct relationship information corresponding to the target entity. The preset reasoning rule base includes indirect and direct relationships between entities in the knowledge graph. The knowledge completion module is used to input the candidate direct relationship information into a preset language model to obtain the direct relationship information between the target entities, and to complete the knowledge graph based on the direct relationship information.

8. A knowledge completion device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the knowledge completion method as described in any one of claims 1 to 6.

9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the knowledge completion method as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the knowledge completion method as described in any one of claims 1 to 6.