Knowledge graph updating method and electronic equipment

By obtaining the conversation information of users interacting with the large model, determining user behavior patterns and making inferences, and updating the knowledge graph, the problems of knowledge sparsity and uncertainty in GraphRAG are solved, and dynamic updates of the knowledge graph and accurate knowledge queries are achieved.

CN120654790APending Publication Date: 2025-09-16LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510727578.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

GraphRAG faces problems of knowledge sparsity, demand diversity and dynamism, and knowledge uncertainty in the process of knowledge graph construction and expansion, which leads to the inability of knowledge graph to meet user query needs in a timely manner and the generation of low-quality or contradictory knowledge.

Method used

By obtaining the conversation information during the interaction between the user and the big model, the user behavior pattern is determined, the big model is used to reason about the conversation information, and the knowledge graph is updated based on the reasoning results, including completing knowledge, adjusting or correcting existing knowledge, and using the representation learning model for vectorized representation and confidence adjustment.

Benefits of technology

It realizes the dynamic update of knowledge graph, can meet the changing needs of users in a timely manner, improve the performance of knowledge query and the accuracy of generated responses, solves the problems of knowledge sparsity and uncertainty, and ensures the reliability of knowledge.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654790A_ABST
    Figure CN120654790A_ABST
Patent Text Reader

Abstract

The invention discloses a knowledge graph updating method and electronic equipment, and relates to the technical field of natural language processing and artificial intelligence, and the method comprises the steps: obtaining dialogue information generated in the interaction process of a user and a large model; wherein the large model carries out question and answer dialogues in an interaction process based on a knowledge graph; determining a user behavior mode corresponding to the dialogue information; if the user behavior mode represents that the knowledge graph has an updating requirement, reasoning the dialogue information through a large model; and updating the knowledge graph based on a reasoning result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of natural language processing and artificial intelligence technology, and in particular to a knowledge graph updating method and electronic device. Background Art

[0002] Retrieval-Augmented Generation (RAG) is a technique that combines retrieval and generation models using a large model. It is often used to retrieve relevant content from a knowledge base and generate natural language answers based on the retrieved content using a generative model. This approach has been widely used in question-answering systems.

[0003] GraphRAG is a new retrieval-enhanced generation technology that integrates knowledge graphs. It aims to improve the performance of large language models (LLMs) when processing complex and diverse datasets. By leveraging graph structure information, GraphRAG can more accurately retrieve and generate context-relevant responses, effectively addressing issues such as "hallucinations," missing domain knowledge, and outdated information that may arise in the model. However, in practical applications, GraphRAG still faces many challenges in the construction and expansion of knowledge graphs, including knowledge sparsity, diverse and dynamic requirements, and knowledge uncertainty. Summary of the Invention

[0004] To this end, this application discloses the following technical solutions:

[0005] A knowledge graph updating method, comprising:

[0006] Obtaining conversation information generated during the interaction between the user and the large model; wherein the large model is based on the question-and-answer conversation during the interaction process of the knowledge graph;

[0007] Determining a user behavior pattern corresponding to the conversation information;

[0008] If the user behavior pattern indicates that the knowledge graph needs to be updated, the conversation information is inferred using a large model;

[0009] The knowledge graph is updated based on the inference results.

[0010] Optionally, reasoning about the conversation information using a large model includes:

[0011] Extracting a first entity from the conversation information;

[0012] Determining, from the knowledge graph, second entities that meet similar conditions to the first entity;

[0013] Determining, by a large model, first candidate relationships between the second entities and confidence levels of the first candidate relationships;

[0014] Alternatively, the conversation information is inferred using a large model, including:

[0015] Extracting a first entity from the conversation information;

[0016] Determining, from the knowledge graph, second entities that meet similar conditions to the first entity;

[0017] Performing reasoning and completion on each of the second entities using the large model to obtain at least one third entity outside the knowledge graph;

[0018] Determine a second candidate relationship between each of the second entities and each of the third entities and a confidence level of the second candidate relationship.

[0019] Optionally, updating the knowledge graph based on the inference result includes:

[0020] Based on the first candidate relationships between the second entities and the confidences of the first candidate relationships, updating the relationships between entities and the confidences of the relationships in the knowledge graph;

[0021] Alternatively, based on the second candidate relationships between each of the second entities and each of the third entities and the confidence of the second candidate relationships, the entities in the knowledge graph and the relationships between the entities and the confidence of the relationships are updated.

[0022] Optionally, the dialogue information includes current question information and historical question-answer pairs before the question information; reasoning on the dialogue information using a large model includes:

[0023] Determining the next entity corresponding to the target relationship that meets the confidence condition from the knowledge graph based on the conversation information;

[0024] generating reply information to the question information based on the target relationship and the corresponding entity, and obtaining feedback information for the reply information;

[0025] The knowledge graph is updated based on the inference result, including:

[0026] The relationships between entities and the confidence levels of the relationships in the knowledge graph are updated based on the feedback information.

[0027] Optionally, determining a next entity corresponding to the target relationship that meets a confidence condition from the knowledge graph based on the conversation information includes:

[0028] Based on the reinforcement learning model, determining the target relationship that meets the confidence condition from the knowledge graph according to the dialogue information and the current state information;

[0029] Determining the next entity corresponding to the target relationship;

[0030] Among them, the current state information includes the current candidate triples and the confidence of the relationship in the candidate triples. The candidate triples include the entities in the dialogue information and the entities in the knowledge graph, and the triples formed by the relationship between them.

[0031] Optionally, updating the relationship between the second entities and the confidence of the relationship in the knowledge graph based on the feedback information includes:

[0032] generating a corresponding reward based on the feedback information;

[0033] Adjusting model parameters of the reinforcement learning model and model parameters of the representation learning model based on the reward, and updating the relationship and confidence of each corresponding second entity in the knowledge graph based on the representation learning model after parameter adjustment;

[0034] Among them, the representation learning model is used to vectorize the knowledge in the knowledge graph, and can be used to embed the confidence of the corresponding triples into the representation vectors of entities and relationships in the vectorized representation of the knowledge graph.

[0035] Optionally, determining a user behavior pattern corresponding to the conversation information includes:

[0036] Obtain a user behavior pattern sample set; the user behavior pattern sample set includes at least one user behavior pattern corresponding to the user's interaction with the large model when the knowledge graph lacks knowledge; different user behavior pattern samples correspond to different knowledge-deficient patterns of the knowledge graph;

[0037] The conversation information and the user behavior pattern sample set are input into a large model, so that the large model predicts the user behavior pattern corresponding to the conversation information based on the user behavior pattern sample set.

[0038] Optionally, the process of determining the user behavior pattern sample set includes:

[0039] Obtaining a set of historical conversation information that meets a target condition; the target condition indicating that user satisfaction with the conversation information is lower than a threshold;

[0040] Determining behavior information corresponding to each piece of dialogue information in the historical dialogue information set, indicating that user satisfaction is lower than a threshold;

[0041] The user behavior pattern sample set is determined based on the behavior information.

[0042] Optionally, determining the user behavior pattern sample set based on the behavior information includes:

[0043] Clustering the behavior information to obtain multiple clusters;

[0044] Determining a target cluster that satisfies a correlation condition with the knowledge from the plurality of clusters;

[0045] A user behavior pattern corresponding to each target cluster and indicating that the user satisfaction is lower than a threshold is determined to obtain the user behavior pattern sample set.

[0046] A knowledge graph updating device, comprising:

[0047] An acquisition module is used to obtain the conversation information generated during the interaction between the user and the large model; wherein the large model is based on the question-and-answer conversation during the interaction process of the knowledge graph;

