A reliable reasoning and question answering method and apparatus that combines large-scale models and knowledge graphs

By employing a trusted reasoning and question-answering method that combines large models and knowledge graphs, and using semantic maximum marginal relevance and path exploration strategies, the system addresses the insufficient generalization ability of named entity recognition and entity disambiguation. This enables efficient and accurate entity linking and path exploration in open domains, improving the system's adaptability and interpretability.

CN121706989BActive Publication Date: 2026-05-05XIAN INT STUDIES UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIAN INT STUDIES UNIV
Filing Date
2026-02-10
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing technologies have weak generalization ability in named entity recognition and entity disambiguation, making it difficult to cope with the diverse entity types and complex language expressions in open domains. Furthermore, existing reasoning methods lack accuracy in complex, multi-level question-answering tasks and are unable to provide interpretable answers.

Method used

By collaborating with large models and knowledge graphs, and employing a semantic maximum marginal relevance and a "coarse-to-fine" entity linking strategy, combined with hard constraints and semantic soft guidance for path exploration, and utilizing immediate reward differences for path quality assessment, a reliable reasoning and question answering method is constructed.

Benefits of technology

It enables efficient and accurate entity linking and path exploration in open domains, improving the system's adaptability, efficiency, and interpretability, and ensuring the credibility and transparency of the reasoning process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121706989B_ABST
    Figure CN121706989B_ABST
Patent Text Reader

Abstract

This invention discloses a reliable reasoning and question-answering method and apparatus based on the collaboration of a large model and a knowledge graph, belonging to the fields of artificial intelligence and natural language processing. It extracts keywords through semantic guidance and links them to entities in the knowledge graph to determine the initial entities; then, it explores paths based on a decision-evaluation collaborative mechanism, expanding paths by combining hard constraints and semantic soft guidance, and dynamically pruning based on the difference in immediate rewards and patience thresholds; finally, it outputs the answer and a traceable reasoning path. This invention solves the problems of rule-dependent entity recognition, black-box reasoning process, and poor interpretability in open-domain question answering, balancing semantic understanding generalization ability with controllable and reliable reasoning process, improving question-answering accuracy, reasoning efficiency, and result reliability, and its overall performance is superior to traditional rule-based, heuristic, or pure neural network-based methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence and natural language processing technology, specifically relating to a reliable reasoning and question answering method and apparatus that combines large models and knowledge graphs. Background Technology

[0002] Knowledge graph-based question-answering reasoning technology provides users with accurate and relevant answers by fully utilizing the structured knowledge information within the knowledge graph. The core objective of this technology is to improve the accuracy of queries in large-scale, complex knowledge bases through reasoning models, while ensuring the interpretability of the reasoning process. It mainly consists of two key modules: question understanding and answer reasoning.

[0003] The problem understanding module includes components such as named entity recognition, entity linking, and entity disambiguation. While traditional rule-based named entity recognition methods offer high efficiency and interpretability in certain specific scenarios, their generalization ability is weak, making it difficult to handle the diverse entity types and complex language expressions in open domains. Deep learning-based entity recognition methods, such as the sequence labeling model based on transducer-based bidirectional encoder representations and bidirectional long short-term memory networks and conditional random fields (BERT-BiLSTM-CRF), can adapt well to some domain data, but still face insufficient accuracy when dealing with unseen entities, long-tailed entities, and composite entities. When entities are split, missed, or misidentified, the construction of subsequent reasoning paths is also affected. Furthermore, traditional entity disambiguation methods mainly rely on semantic similarity calculations based on name matching or single contextual information. In large-scale knowledge graphs, when faced with semantically similar or homonymous entities, they often struggle to effectively distinguish the complex relationships and contexts between multiple entities.

[0004] In the area of ​​answer reasoning, existing research mainly focuses on logical rule reasoning, heuristic reasoning, and neural network reasoning. Logical rule reasoning utilizes expert-defined rules or statistical features to explicitly reason about knowledge graphs, thereby deriving the answer to the question. The core advantage of this type of method lies in its good interpretability; the reasoning process is clear and transparent, and users can intuitively understand the basis of the reasoning. However, in complex, multi-layered reasoning question-answering tasks, the coverage of rules is often insufficient, limiting the adaptability and flexibility of the model.

[0005] Heuristic reasoning methods, based on existing knowledge in a graph, infer new facts or relationships through certain rules or heuristic strategies. They typically rely on simplified assumptions or patterns and can quickly provide feasible reasoning paths. Due to their high interpretability, they are often suitable for scenarios requiring high transparency, but may not guarantee high accuracy when faced with complex reasoning tasks.

[0006] Neural network inference methods employ a "representation + reasoning" architecture. On one hand, the representation model effectively addresses the sparsity problem of knowledge graphs by mapping entities and relations to a low-dimensional vector space. On the other hand, the path reasoning method based on neural networks, with its end-to-end modeling of the problem and reasoning path, can effectively solve multi-hop reasoning problems that are difficult to handle with traditional methods. However, due to its inherent black-box nature, the interpretability of neural network inference methods is relatively weak. Summary of the Invention

[0007] To address the aforementioned problems in the prior art, the present invention is achieved through the following technical solution:

[0008] In a first aspect, this invention provides a reliable reasoning and question-answering method that combines a large model with a knowledge graph, comprising the following steps:

[0009] A set of candidate keywords is generated based on the query question. The candidate keywords are then filtered based on their marginal relevance scores to obtain the final keyword set. Each keyword in the final keyword set is linked to its corresponding entity in the knowledge graph to obtain the candidate entity for each keyword. The candidate entities are then filtered to obtain the initial entity.

