Digital human interaction method and system based on knowledge graph, medium and product program
By adopting a knowledge graph-based method in the digital human interaction system, key entities and entity relationships in user input are extracted, and knowledge subgraphs and reasoning chains are generated, the limitations of cross-domain knowledge interaction are solved, and efficient and accurate digital human interaction and multi-dimensional information fusion are achieved.
Patent Information
- Application Number
- CN202411902560.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-23
AI Technical Summary
Existing digital human interaction technology is difficult to effectively handle cross-domain knowledge interaction, resulting in a stiff interaction process and making it difficult to achieve a high degree of integration of multi-dimensional information.
Using a digital human interaction method based on the knowledge graph, we extract key entities and entity relationships from user input, locate core nodes in the preset knowledge graph and generate knowledge subgraphs, calculate the shortest path to determine the weight of the affinity relationship, and perform pruning and clustering to generate multi-level knowledge structures and knowledge reasoning chains.
It realizes the accurate matching of problems and knowledge graphs, reduces interference from irrelevant knowledge, improves the accuracy and efficiency of digital human interaction, ensures the logic and interpretability of reply, reduces the limitations of cross-domain knowledge interaction, and achieves a high degree of integration of multi-dimensional information.
Smart Images

Figure CN119884388A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of digital cultural creative design, and in particular, relates to a digital human interaction method, system, medium and product program based on knowledge graph. Background Art
[0002] With the development of artificial intelligence technology, digital humans are increasingly used in various fields. Traditional digital human interaction methods mainly rely on preset question-and-answer libraries and simple pattern matching algorithms. In this way, digital humans have a superficial understanding of user input and it is difficult to accurately grasp the deep semantics of user intentions, resulting in a rigid interaction process and difficulty in meeting users' needs for natural and smooth conversations.
[0003] In order to improve the interactive capabilities of digital humans, relevant technologies use natural language processing methods based on deep learning, analyze the text information input by users by establishing a semantic understanding model, and generate corresponding replies based on contextual information. This method can understand the user's expression intention to a certain extent and improve the coherence and naturalness of the conversation.
[0004] However, in actual applications, users often encounter complex problems in multiple professional fields, which require the comprehensive application of professional knowledge in different fields to get reasonable answers. Related technologies mainly focus on semantic understanding and dialogue generation in a single field, and use independent model structures to handle different types of problems. This leads to limitations in digital humans in dealing with cross-domain knowledge interactions, making it difficult to achieve a high degree of integration of multi-dimensional information. Summary of the invention
[0005] The present application provides a digital human interaction method, system, medium and product program based on knowledge graph, which is used to reduce the limitations in processing cross-domain knowledge interaction and achieve a high degree of integration of multi-dimensional information.
[0006] In the first aspect, the present application provides a digital human interaction method based on a knowledge graph, which receives question information input by a user and extracts key entities and entity relationships from the question information; Determine the core node with the highest correlation with the key entity in the preset knowledge graph, and generate a knowledge subgraph with a maximum depth of a preset value based on the core node; Calculate the shortest path between nodes in the knowledge subgraph, and determine the weight of the closeness relationship between nodes based on the length of the shortest path; The knowledge subgraph is pruned based on the affinity weight, and the nodes and corresponding associated edges whose affinity weights are higher than the preset threshold are retained to obtain the optimized knowledge subgraph; Cluster each node in the optimized knowledge subgraph according to the type of corresponding connection edge to obtain a multi-level knowledge structure; Perform depth-first traversal in multi-level knowledge structures based on entity relationships to generate knowledge reasoning chains; Generate reply information based on the knowledge reasoning chain and control the digital human to output the reply information.
[0007] By adopting the above technical solutions, key entities and entity relationships are extracted from the question information, core nodes are located in the preset knowledge graph, and knowledge subgraphs are generated, so as to achieve accurate matching between the question and the knowledge graph. Based on the shortest path, the affinity weight is calculated and pruned, which retains the knowledge nodes and associated edges most relevant to the question and reduces the interference of irrelevant knowledge. The pruned knowledge subgraph is clustered according to the connection edge type to obtain a multi-level structure, making the hierarchical relationship of knowledge clearer. On this basis, a depth-first traversal is performed to generate a knowledge reasoning chain to ensure the coherence and logic of the reasoning process. The system can quickly extract knowledge related to the question from the massive knowledge graph and generate accurate reply information through a structured reasoning process. Through the multi-dimensional analysis and hierarchical processing of knowledge, the accuracy and efficiency of digital human interaction are improved, while the logic and interpretability of the reply are guaranteed, the limitations of processing cross-domain knowledge interaction are reduced, and a high degree of integration of multi-dimensional information is achieved.
[0008] In conjunction with some embodiments of the first aspect, in some embodiments, determining the core node with the highest correlation with the key entity in the preset knowledge graph specifically includes: Calculate the semantic similarity between each key entity and the nodes in the preset knowledge graph; Sort the nodes in the preset knowledge graph in descending order based on semantic similarity, and select candidate nodes whose semantic similarity is in the first preset number; Count the sum of the out-degree and in-degree of each candidate node. The out-degree represents the number of edges starting from the candidate node, and the in-degree represents the number of edges ending at the candidate node. The candidate nodes are sorted in descending order based on the sum of out-degree and in-degree, and the candidate node that ranks first after sorting is determined as the core node.
[0009] By adopting the above technical solution, the semantic similarity and node connectivity are comprehensively considered when determining the core nodes. By calculating the semantic similarity between the key entities and the knowledge graph nodes and sorting them in descending order, the candidate nodes with high semantic relevance are preliminarily screened out. The sum of the out-degree and in-degree of the candidate nodes is further counted, and the node with the highest connectivity is selected as the core node. The relevance of the core node to the semantics of the problem is improved, ensuring that the node has rich associated information in the knowledge graph. The sum of the out-degree and in-degree reflects the information carrying capacity of the node. The selected core node can connect more related knowledge, provide more complete knowledge coverage for the subsequent generation of knowledge subgraphs, improve the accuracy of core node selection, and make the generated knowledge subgraph more in line with the problem requirements.
[0010] In conjunction with some embodiments of the first aspect, in some embodiments, calculating the shortest path between nodes in the knowledge subgraph specifically includes: Construct a node adjacency matrix, where each element in the node adjacency matrix indicates whether there is a direct connection relationship between the corresponding nodes; A distance matrix is constructed based on the node adjacency matrix. In the initial value of the distance matrix, the distance between directly connected nodes is a preset value, and the distance between unconnected nodes is infinite; The distance matrix is iteratively updated to obtain the shortest path between nodes.
[0011] By adopting the above technical solution, the shortest path between nodes is calculated by using the adjacency matrix and distance matrix, making the path calculation process more standardized and efficient. The node adjacency matrix records the direct connection relationship, and the constructed initial distance matrix accurately reflects the direct distance relationship between nodes. In the process of iteratively updating the distance matrix, all possible path combinations can be fully considered. The redundant calculation of the traditional graph traversal algorithm is reduced and the calculation efficiency is improved. The calculation result of the shortest path can accurately quantify the closeness relationship between nodes, providing reliable data support for the subsequent knowledge graph pruning, making knowledge extraction more accurate.
[0012] In conjunction with some embodiments of the first aspect, in some embodiments, before performing a depth-first traversal in a multi-level knowledge structure according to entity relationships to generate a knowledge reasoning chain, the method further includes: A state transfer matrix is constructed based on a multi-level knowledge structure, and the element values of the state transfer matrix are determined according to the type of connection edges between each node; Perform eigenvalue decomposition on the state transfer matrix to obtain the eigenvector corresponding to the maximum eigenvalue, and use the components of the eigenvector as the importance score of each node; Rank the importance of each node based on the importance score, and divide each node into several importance levels according to the preset level threshold; The connection relationship between adjacent level nodes in the multi-level knowledge structure is retained according to the importance level, and a multi-level knowledge structure with optimized level is obtained.
[0013] By adopting the above technical solution, the importance of nodes in the knowledge structure is analyzed using the state transfer matrix and eigenvalue decomposition method, and the quantitative sorting and stratification of nodes are achieved. The element values in the state transfer matrix are determined based on the type of connection edge, retaining the semantic information of the relationship between nodes. The eigenvector components obtained by eigenvalue decomposition are used as node importance scores, reflecting the status of the node in the overall knowledge structure. Based on the importance score, the node stratification and connection relationship retention enable the optimized knowledge structure to maintain the original hierarchical relationship and highlight the role of important nodes.
[0014] In conjunction with some embodiments of the first aspect, in some embodiments, constructing a state transition matrix based on a multi-level knowledge structure specifically includes: Count the number distribution of each type of connection edges in the multi-level knowledge structure; The weight coefficient of each type of connection edge is calculated based on the quantity distribution, and the weight coefficient is inversely proportional to the number of the corresponding type of connection edge; Calculate the state transition probability according to the type of connecting edges between nodes and their corresponding weight coefficients; The state transfer probability is normalized to obtain the state transfer matrix.
[0015] By adopting the above technical solution, the number distribution of each type of connection edge in the multi-level knowledge structure is statistically analyzed, and the weight coefficient of each type of connection edge is calculated, so that the weight of the connection edge is related to its scarcity in the knowledge structure. The importance of different types of knowledge associations can be reflected by calculating the state transition probability according to the type and weight coefficient of the connection edge between nodes. Through the quantitative analysis of the connection relationship in the knowledge structure, the accurate measurement of the strength of knowledge association is achieved, so that the state transfer matrix can accurately describe the transfer rules between knowledge nodes, providing more reasonable probability support for subsequent knowledge reasoning, and improving the accuracy of knowledge association in the digital human interaction process.
[0016] In conjunction with some embodiments of the first aspect, in some embodiments, after obtaining the multi-level knowledge structure after level optimization, the method further includes: Build a contextual knowledge base, which includes the dialogue scene description, node access order and corresponding traversal effect score; Extract historical traversal paths with similar scene features from the situational knowledge base to obtain candidate traversal sequences; Perform dynamic programming analysis on the candidate traversal sequence and calculate the cumulative benefits of each traversal path; The candidate traversal sequences are sorted in descending order based on the cumulative benefits, and the first traversal sequence in the descending order is selected as the optimized traversal path.
[0017] By adopting the above technical solution, a situational knowledge base containing dialogue scene descriptions, node access sequences, and traversal effect scores is constructed, from which historical traversal paths with similar scene characteristics are extracted, and historical interaction experience can be used to guide current knowledge traversal. The cumulative benefits of each traversal path are calculated through dynamic programming analysis, and the long-term impact of path selection on the effect of knowledge reasoning is comprehensively considered. Based on the cumulative benefits, the candidate traversal sequence is sorted in descending order, and the optimal traversal path is selected, so that the knowledge reasoning process is more in line with cognitive laws. Through the accumulation and optimization of historical experience, the dynamic adjustment of knowledge traversal strategies is realized, which improves the knowledge organization ability of digital humans in different dialogue scenarios, making the generated response information more coherent and in line with user cognitive habits.
[0018] In combination with some embodiments of the first aspect, in some embodiments, extracting historical traversal paths with similar scene features from a contextual knowledge base specifically includes: Convert the current conversation scene into a feature vector representation, which includes entity type, relationship type, and hierarchical distribution features; Calculate the similarity between the feature vector and the description of each scene in the situational knowledge base; Filter out historical traversal paths corresponding to similar scenes whose similarity is greater than a preset similarity threshold; Perform cluster analysis on historical traversal paths and extract traversal patterns to form candidate traversal sequences.
[0019] By adopting the above technical solution, the current dialogue scene is converted into a vector representation containing entity types, relationship types and hierarchical distribution features, and the similarity with the description of each scene in the context knowledge base is calculated, so that historical scenes with similar interaction characteristics can be accurately identified. Through in-depth analysis and pattern extraction of historical traversal paths, effective reuse of knowledge traversal experience is achieved, the knowledge organization efficiency of digital humans in similar scenarios is improved, and the interaction process is made more intelligent.
[0020] In the second aspect, an embodiment of the present application provides a digital human interaction system based on a knowledge graph, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and one or more processors call the computer instructions to enable the system to execute the method described in the first aspect and any possible implementation method of the first aspect.
[0021] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a system, causes the system to execute the method described in the first aspect and any possible implementation of the first aspect.
[0022] In a fourth aspect, an embodiment of the present application provides a computer program product, characterized in that when the computer program product runs on a system, the system executes the method described in any possible implementation manner in the first aspect.
[0023] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. This application provides a digital human interaction method based on knowledge graph, which extracts key entities and entity relationships from question information, locates core nodes in a preset knowledge graph and generates a knowledge subgraph, thereby achieving accurate matching between questions and knowledge graphs. Based on the shortest path, the weight of the affinity relationship is calculated and pruned, retaining the knowledge nodes and associated edges most relevant to the question, and reducing the interference of irrelevant knowledge. The pruned knowledge subgraph is clustered according to the type of connection edge to obtain a multi-level structure, making the hierarchical relationship of knowledge clearer. On this basis, a depth-first traversal is performed to generate a knowledge reasoning chain, ensuring the coherence and logic of the reasoning process. The system is enabled to quickly extract knowledge related to the question from massive knowledge graphs, and generate accurate response information through a structured reasoning process. Through multi-dimensional analysis and hierarchical processing of knowledge, the accuracy and efficiency of digital human interaction are improved, while the logic and interpretability of the response are guaranteed, the limitations of processing cross-domain knowledge interaction are reduced, and a high degree of integration of multi-dimensional information is achieved.
[0024] 2. The present application provides a digital human interaction method based on knowledge graph, which uses the state transfer matrix and eigenvalue decomposition method to analyze the importance of nodes in the knowledge structure, and realizes the quantitative sorting and stratification of nodes. The element values in the state transfer matrix are determined based on the type of connection edge, retaining the semantic information of the relationship between nodes. The eigenvector component obtained by eigenvalue decomposition is used as the node importance score, which reflects the position of the node in the overall knowledge structure. The node stratification and connection relationship retention based on the importance score ensure that the optimized knowledge structure not only maintains the original hierarchical relationship, but also highlights the role of important nodes.
[0025] 3. The present application provides a digital human interaction method based on a knowledge graph, constructs a situational knowledge base containing dialogue scene descriptions, node access sequences, and traversal effect scores, extracts historical traversal paths with similar scene characteristics, and can draw on historical interaction experience to guide current knowledge traversal. The cumulative benefits of each traversal path are calculated through dynamic programming analysis, and the long-term impact of path selection on the effect of knowledge reasoning is comprehensively considered. The candidate traversal sequences are sorted in descending order based on the cumulative benefits, and the optimal traversal path is selected to make the knowledge reasoning process more in line with cognitive laws. Through the accumulation and optimization of historical experience, the dynamic adjustment of the knowledge traversal strategy is realized, which improves the knowledge organization ability of digital humans in different dialogue scenarios, and makes the generated response information more coherent and in line with user cognitive habits. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a flow chart of a digital human interaction method based on knowledge graph in an embodiment of the present application.
[0027] Figure 2This is another flow chart of a digital human interaction method based on a knowledge graph in an embodiment of the present application.
[0028] Figure 3 It is a schematic diagram of the physical device structure of a digital human interaction system based on a knowledge graph provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations comprising one or more listed items.
[0030] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0031] The following uses an embodiment and combines Figure 1 , a digital human interaction method based on knowledge graph in an embodiment of the present application is described: See also Figure 1 , which is a flow chart of a digital human interaction method based on knowledge graph in an embodiment of the present application.
[0032] S101, receiving question information input by a user, and extracting key entities and entity relationships from the question information; First, the system uses natural language understanding technology to perform semantic analysis and structured representation of the question information input by the user, and identifies the key information elements contained in the question, such as core nouns, verbs, adjectives, etc. Then, the system uses named entity recognition technology to further extract entities with specific semantic types from these key information elements, such as names of people, places, institutions, proper nouns, etc. Finally, the system uses dependency analysis technology to reveal the associations between different entities at the grammatical and semantic levels and construct an entity relationship map.
[0033] In specific implementation, the system can use a variety of natural language processing technologies to achieve the parsing of question information and the extraction of entity relationships. For example, the system can use a rule-based approach to perform pattern matching and part-of-speech tagging on question information based on predefined grammar templates and dictionary resources, and quickly identify key entities and relationship types. At the same time, the system can also introduce statistical learning-based methods, such as conditional random fields, support vector machines, etc., to automatically learn the discriminant models of entity recognition and relationship classification by training on large-scale annotated corpora, thereby improving the accuracy and generalization ability of information extraction. In addition, the system can also use deep learning technology to build an end-to-end question understanding model, directly map question information to the entity relationship representation space, and reduce reliance on artificial feature engineering.
[0034] S102, determining the core node with the highest correlation with the key entity in the preset knowledge graph, and generating a knowledge subgraph with a maximum depth of a preset value based on the core node; The system determines the core node with the highest correlation with the key entity in the preset knowledge graph, and generates a knowledge subgraph with a maximum depth of a preset value based on the core node. Specifically, the core node with the highest correlation with the key entity is determined by calculating the semantic similarity between each key entity and the node in the preset knowledge graph; Sort the nodes in the preset knowledge graph in descending order based on semantic similarity, and select candidate nodes whose semantic similarity is in the first preset number; Count the sum of the out-degree and in-degree of each candidate node. The out-degree represents the number of edges starting from the candidate node, and the in-degree represents the number of edges ending at the candidate node. The candidate nodes are sorted in descending order based on the sum of out-degree and in-degree, and the candidate node that ranks first after sorting is determined as the core node.
[0035] In order to explore the position and association context of key entities in the entire knowledge system, the system needs to quickly locate the most relevant knowledge nodes in the massive knowledge graph data. The association evaluation here not only considers the semantic similarity between the node and the key entity, but also the importance and centrality of the node itself. Specifically, the system first calculates the semantic similarity between each key entity and the node in the knowledge graph, and uses semantic embedding models such as Word2Vec to map entity words and node labels to a continuous vector space, and measures their proximity at the semantic level through indicators such as vector cosine distance and Jaccard coefficient. Then, the nodes in the knowledge graph are sorted with semantic similarity as the weight to select a set of candidate nodes. Next, the system counts the sum of the out-degree and in-degree of each candidate node, that is, the number of edges with the node as the starting point and end point, as the node importance indicator, and sorts the candidate nodes twice. The higher the out-degree, the more central the node is in the topological structure of the knowledge graph, and the closer the connection with other nodes is. After two rounds of sorting, the system selects the node with the highest comprehensive score as the core node.
[0036] In practical applications, the system can flexibly select algorithms for semantic similarity calculation and node importance evaluation. In addition to traditional word vector methods, the system can also adopt representation learning methods based on graph neural networks, such as GraphAttention Network, etc., while considering node content attributes and topological structure information, to learn more accurate node semantic embedding representations. At the same time, the system can introduce more factors that affect node importance, such as the clustering coefficient and PageRank value of the node, to characterize the central position of the node in the knowledge graph from multiple dimensions. In addition, for large-scale knowledge graphs, the system can also use approximate computing and data compression techniques to significantly improve the efficiency of node association analysis at the expense of a small amount of accuracy. A possible solution is that the system hierarchically divides and locally indexes the knowledge graph, first sorts the nodes within each subgraph, and then compares the association scores of the core nodes across the subgraph, thereby significantly reducing the search space for candidate nodes at each processing stage.
[0037] S103, calculating the shortest path between nodes in the knowledge subgraph, and determining the affinity weight between nodes according to the length of the shortest path; The system calculates the shortest path between nodes in the knowledge subgraph and determines the weight of the affinity between nodes based on the length of the shortest path. Calculating the shortest path between nodes in the knowledge subgraph specifically includes: Construct a node adjacency matrix, where each element in the node adjacency matrix indicates whether there is a direct connection relationship between the corresponding nodes; A distance matrix is constructed based on the node adjacency matrix. In the initial value of the distance matrix, the distance between directly connected nodes is a preset value, and the distance between unconnected nodes is infinite; The distance matrix is iteratively updated to obtain the shortest path between nodes.
[0038] The shortest path reflects the closest connection channel between nodes in the knowledge subgraph. The shorter the path, the more direct the semantic association between nodes, and the higher its importance in the construction of the reasoning chain. In order to efficiently calculate the shortest path between each pair of nodes, the system uses a classic graph theory algorithm. First, the knowledge subgraph is converted into the form of a node adjacency matrix. Each element in the matrix indicates whether there is a direct edge between the corresponding node. Then, an initial distance matrix is constructed based on the adjacency matrix. The distance between directly connected nodes is initialized to 1, and the distance between unconnected nodes is initialized to infinity. Next, the system uses the distance matrix as input and performs dynamic programming solution through the Floyd-Warshall algorithm, continuously updating the distance value between each pair of nodes in the distance matrix until it converges to the shortest path length between each node.
[0039] In practical applications, the system can select different shortest path algorithms according to the scale and sparsity of the knowledge subgraph. For dense graphs, the time complexity of the Floyd-Warshall algorithm is cubic, while for sparse graphs, heuristic methods such as the Dijkstra algorithm or A* search can converge faster. At the same time, in order to process large-scale knowledge subgraphs, the system can also introduce distributed computing frameworks, such as Spark GraphX, to decompose the shortest path calculation task into multiple parallel processing units, significantly improving the scalability of the algorithm. A possible optimization solution is that the system performs community discovery and modular division on the knowledge subgraph, first independently calculates the shortest path within the community, and then propagates the distance update between communities, reducing unnecessary node pair comparisons and improving computational efficiency. In addition, considering the dynamic evolution characteristics of the knowledge graph in the real world, the system can also use an incremental shortest path algorithm, which only locally updates the newly added or deleted edges based on the original distance matrix to avoid recalculation from scratch and improve the time sensitivity of the algorithm.
[0040] S104, pruning the knowledge subgraph based on the affinity weight, retaining the nodes and corresponding associated edges whose affinity weight is higher than a preset threshold, and obtaining an optimized knowledge subgraph; The system prunes the knowledge subgraph based on the affinity weight, retains the nodes with affinity weight higher than the preset threshold and the corresponding associated edges, and obtains the optimized knowledge subgraph. The knowledge subgraph contains a lot of redundant and noisy information, which will interfere with the generation of subsequent reasoning chains and the extraction of answers. In order to optimize the quality and efficiency of the knowledge subgraph, the system needs to prune and simplify it appropriately. Here, the node affinity weight calculated by the shortest path length is used as a measure of node importance. The larger the affinity weight, the closer the relationship between the node and the core node, and the more critical its role in the reasoning chain. Therefore, the system sets a weight threshold to filter all nodes in the knowledge subgraph, retaining only nodes with weights greater than the threshold and the associated edges between them, eliminating a large number of redundant nodes with low relevance, and obtaining an optimized knowledge subgraph with a smaller scale and higher density.
[0041] S105, clustering each node in the optimized knowledge subgraph according to the type of the corresponding connection edge to obtain a multi-level knowledge structure; Knowledge subgraphs usually contain many different types of semantic relationships, such as attributes, positions, causality, and parallelism, which require fine-grained relationship modeling and organization. The system uses a node clustering method based on the type of connection edges to classify nodes with similar semantics into the same category and construct a hierarchical knowledge structure graph. Specifically, the system traverses each edge in the optimized knowledge subgraph and extracts its semantic type label, such as "attribute_of", "located in", "leads to", etc. Then, for each node, the type distribution of its connection edges is counted to obtain a relationship type feature vector. Next, the system uses clustering algorithms such as K-Means to automatically cluster nodes using relationship type feature vectors as samples. During the clustering process, nodes with similar distances in the feature space are divided into the same category to form a semantically tight knowledge cluster. Different knowledge clusters form hierarchical nested relationships based on the diversity of their connection edges.
[0042] In practical applications, the category labels of knowledge clusters are usually difficult to obtain accurately, and the system needs to automatically infer them based on the semantic similarity of the edges. A feasible method is for the system to train a relation classifier based on a large-scale corpus, taking the text description of the connecting edge as input to predict its semantic type. The neural network classifier using the attention mechanism can simultaneously model the local semantic information and global structural information of the edge, thereby improving the accuracy of classification. At the same time, in order to improve the interpretability of knowledge clusters, the system can perform statistical analysis on the text labels of the nodes in the cluster and extract high-frequency co-occurrence words as the representative labels of the cluster. For large-scale knowledge subgraphs, the computational overhead of hierarchical clustering is high. The system can use an approximate algorithm based on random walks to estimate the neighborhood similarity of nodes by sampling the subgraph structure, thereby reducing the time complexity of clustering. A possible improvement is to introduce a multi-view learning mechanism to integrate the content semantic features of the nodes in addition to the relation type features, to achieve more comprehensive semantic modeling and improve the cohesion and diversity of knowledge clusters.
[0043] S106, performing depth-first traversal in a multi-level knowledge structure according to entity relationships to generate a knowledge reasoning chain; Based on the optimized and clustered knowledge subgraph, the system needs to build a reasoning evidence chain related to the problem according to the entity and relationship clues in the original problem. Here, a depth-first search strategy is adopted. Starting from the core entity in the original problem, the nodes most closely associated with the core entity are explored in depth, until all the key entities in the problem appear in the reasoning chain. At the same time, during the traversal process, the system also needs to record the type of knowledge cluster to which the node belongs and obtain the hierarchical information of the reasoning chain. Specifically, the system first adds the core entity node to a node stack to be visited and marks it as visited, and then enters a loop: pop the top node of the stack and add it to the current reasoning chain. Check all outgoing edges of the popped node. For each outgoing edge, if the target node connected to it contains the key entity in the problem and has not been visited, push the target node into the stack and mark it as visited, and recursively execute the next round of loop; if the current node does not contain a new key entity, add it and the relationship label on the corresponding edge to the current reasoning chain, and continue to pop the next top node of the stack. Until the stack is empty, that is, all nodes to be visited have been traversed, the loop ends, and the final reasoning chain is output.
[0044] S107. Generate reply information based on the knowledge reasoning chain, and control the digital human to output the reply information.
[0045] This step is for the end user, converting the previously constructed knowledge reasoning chain into an answer text expressed in natural language. Specifically, the system first performs semantic analysis on the nodes and edge relationships in the reasoning chain to extract key information elements, such as attribute values, numerical values, entity names, etc. Then, based on the question type and the hierarchical structure of the reasoning chain, select a suitable answer template, such as definition judgment, method steps, causal analysis, etc. Next, the system fills the extracted information elements into the slots of the answer template, and generates transitional statements connecting the template slots according to the semantic type of the edge relationship to form a complete answer statement. Finally, the system controls the digital human to output the answer statement to the user in a natural dialogue. While outputting, the system can also generate a visual version of the answer statement to provide users with graphical reasoning chain evidence to enhance the interpretability and credibility of the answer.
[0046] In practical applications, due to the flexibility of natural language expression, problems such as grammatical errors, logical conflicts, and information redundancy often occur during the answer generation process, affecting the quality of the answer. To this end, the system can introduce answer optimization technology based on language models, automatically learn the grammatical and semantic features of question and answer texts through deep neural networks pre-trained on large-scale corpora, and polish and rewrite the generated answers. One idea is to use attention mechanism models such as Transformer, take the knowledge reasoning chain as input, and the answer text as output, and train the conditional language generation model end-to-end. At the same time, the system can also integrate the structural information of the reasoning chain, design an encoder-decoder architecture based on graph neural networks, and explicitly model the semantic dependencies between nodes and edges. Taking into account the differences in reading comprehension levels and information needs of different users, the system can also support personalized answer generation, and dynamically adjust the degree of detail, language style, and information granularity of the answer according to the user's knowledge background, focus, and other attributes. One possible optimization direction is to introduce an active learning mechanism to score and correct the answers through user feedback, and continuously optimize the effect of the answer generation model.
[0047] In the above embodiment, key entities and entity relationships are extracted from the question information, core nodes are located in the preset knowledge graph, and knowledge subgraphs are generated, so as to achieve accurate matching between the question and the knowledge graph. Based on the shortest path, the affinity weight is calculated and pruned, and the knowledge nodes and associated edges most relevant to the question are retained, reducing the interference of irrelevant knowledge. The pruned knowledge subgraph is clustered according to the connection edge type to obtain a multi-level structure, making the hierarchical relationship of knowledge clearer. On this basis, a depth-first traversal is performed to generate a knowledge reasoning chain, ensuring the coherence and logic of the reasoning process. The system is enabled to quickly extract knowledge related to the question from a massive knowledge graph, and generate accurate reply information through a structured reasoning process. Through the multi-dimensional analysis and hierarchical processing of knowledge, the accuracy and efficiency of digital human interaction are improved, while the logic and interpretability of the reply are guaranteed, the limitations of processing cross-domain knowledge interaction are reduced, and a high degree of integration of multi-dimensional information is achieved.
[0048] In order to further improve the accuracy and efficiency of knowledge reasoning during digital human interaction, the embodiment of this application introduces a state transition matrix and a contextual knowledge base on the basis of the above technical solution, deeply optimizes the multi-level knowledge structure, and dynamically adjusts the knowledge traversal strategy based on historical experience. Figure 2 , another digital human interaction method based on knowledge graph in the embodiment of the present application is described: See also Figure 2 , is another flow chart of a digital human interaction method based on knowledge graph in an embodiment of the present application.
[0049] S201. Construct a state transition matrix based on a multi-level knowledge structure; The system constructs a state transfer matrix based on a multi-level knowledge structure. The element values of the state transfer matrix are determined according to the type of connection edges between each node. Specifically: statistics on the number distribution of each type of connection edges in the multi-level knowledge structure; The weight coefficient of each type of connection edge is calculated based on the quantity distribution, and the weight coefficient is inversely proportional to the number of the corresponding type of connection edge; Calculate the state transition probability according to the type of connecting edges between nodes and their corresponding weight coefficients; The state transfer probability is normalized to obtain the state transfer matrix.
[0050] In this step, the system constructs a state transfer matrix based on the existing multi-level knowledge structure. The multi-level knowledge structure is a way to organize and represent knowledge. It uses nodes and connecting edges to represent conceptual entities and their relationships, and uses a hierarchical structure to reflect the abstract level of knowledge. The state transfer matrix is used to describe the probability of transferring from one node to another in the knowledge structure. By analyzing the topological characteristics and node connection relationships of the multi-level knowledge structure, the element values in the state transfer matrix can be calculated.
[0051] Specifically, the system first counts the number distribution of each type of connection edge in the multi-level knowledge structure to understand the distribution characteristics of different relationship types in the knowledge base. Then, the system calculates the weight coefficient of each type of connection edge based on the number distribution. The weight coefficient is inversely proportional to the number of connection edges of the corresponding type. Relationship types with lower frequencies are given higher weights to balance the influence of each relationship type on state transition. Next, the system calculates the state transition probability between nodes based on the connection edge type between each node and its corresponding weight coefficient. Finally, all state transition probabilities are normalized to satisfy the properties of probability distribution, thereby obtaining a complete state transition matrix.
[0052] S202, performing eigenvalue decomposition on the state transfer matrix to obtain an eigenvector corresponding to the maximum eigenvalue, and using the components of the eigenvector as the importance score of each node; In this step, the system performs eigenvalue decomposition on the constructed state transfer matrix, and reveals the intrinsic structural characteristics of the state transfer matrix through the matrix decomposition method. Eigenvalue decomposition is a commonly used matrix decomposition technique, which decomposes the matrix into a linear combination of eigenvalues and eigenvectors. By solving the eigenvalue problem, the eigenvalues and corresponding eigenvectors of the state transfer matrix can be obtained. Among them, the eigenvector corresponding to the maximum eigenvalue has important physical significance, which reflects the steady-state distribution of the state transfer matrix, that is, the equilibrium probability distribution of each state after the system has evolved for a long time.
[0053] Based on this principle, the system uses the component of the eigenvector corresponding to the maximum eigenvalue as the importance score of each node. Each component of the eigenvector represents the probability value of the corresponding node under steady-state distribution. The larger the value, the more important the node is in the knowledge structure and the greater the possibility of being accessed during the state transfer process. Therefore, the eigenvector component can be directly used to measure the importance of the node.
[0054] S203, ranking the importance of each node based on the importance score, and dividing each node into several importance levels according to a preset level threshold; After obtaining the importance score of each node, the system needs to sort and stratify the nodes based on the importance score. By sorting the importance, the core nodes and edge nodes in the knowledge structure can be quickly identified, and the relative importance of the nodes in the entire knowledge system can be understood. At the same time, by setting the level threshold to stratify the nodes, the knowledge structure can be divided into different importance levels, forming a hierarchical knowledge organization form.
[0055] Specifically, the system first uses an appropriate sorting algorithm to sort the nodes in descending order based on the importance scores of the nodes, and the nodes with higher importance scores are ranked higher. Common sorting algorithms include quick sort and merge sort. The system can select a suitable sorting algorithm based on the number of nodes and the hardware environment, taking into account both sorting efficiency and stability. After the sorting is completed, the system divides the nodes into several importance levels according to the preset level threshold. The level threshold can be set according to factors such as the scale of the knowledge structure and the distribution of node importance, and usually adopts an equidistant or equifrequency segmentation method. Each importance level corresponds to an importance score interval, and the nodes in this interval are classified into the corresponding level.
[0056] S204, retaining the connection relationship between adjacent level nodes in the multi-level knowledge structure according to the importance level, to obtain a multi-level knowledge structure after level optimization; In this step, the system optimizes the multi-level knowledge structure and obtains a simplified and efficient knowledge structure representation by retaining the connection relationship between nodes of adjacent importance levels. This optimization process is based on the importance level information of the nodes and aims to filter out redundant or low-value connections, highlight the main thread of the knowledge structure, and improve the efficiency of subsequent knowledge reasoning and interaction.
[0057] Specifically, the system traverses all the connecting edges in the multi-level knowledge structure, and for each connecting edge, determines whether its two end nodes belong to adjacent importance levels. If the two end points of the connecting edge are respectively located in adjacent levels, the connection relationship is retained; otherwise, the connection relationship is removed. After this screening process, the original multi-level knowledge structure is simplified into a hierarchically optimized knowledge structure, which only contains connections between adjacent importance levels. This optimization method can effectively remove redundant connections across levels and reduce the complexity of the knowledge structure.
[0058] When implementing hierarchical optimization, the system can use appropriate data structures and algorithms to improve processing efficiency. For example, the system can store knowledge structures based on adjacency lists or adjacency matrices to facilitate rapid retrieval of node connection information; the system can also use a parallel computing framework to accelerate the screening process of connection edges using multi-core processors or distributed environments. At the same time, the system can introduce some preprocessing techniques, such as sorting nodes and connection edges, hash indexing, etc., to further optimize the time complexity of hierarchical screening.
[0059] S205, constructing a situational knowledge base, extracting historical traversal paths with similar scene features from the situational knowledge base, and obtaining a candidate traversal sequence; The system builds a contextual knowledge base, extracts historical traversal paths with similar scenario features from the contextual knowledge base, and obtains candidate traversal sequences. Specifically: the current dialogue scenario is converted into a feature vector representation, which includes entity type, relationship type, and hierarchical distribution features; Calculate the similarity between the feature vector and the description of each scene in the situational knowledge base; Filter out historical traversal paths corresponding to similar scenes whose similarity is greater than a preset similarity threshold; Perform cluster analysis on historical traversal paths and extract traversal patterns to form candidate traversal sequences.
[0060] In this step, the system builds a contextual knowledge base to store and manage knowledge and experience related to specific interaction scenarios. The contextual knowledge base contains not only information about the multi-level knowledge structure itself, but also a series of historical traversal paths, that is, the sequence of nodes that the system has actually visited in previous interactions. By analyzing and utilizing these historical experiences, the system can better adapt to current interaction needs and provide personalized, context-related knowledge services.
[0061] Specifically, the system first converts the current dialogue scene into a feature vector representation, taking into account factors such as the entity types, relationship types, and distribution in the knowledge structure involved in the scene. Then, based on the feature vector, the system calculates the similarity between the current scene and each historical scene in the contextual knowledge base. Similarity calculations can use common metrics such as cosine similarity and Jaccard coefficient. Next, the system screens out historical scenes whose similarity to the current scene exceeds a preset threshold, and extracts the corresponding historical traversal paths to form a set of candidate traversal sequences. These candidate sequences reflect the system's successful experience in similar scenarios and are of great reference value for guiding current interactions.
[0062] When implementing the contextual knowledge base, the system can use appropriate database technologies for design and optimization, such as relational databases, NoSQL databases, etc., to support efficient data storage, retrieval, and updating. At the same time, the system can introduce technologies such as content-based recommendation algorithms and collaborative filtering algorithms to make personalized historical path recommendations based on scene similarity and user preferences. In addition, for massive historical traversal data, the system can also use big data processing frameworks, such as Hadoop and Spark, to achieve distributed computing and real-time analysis, and improve the performance and effect of context matching.
[0063] S206, performing dynamic programming analysis on the candidate traversal sequence, and calculating the cumulative benefits of each traversal path; After obtaining the candidate traversal sequence, the system needs to evaluate the quality and utility of each traversal path in order to select the optimal path to guide the current knowledge interaction. In this step, the system uses dynamic programming to analyze the candidate traversal sequence, calculates the cumulative benefits of each path, quantifies the comprehensive value of the path, and provides a basis for subsequent decision-making.
[0064] Dynamic programming is a commonly used optimization algorithm that decomposes complex problems into interrelated sub-problems and uses the optimal solutions to the sub-problems to construct the optimal solution to the original problem. In traversal path analysis, the system regards each path as a sequence of nodes and designs a cumulative benefit function to evaluate the quality of the node sequence. The cumulative benefit function considers multiple factors such as the importance of the node, the correlation between nodes, and the access cost, and obtains the comprehensive benefit value of the path through weighted summation or nonlinear combination. Using the idea of dynamic programming, the system can efficiently calculate the optimal cumulative benefit of each candidate path, avoiding repeated calculations and exhaustive searches.
[0065] In specific implementation, the system can represent the candidate traversal sequence as a directed acyclic graph, where nodes correspond to entities in the knowledge structure and edges represent the relationships between entities. A dynamic programming algorithm is applied to the graph to calculate the optimal cumulative benefits of the nodes from the bottom up. For each node, the system considers all possible predecessor nodes, and updates the optimal cumulative benefits of the node based on the benefit value of the current node and the transfer cost of the edge. Through recursive formulas and memorandum technology, the system can efficiently solve the optimal cumulative benefit distribution of the entire candidate sequence.
[0066] S207. Sort the candidate traversal sequences in descending order based on the cumulative benefits, and select the first traversal sequence in the descending order as the optimized traversal path.
[0067] After completing the calculation of the cumulative benefits of the candidate traversal sequences, the system needs to sort the sequences according to the benefit value and select the optimal path as the guide for the current interaction. In this step, the system uses descending sorting to put the traversal sequence with the highest cumulative benefit first and determines it as the optimized traversal path to guide subsequent knowledge reasoning and information presentation.
[0068] In specific implementation, the system can use common sorting algorithms, such as quick sort, merge sort, heap sort, etc., to sort the traversal sequences in descending order according to their cumulative revenue values. Since the number of candidate sequences is usually limited, the time complexity of the sorting process will not become a performance bottleneck. After the sorting is completed, the system directly selects the first sequence in the sorting result as the optimized traversal path. The cumulative revenue value of this path is at the top of all candidate paths, representing the best choice in the current interaction scenario.
[0069] After selecting the optimized traversal path, the system can navigate and traverse the knowledge structure according to the path, access key nodes on the path, extract relevant knowledge, and present it to the user in an appropriate manner. The nodes of the optimized path have a wide coverage and high information density, and can provide users with the maximum knowledge benefits within a limited number of interaction steps. At the same time, the system can also use the structural characteristics and node attributes of the optimized path to dynamically adjust the interaction strategy and presentation method, such as adjusting the amount of information, controlling the depth of interaction, and introducing multimedia elements, to enhance user understanding and experience.
[0070] When responding to real-time interaction needs, the system can adopt an incremental optimization strategy. Based on the existing sorting results, it can dynamically update the cumulative benefit value of the candidate sequence according to the latest user feedback and scenario changes, and adjust the optimized traversal path accordingly. This dynamic tuning mechanism enables the system to adapt to the user's knowledge preferences and interaction intentions in a timely manner and provide continuously optimized knowledge services. In addition, the system can also summarize general traversal patterns and rules by learning and analyzing a large number of optimization paths, forming knowledge navigation templates for different scenarios, and further improving interaction efficiency and quality.
[0071] In the above embodiment, the importance of nodes in the knowledge structure is analyzed by using the state transfer matrix and eigenvalue decomposition method, so as to realize the quantitative sorting and stratification of nodes. The element values in the state transfer matrix are determined based on the type of connection edge, and the semantic information of the relationship between nodes is retained. The eigenvector components obtained by eigenvalue decomposition are used as the node importance score, which reflects the position of the node in the overall knowledge structure. The node stratification and connection relationship retention based on the importance score enable the optimized knowledge structure to maintain the original hierarchical relationship and highlight the role of important nodes.
[0072] The following describes the system in the embodiment of the present invention from the perspective of hardware processing. Figure 3 , which is a schematic diagram of the physical device structure of a digital human interaction system based on a knowledge graph provided in an embodiment of the present application.
[0073] It should be noted that Figure 3 The structure of the system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0074] like Figure 3As shown, the system includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303, such as executing the method in the above embodiment. In RAM 303, various programs and data required for system operation are also stored. CPU 301, ROM 302 and RAM 303 are connected to each other through a bus 304. Input / output (I / O) interface 305 is also connected to bus 304.
[0075] The following components are connected to the I / O interface 305: an input section 306 including a camera, an infrared sensor, etc.; an output section 307 including a liquid crystal display (LCD) and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed so that a computer program read therefrom is installed into the storage section 308 as needed.
[0076] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 309, and / or installed from a removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, various functions defined in the present invention are performed.
[0077] It should be noted that the computer-readable medium shown in the embodiment of the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
[0078] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. Among them, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0079] As another aspect, the present invention further provides a computer-readable storage medium, which may be included in the system described in the above embodiment; or may exist independently without being assembled into the system. The above storage medium carries one or more computer programs, and when the above one or more computer programs are executed by a processor of a system, the system implements the method provided in the above embodiment.
[0080] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0081] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.
[0082] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. 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 computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, 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 includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0083] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. A digital human interaction method based on knowledge graph, characterized in that: include: Receive question information input by a user, and extract key entities and entity relationships from the question information; Determine a core node with the highest correlation with the key entity in a preset knowledge graph, and generate a knowledge subgraph with a maximum depth of a preset value based on the core node; Calculating the shortest path between the nodes in the knowledge subgraph, and determining the affinity weights between the nodes according to the length of the shortest path; Pruning the knowledge subgraph based on the affinity weight, retaining nodes and corresponding associated edges whose affinity weights are higher than a preset threshold, to obtain an optimized knowledge subgraph; Clustering each node in the optimized knowledge subgraph according to the type of corresponding connection edges to obtain a multi-level knowledge structure; Performing a depth-first traversal in the multi-level knowledge structure according to the entity relationship to generate a knowledge reasoning chain; Generate reply information based on the knowledge reasoning chain, and control the digital human to output the reply information.
2. The method according to claim 1, characterized in that Determining the core node with the highest correlation with the key entity in the preset knowledge graph specifically includes: Calculating the semantic similarity between each of the key entities and the nodes in the preset knowledge graph; Sort the nodes in the preset knowledge graph in descending order based on the semantic similarity, and select candidate nodes whose semantic similarity is in the front of a preset number; Counting the sum of the out-degree and in-degree of each candidate node, the out-degree represents the number of edges starting from the candidate node, and the in-degree represents the number of edges ending at the candidate node; The candidate nodes are sorted in descending order based on the sum of the out-degree and the in-degree, and the candidate node that is ranked first after the sorting is determined as the core node.
3. The method according to claim 1, characterized in that The calculating the shortest path between the nodes in the knowledge subgraph specifically includes: Constructing a node adjacency matrix, wherein each element in the node adjacency matrix indicates whether there is a direct connection relationship between corresponding nodes; Constructing a distance matrix based on the node adjacency matrix, wherein in the initial value of the distance matrix, the distance between directly connected nodes is a preset value, and the distance between unconnected nodes is infinite; The distance matrix is iteratively updated to obtain the shortest path between the nodes.
4. The method according to claim 1, characterized in that Before performing depth-first traversal in the multi-level knowledge structure according to the entity relationship to generate a knowledge reasoning chain, the method further includes: Constructing a state transfer matrix based on the multi-level knowledge structure, wherein element values of the state transfer matrix are determined according to the type of connection edges between the nodes; Performing eigenvalue decomposition on the state transfer matrix to obtain an eigenvector corresponding to the maximum eigenvalue, and using the components of the eigenvector as the importance score of each of the nodes; Sorting the importance of each of the nodes based on the importance score, and dividing each of the nodes into a number of importance levels according to a preset level threshold; The connection relationship between adjacent level nodes in the multi-level knowledge structure is retained according to the importance level to obtain a multi-level knowledge structure with optimized levels.
5. The method according to claim 4, characterized in that The constructing of a state transfer matrix based on the multi-level knowledge structure specifically includes: Counting the number distribution of each type of connection edges in the multi-level knowledge structure; Calculate a weight coefficient of each type of connection edge based on the quantity distribution, wherein the weight coefficient is inversely proportional to the quantity of the corresponding type of connection edge; Calculate the state transition probability according to the type of the connecting edge between each of the nodes and its corresponding weight coefficient; The state transfer probability is normalized to obtain a state transfer matrix.
6. The method according to claim 4 or 5, characterized in that: After obtaining the multi-level knowledge structure after level optimization, the method further includes: Constructing a contextual knowledge base, wherein the contextual knowledge base includes a dialogue scenario description, a node access sequence, and a corresponding traversal effect score; Extracting historical traversal paths with similar scene features from the situational knowledge base to obtain candidate traversal sequences; Performing dynamic programming analysis on the candidate traversal sequence to calculate the cumulative benefits of each traversal path; The candidate traversal sequences are sorted in descending order based on the cumulative benefits, and the first traversal sequence in the descending order is selected as the optimized traversal path.
7. The method according to claim 6, characterized in that The extracting of historical traversal paths with similar scene features from the situational knowledge base specifically includes: Converting the current dialogue scene into a feature vector representation, wherein the feature vector representation includes entity type, relationship type, and hierarchical distribution features; Calculating the similarity between the feature vector and each scene description in the situational knowledge base; Filter out the historical traversal paths corresponding to the similar scenes whose similarity is greater than a preset similarity threshold; Cluster analysis is performed on the historical traversal paths to extract traversal patterns to form candidate traversal sequences.
8. A digital human interaction system based on knowledge graph, characterized in that: The system comprises: One or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to cause the system to execute the method as described in any one of claims 1-7.
9. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on a system, the system is caused to execute the method according to any one of claims 1 to 7.
10. A computer program product, characterized in that When the computer program product is run on a system, the system is caused to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Knowledge graph semantic question-answering method and device, computer equipment and storage medium
CN112487168A
Knowledge graph question and answer method and system based on path sorting
CN113742446A
Question and answer method and device based on multi-modal input and knowledge graph
CN117521814A
Visual development system for knowledge graph
CN118093895A
Knowledge graph retrieval method and device, medium and product
CN118227668A
Cited By
Request response method and device, electronic equipment and storage medium
CN120407755A
Information acquisition method and device based on knowledge graph, equipment and storage medium
CN120596633A
Knowledge graph-based information acquisition method and device, equipment and storage medium
CN120596633B
Digital human configuration method and system based on industrial element universe digital twinning
CN120763197A
Digital human configuration method and system based on industrial metaverse digital twinning
CN120763197B