[0048] A determination module, configured to determine a user behavior pattern corresponding to the conversation information;

[0049] An inference module, configured to infer the conversation information using a large model if the user behavior pattern indicates that the knowledge graph needs to be updated;

[0050] An updating module is used to update the knowledge graph based on the reasoning results.

[0051] An electronic device, comprising:

[0052] a memory for storing at least one set of computer instructions;

[0053] A processor is used to implement any of the knowledge graph updating methods described above by executing the instruction set stored in the memory.

[0054] A storage medium carrying one or more computer instruction sets, which, when executed by an electronic device, can enable the electronic device to implement any of the knowledge graph updating methods described above. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0056] Figure 1This is a flowchart of the knowledge graph updating method provided by this application;

[0057] Figure 2 This is a flowchart of a sample set of user behavior patterns provided by this application;

[0058] Figure 3 This is a schematic diagram of user behavior pattern mining in the absence of knowledge provided by this application;

[0059] Figure 4 This is another flowchart of the knowledge graph updating method provided by this application;

[0060] Figure 5 This is another flowchart of the knowledge graph updating method provided by this application;

[0061] Figure 6 This is another flowchart of the knowledge graph updating method provided by this application;

[0062] Figure 7 This is an exemplary implementation framework diagram for updating the knowledge graph provided by this application;

[0063] Figure 8 This is a structural diagram of the knowledge graph updating device provided by this application;

[0064] Figure 9 This is a structural diagram of the electronic device provided in this application. DETAILED DESCRIPTION

[0065] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0066] GraphRAG is a new search-enhanced generation technology that combines knowledge graphs. The applicant found that in practical applications, GraphRAG faces the following major problems in the process of knowledge graph construction and expansion:

[0067] 1. Knowledge sparsity: The initial knowledge graph generated by retrieval enhancement is often incomplete and has significant sparsity. For example, in rapidly iterating fields, the entities and relationships in the knowledge graph may be far from sufficient to meet user query requirements.

[0068] 2. Demand diversity and dynamism: Users’ actual needs are constantly changing, and sparse knowledge graphs cannot timely complete the knowledge content that meets user queries.

[0069] 3. Knowledge uncertainty: The generated knowledge may be of low quality or contradictory due to the diversity of sources or the instability of the generation model, further exacerbating the inconsistency of the knowledge graph.

[0070] Based on this, embodiments of the present application provide a knowledge graph update method and electronic device for resolving at least some of the technical issues faced by GraphRAG during knowledge graph construction and expansion. The knowledge graph update method is applicable to, but not limited to, electronic devices in a wide range of general-purpose or specialized computing device environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multi-processor devices, and the like.

[0071] See also Figure 1 As shown in the method flow chart, the knowledge graph updating method provided in the embodiment of the present application may include the following steps 101 to 104, and these steps are described in detail below.

[0072] Step 101: Obtain conversation information generated during the interaction between the user and the big model; wherein the big model is based on the question-and-answer conversation during the interaction process of the knowledge graph.

[0073] Optionally, the large model may be a large language model.

[0074] In an embodiment of the present application, the question-answering dialogue in the interaction process of the big model based on the knowledge graph may refer to retrieving contextual information related to the user question in the knowledge graph based on GraphRAG technology, and inputting the user question and its contextual information into the big model, so that the big model generates reply information related to the contextual information to the user question.

[0075] The dialogue information is specifically historical dialogue information generated during the interaction between the current user and the large model.

[0076] Optionally, the conversation information includes the user's current question and historical question-answer pairs prior to the question. Optionally, the historical question-answer pairs are correlated with the question. The correlation between the historical question-answer pairs and the question may mean that the historical question-answer pairs and the question correspond to the same unanswered question of the user.

[0077] Two examples of the dialog information are provided below.

[0078] Example 1:

[0079] User A: "Does the ThinkPad X1 Carbon support a touch screen?"

[0080] System: "No relevant information found yet."

[0081] User A: "So does the X1 Carbon have touchscreen functionality?"

[0082] Example 2:

[0083] User B: "Does the ThinkPad Z13 support Thunderbolt 4?"

[0084] System: "No relevant information found yet."

[0085] User B: “You don’t even know this?”

[0086] In the first example above, "So, does the X1 Carbon have touch control?" is the user's current question, and the other information is the historical question-answer pairs that preceded it and are relevant to it. Similarly, in the second example above, "Don't you even know this?" is the user's current question, and the other information is the historical question-answer pairs that preceded it and are relevant to it.

[0087] Step 102: Determine the user behavior pattern corresponding to the conversation information.

[0088] After obtaining the dialogue information generated during the interaction between the user and the large model, the user behavior pattern corresponding to the dialogue information is further determined to determine whether the knowledge graph has an update requirement based on the user behavior pattern corresponding to the dialogue information.

[0089] Optionally, a user behavior pattern corresponding to the conversation information may be determined through a large model.

[0090] The implementation process of determining the user behavior pattern corresponding to the conversation information using the large model may include the following processing steps 11)-12):

[0091] 11) Obtain a sample set of user behavior patterns.

[0092] The user behavior pattern sample set includes at least one user behavior pattern corresponding to the process of user interaction with the big model when the knowledge graph lacks knowledge.

[0093] In the process of question-and-answer interaction between the large model and the user based on the knowledge graph, if the knowledge graph lacks knowledge, the phenomenon of "multiple rounds of question-and-answer interactions still fail to effectively answer the user's questions and fail to provide satisfactory answers to the user" will often occur. This situation usually causes the user to exhibit behaviors related to the lack of knowledge of the knowledge graph. In view of this feature, the embodiment of the present application pre-mines and summarizes a series of behaviors exhibited by users when the knowledge graph lacks knowledge, obtains multiple behavior pattern examples of users when the knowledge graph lacks knowledge, and forms the user behavior pattern sample set based on these mined and summarized behavior pattern examples.

[0094] The user behavior pattern sample set may include, but is not limited to, user behavior pattern samples such as users repeatedly asking the same question, users directly pointing out that a reply result is inaccurate, and users expressing negative emotions (e.g., expressing disappointment or negativity towards the agent).

[0095] Optionally, each user behavior pattern example corresponds to a corresponding knowledge missing pattern of the knowledge graph, and different user behavior pattern examples correspond to different knowledge missing patterns of the knowledge graph.

[0096] For example, for the user behavior pattern example of "user repeatedly asks the same question", the corresponding knowledge loss pattern may be insufficient knowledge in the knowledge graph. For the user behavior pattern example of "user directly points out that the reply result is inaccurate", the corresponding knowledge loss pattern may be inaccurate or erroneous knowledge in the knowledge graph.

[0097] 12) Inputting the conversation information and the user behavior pattern sample set into a large model, so that the large model predicts the user behavior pattern corresponding to the conversation information based on the user behavior pattern sample set.

[0098] After obtaining the user behavior pattern sample set, the user behavior pattern sample set can be input into the big model as a Fewshot example, and the conversation information can be input into the big model at the same time, so that the big model can predict the user behavior pattern corresponding to the conversation information based on the input Fewshot example, that is, the user behavior pattern sample set.

[0099] Optionally, the output of the large model includes the user behavior pattern corresponding to the conversation information as the confidence of each user behavior pattern sample in the user behavior pattern sample set.