[0010] The path exploration state is determined based on the query question and the initial entity. A set of candidate path expansion actions is obtained based on the path exploration state. Hard constraints are applied to the set of candidate path expansion actions to obtain a set of compliant actions. Semantic soft guidance is applied to the set of compliant actions to select compliant actions for path expansion, resulting in a set of exploration paths for the current expansion step. The set of exploration paths for the current expansion step is filtered based on the difference in immediate rewards to obtain a set of valid paths. The process of selecting compliant actions for path expansion and obtaining a set of valid paths is repeated until the number of repetitions exceeds a set threshold, at which point the expansion stops and a set of terminated paths is obtained.

[0011] The final evidence set is obtained from the set of termination paths, and the answer to the query question is obtained from the final evidence set.

[0012] A candidate keyword set is generated based on the query question. This set is then filtered based on the marginal relevance scores of the candidate keywords to obtain the final keyword set, which includes:

[0013] The bge-base-zh-v1.5 model is used to map the query question and the candidate keywords in the set into high-dimensional semantic vectors for the question and candidate keywords, respectively.

[0014] The semantic relevance between the query question and the candidate keywords is calculated based on the high-dimensional semantic vector of the question and the high-dimensional semantic vector of the candidate keywords. The marginal relevance score of the candidate keywords is determined based on the semantic relevance. The candidate keywords with the highest marginal relevance score in each round are selected in a greedy manner and added to the final keyword set until the size of the final keyword set reaches the preset value or the maximum number of iterations is reached.

[0015] Each keyword in the final keyword set is linked to its corresponding entity in the knowledge graph to obtain the candidate entities corresponding to each keyword, including:

[0016] The entities in the knowledge graph are vectorized and normalized to obtain entity vectors. K-Means clustering is performed on the entity vectors to obtain M cluster centers. Each entity in the knowledge graph is assigned to the nearest cluster center to form multiple semantic clusters.

[0017] The keywords in the final keyword set are vectorized and normalized to obtain keyword vectors. The similarity between the keyword vectors and the cluster center vectors is calculated. The m cluster centers with the highest similarity are selected. The similarity between the keyword vectors and entity vectors is calculated in the semantic clusters corresponding to the m cluster centers. The top N entities with the highest similarity are retained as candidate entities corresponding to the keywords.

[0018] The candidate entities are filtered to obtain the initial entities, including:

[0019] Construct the final feature vector of the candidate entities, calculate the probability that the candidate entity corresponding to each keyword is the initial entity based on the final feature vector of the candidate entities, determine the score of the candidate entities based on the probability that the candidate entities are the initial entities, and select the candidate entity with the highest score as the initial entity.

[0020] Constructing the final feature vector of the candidate entities includes:

[0021] The query question and candidate entities are encoded independently to obtain query question vector sequences and candidate entity vector sequences; the two are semantically aligned to obtain fused semantic vectors of candidate entities; the structural enhancement features of candidate entities are linearly projected to obtain projected structural enhancement feature vectors.

[0022] The final feature vector of the candidate entity is obtained by concatenating the fused semantic vector of the candidate entity and the projected structurally enhanced feature vector.

[0023] Based on the path exploration state, a set of candidate path expansion actions is obtained, including:

[0024] Based on the query path exploration state query, the current entity in the corresponding knowledge graph is used as the candidate path expansion action set, and all relation-entity pairs in the knowledge graph with the current entity as the head entity or tail entity are used as the candidate path expansion action set.

[0025] Semantic soft guidance is applied to the set of compliant actions, and compliant actions are selected for path expansion to obtain the set of exploration paths for the current expansion step, including:

[0026] Calculate the semantic similarity between the query question and the current entity, and construct a semantic mask question based on the semantic similarity. Form a probability distribution of the set of compliant actions based on the semantic mask question, perform random sampling according to the probability distribution, select compliant actions for path expansion, and obtain the set of exploration paths for the current expansion step.

[0027] The set of exploration paths for the current expansion step is filtered based on the difference in immediate rewards to obtain a set of valid paths, including:

[0028] The state value is obtained by comparing the immediate reward of the exploration path expanded in the current expansion step with the immediate reward of the previous expansion path. Paths whose state value is exhausted in the set of exploration paths expanded in the current expansion step are removed to obtain a set of candidate paths.

[0029] The structure ranking score of each path in the candidate path set is determined based on the immediate reward. The top K paths with the highest structure ranking scores in the candidate path set are selected for verification. Paths that fail verification in the top K paths are removed to obtain the valid path set.

[0030] The final evidence set is obtained based on the set of termination paths. The answer to the query question is then obtained from the final evidence set, including:

[0031] Calculate the structure ranking score for each path in the set of termination paths, obtain the final evidence set based on the structure ranking score, and obtain the answer to the query question based on the final evidence set.

[0032] A second aspect of the present invention provides a reliable reasoning and question-answering apparatus that combines a large model with a knowledge graph, comprising:

[0033] The initial entity acquisition module is used to generate a set of candidate keywords based on the query question, filter the candidate keywords based on their marginal relevance scores to obtain the final keyword set; link each keyword in the final keyword set to the corresponding entity in the knowledge graph to obtain the candidate entity for each keyword; and filter the candidate entities to obtain the initial entity.

[0034] The extended path reasoning module is used to determine the path exploration state based on the query question and the initial entity, and obtain a set of candidate path expansion actions based on the path exploration state; apply hard constraints to the set of candidate path expansion actions to obtain a set of compliant actions; apply semantic soft guidance to the set of compliant actions, select compliant actions for path expansion, and obtain a set of exploration paths for expansion under the current expansion step; filter the set of exploration paths for expansion under the current expansion step according to the difference in immediate reward, and obtain a set of valid paths; repeat the process of selecting compliant actions for path expansion and obtaining a set of valid paths until the number of repetitions exceeds a set threshold, at which point the expansion stops and a set of terminated paths is obtained.

[0035] The answer generation module is used to obtain the final evidence set based on the set of termination paths, and to obtain the answer to the query question based on the final evidence set.

