Knowledge graph completion method, device and product
By traversing the subgraphs of the knowledge graph and generating candidate triple information using a large generative model, enhanced retrieval and questioning are performed. Combined with an arbitration model to determine confidence, the problem of balancing accuracy and consistency in knowledge graph completion is solved, achieving highly reliable enterprise-level knowledge management.
Patent Information
- Application Number
- CN202511302201.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-12
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-09-12
AI Technical Summary
Existing knowledge graph completion methods struggle to balance accuracy and consistency, failing to meet the high reliability requirements of enterprise-level knowledge management.
By traversing the knowledge graph subgraphs, generating candidate triple information using a large generative model, and performing enhanced retrieval, counterexamples and counterfactual questions are constructed by questioning the large model. Finally, an arbitration model is used to synthesize opinions from all parties and determine the confidence level of the candidate triples to ensure the quality of the completion.
It improves the accuracy and reliability of knowledge graph completion, is applicable to various enterprise-level knowledge management systems, and balances semantic richness with structural consistency.
Smart Images

Figure CN120806103B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information technology, and in particular to a knowledge graph completion method, device and product. Background Technology
[0002] Knowledge graphs, as a structured representation of entities and their relationships, have been widely used in fields such as search recommendation, intelligent question answering, and risk identification. However, in actual construction, due to limitations in data acquisition costs and the difficulty of relationship annotation, knowledge graphs often suffer from missing relationships or incomplete triples, which significantly affects the accuracy and robustness of downstream tasks.
[0003] To alleviate the sparsity of knowledge graphs, knowledge graph completion (KGC) has gradually become a research hotspot. Existing methods mainly include: graph embedding-based completion methods (such as TransE and RotatE), which model the potential associations between entities and relations through vector space, but struggle to capture complex reasoning paths and have insufficient generalization ability; rule- and path-based reasoning methods (such as logical rule extraction and path ranking), which have a certain degree of interpretability, but rely on explicit paths and are difficult to adapt to large-scale knowledge graphs; and methods based on pre-trained language models that have emerged in recent years (such as "GPT (Generative Pre-trained Transformer)" and "Qwen"), which can use natural language to generate and complete missing relations, showing strong potential, but due to the lack of structured constraints, they are prone to generating fictitious triples, resulting in insufficient reliability.
[0004] In summary, there is currently a lack of a universal completion method that can balance accuracy, consistency, and verifiability, making it difficult to meet the high reliability and controllability requirements of enterprise-level knowledge management. Summary of the Invention
[0005] One objective of this application is to provide knowledge graph completion methods, devices, and products, at least to address the problem that it is difficult to balance accuracy and consistency in knowledge graph completion results, making it difficult to meet the high reliability requirements of enterprise-level knowledge management.
[0006] To achieve the above objectives, some embodiments of this application provide the following aspects:
[0007] Firstly, this application provides a knowledge graph completion method, which includes:
[0008] Traverse the subgraphs of the knowledge graph to be completed to obtain the structure and context information of the subgraphs to be completed.
[0009] Construct prompt text based on the structure of the subgraph to be completed and the context information;
[0010] Based on the prompt text, candidate triplet information is generated using a large model.
[0011] The candidate triplet information is enhanced to obtain retrieval information;
[0012] The large-scale model generates questioning information based on the candidate triplet information and the retrieval information.
[0013] The confidence level is calculated using the arbitration big model based on the candidate triplet information, the retrieval information, and the challenge information.
[0014] In response to the confidence level being greater than or equal to a preset threshold, the candidate triplet information is saved.
[0015] Secondly, this application also provides an electronic device, the electronic device comprising:
[0016] One or more processors; and
[0017] A memory storing computer program instructions, which, when executed, cause the processor to perform the steps of any of the methods described above.
[0018] Thirdly, this application also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of any of the methods described above.
[0019] Compared with related technologies, the solution provided in this application traverses the subgraphs of the knowledge graph, utilizes the language generation capabilities of the large-scale model to generate candidate triple information based on the prompt text, performs enhanced retrieval, actively constructs counterexamples and counterfactual questions by questioning the large-scale model, and then uses an arbitration model to synthesize opinions from all parties to determine the confidence level of the candidate triples, thereby ensuring the quality of the completion, ensuring the reliability of each generated triple data, taking into account both semantic richness and structural consistency, improving the accuracy of the completed knowledge graph, and is applicable to various enterprise-level knowledge management systems. Attached Figure Description
[0020] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0021] Figure 1 A flowchart of a knowledge graph completion method provided as an exemplary embodiment of this disclosure;
[0022] Figure 2An exemplary structural diagram of the electronic device provided for some embodiments of this application. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] Figure 1 A knowledge graph completion method is provided as an exemplary embodiment of this disclosure. The knowledge graph completion method includes:
[0025] S101. Traverse the subgraphs of the knowledge graph to be completed and obtain the structure and context information of the subgraphs to be completed.
[0026] Specifically, the local subgraphs of the knowledge graph to be completed are directly traversed to obtain the subgraph topology (nodes, edges, paths), entity type labels (such as "disease" and "drug"), relation semantic constraints (including the domain and range of the relation in the knowledge graph ontology, i.e., the allowed set of head and tail entity types), examples (the tail entity type of the relation "treatment" should be "disease" or "symptom"), historical completion records, and knowledge version information. The relation semantic constraints are derived from: the knowledge graph's own ontology (schema) definition, the type rules of external standard knowledge bases (such as UMLS, SNOMED CT, and Wikidata), and high-frequency patterns based on statistical induction of graph data.
[0027] Taking medical knowledge graph completion as an example, the scenario involves a hospital constructing a diabetes-related knowledge graph, which lacks some treatment and complication information. This step is the starting point of the entire medical knowledge graph completion process. Its core objective is to detect and locate key information such as missing treatment plans and complication relationships in the hospital's existing knowledge graph under the theme of "diabetes." This can be achieved by using the "diabetes" entity as an anchor point and utilizing graph databases (such as Neo4j) or graph embedding search engines to extract all nodes and edges within a radius of k hops (k≥2). By traversing the relevant subgraphs, the subgraph structure and existing triples can be obtained, and the triples that need to be completed can be determined.
[0028] S102. Construct prompt text based on the structure of the subgraph to be completed and the context information.
[0029] Specifically, prompt text is constructed based on subgraph information, for example:
[0030] Given: (diabetes, complications, retinopathy), (diabetes, treatment, metformin). Please complete the 'complications' of another 'diabetes', output in the format: (head entity, relation, tail entity), with a reason for generation.
[0031] The output must strictly follow the following format example:
[0032] json
[0033] {
[0034] "triple":["diabetes","complications","xx"],
[0035] "reasoning":"xxxxx",
[0036] "evidence":"xxxxx",
[0037] }
[0038] "
[0039] S103. Generate candidate triplet information by generating a large model based on the prompt text.
[0040] Specifically, the above prompt text is input into the large model to obtain a structured output.
[0041] Based on the constructed prompt text, the input is fed into a large-scale model to generate formatted triples. The large-scale model can be a large language model (LLM) such as GPT or Qwen. A formatted triple refers to a triple with a specific structure, including a head entity, a relation, and a tail entity, represented in the format (head entity, relation, tail entity). The candidate triple information generated from the prompt text includes the triple T_c, along with reasoning and evidence, where reasoning and evidence constitute the generated reason R_gen.
[0042] For example:
[0043] {
[0044] "triple":["diabetes","complications","fatigue"],
[0045] "reasoning": "Fatigue is a common symptom in diabetic patients. Long-term high blood sugar affects the function of the nervous system, leading to abnormal energy metabolism."
[0046] "evidence": "Some documents indicate that approximately 60% of diabetic patients report chronic fatigue."
[0047] }
[0048] S104. Enhance the retrieval of the candidate triplet information to obtain retrieval information.
[0049] Specifically, based on the candidate triples T_c and R_gen, a search query is constructed. For example, the above candidate triple information can be used to construct "latest research on fatigue as a complication of diabetes". Then, the knowledge base interface is called to execute the search. The latest research results related to T_c are obtained as external validation evidence, and sample search results are provided. For example:
[0050] “A 2023 study stated: ‘Chronic Fatigue Syndrome is not a direct complication of type 2 diabetes: a cohort study,’ indicating a correlation between chronic fatigue syndrome and diabetes, but no direct causal evidence.”
[0051] The retrieved information will be denoted as R_rag for use in subsequent challenges and arbitration.
[0052] S105. Generate questioning information based on the candidate triplet information and the retrieval information using the questioning big model.
[0053] Specifically, the large-scale questioning model is used to generate counterexamples and questioning information from a language model, which questions the candidate triplet information and outputs questioning information.
[0054] For example, one could question this using R_gen and R_rag. For instance, "Fatigue is a common symptom in diabetic patients. Long-term high blood sugar affects the nervous system function, leading to abnormal energy metabolism. Some documents indicate that approximately 60% of diabetic patients report chronic fatigue. A 2023 study stated: 'Chronic Fatigue Syndrome is not a direct complication of type 2 diabetes: a cohort study,' indicating a correlation between chronic fatigue syndrome and diabetes, but without direct causal evidence. Does this affect the conclusion?"
[0055] Multiple instantiated question statements, R_gen, and R_rag are input into the large question model, which generates a semantically coherent and naturally phrased final question prompt:
[0056] "Fatigue is a common symptom in diabetic patients. Long-term high blood sugar affects the function of the nervous system, leading to abnormal energy metabolism. Some documents indicate that about 60% of diabetic patients report chronic fatigue. A 2023 study stated: 'Chronic Fatigue Syndrome is not a direct complication of type 2 diabetes: a cohort study,' indicating a correlation between chronic fatigue syndrome and diabetes, but without direct causal evidence. Does this affect the conclusion?"
[0057] The large model outputs questioning information including a questioning strength score and a questioning reason. The questioning strength score S_skeptic∈[0,1], for example: S_skeptic=0.7, reason: research shows that it was not listed as an independent complication; and the new study questions causality.
[0058] S106. Calculate the confidence level using the arbitration big model based on the candidate triplet information, the retrieval information, and the challenge information.
[0059] Receive candidate triples T_c, generation reasons R_gen, RAG retrieval results R_rag, and challenge information; construct the structured arbitration prompt text P_arbitrate and input it into the large arbitration model, as shown in the example below:
[0060] You are a medical knowledge graph reviewer. Please evaluate the credibility of the following candidate triples:
[0061] [Candidate Triple Pair]
[0062] (Diabetes, complications, fatigue)
[0063] [Reason for generation]
[0064] Reasoning: Fatigue is a common symptom in diabetic patients. Long-term high blood sugar affects the function of the nervous system, leading to abnormal energy metabolism.
[0065] Evidence: Some documents indicate that approximately 60% of people with diabetes report chronic fatigue.
[0066]
RAG search result: R_rag
[0067] A 2023 study stated: 'Chronic Fatigue Syndrome is not a direct complication of type 2 diabetes: a cohort study', indicating that there is a correlation between chronic fatigue syndrome and diabetes, but no direct causal evidence.
[0068] [Points of contention]
[0069] "Fatigue" is a symptom, not a disease; and new research questions causality.
[0070] S_skeptic=0.7
[0071] Please output:
[0072] 1. Overall confidence level (between 0 and 1, rounded to two decimal places)
[0073] 2. Does it support writing? (Yes / No)
[0074] 3. Reasons for the ruling (explaining the basis for the scoring)
[0075] The output must strictly follow the following format example:
[0076] {
[0077] "confidence":"xx",
[0078] "decision": "yes or no",
[0079] "reason":"xxxx"
[0080] }
[0081] S107. In response to the confidence level being greater than or equal to a preset threshold, the candidate triplet information is saved.
[0082] If a preset threshold C is set (e.g., 0.8), then if the confidence level of the candidate triplet information is greater than 0.8, the candidate triplet information will be saved.
[0083] Candidate triples are written into the knowledge graph and synchronized to the evolutionary memory. The information saved includes: assigning confidence scores to candidate triples; recording the generation time, R_gen, R_rag, and verification path (input and output of the entire generation model, questioning model, and arbitration model).
[0084] The aforementioned large-scale model for generation, questioning, and arbitration can be the same large-scale model or multiple large-scale models. The types of large-scale models can be different, or they can be large-scale models trained for a specific scenario, or general large-scale models such as GPT, Qwen, and other large language models (LLM).
[0085] In this embodiment, after traversing the subgraphs of the knowledge graph, the language generation capability of the large-scale model is used to generate candidate triple information based on the prompt text. After enhanced retrieval, the large-scale model actively constructs counterexamples and counterfactual questions. Then, the arbitration model integrates the opinions of all parties and determines the confidence level of the candidate triples to ensure the completion quality. This ensures that each generated triple data is reliable, takes into account both semantic richness and structural consistency, and improves the accuracy of the completed knowledge graph. It is suitable for various enterprise-level knowledge management systems.
[0086] In one embodiment, the knowledge graph completion method further includes:
[0087] The candidate triplet information is verified for type consistency and / or detected for semantic conflict and / or for common sense violation by using a large inference model, and logical consistency information is output.
[0088] The confidence level is calculated using the arbitration big data model based on the candidate triplet information, the retrieval information, the logical consistency information, and the challenge information.
[0089] Specifically, a large inference model is used to check whether candidate triples violate graph logic. This large inference model can be a general-purpose model or a model trained specifically for inference. This includes type consistency, semantic conflict detection, and common sense violation detection.
[0090] For example: Type consistency: The tail entity "fatigue" belongs to the "symptom" class, while the value range constraint of the "complication" relation belongs to the "disease" class, so the types are inconsistent.
[0091] Semantic conflict detection: Are there any semantically opposite relationships to "complications" (such as "alleviate", "improve", "reduce") pointing to the same tail entity "fatigue"? Table 1 shows the semantic opposition relationships.
[0092] For example, if the graph contains (metformin, relief, fatigue) and (metformin, treatment, diabetes), it indicates that "fatigue" is an modifiable symptom and may not be suitable as a stable "complication" of "diabetes".
[0093] Violation of common sense: Does it violate common medical knowledge?
[0094] The output logical consistency information includes a logical consistency score and a reason. The logical consistency score is S_logic∈[0,1], for example: S_logic=0.2, and the reason is: (Type inconsistency: the tail entity "fatigue" belongs to the "symptom" class, but the "complication" relationship requires the "disease" class).
[0095] Through the above steps, the large-scale reasoning model can provide a logical verification mechanism based on logical rules, semantic consistency, and common-sense constraints, enabling the large-scale arbitration model to comprehensively consider semantic, logical, and factual factors when calculating confidence.
[0096] Table 1
[0097]
[0098] In this embodiment, by adding a large reasoning model to perform logical reasoning verification on the candidate triple information, it is possible to further constrain the type, semantics, and common sense of the candidate triples, ensuring that each generated triple has "semantic support", taking into account both semantic richness and structural consistency, and improving the accuracy of the completed knowledge graph.
[0099] In one embodiment, after the step of saving the candidate triplet information in response to the confidence level being greater than or equal to a preset threshold, the knowledge graph completion method further includes:
[0100] The confidence level of the candidate triplet information decreases over time;
[0101] In response to the confidence level being less than a preset threshold, the confidence level of the candidate triplet information is recalculated.
[0102] In one embodiment, the knowledge graph completion method further includes periodically recalculating the confidence level of the candidate triplet information.
[0103] Specifically, the knowledge credit score of all elements written into the triple decays over time:
[0104]
[0105] Where S(t) is the confidence level at time t. Let t be the initial knowledge credit score and t be the current time. λ is the write time of the triplet, and λ is the decay coefficient.
[0106] S(t) represents the confidence level of the triple at the current moment, with a value ranging from [0,1]. The lower the score, the more likely the knowledge is to be outdated and needs to be re-verified. For example, S(2025) = 0.5 means that the confidence level of the triple in 2025 is 0.5. This is the confidence level assigned when the triple is first validated and written into the graph. This value is determined by the confidence score of the large arbitration model. For example, if the large arbitration model outputs a confidence score of 0.8, then... t represents the real-time time when confidence calculation or revalidation decision is performed, such as the current system time: August 19, 2025. The timestamp for the first successful writing of this triple into the knowledge graph, accurate to the day or hour, for example... . This represents the duration of the triplet, the time elapsed since the triplet was written, usually in years. If t and In terms of years, then This indicates the number of years that have passed. For example, t=2025. ,but Year. λ is a parameter that controls the rate at which credit scores decay, λ>0. The larger λ is, the faster the triplet becomes obsolete. For example, in the medical field: λ≈0.1 / year (it takes about 7 years to decay to 50% of the initial value).
[0107] As confidence levels decrease over time, automatic revalidation should be initiated for triples with credit scores below a threshold, or periodically (e.g., quarterly). The RAG search can be re-executed to check for support from the latest literature, update the credit score, or mark the triple as "pending manual review."
[0108] In this embodiment, confidence is correlated with time. The confidence of triples naturally decreases over time, avoiding long-term reliance on outdated or invalid knowledge. When the credit score falls below a threshold, revalidation is automatically triggered. For example, by searching for the latest papers, databases, or authoritative sources through RAG, outdated knowledge can be automatically discovered, updated, or even replaced without human intervention. This decay + revalidation mechanism upgrades the knowledge graph from "static storage" to "dynamic evolution," ensuring its timeliness, reliability, and self-updating capabilities.
[0109] In one embodiment, generating challenge information from the candidate triplet information and the retrieval information using a challenge model specifically includes:
[0110] The candidate triplet information is subject to type-based and / or time-based questioning.
[0111] The model generates a skepticism score and the reasons for the skepticism by questioning the big data model, and outputs the skepticism information.
[0112] Specifically, the large-scale questioning model generates questioning content based on a template library. It matches templates from a pre-defined questioning prompt template library according to the relation type r of T_c and the entity category. The templates are shown in the table below:
[0113] Table 2
[0114]
[0115] Replace variables in the matching template with actual values (variable population):
[0116] T01 Template:
[0117] "{tail_entity} belongs to type {type}, but this relationship usually requires the tail entity to be {expected_type}. Is there an error?"
[0118] After filling:
[0119] "Fatigue is a symptom type, but this relationship usually requires the tail entity to be a disease. Is there an error?"
[0120] Here, {tail_entity} represents the tail entity of the triple, that is, the entity that the relation points to. For example, in the example, it is "fatigue".
[0121] {type} indicates the type of the tail entity currently labeled or identified. For example, "symptoms" in the example.
[0122] {expected_type} indicates the type requirement of the tail entity for this relation, that is, the type to which the tail entity should belong according to the definition of the relation in the knowledge graph. For example, in the example "disease", it means that the "complications" relation usually requires the tail entity to be of the "disease" category.
[0123] T05 Template:
[0124] Is this knowledge based on earlier research? Do {R_gen} and {R_rag} affect the conclusion?
[0125] Enhancement by combining R_gen and R_rag:
[0126] "Is this knowledge based on earlier research? Fatigue is a common symptom in diabetic patients. Long-term high blood sugar affects the nervous system function, leading to abnormal energy metabolism. Some documents indicate that about 60% of diabetic patients report chronic fatigue. A 2023 study stated: 'Chronic Fatigue Syndrome is not a direct complication of type 2 diabetes: a cohort study,' indicating a correlation between chronic fatigue syndrome and diabetes, but without direct causal evidence. Does this affect the conclusion?"
[0127] Multiple instantiated question statements, R_gen, and R_rag are input into the large question model, which generates a semantically coherent and naturally phrased final question prompt:
[0128] "Is there an error in the claim that 'fatigue' is a symptom type, but this relationship usually requires the tail entity to be a disease type? Furthermore, is this knowledge based on earlier research? Fatigue is a common symptom in diabetic patients; long-term hyperglycemia affects nervous system function, leading to abnormal energy metabolism. Some documents state that approximately 60% of diabetic patients report chronic fatigue. A 2023 study stated: 'Chronic Fatigue Syndrome is not a direct complication of type 2 diabetes: a cohort study,' indicating a correlation between chronic fatigue syndrome and diabetes, but without direct causal evidence. Does this affect the conclusion?"
[0129] The large model outputs a skepticism strength score S_skeptic∈[0,1], with an example S_skeptic=0.7, based on the following reasons: "fatigue" is a symptom rather than a disease and is not listed as an independent complication; and the new study questions causality.
[0130] In this embodiment, questioning the type of the large model (such as whether the entity category matches) can quickly identify structural errors (e.g., "fatigue" being incorrectly labeled as a disease). Questioning the timeliness of the data can uncover outdated conclusions or conflicts between old and new research, avoiding reliance on stale information. This makes subsequent arbitration more accurate, reduces the influx of "illusory knowledge" or erroneous triples into the final knowledge base, and improves overall credibility.
[0131] In one embodiment, the knowledge graph completion method further includes adding a counterexample to the knowledge base in response to a questioning score greater than a questioning score threshold in the questioning information.
[0132] Specifically, the counterexample information is used to explicitly label the candidate triplet as potentially erroneous or controversial within the current semantic context or research conclusion. For example, if the large model identifies entity type mismatch and insufficient causality in the candidate triplet "fatigue → complications → diabetes," and the output challenge score S_skeptic = 0.8, which is greater than a preset threshold (e.g., 0.6), then a corresponding counterexample triplet "fatigue → non-complications → diabetes" is generated, and this counterexample is stored in the knowledge base in labeled form. The advantage of this approach is that by introducing counterexamples, not only can erroneous knowledge be prevented from being directly adopted, but comparative evidence can also be provided for subsequent training, inference, and arbitration.
[0133] In one embodiment, the knowledge graph completion method further includes, in response to the timeliness judgment of the challenged big model, if the timeliness of the candidate triple information is higher than that of the retrieved information, saving the candidate triple information to the knowledge base.
[0134] Specifically, the timeliness is determined by comprehensively comparing the publication time, citation count, and source authority of the candidate triples and the retrieved information. For example, if the candidate triples come from the latest clinical research in 2024, while the supporting information retrieved mainly comes from review articles in 2018, it is determined that the retrieved information R_rag cites outdated literature. In this case, R_gen in the candidate triples information will replace the R_rag information in the knowledge base. This avoids discarding new knowledge due to interference from old literature or outdated data, ensuring that the knowledge base can promptly absorb cutting-edge research results, thereby better serving subsequent challenges and arbitrations.
[0135] In this embodiment, by automatically generating and storing counterexamples when the challenge score exceeds a threshold, not only can erroneous or unreliable candidate triples be effectively prevented from directly entering the knowledge base, but the content of the knowledge graph is also enriched through comparison. This allows subsequent arbitration models and inference engines to simultaneously refer to both "positive examples" and "counterexamples" when making judgments, improving the accuracy and robustness of reasoning. Simultaneously, combined with the timeliness judgment mechanism of the challenge model, more timely knowledge items can be automatically identified and prioritized among multiple candidate pieces of evidence, ensuring that the information stored in the knowledge base is more consistent with current research progress and the state of fact. Through the combination of these two aspects, the credibility, timeliness, and interpretability of the knowledge base are significantly improved.
[0136] In one embodiment, the knowledge graph completion method further includes:
[0137] The logical consistency information includes a logical consistency score. In response to a logical consistency score that is less than a logical consistency threshold, a type constraint is added to the logical large model.
[0138] Specifically, the logical consistency score is used to characterize the degree of matching between the candidate triple and the existing relational patterns and type rules in the existing knowledge base, with a value range of [0,1]. When the score is lower than a preset threshold (e.g., 0.5), it indicates that the candidate triple has obvious inconsistencies or conflicts at the logical level. For example, if the candidate triple is "fatigue → belongs to → disease", while the existing relational constraints in the knowledge base require that the tail entity type of the "belongs to (∈)" relation should be "disease classification", then the logical consistency detection result may determine that the tail entity type of the triple does not match, and output a logical consistency score S_logic=0.3, which is lower than the threshold of 0.5.
[0139] In this scenario, type constraints will be automatically generated to prevent similar errors from recurring in future knowledge reasoning or triple generation processes of the large logic model. For example, a rule can be added to the constraint library of the large logic model: "If the relation r = 'belongs to,' then the tail entity type must be {disease classification}." When the large logic model generates candidate triples involving the "belongs to" relation again, the constraint mechanism will prioritize validating the tail entity type. If it does not conform to the preset rule, the confidence level will be automatically reduced, or the output will be rejected directly.
[0140] In this embodiment, by introducing a type constraint mechanism driven by logical consistency scoring, the large logical model can gradually learn and solidify logical rules during continuous iteration, thereby reducing the occurrence of repeated errors and ensuring the consistency, rigor, and scalability of the knowledge graph at the semantic reasoning level.
[0141] In one embodiment, the knowledge graph completion method further includes:
[0142] In response to the confidence level being less than a preset threshold, the candidate triplet information is discarded;
[0143] Based on the prompt text, the large model is invoked again to regenerate the candidate triplet information;
[0144] The confidence level of the candidate triplet information is kept greater than or equal to a preset threshold until the confidence level is greater than or equal to the preset threshold.
[0145] Specifically, the lower the confidence level of a candidate triplet, the lower the credibility of the proof. Therefore, candidate triplets with low confidence levels are discarded. After discarding the candidate triplets, candidate triplet information is regenerated based on the prompt text. The regenerated candidate triplet information undergoes verification steps such as retrieval, challenge, and arbitration again, and the confidence level is regenerated through the arbitration model. This process continues until the confidence level of the candidate triplet information is greater than or equal to a preset threshold, at which point the triplet is saved and output.
[0146] In this embodiment, the automatic discarding and iterative regeneration mechanism of low-confidence candidate triples effectively prevents unreliable knowledge from directly entering the knowledge graph. Candidate triples are then generated again, and sequentially undergo retrieval, questioning, and arbitration processes to ensure that the generated results are accepted only after multiple verifications. This not only significantly improves the accuracy and credibility of candidate triples but also establishes a process similar to "adaptive training," enabling the large-scale model to gradually converge to the correct output through multiple iterations, thereby improving the stability and robustness of the entire knowledge completion process. Furthermore, this mechanism, while ensuring the quality of candidate triple data, makes knowledge graph construction more automated and intelligent, possessing self-correction and evolutionary capabilities. Through continuous generation and verification matching, the large-scale model continuously outputs triple data, integrating generation, verification, reasoning, questioning, and arbitration into an adaptive pipeline, reducing manual intervention and automatically generating qualified triple data.
[0147] In one embodiment, the knowledge graph completion method further includes:
[0148] If the number of candidate triplet information generated exceeds the maximum number of generation times, stop generating candidate triplet information.
[0149] Specifically, if the number of times candidate triple information is generated exceeds the maximum number of generation times (default 3), and the confidence level of the generated candidate triple information is still lower than the preset threshold, then a mark is made, and the generation process terminates to prevent infinite loops. This completion point is marked as completion failed, pending manual confirmation for subsequent review or manual annotation.
[0150] In one embodiment, the knowledge graph completion method further includes:
[0151] If the time taken to generate candidate triplet information exceeds the maximum time threshold, stop generating candidate triplet information.
[0152] Specifically, you can also stop the generation and report an error if the timeout is exceeded by setting a maximum time threshold and a maximum time consumption per round (default 120s, including LLM generation and verification time).
[0153] In one embodiment, the knowledge graph completion method further includes:
[0154] When the consumption of text units generated from candidate triplet information exceeds the maximum text unit threshold, the generation of candidate triplet information is stopped.
[0155] Specifically, you can also stop generating tokens and issue an error message by setting the maximum token (text unit) threshold and the maximum token consumption per round (default 2M).
[0156] In the above embodiments, by limiting the number of generation attempts, generation time, and token consumption, infinite loops are prevented, waiting time is saved, and token consumption is reduced.
[0157] Furthermore, some embodiments of this application also provide an electronic device. The electronic device can be various forms of digital computer, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, etc. The electronic device can also be various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices.
[0158] The electronic device includes: one or more processors; and a memory storing computer program instructions that, when executed, cause the processor to perform the steps of the methods provided in any one or more of the above embodiments. Figure 2 An exemplary structural diagram of the electronic device is disclosed. The electronic device includes one or more processors 1101, a memory 1102, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components are interconnected via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In some other embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations. The components, their connections and relationships, and their functions shown herein are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.
[0159] The electronic device may further include an input device 1103 and an output device 1104. The processor 1101, memory 1102, input device 1103 and output device 1104 may be connected by a bus or other means, as shown in the figure, which is connected by a bus.
[0160] Input device 1103 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the electronic device, such as a touch screen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 1104 may include a display device, auxiliary lighting device (e.g., LED), and haptic feedback device (e.g., vibration motor). The display device may include, but is not limited to, a liquid crystal display, a light-emitting diode display, and a plasma display. In some embodiments, the display device may be a touch screen.
[0161] To provide interaction with the user, the electronic device can be a computer. The computer has: a display device (e.g., a cathode ray tube or LCD monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback); and input from the user can be received in any form (e.g., voice input or tactile input).
[0162] In this embodiment, a computer-readable medium stores a computer program / instructions that, when executed by a processor, implement the steps of the methods provided in any one or more of the above embodiments. This computer-readable medium may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into that device. The aforementioned computer-readable medium carries one or more computer-readable instructions.
[0163] The memory 1102 can serve as a non-transitory computer-readable storage medium, used to store non-transitory software programs, non-transitory computer-executable programs, and modules. The processor 1101 executes various functional applications and data processing of the server by running the non-transitory software programs, instructions, and modules stored in the memory 1102, thereby implementing the program instructions / modules corresponding to the methods provided in any one or more of the embodiments described above in this application.
[0164] The memory 1102 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device. Furthermore, the memory 1102 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 1102 may optionally include memory remotely located relative to the processor 1101, and these remote memories can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0165] It should be noted that the computer-readable medium described in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. Computer-readable media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or 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, read-only memory, erasable programmable read-only memory, optical fibers, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0166] Computer-readable media include permanent and non-permanent, removable and non-removable media, which can store information by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory, static random access memory, dynamic random access memory, other types of random access memory, read-only memory, electrically erasable programmable read-only memory, flash memory or other memory technologies, read-only optical discs, digital versatile optical discs or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0167] 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 C or similar 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 local area networks (LANs) or wide area networks (WANs), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0168] In the above embodiments, all or part of the implementation can be achieved through software, hardware, firmware, or any combination thereof. For example, it can be implemented using an application-specific integrated circuit (ASIC), a general-purpose computer, or any other similar hardware device. In some embodiments, the software program of this application can be executed by a processor to implement the above steps or functions. Similarly, the software program of this application (including related data structures) can be stored in a computer-readable recording medium, such as RAM memory, magnetic or optical drives, floppy disks, and similar devices. In addition, some steps or functions of this application can be implemented in hardware, for example, as circuitry that cooperates with a processor to perform the various steps or functions.
[0169] The computer program product provided in this application includes one or more computer programs / instructions. When executed by a processor, these computer programs / instructions generate, in whole or in part, the processes or functions described in this application. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0170] The flowcharts or block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, 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, may be implemented using a dedicated hardware-specific system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0171] The scope of this application is defined by the appended claims rather than the foregoing description, and is therefore intended to encompass all variations falling within the meaning and scope of equivalents of the claims. Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in the apparatus claims may also be implemented by a single unit or device in software or hardware. Terms such as "first," "second," etc., are used only for distinguishing descriptions and do not indicate any particular order, nor should they be construed as indicating or implying relative importance.
[0172] 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 made 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, and the above embodiments should be regarded as exemplary and non-limiting.
Claims
1. A knowledge graph completion method, characterized in that, The knowledge graph completion method includes: Traverse the subgraphs of the knowledge graph to be completed to obtain the structure and context information of the subgraphs to be completed. Construct prompt text based on the structure of the subgraph to be completed and the context information; Based on the prompt text, candidate triplet information is generated using a large model. The candidate triplet information is enhanced to obtain retrieval information; The large-scale model generates questioning information based on the candidate triplet information and the retrieval information. The questioning model is a language model that generates counterexamples and questioning information, questions the candidate triplet information, and outputs questioning information. The confidence level is calculated using the arbitration big model based on the candidate triplet information, the retrieval information, and the challenge information. In response to the confidence level being greater than or equal to a preset threshold, the candidate triplet information is saved.
2. The knowledge graph completion method according to claim 1, characterized in that, The knowledge graph completion method also includes: The candidate triplet information is verified for type consistency and / or detected for semantic conflict and / or for common sense violation by using a large inference model, and logical consistency information is output. The confidence level is calculated using the arbitration big data model based on the candidate triplet information, the retrieval information, the logical consistency information, and the challenge information.
3. The knowledge graph completion method according to claim 1 or 2, characterized in that, Following the step of saving the candidate triplet information in response to a confidence level greater than or equal to a preset threshold, the knowledge graph completion method further includes: The confidence level of the candidate triplet information decreases over time; In response to the confidence level being less than a preset threshold, the confidence level of the candidate triplet information is recalculated. and / or; The confidence level of the candidate triplet information is recalculated periodically.
4. The knowledge graph completion method according to claim 1 or 2, characterized in that, The step of generating questioning information from the candidate triplet information and the retrieval information through a questioning model specifically includes: The candidate triplet information is subject to type-based and / or time-based questioning. The model generates a skepticism score and the reasons for the skepticism by questioning the big data model, and outputs the skepticism information.
5. The knowledge graph completion method according to claim 4, characterized in that, The knowledge graph completion method also includes: If the question score in the question information is greater than the question score threshold, add a counterexample to the knowledge base; and / or; In response to the timeliness judgment of the challenged big model, if the timeliness of the candidate triple information is higher than that of the retrieved information, the candidate triple information is saved to the knowledge base.
6. The knowledge graph completion method according to claim 2, characterized in that, The knowledge graph completion method also includes: The logical consistency information includes a logical consistency score. In response to a logical consistency score that is less than a logical consistency threshold, a type constraint is added to the logical large model.
7. The knowledge graph completion method according to claim 1 or 2, characterized in that, The knowledge graph completion method also includes: In response to the confidence level being less than a preset threshold, the candidate triplet information is discarded; Based on the prompt text, the large model is invoked again to regenerate the candidate triplet information; The confidence level of the candidate triplet information is kept greater than or equal to a preset threshold until the confidence level is greater than or equal to the preset threshold.
8. The knowledge graph completion method according to claim 1 or 2, characterized in that, The knowledge graph completion method also includes: In response to the fact that the number of times the candidate triplet information is generated exceeds the maximum number of times it can be generated, the generation of the candidate triplet information is stopped. And / or in response to the candidate triplet information generation time being greater than the maximum time threshold, stop generating the candidate triplet information; And / or in response to a candidate triplet information generation text unit consumption exceeding the maximum text unit threshold, stop generating candidate triplet information.
9. An electronic device, characterized in that, The electronic device includes: One or more processors; and A memory storing computer program instructions, which, when executed, cause the processor to perform the steps of the method as described in any one of claims 1 to 8.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Collaborative system and method for validating equipment failure models in an analytics crowdsourcing environment
CA3178658A1
Method and device for complementing knowledge graph and computer storage medium
CN117094395A