[0100] Subsequently, the user behavior pattern corresponding to the conversation information can be determined based on the confidence level of each user behavior pattern example. Specifically, but not limited to, the user behavior pattern example with the highest confidence level that reaches a set threshold can be used as the user behavior pattern corresponding to the conversation information. If the confidence levels of each user behavior pattern example corresponding to the conversation information do not reach the set threshold, indicating that the user behavior pattern corresponding to the conversation information does not match any user behavior pattern example in the user behavior pattern example set, then the user behavior pattern corresponding to the conversation information can be determined to be a behavior pattern in the knowledge graph without knowledge deficiency.

[0101] Step 103: If the user behavior pattern indicates that the knowledge graph needs to be updated, the conversation information is inferred using a large model.

[0102] If the user behavior pattern corresponding to the conversation information is a corresponding user behavior pattern example in the user behavior pattern example set, the representation knowledge graph lacks knowledge (e.g., insufficient knowledge or inaccurate knowledge / errors), and the corresponding representation knowledge graph needs to be updated. Conversely, if the user behavior pattern corresponding to the conversation information is a behavior pattern that does not indicate a knowledge deficiency in the knowledge graph, the representation knowledge graph does not lack knowledge and does not need to be updated.

[0103] When the user behavior pattern representation knowledge graph needs to be updated, the present application uses a large model to infer the conversation information to further infer knowledge related to the conversation information and realize knowledge mining related to the conversation information, including but not limited to inferring entities and / or relationships related to the knowledge in the conversation information, etc. This part will be described in detail in the following embodiments.

[0104] Step 104: Update the knowledge graph based on the inference result.

[0105] After the conversation information is inferred through the large model, the knowledge graph is further updated based on the inference results, i.e., the inferred knowledge, including but not limited to adding the inferred knowledge outside the knowledge graph to the knowledge graph, and / or using the inferred knowledge to adjust and correct the relevant existing knowledge in the knowledge graph.

[0106] When updating the knowledge graph based on the reasoning results, the update of the knowledge graph can be optionally guided based on the knowledge missing pattern corresponding to the user behavior pattern. For example, if the knowledge missing pattern corresponding to the user behavior pattern represents insufficient knowledge in the knowledge graph, the knowledge inferred by the large model, such as the inferred entities and / or relationships, can be supplemented to the knowledge graph to achieve knowledge completion or expansion of the knowledge graph. If the knowledge missing pattern corresponding to the user behavior pattern represents that the knowledge in the knowledge graph is inaccurate / erroneous, knowledge that conflicts / contradicts the knowledge inferred by the large model can be determined from the knowledge graph, such as entities and / or relationships that contradict the knowledge inferred by the large model, and the inferred knowledge can be used to replace the knowledge in the knowledge graph that contradicts the knowledge, or the confidence of the knowledge that contradicts the knowledge can be reduced, etc., to achieve error correction and quality improvement of the knowledge graph.

[0107] In summary, the knowledge graph updating method provided in the embodiment of the present application determines the user behavior pattern corresponding to the conversation information generated during the interaction between the user and the big model, and when the user behavior pattern indicates that the knowledge graph has an update demand, the big model is used to infer the conversation information, and then the knowledge graph is updated based on the inference results. The technical concept of driving the dynamic update of the knowledge graph based on user needs is proposed and implemented, and the knowledge graph can be dynamically updated based on user needs. The knowledge missing pattern in the user needs can be automatically mined to guide the completion or optimization of the knowledge graph. On the one hand, this solves or alleviates the knowledge sparsity problem of the knowledge graph, so as to meet the knowledge query needs in application scenarios such as GraphRAG as much as possible. On the other hand, since the knowledge graph is driven to update knowledge based on user needs, it can adapt to the diversity and dynamism of user needs, and can timely complete the knowledge graph with knowledge content that meets the dynamic and changing needs of users according to the knowledge missing pattern corresponding to the user behavior pattern, thereby facilitating more accurate retrieval and generation of context-related responses in application scenarios such as GraphRAG, and can further improve the knowledge query performance based on the knowledge graph and the big model reasoning performance.

[0108] In an optional embodiment, a process for determining a user behavior pattern sample set is further provided. Optionally, see Figure 2 The process of determining the user behavior pattern sample set may include the following steps 201-203:

[0109] Step 201: Obtain a set of historical conversation information that meets a target condition; the target condition indicates that user satisfaction with the conversation information is lower than a threshold.

[0110] During implementation, optionally, a series of historical conversation information that represents the user's dissatisfaction with the conversation information (such as the response result) during the conversation interaction process can be filtered out from the conversation log between the user and the large model through manual annotation, as a set of historical conversation information that meets the target conditions.

[0111] However, the present invention is not limited to this. The historical conversation information in the conversation log between the user and the big model can also be analyzed based on automatic screening to analyze the conversation characteristics of the user's tone, emotion, question content (such as the content of the new round of questions is essentially the same as the content of the previous round of questions), and the user satisfaction is calculated based on the analysis results. Then, a series of historical conversation information with user satisfaction below a threshold is screened out from the conversation log between the user and the big model as a set of historical conversation information that meets the target conditions.

[0112] In actual applications, manual labeling and automatic screening can also be combined to select a historical conversation information set that meets the target conditions from the conversation log between the user and the large model. There is no restriction on this and it can be determined according to actual application needs.

[0113] Step 202: Determine the behavior information corresponding to each dialogue information in the historical dialogue information set and indicating that the user satisfaction is lower than a threshold.

[0114] See also Figure 3 As shown in the diagram of user behavior pattern mining in the case of lack of knowledge, after obtaining a set of historical conversation information that meets the target conditions, the behavioral performance representing low user satisfaction in these conversation information can be optionally analyzed to determine the behavioral information corresponding to each conversation information that represents user satisfaction below a threshold.

[0115] During implementation, optionally, a large model such as a large language model may be used to perform user behavior analysis on each dialogue information in the historical dialogue information set to determine the behavior information corresponding to each dialogue information indicating that the user satisfaction is lower than a threshold.

[0116] Step 203: Determine the user behavior pattern sample set based on the behavior information.

[0117] On the basis of step 202 , a user behavior pattern sample set may be further determined based on the behavior information corresponding to each dialogue information in the historical dialogue information set and indicating that the user satisfaction is lower than a threshold.

[0118] Optionally, the implementation process of determining the user behavior pattern sample set may include the following steps 21)-23)

[0119] 21) Clustering the behavior information to obtain multiple clusters.

[0120] The behavior information representing user satisfaction below a threshold corresponding to each conversation information in the historical conversation information set may be clustered using, but is not limited to, a clustering algorithm such as K-means or hierarchical clustering to obtain multiple clusters.

[0121] 22) Determine a target cluster from the plurality of clusters that satisfies a correlation condition with the knowledge.

[0122] The fact that a cluster satisfies a correlation condition with knowledge may mean that the user behavior represented by the user behavior information in the cluster is related to the knowledge.

[0123] For example, if the user behavior information in a cluster represents that the user repeatedly asks the same question, or represents that the user expresses negative emotions towards the answer of the large model, etc., these behaviors are related to the knowledge of the knowledge graph. Therefore, it can be determined that the cluster and the knowledge meet the correlation conditions, and the cluster can be determined as the target cluster accordingly.

[0124] During implementation, a target cluster that meets the relevance condition with the knowledge can be determined from the multiple clusters through, but is not limited to, a large model.

[0125] 23) Determine the user behavior pattern corresponding to each target cluster, which indicates that the user satisfaction is lower than a threshold, to obtain the user behavior pattern sample set.