[0036] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0037] 1. This invention designs an entity linking strategy based on maximum semantic marginal relevance and "coarse-to-fine" retrieval to accurately and efficiently locate initial entities in a knowledge graph from open-domain queries. Without relying on predefined entity types or large amounts of labeled data, it directly extracts key semantic units from the question through semantic vector calculation and diversity balancing, and quickly links to candidate entities using clustering indexes, significantly improving the system's adaptability, efficiency, and interpretability in open-domain scenarios.

[0038] 2. This invention models the construction process of multi-hop reasoning paths as a constrained semantically guided path exploration problem and proposes a decision framework that integrates hard constraint verification and semantic soft guidance to synergistically optimize the compliance, semantic relevance, and exploration efficiency of reasoning paths. By utilizing the structural constraints of knowledge graphs to filter illegal actions and dynamically constructing semantic mask questions to softly guide the path towards problem-related directions, it effectively solves the problems of combinatorial explosion and semantic drift in path search within complex knowledge graphs, achieving precise and controllable reasoning exploration.

[0039] 3. This invention introduces a dynamic path quality assessment based on the difference in immediate rewards and a patience exhaustion termination mechanism, constructing a reasoning process with self-evaluation and early termination capabilities. By calculating the semantic gain changes brought about by path expansion in real time, the quality of path branches is automatically judged, and inefficient or deviating explorations are terminated in a timely manner, ensuring the efficiency of the reasoning process and the credibility of the final answer. At the same time, the alternating repetition process is fully recorded, providing a clear and traceable reasoning basis for the answer, significantly enhancing the credibility and transparency of the system.

[0040] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0041] Figure 1 This is a flowchart of a reliable reasoning and question answering method that combines a large model and a knowledge graph, provided in an embodiment of the present invention.

[0042] Figure 2 This is a diagram of a reliable reasoning and question-answering device that combines a large model and a knowledge graph, as provided in an embodiment of the present invention. Detailed Implementation

[0043] To further illustrate the technical means and effects adopted by the present invention to achieve the intended purpose, the following detailed description of the solution according to the present invention is provided in conjunction with the accompanying drawings and specific embodiments.

[0044] The foregoing and other technical contents, features, and effects of the present invention will be clearly presented in the following detailed description of specific embodiments in conjunction with the accompanying drawings. Through the description of the specific embodiments, a more in-depth and concrete understanding can be gained of the technical means and effects adopted by the present invention to achieve its intended purpose. However, the accompanying drawings are for reference and illustration only and are not intended to limit the technical solutions of the present invention.

[0045] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations are intended to cover non-exclusive inclusion, such that an article or apparatus comprising a list of elements includes not only those elements but also other elements not expressly listed. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the article or apparatus that includes said element.

[0046] like Figure 1 The diagram shown is a flowchart of a reliable reasoning and question-answering method based on the collaboration of a large model and a knowledge graph, provided in Embodiment 1 of the present invention. The method includes the following steps:

[0047] Step 1: Generate a set of candidate keywords based on the query question, filter the candidate keywords based on their marginal relevance scores to obtain the final keyword set; link each keyword in the final keyword set to its corresponding entity in the knowledge graph to obtain the candidate entity for each keyword; filter the candidate entities to obtain the initial entity.

[0048] Step 1.1: Input query question Q, and extract n-gram fragments from query question Q using a sliding window method to form a candidate keyword set C. Here, an n-gram is a subsequence consisting of n consecutively occurring language units in query question Q.

[0049] The bge-base-zh-v1.5 model was used as the sentence encoder. The query question Q and the candidate keywords in the candidate keyword set C are combined. These are respectively mapped to a high-dimensional semantic vector of the question and a high-dimensional semantic vector of the candidate keywords:

[0050]

[0051]

[0052] in, The question is a high-dimensional semantic vector. The candidate keywords are high-dimensional semantic vectors. Let i be the i-th candidate keyword in the candidate keyword set, where i is the variable index.

[0053] Based on the high-dimensional semantic vector of the question and high-dimensional semantic vectors of candidate keywords Calculate the semantic relevance between the query question and candidate keywords:

[0054]

[0055] in, To query the semantic relevance between the query question and candidate keywords, This represents the function for calculating cosine similarity. This represents the L2 norm of a vector.

[0056] To improve keyword diversity and information coverage, the Maximum Marginal Relevance (MMR) mechanism is introduced. MMR seeks a balance between keyword relevance and diversity, ensuring that the final selected keywords are closely related to the semantics of the question, thus improving the breadth of the semantic space covered by the keywords while avoiding redundancy.

[0057] The specific formula for determining the marginal relevance score of candidate keywords based on semantic relevance is as follows:

[0058]

[0059] in, Marginal relevance score for candidate keywords; To balance the parameters, a value of 0.8 is chosen; This is the final set of keywords, initially set to an empty set. Let i be the i-th keyword in S; express and The semantic relevance, where max represents taking the maximum value. express The maximum semantic relevance with all keywords in S; i is the variable index.

[0060] By iteratively selecting the candidate keyword with the highest marginal relevance score in each round using a greedy approach, the final keyword set is added to the final keyword set until the size of the final keyword set reaches a preset value or the maximum number of iterations is reached, thus obtaining the final keyword set S, which achieves optimal expressiveness and diversity in the final keyword set.

[0061] By employing the above methods, robust extraction of core semantic units from open-domain problems can be achieved without the need for predefined types and training data, laying a reliable semantic foundation for subsequent entity linking and enhancing the interpretability and domain adaptability of the entire system.

[0062] Step 1.2: Vectorize and normalize the entities in the knowledge graph to obtain entity vectors. Perform K-Means clustering on the entity vectors to obtain M cluster centers. Assign each entity in the knowledge graph to the nearest cluster center to form multiple semantic clusters.