[0126] For each target cluster, the behavioral pattern of a series of user behavior information contained in the target cluster can be summarized to obtain the user behavior pattern corresponding to the target cluster. The summarized user behavior pattern is essentially the user's behavior pattern when the knowledge graph lacks knowledge, such as users repeatedly asking the same questions, users directly pointing out that the answer results are inaccurate, and users expressing negative emotions.

[0127] During implementation, the behavioral patterns of a series of user behavior information contained in each target cluster can also be summarized through a large model, but is not limited to the large model.

[0128] In the embodiment of the present application, the user behavior pattern corresponding to each target cluster is referred to as a user behavior pattern sample, and the user behavior patterns corresponding to each target cluster form the user behavior pattern sample set.

[0129] This embodiment mines and summarizes user behavior patterns in situations where the knowledge graph lacks knowledge based on a historical conversation information set with low user satisfaction, so as to construct the user behavior pattern sample set. This user behavior pattern sample set can be used to provide the big model with a few shot examples when the big model needs to determine the user behavior pattern corresponding to the conversation information in the future, so as to help the big model accurately determine the user behavior pattern corresponding to the conversation information, thereby providing support for driving the knowledge graph update based on user needs.

[0130] In an optional embodiment, the knowledge graph in this application is an uncertainty knowledge graph.

[0131] Among them, the knowledge in the deterministic knowledge graph is in the form of triples, namely (h, r, t), where h and t represent the head entity and the tail entity respectively, and r represents the relationship between the head and tail entities.

[0132] In the construction of a deterministic knowledge graph, a confidence threshold is usually set to filter out low-quality triples, so that all triples in the deterministic knowledge graph are high-quality triples that meet the confidence threshold, thereby ensuring the quality of the knowledge graph.

[0133] The construction of an uncertain knowledge graph relaxes the assumption that all knowledge must be accurate and correct, allowing for the retention of more potentially valuable but less confident triplets. This significantly improves the graph's coverage and expands the knowledge in the knowledge graph from a triple (h, r, t) to a quadruple, namely <(h, r, t), s>, where h, r, and t have the same meanings as in a deterministic knowledge graph, and s represents the confidence level of the triple, or the confidence level of the relationship within the triple. Preserving confidence levels in an uncertain knowledge graph facilitates its evolution and updating.

[0134] This embodiment pre-constructs an uncertainty knowledge graph based on an existing knowledge base. For example, an uncertainty knowledge graph is pre-constructed offline based on domain knowledge, and triples with higher confidence (such as reaching a threshold γ) and their confidence are screened to form a sub-knowledge graph as the knowledge base for knowledge query in GraphRAG. It is easy to understand that the sub-knowledge graph is a subset of the knowledge graph. Compared with the sub-knowledge graph, the knowledge graph also retains triples that may have value but lower confidence and their corresponding confidence.

[0135] Subsequent user-driven knowledge graph updates, specifically updates to the knowledge graph (not the sub-knowledge graph), may cause synchronous dynamic changes to the sub-knowledge graph as knowledge within the knowledge graph is updated, such as knowledge expansion, error correction, and adjustment of triple confidence. For example, if a triple is changed from low confidence to high confidence (reaching a threshold γ) based on knowledge update, the triple will be expanded to the sub-knowledge graph.

[0136] In the GraphRAG application scenario, knowledge retrieval of a knowledge graph (such as the sub-knowledge graph) is usually implemented in vector form, and the knowledge graph needs to be converted into vector form accordingly. Based on this, the embodiment of the present application also pre-constructs a representation learning model for an uncertain knowledge graph.

[0137] The representation learning model is used to vectorize the knowledge in the uncertain knowledge graph, and can be used to embed the confidence of the corresponding triples into the representation vectors of entities and relationships in the vectorized representation of the knowledge graph, wherein the confidence of the triples can be fitted but not limited to using MSE (Mean Square Error) Loss, and the confidence of the triples is embedded into the entity and relationship vectors.

[0138] During implementation, optionally, the representation learning model can also embed the structural information of the knowledge graph into the representation vectors of entities and relationships in the vectorized representation of the knowledge graph.

[0139] The representation learning model can be implemented by, but is not limited to, traditional TransE or Graph Neural Network (GNN).

[0140] This embodiment constructs an uncertainty knowledge graph in application scenarios such as GraphRAG, and filters triples with higher confidence and their corresponding confidence to form a sub-knowledge graph, which serves as a knowledge base for knowledge query in GraphRAG. On the one hand, it allows more triples that may be valuable but have lower confidence to be retained to improve the coverage of the knowledge graph, and can support triples with lower confidence to be dynamically updated to the sub-knowledge graph when conditions are met (such as the confidence of a triple reaches a threshold γ after the update) as the knowledge graph is updated. On the other hand, it can ensure that the knowledge used for query is high-confidence knowledge, which can provide accurate context information for user question information in scenarios such as GraphRAG, facilitating the generation of accurate responses to user question information.

[0141] In addition, this embodiment embeds the confidence of the corresponding triples into the representation vectors of entities and relationships, which supports the use of the energy function of the triples to determine their corresponding confidence, thereby facilitating more reasonable and accurate knowledge graph updates based on the confidence.

[0142] In an alternative embodiment, see Figure 4 As shown in the flowchart of the knowledge graph updating method, in step 103 of the knowledge graph updating method provided in this application, reasoning on the conversation information through a large model can be implemented as the following steps 401-403:

[0143] Step 401: Extract the first entity in the conversation information.

[0144] The entities in the conversation information can be extracted by, but are not limited to, a large model.

[0145] In this embodiment, the entity in the dialog information is referred to as the first entity.

[0146] Step 402: Determine from the knowledge graph each second entity that satisfies similar conditions to the first entity.

[0147] Optionally, the first entity may be used to search in the sub-knowledge graph to obtain second entities that meet similar conditions to the first entity.

[0148] The similarity condition may be, but is not limited to, being set as a vector distance between entities being less than a preset threshold.

[0149] Step 403: Determine the first candidate relationships between the second entities and the confidence levels of the first candidate relationships using a large model.

[0150] After obtaining each second entity that meets similar conditions with the first entity in the conversation information, continue to use the large model to reason on each second entity to infer the first candidate relationship between each second entity and predict the confidence of each first candidate relationship.

[0151] On this basis, see Figure 4 Step 104 of the knowledge graph updating method provided in this application, i.e., updating the knowledge graph based on the inference result, can be implemented as the following step 404:

[0152] Step 404: Based on the first candidate relationships between the second entities and the confidences of the first candidate relationships, update the relationships between the entities and the confidences of the relationships in the knowledge graph.

[0153] Among them, it is possible but not limited to adding the first candidate relationship between each second entity and the confidence of the first candidate relationship to the knowledge graph, or using the first candidate relationship between each second entity and the confidence of the first candidate relationship to adjust the relevant existing relationships and / or the confidence of the relationship in the knowledge graph.

[0154] In the embodiment of the present application, the confidence of a relationship is the confidence of the triplet corresponding to the relationship.

[0155] Furthermore, the update of the knowledge graph can be guided based on the knowledge missing pattern corresponding to the user behavior pattern, wherein, if the knowledge missing pattern corresponding to the user behavior pattern represents insufficient knowledge in the knowledge graph, the first candidate relationship between each second entity and the confidence of the first candidate relationship can be added to the knowledge graph to achieve knowledge completion or expansion of the knowledge graph; if the knowledge missing pattern corresponding to the user behavior pattern represents inaccurate / erroneous knowledge in the knowledge graph, the existing relationship or existing confidence that conflicts / contradicts the first candidate relationship between each second entity and the confidence of the first candidate relationship can be determined from the knowledge graph, and the first candidate relationship between each second entity and the confidence of the first candidate relationship can be used to replace the existing relationship or existing confidence in the knowledge graph that conflicts / contradicts it, or the confidence of the existing relationship that conflicts / contradicts it can be reduced, etc., to achieve error correction or quality improvement of the knowledge graph.