[0063] Specifically, entities in the knowledge graph Using a pre-trained sentence vector model Vectorize it:

[0064]

[0065] in, Representing entities The original semantic vector, where i is the variable index; d represents the i-th entity in the knowledge graph; d represents the embedding dimension. Represents the set of real numbers; Let represent a d-dimensional real vector space.

[0066] Entity The original semantic vector is normalized to obtain the normalized entity vector. :

[0067]

[0068] in, For the i-th entity Normalized entity vectors, This represents the L2 norm of the original semantic vector.

[0069] K-Means clustering is performed on all entity vectors after vectorization and normalization to obtain M cluster centers. Each entity in the knowledge graph is assigned to the nearest cluster center, forming multiple semantic clusters. The entity set of the j-th semantic cluster is... for:

[0070]

[0071] in, Represents the set of entities belonging to the j-th semantic cluster; Let the vector of the j-th cluster center be denoted by the dimension and the expression. Same; argmin( () represents the index of the cluster center that minimizes the distance; j is the variable index; express and The square of the Euclidean distance.

[0072] The keywords in the final keyword set S are vectorized and normalized to obtain keyword vectors. The similarity between the keyword vectors and the cluster center vectors is calculated. The m cluster centers with the highest similarity are selected. The similarity between the keyword vectors and entity vectors is calculated in the semantic clusters corresponding to the m cluster centers. The top N entities with the highest similarity are retained as candidate entities corresponding to the keywords.

[0073] When making links, we first locate a few semantic clusters that are closest to the keyword vector, and then perform a fine search only within these clusters. Through a two-stage retrieval strategy from coarse to fine, we can significantly improve the retrieval efficiency in a massive entity database with minimal loss of precision.

[0074] Step 1.3: Construct the final feature vector of the candidate entity, calculate the probability that the candidate entity corresponding to each keyword is the initial entity based on the final feature vector of the candidate entity, determine the candidate entity score based on the probability that the candidate entity is the initial entity, and select the candidate entity with the highest score as the initial entity.

[0075] Candidate entities corresponding to keywords Where n represents the total number of candidate entities corresponding to the keyword. This represents the i-th entity, where i is the variable index; the query question Q and candidate entities are independently encoded by a dual-path pre-trained language encoder, resulting in a query question vector sequence that contains the contextual semantics. and candidate entity vector sequence .

[0076] in, To query the number of tokens after word segmentation, d represents the number of hidden layers. This represents the number of lexical units in the candidate entity text after word segmentation.

[0077] Semantically align the query question vector sequence and the candidate entity vector sequence to obtain the fused semantic vector of the candidate entities. :

[0078]

[0079] in, Let be the fused semantic vector of the candidate entity, with dimension d; To query the number of tokens after word segmentation; ) represents the cross-attention function, which uses deliberate computation to align the semantics of the query question with those of the candidate entities. This represents the i-th row of the cross-attention output matrix, which has a shape of 1×d.

[0080] The cross-attention output matrix is ​​obtained through the cross-attention module, as shown in the following formula:

[0081]