[0156] The reasoning results of the large model are usually in the form of natural language. When updating the knowledge graph based on the reasoning results of the large model, the reasoning results of the large model, such as the first candidate relationship between each second entity and the confidence of the first candidate relationship, can first be input into the representation learning model of the uncertainty knowledge graph, so that the representation learning model can convert the input entities and relationships into vectors, and embed the confidence of the corresponding triples into the vectors of the entities and relationships.

[0157] On this basis, the confidence of the triple vector (a vector containing entities and relationships between entities) representing the output of the learning model can be further determined through the energy function of the triple, and the knowledge graph can be updated by completing or correcting errors based on the triple vector and its confidence.

[0158] This embodiment uses a large model to reason about the conversation information and updates the knowledge graph based on the corresponding reasoning results (such as the first candidate relationship between each second entity and the confidence of the first candidate relationship). This realizes the dynamic update of the knowledge graph driven by user needs, and can automatically mine the knowledge missing patterns in user needs to guide the completion or optimization of the knowledge graph. It not only solves or alleviates the knowledge sparsity problem of the knowledge graph, but also can timely complete the knowledge graph with knowledge content that meets the dynamic and changing needs of users, thereby facilitating more accurate retrieval and generation of context-related responses in application scenarios such as GraphRAG, and improving the knowledge query performance based on the knowledge graph and the large model reasoning performance. At the same time, the confidence of the completed knowledge is predicted by the energy function based on the uncertainty knowledge graph (i.e., the energy function of the triplet), ensuring the reliability of the knowledge.

[0159] In an alternative embodiment, see Figure 5As shown in the flowchart of the knowledge graph updating method, in step 103 of the knowledge graph updating method provided in this application, reasoning on the conversation information through a large model can be implemented as the following steps 501-504:

[0160] Step 501: Extract the first entity in the conversation information.

[0161] Step 502: Determine from the knowledge graph each second entity that satisfies similar conditions to the first entity.

[0162] Among them, steps 501-502 are the same as steps 401-402 in the previous embodiment. For details, please refer to the description of steps 401-402 in the previous embodiment, which will not be repeated here.

[0163] Step 503: Use the large model to infer and complete each of the second entities to obtain at least one third entity outside the knowledge graph.

[0164] After obtaining each second entity that meets similar conditions to the first entity in the conversation information, this embodiment continues to use the large model to infer and complete each second entity to obtain at least one third entity outside the knowledge graph.

[0165] Each third entity may be similar to the corresponding second entity, such as the vector distance between the third entity and the corresponding second entity is less than a threshold; or, each third entity may also be related to the corresponding second entity, that is, it may also have a correlation relationship with the corresponding second entity (such as a doctor-patient relationship).

[0166] Step 504: Determine a second candidate relationship between each of the second entities and each of the third entities and a confidence level of the second candidate relationship.

[0167] On the basis of step 503, the relationship between each second entity and each third entity can be further inferred through the large model, that is, the relationship between each second entity and each third entity can be analyzed to obtain the second candidate relationship between each second entity and each third entity, and the confidence of each second candidate relationship can also be predicted.

[0168] Continue to see Figure 5 , step 104 in the knowledge graph updating method provided in this application, i.e., updating the knowledge graph based on the inference result, can be implemented as the following step 505:

[0169] Step 505: Based on the second candidate relationships between each second entity and each third entity and the confidence of the second candidate relationships, update the entities in the knowledge graph and the relationships between the entities and the confidence of the relationships.

[0170] Among them, it is possible but not limited to adding the second candidate relationship between each second entity and each third entity and the confidence of the second candidate relationship to the knowledge graph, or using the second candidate relationship between each second entity and each third entity and the confidence of the second candidate relationship to adjust the relevant existing entities, relationships and / or confidence of relationships in the knowledge graph.

[0171] Furthermore, the update of the knowledge graph can be guided based on the knowledge missing pattern corresponding to the user behavior pattern, wherein, if the knowledge missing pattern corresponding to the user behavior pattern represents insufficient knowledge in the knowledge graph, the second candidate relationship between each second entity and each third entity and the confidence of the second candidate relationship can be added to the knowledge graph to achieve knowledge completion or expansion of the knowledge graph; if the knowledge missing pattern corresponding to the user behavior pattern represents inaccurate / erroneous knowledge in the knowledge graph, the existing entities, relationships or existing confidences that conflict / contradict with the second candidate relationship between each second entity and each third entity and the confidence of the second candidate relationship can be determined from the knowledge graph, and the second candidate relationship between each second entity and each third entity and the confidence of the second candidate relationship can be used to replace the existing entities, relationships and / or existing confidences in the knowledge graph that conflict / contradict with them, or the confidence of the existing relationships that conflict / contradict with them can be reduced, etc., to achieve error correction and quality improvement of the knowledge graph.

[0172] The inference results of the large model are in natural language form. When updating the knowledge graph based on the inference results of the large model, this embodiment can also first input the inference results of the large model, such as the second candidate relationships between each second entity and each third entity and the confidence of the second candidate relationship, into the representation learning model of the uncertainty knowledge graph, so that the representation learning model can convert the input entities and relationships into vectors and embed the confidence of the corresponding triples into the entity and relationship vectors.

[0173] On this basis, the confidence of the triple vector (containing vectors corresponding to entities and relationships between entities) representing the output of the learning model can be further determined through the energy function of the triple, and the knowledge graph can be updated by completing or correcting errors based on the triple vector and its confidence.

[0174] This embodiment uses a large model to reason about the conversation information and updates the knowledge graph based on the corresponding reasoning results (such as the second candidate relationship between each second entity and each third entity and the confidence of the second candidate relationship). This realizes the dynamic update of the knowledge graph driven by user needs, and can automatically mine the knowledge missing patterns in user needs to guide the completion or optimization of the knowledge graph. It not only solves or alleviates the knowledge sparsity problem of the knowledge graph, but also can timely complete the knowledge graph with knowledge content that meets the dynamic and changing needs of users, thereby facilitating more accurate retrieval and generation of context-related responses in application scenarios such as GraphRAG, and improving the knowledge query performance based on the knowledge graph and the large model reasoning performance. At the same time, the confidence of the completed knowledge is predicted by the energy function based on the uncertainty knowledge graph (i.e., the energy function of the triplet), ensuring the reliability of the knowledge.

[0175] In an alternative embodiment, see Figure 6 As shown in the flowchart of the knowledge graph updating method, in step 103 of the method provided by this application, reasoning on the conversation information through the large model can be implemented as the following steps 601-602:

[0176] Step 601: Determine the next entity corresponding to the target relationship that meets the confidence condition from the knowledge graph based on the conversation information.

[0177] Optionally, this embodiment pre-builds a reinforcement learning model for optimizing the representation learning model of the uncertainty knowledge graph based on user feedback, and updates the knowledge graph by optimizing the representation learning model.

[0178] The following describes the state space, action space, policy network, reward signal, and policy network optimization corresponding to the reinforcement learning model.

[0179] 1. State Space