[0082] in, This represents the cross-attention output matrix; To query the weight matrix, used to... Linear projection onto the query space; This is the key weight matrix, used to... Linear projection onto bond space; The value weight matrix is ​​used to... Linear projection onto the value space; Represents matrix transpose, softmax( The attention allocation ratio function is used to normalize the attention score. This is a scaling factor used to alleviate the problem of excessively high scores from key players.

[0083] To improve the accuracy and robustness of entity filtering, three types of structural enhancement features are introduced based on semantic cross-fusion representation, including:

[0084] Keyword scoring measures the importance of keywords in the question, preventing low-information words from interfering with entity identification. Specifically:

[0085]

[0086] in, Represents the i-th keyword Then, score the importance of the query question Q; To balance the parameters, a value of 0.8 is chosen; This is the final set of keywords, initially set to an empty set. Let i be the i-th keyword in S; express and The semantic relevance, where max represents taking the maximum value. express The maximum semantic relevance with all keywords in S; i is the variable index.

[0087] The entity linking score represents the confidence level of the match between candidate entities and their corresponding keywords during the entity linking stage. This score strictly corresponds to the recall and filtering stage of the "clustering inverted index + intra-cluster fine-tuning" process in step 1.2 of the entity linking workflow, and is used to characterize the degree of local semantic matching between entities and keywords during the recall stage. Specifically:

[0088]

[0089] in, express and The matching confidence score, Represents the corresponding keywords in the knowledge graph The j-th entity, This represents the i-th keyword in the final keyword set S. This represents the function for calculating cosine similarity. Represents the i-th keyword Normalized keyword vectors; Represents the j-th entity The normalized entity vector, where j is the variable index.

[0090] Entity structure importance score: used to capture the character overlap between entities and question keywords. After candidate entities are determined, relying solely on semantic similarity is still insufficient to distinguish entities that play different structural roles in the knowledge graph. To characterize the scalability and reasoning potential of candidate entities in local knowledge structures, a graph-based entity structure importance score is further introduced. Specifically, using the set of candidate entities linked by keywords as seed nodes, a depth-limited breadth-first search (BFS) is performed in the knowledge graph, and the expansion process is pruned using directional constraints and redundancy removal strategies to construct an induced subgraph containing only candidate entities and their local relationships:

[0091]

[0092] in, This is an induced subgraph representing candidate entities and their local relationships; Let be the set of nodes in the subgraph; Let be the set of edges in the subgraph.

[0093] The induced subgraphs of candidate entities and their local relationships effectively suppress structural noise introduced by the full graph scale while preserving local structural information relevant to the query question, allowing entity structure analysis to focus on the question-related subspace. The out-degree of an entity in this subgraph is used as a measure of its structural activity, and a structural importance score is obtained through global normalization.

[0094]

[0095] in, Represents the j-th entity Importance score; Representing entities In subgraph Out of range; Subgraph The number of edges in the array.

[0096] By jointly representing the three types of structural enhancement features, we obtain the structural enhancement feature vector of the candidate entity:

[0097]

[0098] in, This represents the structural enhancement feature vector.

[0099] The structural enhancement features of the candidate entity are linearly projected through the feature projection layer to obtain the projected structural feature vector.

[0100]

[0101] in, This represents the structure-enhanced feature vector after projection; Represents the structural enhancement feature vector. ; Let be the projection matrix. ; For bias terms, f represents the dimension of the feature vector; Let represent a d-dimensional real vector space.

[0102] The fused semantic vector of the candidate entity and the projected structure-enhanced feature vector are concatenated to obtain the final feature vector of the candidate entity corresponding to each keyword:

[0103]

[0104] in, This represents the final feature vector of the candidate entity; Represents a 2d-dimensional real vector space; This represents a vector concatenation operation, which concatenates two d-dimensional vectors into a 2d-dimensional vector.

[0105] Based on the final feature vectors of the candidate entities, the probability that the candidate entity corresponding to each keyword is the initial entity is calculated using a multilayer perceptron (MLP):

[0106]

[0107] in, This represents the probability that the candidate entity is the initial entity; Represents the unnormalized classification score vector of the i-th candidate entity; express The original score of the first element; express The original score of the second element; exp represents the normalization function; exp is the exponential function.

[0108]

[0109] Where logits represents the unnormalized classification score vector; MLP( ) represents a multilayer perceptron function used to... It is mapped to a two-dimensional vector.

[0110] Relying solely on structured features and local semantic matching may still result in insufficient discrimination, leading to incorrect entity links. Therefore, in probabilistic... Based on this, the candidate entity score is determined according to the probability that the candidate entity is the initial entity, and the candidate entity with the highest score is selected as the initial entity.

[0111] Specifically, the candidate entity is jointly represented with the probability that the candidate entity is the initial entity. As structured information, in which, The set of joint representations of candidate entities and the probability that a candidate entity is the initial entity. This represents the nth candidate entity. Represents the nth candidate entity The probability of the initial entity.

[0112] The joint probabilistic representation is input into an LLM model, specifically a Qwen3-8b model, to obtain the semantic consistency score of candidate entities. , This score reflects the referential plausibility and semantic consistency of candidate entities within the complete question context. The probability that a candidate entity is the initial entity is combined with its semantic consistency score to obtain the candidate entity score:

[0113]

[0114] in, This represents the score of the i-th candidate entity; and They are respectively and The weight parameters.

[0115] Select candidate entity score The highest-ranking candidate entity is used as the initial entity. :

[0116]

[0117] in, This represents the initial entity obtained after the final screening; This represents the set of candidate entities corresponding to the keyword; This represents the final score of the i-th candidate entity; This indicates selecting the entity with the highest final score from the entity set E.

[0118] By employing a dual-path encoding and semantic alignment mechanism, combined with enhanced representation of structural features, accurate screening and disambiguation of candidate entities are achieved, improving the accuracy and robustness of initial entity recognition and providing a reliable starting point for subsequent path reasoning.

[0119] Step 2: Determine the path exploration state based on the query question and the initial entity, and obtain a set of candidate path expansion actions based on the path exploration state; apply hard constraints to the set of candidate path expansion actions to obtain a set of compliant actions; apply semantic soft guidance to the set of compliant actions, select compliant actions for path expansion, and obtain a set of exploration paths for expansion under the current expansion step; filter the set of exploration paths for expansion under the current expansion step according to the difference in immediate rewards to obtain a set of valid paths; repeat the process of selecting compliant actions for path expansion and obtaining a set of valid paths until the number of repetitions exceeds a set threshold, then stop expansion and obtain a set of terminated paths.

[0120] Step 2.1: Based on the query question Q and the unique initial entity Determine the current path exploration status .

[0121] Path exploration status Contains the current path node sequence Encoding representation And the vector of query question Q, where the current path node sequence Composed of all entities with extended paths, the current entity This is the last entity in the current path node sequence.

[0122] Based on the query path, explore the current entity in the state query knowledge graph. All entities in the knowledge graph that are currently represented by the entity The set of entity pairs representing the relationship between the head or tail entity is used as the candidate path to expand the action set A. Among them, path expansion action ∈A , specifically , by relationship Entities connected through relationships composition.

[0123] For A Each path expansion action in Hard constraint check:

[0124]

[0125] in, The binary mask vector representing the i-th path extension action is used to mark whether the action is compliant; A value of 1 indicates a path expansion action. Valid, a value of 0 indicates a path expansion action. illegal, This represents the initial set of compliance actions.

[0126]

[0127] in, Indicates the state of path exploration. A collection of compliance actions.

[0128] Path exploration status A collection of compliance actions Perform semantic soft guidance, specifically:

[0129] Calculate the semantic similarity between the query question and the current entity in the current path exploration state. Specifically:

[0130]

[0131] in, The keyword string representing the query question has semantic similarity to the current entity; s represents the keyword string representing the query question in the path exploration state. Indicates the current entity Name text; This is the intersection operator; Indicates the length of character s; express The length of the characters.

[0132] Select the keyword strings with the highest similarity :

[0133]

[0134] in, This represents the keyword string that has the highest semantic similarity to the current entity in the query; This represents the final set of keywords; argmax( ) represents the parameter maximization operator.

[0135] Based on the most similar keyword strings The problem of constructing semantic masks, specifically:

[0136] Q

[0137] Among them, Q Q represents the semantic masking problem; Q represents the query problem. Indicates the similarity threshold; This indicates a special mask marker used for replacement. ; This is a string deletion operator used to delete strings from Q. ; This is a string insertion operator used to mark special masks. Insert to Delete The location.

[0138] The system uses an entity fuzzy matching strategy to identify the keyword string that is most similar to the entity in the current path exploration state in the query question Q, and then masks the string to reduce the interference of existing entities in the path on semantic retrieval.

[0139] Probability distribution of forming a set of compliant actions based on the semantic masking problem:

[0140]

[0141] in, This represents the final selection probability of the i-th path expansion action, i.e., the path exploration state. The probability distribution of the set of compliant actions is used to represent the priority of selecting that action for path expansion; ( ) represents an exponential function; This indicates semantic similarity calculation; j is the variable index; This represents the path expansion action being traversed. vector; Indicates path expansion action vector; The binary mask vector representing the i-th path extension action; This represents the binary mask vector of the j-th path expansion action being traversed. Path expansion action vector ;emb( ) is a mapping function used to embed vectors.

[0142] Based on the current path exploration status The probability distribution of the set of compliant actions is randomly sampled, and compliant actions are selected for path expansion to obtain the set of exploration paths for the current expansion step. Each path in the expanded exploration path set is represented by P. Each step of the triplet is .in, Let represent the triplet at step i in the path, and k represent the total number of reasoning steps in path P; Represents the head entity of step i; Indicates the relationship at step i; This represents the tail entity at step i.

[0143] By combining hard constraints with semantic soft guidance, a path expansion mechanism is established to ensure both the compliance and semantic relevance of the reasoning path. This effectively avoids ineffective exploration, improves the accuracy and interpretability of path selection, and provides a clear and reliable basis for action decisions in multi-hop reasoning.

[0144] Step 2.2: Filter the set of exploration paths for the current expansion step based on the difference in immediate rewards to obtain a set of valid paths; repeat the process of selecting compliant actions to expand paths and obtain a set of valid paths until the number of expansion rounds exceeds a set threshold, then stop expansion and obtain a set of terminated paths.

[0145] Specifically, calculate the current expansion step. Instant rewards for expanding the exploration path below Compared with the previous step Instant rewards for expanding paths The difference yields the state value, which is the current path exploration state value. The calculation formula is as follows:

[0146]

[0147]

[0148]

[0149] in, Indicates the value of the current path exploration state; Parameters representing the value of a state; This represents semantic similarity calculation; Q represents the query question. Represents the current path node sequence The encoded representation; Represents the sequence of path nodes in the previous step. The encoding representation.

[0150] The quality of path expansion is evaluated by calculating the difference between the immediate reward of the current step and the previous step. The initial patience value for calculating the immediate reward difference is set to 0. If the initial patience value is increased by 1, then the initial patience value is increased by 1. If the initial patience value is 0, the patience value will be reduced to 0 until the patience for exploring the state value is exhausted. ,in, This indicates patience in exploring the value of a state. This represents the patience threshold for exploring the state value; patience exhaustion indicates that the path quality has decreased or deviated from the query question, classifying the path as a low-quality branch, stopping expansion, and removing paths with exhausted state value from the exploration path set expanded in the current expansion step to obtain a candidate path set. .

[0151] Step 2.3: Determine the structure ranking score of each path in the candidate path set based on the immediate reward. Select the top K paths with the highest structure ranking scores from the candidate path set for verification. Remove the paths that fail verification from the top K paths to obtain the valid path set. .

[0152] In obtaining the candidate path set Then, the structural ranking score of each path in the candidate path set is determined based on the immediate reward and the value of the current path exploration state:

[0153]

[0154] in, express The structural score of the step-by-step extended path; express Instant rewards for exploring the expanded path; Indicates the current expansion step; Used to balance the current semantic matching degree of the path with the semantic gain brought about by the most recent expansion;

[0155] Higher instant rewards This indicates that the overall semantics of the path remain highly relevant to the query question, resulting in a positive reward differential. This reflects that the path is still in the process of converging towards the semantics of the problem during the expansion. By considering these two aspects together, it is possible to effectively avoid retaining paths that only have historical cumulative scores but have shown a trend of semantic degradation.

[0156] Based on the candidate path set Sorting score of the middle path Sort the paths in descending order and select the top K paths with the highest scores to obtain a compact candidate set. :

[0157]

[0158] in, Represents a compact candidate set; Represents the set of candidate paths; Represents the set of candidate paths The i-th path in; This represents a function that takes the first K maximum values.

[0159] Compact candidate set Each path consists of multiple triples. ,in, This represents the Kth path in the compact candidate set; This represents the i-th path in the compact candidate set; express The triplet in step m; This represents the head entity at step m; Indicates the relationship at step m; This represents the tail entity at step m.

[0160] For each path, calculate its logical consistency score. And causal consistency score ,in, , Based on the logical consistency score and causal consistency score, the path verification identifiers in the compact candidate set are obtained:

[0161]

[0162] in, This represents the verification identifier for the i-th path. A value of 0 indicates that the verification failed. A value of 1 indicates that the verification passed; This represents the logical consistency score threshold; Indicates the threshold for causal consistency scoring; It is a logical AND operator, meaning that two threshold conditions must be met simultaneously.

[0163] Path verification is performed based on the verification flag. If the verification flag is 0, the path fails verification. Paths that fail verification are then removed from the compact candidate set to obtain the set of valid paths. :

[0164]

[0165] in, Represents the set of valid paths; Represents a compact candidate set The i-th path in the sequence.

[0166] Paths that fail to meet semantic and logical consistency constraints will be pruned in advance at this stage, thereby avoiding the retention of structurally feasible paths that lack overall semantic or causal rationality.

[0167] The process of repeatedly selecting compliant actions to expand the path and obtain a set of effective paths continues until the number of repeated expansion rounds R exceeds a set threshold. When the number of expansion attempts is exhausted and the path can no longer be expanded, indicating that the end point of the path has been reached, the set of terminated paths is obtained. .

[0168] By using dynamic evaluation based on the difference in immediate rewards and a patience exhaustion mechanism, the quality of reasoning paths in repetitive fantasy processes is monitored in real time and intelligently terminated. This effectively suppresses the redundant expansion of low-quality paths, ensures the efficiency of the reasoning process and the credibility of the results, and provides a traceable reasoning basis for answer generation.

[0169] Step 3: Obtain the final evidence set based on the set of termination paths, and obtain the answer to the query question based on the final evidence set.

[0170] For the set of termination paths any one of the paths ,in This represents the nth path in the set of terminating paths; This represents the i-th path in the compact candidate set; express The triplet in step g; This represents the head entity at step g; Indicates the relationship at step g; This represents the tail entity at step g.

[0171] The path consists of a sequence of triples, forming a complete inference chain. A structure score is calculated for the set of terminating paths, based on the structure ranking score. For the set of termination paths Sort the paths in descending order to obtain a set of path sequences arranged by confidence level, which serves as the final evidence set. :

[0172]

[0173] in, Indicates the final set of evidence; This represents the structural sorting score of the i-th path; It is a sorting function; express The i-th path in the sequence.

[0174] According to the final collection of evidence The answer to the query question Q is obtained by:

[0175]

[0176] in, This indicates a query for the answer to question Q; This represents the large language model Qwen3-8b, used to generate answers based on the final evidence set.

[0177] LLM summarizes the answer based on the structured facts contained in each path in the evidence path set and transforms it into a natural language expression. Since the evidence paths themselves have undergone multi-stage pruning at the structural layer and are ordered according to the value of the path state, LLM prioritizes the use of high-confidence reasoning chains when generating the answer, while retaining the remaining paths as supplementary facts, thereby achieving a balance between the completeness and consistency of the answer.

[0178] like Figure 2 The diagram shown is a reliable reasoning and question-answering device for collaboration between a large model and a knowledge graph, provided in Embodiment 2 of the present invention, comprising:

[0179] The initial entity acquisition module generates a set of candidate keywords based on the query question, filters the candidate keywords based on their marginal relevance scores, and obtains the final keyword set. Each keyword in the final keyword set is linked to the corresponding entity in the knowledge graph to obtain the candidate entity for each keyword. The candidate entities are then filtered to obtain the initial entity.

[0180] The extended path reasoning module determines the path exploration state based on the query question and initial entities, and obtains a set of candidate path expansion actions based on the path exploration state. It then applies hard constraints to the candidate path expansion action set to obtain a set of compliant actions. Semantic soft guidance is applied to the compliant action set to select compliant actions for path expansion, resulting in a set of expanded exploration paths for the current step. The set of expanded exploration paths for the current expansion step is then filtered based on the difference in immediate rewards to obtain a set of valid paths. This process of selecting compliant actions for path expansion and obtaining a set of valid paths is repeated until the number of repetitions exceeds a set threshold, at which point expansion stops, resulting in a terminated path set.

[0181] The answer generation module obtains the final evidence set based on the set of termination paths, and then obtains the answer to the query question based on the final evidence set.

[0182] This invention proposes a reliable reasoning and intelligent question answering method and apparatus based on the collaboration of a large model and knowledge graph. It provides semantic guidance for query questions, extracts representative keywords from the query questions through a maximum marginal relevance mechanism, achieves efficient entity linking using a coarse-to-fine clustering index, and then performs entity disambiguation and filtering to determine unique initial entities. Furthermore, it explores interpretable paths based on a decision-evaluation collaborative mechanism, generates compliant actions through hard constraint filtering and semantic soft guidance, and dynamically evaluates path quality based on immediate reward difference and patience threshold, achieving intelligent pruning and path convergence. Finally, it generates answers based on the sorted set of terminated paths and provides a complete and traceable reasoning path as the basis for explanation.

[0183] This invention effectively solves the technical challenges of entity recognition relying on dictionary rules, black-box reasoning in open-domain knowledge graph question answering, and poor interpretability, while balancing the generalization ability of semantic understanding with the credibility and controllability of the reasoning process. By deeply integrating the deep semantic understanding capabilities of large models with the structured knowledge of knowledge graphs, and leveraging a decision-evaluation collaborative mechanism to achieve a balance between path compliance, semantic relevance, and exploration efficiency, it provides a fully verifiable and traceable chain of reasoning evidence while ensuring the accuracy of multi-hop reasoning. Compared to traditional rule-based, heuristic, or pure neural network-based methods, it significantly improves the system's adaptability, reasoning efficiency, and result credibility in open scenarios, providing a reliable technical foundation for intelligent question answering and credible decision support.

[0184] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.

Claims

1. A reliable reasoning and question-answering method that combines a large model with a knowledge graph, characterized in that, Includes the following steps: A candidate keyword set is generated based on the query question. The candidate keywords are then filtered based on their marginal relevance scores to obtain the final keyword set. Each keyword in the final keyword set is then linked to its corresponding entity in the knowledge graph to obtain the candidate entity for each keyword. The candidate entities are filtered to obtain the initial entities; The path exploration state is determined based on the query question and the initial entity, and a set of candidate path expansion actions is obtained based on the path exploration state. Hard constraints are applied to the candidate path expansion action set to obtain a compliant action set; semantic soft guidance is applied to the compliant action set to calculate the semantic similarity between the query question and the current entity, and a semantic mask question is constructed based on the semantic similarity. Based on the probability distribution of the set of compliant actions formed by the semantic masking problem, random sampling is performed according to the probability distribution, and compliant actions are selected for path expansion to obtain the set of exploration paths for the current expansion step. The set of exploration paths for the current expansion step is filtered according to the difference in immediate reward to obtain the set of effective paths. The process of selecting compliant actions for path expansion and obtaining the set of effective paths is repeated until the number of repetitions exceeds a set threshold, at which point the expansion stops and the set of terminated paths is obtained. The final evidence set is obtained from the set of termination paths, and the answer to the query question is obtained from the final evidence set.

2. The reliable reasoning and question answering method based on the collaboration of a large model and a knowledge graph as described in claim 1, characterized in that, The process involves generating a candidate keyword set based on the query question, filtering the candidate keywords based on their marginal relevance scores, and obtaining the final keyword set, which includes: The bge-base-zh-v1.5 model is used to map the query question and the candidate keywords in the set into high-dimensional semantic vectors for the question and candidate keywords, respectively. The semantic relevance between the query question and the candidate keywords is calculated based on the high-dimensional semantic vector of the question and the high-dimensional semantic vector of the candidate keywords. The marginal relevance score of the candidate keywords is determined based on the semantic relevance. The candidate keywords with the highest marginal relevance score in each round are selected in a greedy manner and added to the final keyword set until the size of the final keyword set reaches the preset value or the maximum number of iterations is reached.

3. The reliable reasoning and question answering method based on the collaboration of a large model and a knowledge graph as described in claim 1, characterized in that, The step of linking each keyword in the final keyword set to the corresponding entity in the knowledge graph to obtain the candidate entity corresponding to each keyword includes: The entities in the knowledge graph are vectorized and normalized to obtain entity vectors. K-Means clustering is performed on the entity vectors to obtain M cluster centers. Each entity in the knowledge graph is assigned to the nearest cluster center to form multiple semantic clusters. The keywords in the final keyword set are vectorized and normalized to obtain keyword vectors. The similarity between the keyword vectors and the cluster center vectors is calculated. The m cluster centers with the highest similarity are selected. The similarity between the keyword vectors and entity vectors is calculated in the semantic clusters corresponding to the m cluster centers. The top N entities with the highest similarity are retained as candidate entities corresponding to the keywords.

4. The reliable reasoning and question answering method based on the collaboration of a large model and a knowledge graph as described in claim 1, characterized in that, The process of filtering candidate entities to obtain initial entities includes: Construct the final feature vector of the candidate entities, calculate the probability that the candidate entity corresponding to each keyword is the initial entity based on the final feature vector of the candidate entities, determine the score of the candidate entities based on the probability that the candidate entities are the initial entities, and select the candidate entity with the highest score as the initial entity.

5. The reliable reasoning and question answering method based on the collaboration of a large model and a knowledge graph as described in claim 4, characterized in that, The construction of the final feature vector of the candidate entity includes: The query question and candidate entities are encoded independently to obtain query question vector sequences and candidate entity vector sequences; the two are semantically aligned to obtain fused semantic vectors of candidate entities; the structural enhancement features of candidate entities are linearly projected to obtain projected structural enhancement feature vectors. The final feature vector of the candidate entity is obtained by concatenating the fused semantic vector of the candidate entity and the projected structurally enhanced feature vector.

6. The reliable reasoning and question answering method based on the collaboration of a large model and a knowledge graph as described in claim 1, characterized in that, The set of candidate path expansion actions obtained based on the path exploration state includes: Based on the query path exploration state query, the current entity in the corresponding knowledge graph is used as the candidate path expansion action set, and all relation-entity pairs in the knowledge graph with the current entity as the head entity or tail entity are used as the candidate path expansion action set.

7. The reliable reasoning and question answering method based on the collaboration of a large model and a knowledge graph as described in claim 1, characterized in that, The process of filtering the set of exploration paths for the current expansion step based on the difference in immediate rewards to obtain a set of valid paths includes: The state value is obtained by comparing the immediate reward of the exploration path expanded in the current expansion step with the immediate reward of the previous expansion path. Paths whose state value is exhausted in the set of exploration paths expanded in the current expansion step are removed to obtain a set of candidate paths. The structure ranking score of each path in the candidate path set is determined based on the immediate reward. The top K paths with the highest structure ranking scores in the candidate path set are selected for verification. Paths that fail verification in the top K paths are removed to obtain the valid path set.

8. The reliable reasoning and question answering method based on the collaboration of a large model and a knowledge graph as described in claim 1, characterized in that, The process of obtaining the final evidence set based on the set of termination paths, and obtaining the answer to the query question based on the final evidence set, includes: Calculate the structure ranking score for each path in the set of termination paths, obtain the final evidence set based on the structure ranking score, and obtain the answer to the query question based on the final evidence set.

9. A reliable reasoning and question-answering device that combines a large model with a knowledge graph, characterized in that, The apparatus for implementing a reliable reasoning and question-answering method that combines a large model and a knowledge graph, as described in any one of claims 1 to 8, comprises: The initial entity acquisition module is used to generate a set of candidate keywords based on the query question, filter the candidate keywords based on their marginal relevance scores to obtain the final keyword set; link each keyword in the final keyword set to the corresponding entity in the knowledge graph to obtain the candidate entity for each keyword; and filter the candidate entities to obtain the initial entity. The extended path reasoning module is used to determine the path exploration state based on the query question and the initial entity, and obtain a set of candidate path expansion actions based on the path exploration state; apply hard constraints to the set of candidate path expansion actions to obtain a set of compliant actions; apply semantic soft guidance to the set of compliant actions, select compliant actions for path expansion, and obtain a set of exploration paths for expansion under the current expansion step; filter the set of exploration paths for expansion under the current expansion step according to the difference in immediate reward, and obtain a set of valid paths; repeat the process of selecting compliant actions for path expansion and obtaining a set of valid paths until the number of repetitions exceeds a set threshold, at which point the expansion stops and a set of terminated paths is obtained. The answer generation module is used to obtain the final evidence set based on the set of termination paths, and to obtain the answer to the query question based on the final evidence set.

Citation Information

Patent Citations

  • Intelligent analysis method based on medical document structure perception and multi-modal fusion

    CN121351790A

  • Method and system for generating a document representation

    US20100228693A1