[0180] The state space includes: the dialogue information generated during the interaction between the user and the large model (such as the user's current question information and the historical question-answer pairs before the question information), as well as the triples to be selected and the confidence of these triples.

[0181] The state space can be expressed as: S = (memory, (h, r, t, s)).

[0182] Wherein, memory represents the conversation information, and (h, r, t, s) represents the triplet to be selected and its confidence prediction value.

[0183] The triples to be currently selected include entities in the conversation information, entities in the knowledge graph, and triples formed by the relationships between them.

[0184] The knowledge graph here can be the knowledge graph obtained after the knowledge graph is updated based on the inference results of the conversation information based on the big model, or it can be the knowledge graph before the knowledge graph is updated based on the inference results of the conversation information based on the big model. There is no limitation on this.

[0185] 2. Action Space

[0186] An action in the action space is used to select a triple (relation r).

[0187] Each triplet has a confidence prediction value associated with it, which reflects the reinforcement learning model's confidence in the correctness of the triplet.

[0188] 3. Policy Network

[0189] Policy network π of reinforcement learning model θ , which is used to select a relation r from the current set of triples to be selected and output a corresponding confidence prediction value for each relation r. This confidence prediction value is calculated by a portion of the policy network. The policy network's role is to select the relation most likely to be "correct" for the user's current question based on the current state and output its confidence prediction value, thereby generating a response to the user's question based on the most likely "correct" relation.

[0190] 4. Reward Signals

[0191] Users provide feedback on the model's response information, and the feedback results (such as satisfaction) are directly related to the relationship selected by the policy network and its confidence value.

[0192] If the user is satisfied, it means that the selection of this relationship and its confidence prediction are relatively accurate, and the reward is higher; otherwise, the reward is lower.

[0193] 5. Optimization of Policy Network

[0194] This example optimizes the policy network of the reinforcement learning model based on user feedback through DPO (Direct Preference Optimization). The specific process is as follows:

[0195] 1. Select relation and confidence: The policy network selects a relation r based on the current state (including the dialogue information) and predicts its confidence p(r|s).

[0196] 2. User Feedback: Users provide feedback on the output response information. If the user is satisfied with the response information, it indicates that the selected relationship and its confidence are relatively accurate, and the reward is high. If the user is dissatisfied, it indicates that there is an error in the selection of this relationship or the prediction of the confidence level, and the reward is low.

[0197] 3. Optimization Objective: Based on user satisfaction feedback, DPO uses the reward signal as the objective function to directly optimize the parameters of the policy network. By maximizing the reward, the policy network gradually learns to select more accurate relationships and achieve higher confidence predictions. The loss function is:

[0198] L(θ)=-E t [logπ θ (r|s)·R].

[0199] Among them, π θ (r|s) is the probability that the policy network selects relation r based on the current state s, R is the reward based on user feedback, and Et represents the expected value (Expectation), specifically the expectation of the distribution at time step t.

[0200] 4. Confidence Update: The confidence prediction accuracy is optimized as rewards are adjusted, gradually approaching the user's desired value. If a triplet relationship is accepted and satisfactory by the user, its confidence prediction will be pushed to a higher level; conversely, if it is unsatisfactory, the confidence prediction will be adjusted to a lower value.

[0201] Based on the constructed reinforcement learning model, optionally, this step 601 can be implemented as the following steps 31)-32):

[0202] 31) Based on the reinforcement learning model, determine the target relationship that meets the confidence condition from the knowledge graph according to the dialogue information and the current state information.

[0203] Optionally, the policy network of the reinforcement learning model can determine the most likely "correct" relationship for the user's current question from the knowledge graph based on the conversation information and current state information, and combined with the confidence prediction of the relationship, such as the relationship that is related to the current question information and has the highest predicted confidence, as the target relationship.

[0204] Among them, the current state information includes the current candidate triples and the confidence of the relationship in the candidate triples. The candidate triples include the entities in the dialogue information and the entities in the knowledge graph, and the triples formed by the relationship between them.

[0205] 32) Determine the next entity corresponding to the target relationship.

[0206] The next entity corresponding to the target relationship refers to the next hop node, which essentially refers to the entity corresponding to the target relationship in the knowledge graph (not included in the user's current question information), and is used to generate corresponding reply information for the user's current question information.

[0207] Step 602: Generate reply information to the question information based on the target relationship and the corresponding entity, and obtain feedback information for the reply information.

[0208] On the basis of step 601, this step generates reply information to the user's current question information based on the target relationship and the corresponding entity (ie, the next entity corresponding to the target relationship).

[0209] The reply information is then returned to the user, and feedback information from the user on the reply information is obtained, such as user satisfaction with the reply information.

[0210] See also Figure 6 In this embodiment, step 104 of the knowledge graph updating method provided in this application, i.e., updating the knowledge graph based on the inference result, can be implemented as the following step 603:

[0211] Step 603: Update the relationships between entities and the confidence levels of the relationships in the knowledge graph based on the feedback information.

[0212] This step may first generate a corresponding reward based on the feedback information, wherein the higher the user's satisfaction with the reply information represented by the feedback information, the higher the generated reward; conversely, the lower the user's satisfaction with the reply information represented by the feedback information, the lower the generated reward.

[0213] Afterwards, the model parameters of the reinforcement learning model and the model parameters of the representation learning model are adjusted based on the reward, and the relationships between the corresponding entities and the confidence of the relationships in the knowledge graph are updated based on the representation learning model after parameter adjustment.

[0214] This embodiment uses reinforcement learning based on user feedback to model next-hop node selection and confidence prediction as two related subtasks, allowing them to share the same learning framework (i.e., the framework of the reinforcement learning model) while optimizing their performance. The next-hop node selection task is used to select the most relevant next-hop node in knowledge graph reasoning to shorten the path and improve the efficiency of reasoning for user questions. The confidence prediction task is used to perform confidence scoring on the selected path and the relationship between its nodes to ensure the reliability of the reasoning path.

[0215] This embodiment optimizes the representation learning model of the uncertainty knowledge graph through reinforcement learning based on user feedback, thereby achieving the effect of further completing or optimizing the knowledge graph, while improving the accuracy of next-hop node selection and confidence prediction, and correspondingly improving the accuracy of the reply information generated for user question information.

[0216] An application example of the present method is provided below.

[0217] See also Figure 7 , provides a framework diagram for updating the knowledge graph in this example. In this example, the knowledge graph update process can include the following steps:

[0218] 1. Mining user behavior patterns when knowledge graphs lack knowledge

[0219] 1-1. Collect user conversation logs

[0220] For example, collect the following historical conversation information with low user satisfaction:

[0221] Dialogue message 1:

[0222] User A: "Does the ThinkPad X1 Carbon support a touch screen?"

[0223] System: "No relevant information found yet."

[0224] User A: "So does the X1 Carbon have touchscreen functionality?"

[0225] Dialogue message 2:

[0226] User B: "Does the ThinkPad Z13 support Thunderbolt 4?"

[0227] System: "No relevant information found yet."

[0228] User B: “You don’t even know this?”

[0229] Dialogue message three:

[0230] User C: "The ThinkPad T16 has a battery life of 15 hours?"

[0231] System: "T16's battery life is 10 hours."

[0232] User: "That's impossible. The official website clearly says it's 12 hours."

[0233] 1-2. Summary of User Behavior Patterns

[0234] Use LLM or embedding models to determine the behavior information that indicates low user satisfaction corresponding to each historical conversation information, cluster the behavior information that indicates low user satisfaction, select target clusters related to knowledge from each cluster formed after clustering, and summarize the user behavior patterns corresponding to the user behaviors in each target cluster, such as:

[0235] a. Repeated questioning pattern: Users ask similar questions many times, indicating a lack of knowledge;

[0236] b. Direct blame error mode: users point out system errors, indicating low knowledge confidence or inaccurate data;

[0237] c. Negative emotion expression pattern: Users express disappointment, indicating that the answer coverage is insufficient.

[0238] The user behavior pattern corresponding to each target cluster is regarded as a user behavior pattern example under the knowledge deficiency mode, thereby forming a user behavior pattern sample set.

[0239] Step 2: Uncertainty Knowledge Graph Construction

[0240] Extract triples (entity-relationship-entity) from the domain knowledge source. Embed entities and relationships into a vector space using a representation learning model based on an uncertain knowledge graph. Then assign confidence to each triple using a triple energy function. High-confidence data is retained as the basic knowledge graph for the query, also referred to as the sub-knowledge graph above.

[0241] Step 3: Knowledge auto-completion

[0242] 3-1. Predicting the timing of completion

[0243] 1) Get conversation information

[0244] For example, to get the most recent n rounds of conversations recorded in the conversation history memory:

[0245] User: How many watts of PD fast charging does the Thunderbolt port of YOGA Pro 16s support?

[0246] System: The reference material mentions that the power port can support up to 170W charging.

[0247] User: How many watts of fast charging does the Thunderbolt interface support?

[0248] 2) The large model determines the user behavior pattern corresponding to the conversation information

[0249] Based on the repeated questioning behavior pattern output by the above dialogue information model, it is determined that the knowledge graph needs to be supplemented with knowledge.

[0250] 3-2. Entity Matching and Reasoning Completion

[0251] 1) Find similar nodes from the knowledge graph:

[0252] For the question "How many watts of PD fast charging does the Thunderbolt port of YOGA Pro 16s support?", we extract k=3 similar nodes from the knowledge graph:

[0253] (YOGA Pro 16s, configuration interface, Thunderbolt interface) [Confidence: 0.8];

[0254] (yogapro 16, charging performance, supports fast charging) [confidence: 0.9];

[0255] (YogaPro, supports Type-C interface, yes) [Confidence: 0.7].

[0256] 2) Large model reasoning relationship:

[0257] The extracted entities and relationships are input into the large model. Combined with the large model's own knowledge, the relationship between the Thunderbolt 4 interface and the charging power is inferred, and (Thunderbolt 4 interface, maximum supported power, 100w PD fast charging) is obtained.

[0258] 3) Update the knowledge graph:

[0259] The core of UKG (Uncertain Knowledge Graph) is to embed entities and relationships into vector space and predict the rationality and confidence of new triples.

[0260] Therefore, the newly added triple vector is added to the graph and the confidence is updated:

[0261] (Thunderbolt 4 interface, maximum supported power, 100w PD fast charging, 0.8).

[0262] 3-3. Answer user questions and strengthen learning optimization

[0263] 1) Answer user questions:

[0264] The system replied to the user: "The Thunderbolt 4 interface of YOGA Pro 16s supports 100W PD fast charging."

[0265] 2) Collect user feedback:

[0266] When the user clicks the "Satisfied" button, the system records the positive reward.

[0267] 3) Reinforcement Learning Optimization:

[0268] User feedback is used to optimize the representation learning model and reinforcement learning model of the uncertainty knowledge graph to improve the accuracy of next-hop node selection and confidence prediction, and the knowledge graph is updated based on the optimized representation learning model.

[0269] In summary, the method of the embodiment of the present application has at least the following technical advantages:

[0270] 1. Dynamic adaptability: Through reinforcement learning, the knowledge completion strategy is continuously optimized to dynamically adapt to changes in user query patterns.

[0271] 2. High reliability: Knowledge screening and completion based on confidence assessment can effectively avoid the introduction of erroneous knowledge into the knowledge graph.

[0272] 3. Automated expansion: Utilize user conversation logs to automatically discover knowledge-missing patterns in the knowledge graph and perform user-demand-driven knowledge completion on the knowledge graph without manual intervention. This is suitable for large-scale knowledge graph construction and expansion.

[0273] Corresponding to the above-mentioned knowledge graph updating method, the present application embodiment also provides a knowledge graph updating device, whose composition structure is as follows: Figure 8 As shown, including:

[0274] Acquisition module 801 is used to obtain dialogue information generated during the interaction between the user and the large model; wherein the large model is based on the knowledge graph during the interaction process of the question-and-answer dialogue;

[0275] Determination module 802, used to determine the user behavior pattern corresponding to the conversation information;

[0276] Inference module 803, configured to infer the conversation information using a large model if the user behavior pattern indicates that the knowledge graph needs to be updated;

[0277] The updating module 804 is used to update the knowledge graph based on the reasoning result.

[0278] In an optional implementation, when the reasoning module 803 performs reasoning on the dialogue information using the large model, it is specifically configured to:

[0279] Extracting a first entity from the conversation information; determining second entities that meet similar conditions with the first entity from the knowledge graph; and determining first candidate relationships between the second entities and confidence levels of the first candidate relationships using a large model;

[0280] Alternatively, extract the first entity from the conversation information; determine each second entity that meets similar conditions as the first entity from the knowledge graph; perform reasoning and completion on each second entity through a large model to obtain at least one third entity outside the knowledge graph; determine the second candidate relationship between each second entity and each third entity and the confidence of the second candidate relationship.

[0281] In an optional implementation manner, the update module 804 is specifically configured to:

[0282] Based on the first candidate relationships between the second entities and the confidences of the first candidate relationships, updating the relationships between entities and the confidences of the relationships in the knowledge graph;

[0283] Alternatively, based on the second candidate relationships between each of the second entities and each of the third entities and the confidence of the second candidate relationships, the entities in the knowledge graph and the relationships between the entities and the confidence of the relationships are updated.

[0284] In an optional embodiment, the dialogue information includes the current question information and historical question-answer pairs before the question information;

[0285] When reasoning about the conversation information using the large model, the reasoning module 803 is specifically used to:

[0286] Determining the next entity corresponding to the target relationship that meets the confidence condition from the knowledge graph based on the conversation information;

[0287] Reply information to the question information is generated based on the target relationship and the corresponding entity, and feedback information for the reply information is obtained.

[0288] The updating module 804 is specifically used to update the relationships between entities and the confidence levels of the relationships in the knowledge graph based on the feedback information.

[0289] In an optional implementation, when determining the next entity corresponding to the target relationship that meets the confidence condition from the knowledge graph based on the conversation information, the reasoning module 803 is specifically configured to:

[0290] Based on the reinforcement learning model, determining the target relationship that meets the confidence condition from the knowledge graph according to the dialogue information and the current state information;

[0291] Determining the next entity corresponding to the target relationship;

[0292] Among them, the current state information includes the current candidate triples and the confidence of the relationship in the candidate triples. The candidate triples include the entities in the dialogue information and the entities in the knowledge graph, and the triples formed by the relationship between them.

[0293] In an optional implementation, when updating the relationship and confidence of each second entity in the knowledge graph based on the feedback information, the updating module 804 is specifically configured to:

[0294] generating a corresponding reward based on the feedback information;

[0295] Adjusting model parameters of the reinforcement learning model and model parameters of the representation learning model based on the reward, and updating the relationship and confidence of each corresponding second entity in the knowledge graph based on the representation learning model after parameter adjustment;

[0296] Among them, the representation learning model is used to vectorize the knowledge in the knowledge graph, and can be used to embed the confidence of the corresponding triples into the representation vectors of entities and relationships in the vectorized representation of the knowledge graph.

[0297] In an optional implementation manner, the determination module 802 is specifically configured to:

[0298] Obtain a user behavior pattern sample set; the user behavior pattern sample set includes at least one user behavior pattern corresponding to the user's interaction with the large model when the knowledge graph lacks knowledge; different user behavior pattern samples correspond to different knowledge-deficient patterns of the knowledge graph;

[0299] The conversation information and the user behavior pattern sample set are input into a large model, so that the large model predicts the user behavior pattern corresponding to the conversation information based on the user behavior pattern sample set.

[0300] In an optional embodiment, the determination module 802 is further configured to determine the user behavior pattern sample set. When determining the user behavior pattern sample set, the determination module 802 is specifically configured to:

[0301] Obtaining a set of historical conversation information that meets a target condition; the target condition indicating that user satisfaction with the conversation information is lower than a threshold;

[0302] Determining behavior information corresponding to each piece of dialogue information in the historical dialogue information set, indicating that user satisfaction is lower than a threshold;

[0303] The user behavior pattern sample set is determined based on the behavior information.

[0304] When determining the user behavior pattern sample set based on the behavior information, the determination module 802 is specifically configured to:

[0305] Clustering the behavior information to obtain multiple clusters;

[0306] Determining a target cluster that satisfies a correlation condition with the knowledge from the plurality of clusters;

[0307] A user behavior pattern corresponding to each target cluster and indicating that the user satisfaction is lower than a threshold is determined to obtain the user behavior pattern sample set.

[0308] The present application also discloses an electronic device, the composition structure of which is as follows: Figure 9 As shown, including at least:

[0309] Memory 10, for storing a computer instruction set;

[0310] A set of computer instructions can be implemented in the form of a computer program.

[0311] The processor 20 is used to implement the knowledge graph updating method provided in any of the method embodiments above by executing the computer instruction set in the memory.

[0312] The processor 20 can be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a neural network processor (NPU), a deep learning processor (DPU) or other programmable logic devices, etc.

[0313] Optionally, the electronic device also includes storage resources such as memory and cache.

[0314] Optionally, the electronic device further includes a camera assembly, and / or is connected to an external camera assembly.

[0315] In addition, the electronic device may also include components such as a communication interface and a communication bus. The memory, processor, and communication interface communicate with each other via the communication bus.

[0316] Communication interfaces are used for communication between electronic devices and other devices. The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, and a control bus.

[0317] An embodiment of the present application also discloses a storage medium, which carries one or more computer instruction sets. When the one or more computer instruction sets are executed by an electronic device, the electronic device can implement the knowledge graph updating method described in any of the method embodiments above.

[0318] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referenced to each other.

[0319] For the convenience of description, the above systems or devices are described as being divided into various modules or units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0320] Through the description of the above embodiments, it can be seen that those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform. Based on this understanding, the technical solution of the present application can be essentially or the part that makes a creative contribution in the form of a software product. The computer software product can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or certain parts of the embodiments of the present application.

[0321] Finally, it should be noted that, in this document, relational terms such as first, second, third, and fourth are used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.

[0322] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A knowledge graph updating method, comprising: Obtaining conversation information generated during the interaction between the user and the large model; wherein the large model is based on the question-and-answer conversation during the interaction process of the knowledge graph; Determining a user behavior pattern corresponding to the conversation information; If the user behavior pattern indicates that the knowledge graph needs to be updated, the conversation information is inferred using a large model; The knowledge graph is updated based on the inference results.

2. The knowledge graph updating method according to claim 1, wherein reasoning on the conversation information using a large model comprises: Extracting a first entity from the conversation information; Determining, from the knowledge graph, second entities that meet similar conditions to the first entity; Determining, by a large model, first candidate relationships between the second entities and confidence levels of the first candidate relationships; Alternatively, the conversation information is inferred using a large model, including: Extracting a first entity from the conversation information; Determining, from the knowledge graph, second entities that meet similar conditions to the first entity; Performing reasoning and completion on each of the second entities using the large model to obtain at least one third entity outside the knowledge graph; Determine a second candidate relationship between each of the second entities and each of the third entities and a confidence level of the second candidate relationship.

3. The knowledge graph updating method according to claim 2, wherein updating the knowledge graph based on the inference result comprises: Based on the first candidate relationships between the second entities and the confidences of the first candidate relationships, updating the relationships between entities and the confidences of the relationships in the knowledge graph; Alternatively, based on the second candidate relationships between each of the second entities and each of the third entities and the confidence of the second candidate relationships, the entities in the knowledge graph and the relationships between the entities and the confidence of the relationships are updated.

4. The knowledge graph updating method according to claim 1 or 3, wherein the dialogue information includes the current question information and the historical question-answer pairs before the question information; The conversation information is inferred using a large model, including: Determining the next entity corresponding to the target relationship that meets the confidence condition from the knowledge graph based on the conversation information; generating reply information to the question information based on the target relationship and the corresponding entity, and obtaining feedback information for the reply information; The knowledge graph is updated based on the inference result, including: The relationships between entities and the confidence levels of the relationships in the knowledge graph are updated based on the feedback information.

5. The knowledge graph updating method according to claim 4, wherein determining the next entity corresponding to the target relationship that satisfies the confidence condition from the knowledge graph based on the conversation information comprises: Based on the reinforcement learning model, determining the target relationship that meets the confidence condition from the knowledge graph according to the dialogue information and the current state information; Determining the next entity corresponding to the target relationship; Among them, the current state information includes the current candidate triples and the confidence of the relationship in the candidate triples. The candidate triples include the entities in the dialogue information and the entities in the knowledge graph, and the triples formed by the relationship between them.

6. The knowledge graph updating method according to claim 5, wherein updating the relationship and confidence of each of the second entities in the knowledge graph based on the feedback information comprises: generating a corresponding reward based on the feedback information; Adjusting model parameters of the reinforcement learning model and model parameters of the representation learning model based on the reward, and updating the relationship and confidence of each corresponding second entity in the knowledge graph based on the representation learning model after parameter adjustment; Among them, the representation learning model is used to vectorize the knowledge in the knowledge graph, and can be used to embed the confidence of the corresponding triples into the representation vectors of entities and relationships in the vectorized representation of the knowledge graph.

7. The knowledge graph updating method according to claim 1, wherein determining the user behavior pattern corresponding to the conversation information comprises: Obtain a sample set of user behavior patterns; The user behavior pattern sample set includes at least one user behavior pattern corresponding to the process of the user interacting with the large model when the knowledge graph lacks knowledge; different user behavior pattern samples correspond to different knowledge missing patterns of the knowledge graph; The conversation information and the user behavior pattern sample set are input into a large model, so that the large model predicts the user behavior pattern corresponding to the conversation information based on the user behavior pattern sample set.

8. The knowledge graph updating method according to claim 7, wherein the process of determining the user behavior pattern sample set comprises: Obtain a set of historical conversation information that meets the target conditions; The target condition indicates that user satisfaction with the conversation information is lower than a threshold; Determining behavior information corresponding to each piece of dialogue information in the historical dialogue information set, indicating that user satisfaction is lower than a threshold; The user behavior pattern sample set is determined based on the behavior information.

9. The knowledge graph updating method according to claim 8, wherein determining the user behavior pattern sample set based on the behavior information comprises: Clustering the behavior information to obtain multiple clusters; Determining a target cluster that satisfies a correlation condition with the knowledge from the plurality of clusters; A user behavior pattern corresponding to each target cluster and indicating that the user satisfaction is lower than a threshold is determined to obtain the user behavior pattern sample set.

10. An electronic device comprising: a memory for storing at least one set of computer instructions; A processor, configured to implement the knowledge graph updating method according to any one of claims 1 to 9 by executing the instruction set stored in the memory.