Intelligent question answering system and method for large-scale traffic engineering models based on knowledge graph

By extracting the multi-dimensional features of natural language queries to generate retrieval intent vectors, dynamically selecting retrieval paths, and performing hybrid collaborative retrieval in knowledge graphs and vector databases, a complete reasoning chain is constructed, which solves the accuracy and coherence problems of existing question-answering systems in complex queries and realizes efficient and explainable intelligent question-answering.

CN120407752BActive Publication Date: 2025-09-12ANHUI TRANSPORT CONSULTING & DESIGN INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510912996.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-03
Publication Date
2025-09-12
Estimated Expiration
2045-07-03

AI Technical Summary

Technical Problem

When processing complex natural language queries, existing intelligent question-answering systems find it difficult to balance the comprehensiveness of retrieval and the integrity of the reasoning chain, and lack a dynamic path selection mechanism, resulting in insufficient answer accuracy and logical breaks.

Method used

By parsing natural language query statements to extract the degree of structure, semantic ambiguity and context-related features, a retrieval intent vector is generated, the retrieval path is dynamically selected, and hybrid collaborative retrieval is performed in the knowledge graph and vector database. Combined with entity consistency, semantic similarity and relationship connectivity verification, a complete reasoning chain is constructed, and the large model completion mechanism is used to solve the reasoning gap.

Benefits of technology

It achieves a highly accurate, coherent and explainable question-answering process, adapts to complex natural language queries, and improves the system's answering ability and reliability in complex query scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407752B_ABST
    Figure CN120407752B_ABST
Patent Text Reader

Abstract

The present invention discloses a large-scale intelligent question-answering system and method for traffic engineering based on a knowledge graph. By receiving and parsing natural language query statements input by users, the system extracts structural degree features, semantic fuzziness features and contextual association features, generates a retrieval intention vector, and dynamically selects a retrieval path based on the intention classification model. According to the retrieval path, a structured query statement or a semantic vector is constructed, and the knowledge graph and the vector database are searched respectively to obtain a first retrieval result and a second retrieval result. Further, two-way verification is performed through entity consistency, semantic similarity and relationship connectivity indicators to screen the candidate result set and construct an inference chain; if the inference chain is broken, a large-scale model inference gap filling mechanism is used to generate relay nodes to form a complete inference chain, and an inference-type answer output is generated based on the complete chain. This method improves the retrieval accuracy and inference coherence of the question-answering system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent question answering technology, and in particular to a knowledge graph-based intelligent question answering system and method for a large-scale traffic engineering model. Background Art

[0002] In the field of intelligent question-answering systems, achieving accurate understanding and efficient reasoning of complex natural language queries has always been a key issue in artificial intelligence research and application. As the scale of information continues to grow, traditional question-answering systems that rely on a single data source (such as those based solely on knowledge graphs or vector-based retrieval) have gradually exposed limitations such as a single retrieval path, a fragmented reasoning process, and insufficient answer accuracy. Existing systems often struggle to balance comprehensive retrieval with the integrity of the reasoning chain when processing queries with varying degrees of structure, high semantic ambiguity, and complex contextual relationships. This leads to logical discontinuities or semantic deviations in the final answer.

[0003] Among existing technologies, knowledge graph retrieval is good at processing structured queries and can generate relatively rigorous answers based on entity relationship reasoning, but its ability to understand vague or non-standard expressions in natural language is relatively weak. Retrieval methods based on vector databases rely on deep semantic representations for similarity retrieval. Although they perform well in dealing with open domain queries, they are prone to lack of explainability and it is difficult to ensure the logical coherence of the reasoning path. Although some studies have attempted to integrate structured knowledge with semantic retrieval, most of them lack effective path selection mechanisms and reasoning chain completion strategies, and are unable to deal with the problem of reasoning breaks caused by incomplete knowledge or sparse entity associations during the reasoning process.

[0004] In terms of the collaborative mechanism of retrieval and reasoning, existing methods usually select retrieval paths based on static strategies and lack the ability to dynamically adjust the retrieval process according to the query intent, resulting in unstable retrieval results under complex query conditions. At the same time, for key steps such as consistency verification of retrieval results, semantic similarity assessment, and relationship connectivity checking, existing systems generally use simple matching or local feature-based verification methods, which cannot fully guarantee the accuracy of the final answer and the integrity of the reasoning chain. In addition, for the gap problem that occurs in reasoning, most traditional methods use a rule-based supplementary strategy and lack an intelligent completion mechanism based on large-scale model reasoning capabilities, which limits the system's ability to adapt to complex reasoning needs.

[0005] Therefore, how to provide an intelligent question-answering system and method for large-scale traffic engineering models based on knowledge graphs is an urgent problem that technicians in this field need to solve. Summary of the Invention

[0006] One purpose of the present invention is to propose a large-scale intelligent question-answering system and method for traffic engineering based on a knowledge graph. The present invention extracts structural degree features, semantic fuzziness features and context association features by parsing natural language query statements, generates a retrieval intention vector and dynamically selects a retrieval path, constructs structured query statements and semantic vectors respectively, performs hybrid collaborative retrieval in the knowledge graph and vector database, performs two-way verification and screening results based on entity consistency, semantic similarity and relationship connectivity, further generates a complete reasoning chain through reasoning chain construction and large-scale model reasoning gap filling mechanism, and finally outputs an inference-based answer. The system has the advantages of high retrieval accuracy, coherent reasoning chain, strong explainability of the question-answering process and excellent adaptability to complex natural language queries.

[0007] According to an embodiment of the present invention, a traffic engineering large model intelligent question answering system and method based on a knowledge graph includes the following steps:

[0008] S1. Receive a natural language query statement input by the user, parse the natural language query statement, and extract structured degree features, semantic fuzziness features, and contextual association features as query intent representation features;

[0009] S2. Generate a retrieval intent vector based on the query intent representation features, and dynamically select a retrieval path through a preset intent classification model;

[0010] S3. Based on the query intent representation features and in accordance with the search path requirements, a structured query statement corresponding to the knowledge graph search path and a semantic vector corresponding to the vector database search path are constructed respectively;

[0011] S4. When a hybrid collaborative search path is adopted, entity linking and relationship reasoning are performed in the knowledge graph based on the structured query statement to obtain the first search result, and similarity search is performed in the vector database based on the semantic vector to obtain the second search result;

[0012] S5. Perform bidirectional verification on the first search result and the second search result based on entity consistency, semantic similarity, and relationship connectivity indicators, and select a candidate result set that passes the bidirectional verification;

[0013] S6. Build an inference chain for the candidate result set. If there is a break in the inference chain, generate relay nodes based on the large model inference gap filling mechanism to form a complete inference chain.

[0014] S7. Based on the complete reasoning chain, generate and output the final reasoning answer.

[0015] Optionally, the S2 specifically includes:

[0016] S21. Based on the query intent representation features, a segmented quantization coding method is used for the structured degree feature to map different structured levels into discrete vectors. A normalized numerical coding method is used for the semantic fuzziness feature to normalize the fuzziness value to a standard interval to generate a vector. A sliding window statistical coding method is used for the context-related feature to extract the context continuity feature vector, and a first sub-feature vector, a second sub-feature vector, and a third sub-feature vector are generated respectively.

[0017] S22, concatenating the first sub-feature vector, the second sub-feature vector, and the third sub-feature vector in the order of structured degree feature, semantic fuzziness feature, and contextual association feature to form a unified multi-dimensional combined feature vector, wherein the vector concatenation method is linear concatenation in a fixed order of feature categories;

[0018] S23, performing Min-Max normalization processing on the multidimensional combined feature vector, scaling each dimension value to the interval [0, 1], and then performing feature transformation on the normalized multidimensional combined feature vector by linear mapping using a linear feature mapping function to obtain a retrieval intent vector;

[0019] S24. Input the retrieval intention vector into the intent classification model, classify the retrieval intention vector through the intent classification model, and determine the retrieval path corresponding to the natural language query statement based on the classification result. The retrieval path includes a knowledge graph retrieval path, a vector database retrieval path, and a hybrid collaborative retrieval path.

[0020] Optionally, the intent classification model is a shallow neural network classifier:

[0021] Receiving a retrieval intention vector as input, wherein the retrieval intention vector retains a structured degree feature value, a semantic fuzziness feature value, and a contextual relevance feature score as dimension information;

[0022] Inputting the retrieval intention vector into a first linear transformation layer for feature compression, and outputting a first latent feature vector;

[0023] The ReLU activation function is used to perform nonlinear transformation on the first latent eigenvector to obtain the activated eigenvector;

[0024] The activated feature vector is input into the second linear transformation layer, and the matrix multiplication operation is performed with the weight matrix of the second linear transformation layer and the bias vector is superimposed to extract the combined features of the structural degree feature, the semantic ambiguity feature and the context association feature, and the classification feature vector is output;

[0025] Perform Softmax normalization on the classification feature vector to generate three-category probability distribution, corresponding to the knowledge graph retrieval path, vector database retrieval path, and hybrid collaborative retrieval path respectively;

[0026] Based on the structured degree feature value, semantic ambiguity feature value and contextual relevance feature score retained in the retrieval intent vector, the retrieval path is determined according to the following classification criteria:

[0027] When the structured degree eigenvalue is greater than 0.7 and the semantic fuzziness eigenvalue is less than 0.3, it is classified as a knowledge graph retrieval path;

[0028] When the structured degree eigenvalue is less than 0.4 and the semantic fuzziness eigenvalue is greater than 0.6, it is classified as a vector database retrieval path;

[0029] When the structured degree feature value is between 0.4 and 0.7, the semantic ambiguity feature value is between 0.3 and 0.6, and the contextual relevance feature score is greater than 0.5, it is classified as a hybrid collaborative retrieval path;

[0030] When the structured degree feature value, semantic fuzziness feature value, and contextual relevance feature score do not meet the classification criteria, it indicates that there is no relevant search content.

[0031] Optionally, the S3 specifically includes:

[0032] S31. When the search path is a knowledge graph search path, based on the query intent representation feature, parse the natural language query statement, perform entity recognition operations, and extract entity terms with clear semantic references in the natural language query statement;

[0033] S32, natural language query statements, identify the relationship phrases between entity terms, and build a preliminary set of entity-relationship-entity triples based on the knowledge graph preset pattern library;

[0034] S33, standardizing the preliminary triple set, including performing standardized name mapping on entity nodes and applying synonymous relationship expansion rules on relationship edges, to form a structured query statement that complies with the knowledge graph query specification;

[0035] S34. When the search path is a vector database search path, perform BiLSTM-CRF context-aware word segmentation processing on the natural language query statement based on the query intent representation feature, remove stop words, and extract a keyword set;

[0036] S35, encoding the keyword set using a bidirectional context-aware mechanism to generate a preliminary semantic vector capable of representing deep semantic features of the query statement;

[0037] S36, performing normalization processing and vector space mapping on the preliminary semantic vector to obtain a semantic vector for vector database retrieval;

[0038] S37. When the search path is a hybrid collaborative search path, simultaneously execute S31 to S33 to generate a structured query statement, and execute S34 to S36 to generate a semantic vector.

[0039] Optionally, the process of obtaining the first search result is:

[0040] Receive structured query statements, parse the query target entity, query condition relationship and target entity type in the query statement, and use them as the starting point of retrieval reasoning, reasoning path constraints and target node screening basis;

[0041] Based on the knowledge graph entity index library, the query target entity is linked to the entity. By combining entity name similarity matching with entity attribute cross-validation, the corresponding starting entity node in the knowledge graph is determined, and the entity mapping relationship between the query statement and the knowledge graph is established.

[0042] Starting from the successfully linked starting entity node, the relationship expansion reasoning is performed in the knowledge graph according to the query condition relationship, starting from the starting entity. Multi-hop expansion is allowed during the reasoning process, and each hop reasoning must meet the relationship semantic consistency requirements;

[0043] During the reasoning process, a path confidence score is calculated for each extended reasoning path. The path confidence score comprehensively considers the relationship semantic matching degree, the path hop penalty factor, and the node connection weight. Reasoning paths with a path confidence score below a preset threshold are dynamically pruned.

[0044] For all entity nodes at the end of the reasoning path that pass the confidence screening, further screening is performed according to the target entity type requirements to eliminate entity nodes that do not match the target entity type;

[0045] The entity node set after further screening is used as the first search result.

[0046] Optionally, the process of obtaining the second search result is:

[0047] Receive a semantic vector generated by the query intent representation feature as a query vector for vector database retrieval;

[0048] Input the query vector into the vector database index and quickly locate the set of candidate vectors that are close to the query vector semantic space based on the preset vector inverted index mechanism;

[0049] The cosine similarity measurement method is used to calculate the similarity between the query vector and each vector in the candidate vector set, and the similarity score between each candidate vector in the candidate vector set and the query vector is obtained;

[0050] Based on the similarity score, candidate vectors with scores higher than the preset similarity threshold are screened out to form the first round of similar candidate sets;

[0051] Based on the first round of similar candidate sets, the context relevance re-ranking mechanism is used to perform weighted sorting based on the frequency of occurrence and association strength of candidate entities in the original context to generate the final candidate set;

[0052] The entity node or document object corresponding to the final candidate set is used as the second retrieval result.

[0053] Optionally, the S5 specifically includes:

[0054] S51, receiving the first search result and the second search result, respectively extracting the standardized name, contextual semantic representation and knowledge graph entity node identifier of each entity;

[0055] S52. Based on standardized name matching, for each entity in the first search result, search for entity nodes in the second search result that have the same or semantically similar standardized names to form preliminary entity consistency matching pairs;

[0056] S53: For the preliminary entity consistency matching pairs, extract the corresponding contextual semantic representations, calculate the cosine similarity between the semantic vectors, select the matching pairs with similarity scores higher than a first preset threshold, and mark them as having passed the semantic similarity verification;

[0057] S54. For the matching pairs that have passed the semantic similarity verification, connectivity verification is performed based on the knowledge graph relationship network to retrieve the shortest path between the two entity nodes. When there is a connected path with a hop count not exceeding a preset maximum hop count and the path semantics conforming to the inference relationship constraint, it is determined that the relationship connectivity verification has passed.

[0058] S55. The set of entity nodes that have passed the entity consistency verification, the semantic similarity verification, and the relationship connectivity verification is used as a candidate result set that has passed the bidirectional verification.

[0059] Optionally, the S6 specifically includes:

[0060] S61: Receive the candidate result set that has passed the bidirectional verification, and extract the starting entity and the ending entity according to the reasoning target in the query intent as the starting and ending nodes for constructing the reasoning chain;

[0061] S62: Based on the existing relationship network of the knowledge graph, starting from the starting entity, along the relationship path that matches the query intent semantics, expand the reasoning chain hop by hop, give priority to the relationship edges with high path confidence, and try to gradually connect to the end entity;

[0062] S63. During the reasoning chain expansion process, the connectivity between adjacent entity nodes is detected in real time. When no connection path that meets the semantic consistency and hop count limit exists in a certain expansion step, this position is recorded as a reasoning gap and the current reasoning chain expansion is suspended.

[0063] S64. For each reasoning gap, extract the context information, existing path information, and reasoning intention constraints of the entities at both ends of the reasoning gap as input to the large model reasoning gap completion mechanism;

[0064] S65. Generate a relay node that can connect entities at both ends of the reasoning gap through a large model reasoning gap completion mechanism;

[0065] S66: insert the selected relay node into the reasoning gap position, update the reasoning chain structure, and continue to expand and connect the reasoning chain until reaching the terminal entity;

[0066] S67. After the reasoning chain is fully connected, the complete reasoning chain is confirmed based on the confidence score of the overall reasoning path and semantic consistency verification.

[0067] Optionally, the large model reasoning gap filling mechanism specifically includes:

[0068] Extract the standardized names, entity types, contextual semantic descriptions, and historical path information of the entities at both ends of the reasoning gap, and combine them with the query intent to form the reasoning gap completion input dataset;

[0069] Analyze the reasoning gap type and identify whether the reasoning gap is entity missing, relationship missing, or path broken based on the entities at both ends of the reasoning gap and the historical path information;

[0070] Dynamically generate reasoning completion hints based on the reasoning gap type and query intent. The hints include the reasoning starting entity, end entity, contextual relationship requirements, reasoning hop limit, and expected reasoning target description.

[0071] Input the completion hint content into the inference engine, limit the inference scope to the entity types and relationship categories supported by the current knowledge graph structure, and generate multiple relay node candidates. Each relay node candidate is accompanied by a relationship description path between the corresponding starting entity and the end entity;

[0072] For each relay node candidate, a comprehensive evaluation score is calculated in a weighted manner based on the confidence score of reasoning rationality, relationship coherence test, entity context consistency analysis, and knowledge graph existing connection verification;

[0073] The relay node with the highest comprehensive evaluation score is selected as the formal filling node in the reasoning chain completion process.

[0074] Optional, a large-scale intelligent question-answering system for traffic engineering models based on knowledge graphs, characterized by including:

[0075] The query parsing module is used to receive natural language query statements, extract structured degree features, semantic fuzziness features and contextual association features, and generate query intent representation features;

[0076] The retrieval path decision module is used to generate a retrieval intent vector based on the query intent representation features, and dynamically select the knowledge graph retrieval path, vector database retrieval path, or hybrid collaborative retrieval path through the intent classification model;

[0077] The retrieval input construction module is used to generate structured query statements based on entity recognition and relationship extraction in the knowledge graph retrieval path, and to generate semantic vectors based on context-aware word segmentation and semantic encoding in the vector database retrieval path;

[0078] A hybrid search execution module is used to perform entity linking and relationship reasoning in the knowledge graph based on the structured query statement under the hybrid collaborative search path to obtain a first search result, and to perform similarity search in the vector database based on the semantic vector to obtain a second search result;

[0079] A two-way verification module is used to perform two-way verification on the first search result and the second search result based on entity consistency, semantic similarity and relationship connectivity indicators, and screen out candidate result sets that pass the two-way verification;

[0080] The inference chain construction module is used to build an inference chain based on the candidate result set that has passed bidirectional verification, detect the connectivity of the inference chain, and if there is an inference gap, call the large model inference gap filling mechanism to generate a relay node and insert it into the gap position of the inference chain to form a complete inference chain;

[0081] The large-model reasoning gap completion module is used to extract the context and historical path information of the entities at both ends of the reasoning gap, generate completion prompts, call large-model reasoning to generate a set of relay node candidates, and based on a comprehensive evaluation of the confidence level of reasoning rationality, relationship coherence, and context consistency, select the relay node with the highest score to complete the reasoning chain;

[0082] The inference-based answer generation module is used to parse the inference path steps based on the complete inference chain, determine the answer focus and style based on the query intent, generate a set of inference path descriptions, perform natural language optimization processing, integrate the inference chain information to generate the final inference-based answer text, and attach the explainable annotation information of the inference chain, and output it to the user interface.

[0083] The beneficial effects of the present invention are:

[0084] (1) The present invention generates a unified search intent vector by extracting the structured degree features, semantic fuzziness features, and contextual association features of natural language query statements. It then dynamically selects a knowledge graph search path, a vector database search path, or a hybrid collaborative search path based on a shallow neural network intention classification model, and adaptively optimizes the search strategy for different types of query requirements. Compared to traditional static path configuration methods, the present invention can adjust the search direction in real time according to query characteristics, ensuring both the inference accuracy in highly structured query scenarios and the coverage breadth and flexibility in open semantic query scenarios. This greatly improves the question-answering system's ability to understand complex natural language input and its search adaptability, solving the problems of single search path selection and lack of dynamic adaptation mechanisms in existing technologies.

[0085] (2) The present invention simultaneously constructs structured query statements and deep semantic vectors during the retrieval process, performs retrieval operations in the knowledge graph and vector database respectively, and performs bidirectional cross-screening based on entity consistency verification, semantic similarity verification, and relationship connectivity verification to form a high-confidence candidate result set. Through the multi-dimensional verification mechanism, the system can effectively eliminate low-quality retrieval results caused by semantic deviation or entity mapping errors, ensuring the high accuracy of the information basis in the answer generation stage. Compared with the existing methods that only rely on single feature screening strategies, the bidirectional verification framework of the present invention significantly improves the accuracy and reliability of retrieval results, especially when facing complex query tasks with high semantic ambiguity or sparse entity relationships. It can maintain stable and accurate result output, overcoming the problem of result drift and answer deviation in existing question-answering systems.

[0086] (3) The present invention proposes a mechanism for constructing reasoning chains and filling gaps in large-scale reasoning. Based on candidate results that have passed bidirectional verification, a reasoning chain is constructed according to the query intent target. When the reasoning chain is broken, relay nodes are dynamically generated for intelligent completion based on the contextual information, historical path characteristics, and reasoning intent requirements of the entities at both ends of the reasoning gap. By introducing large-scale reasoning capabilities, the system can automatically identify missing links in the reasoning logic and reasonably generate supplementary paths within the scope allowed by the knowledge graph to achieve the continuity and integrity of the reasoning chain. Compared with traditional methods based on fixed rules or manually set completion strategies, the present invention has higher intelligence and adaptability, and can effectively solve the problem of easy breakage and difficulty in connecting reasoning chains in complex knowledge environments, significantly improving the overall reasoning coherence, answer integrity, and ability to cope with complex reasoning tasks of the system.

[0087] (4) Based on the reasoning chain, the present invention combines the reasoning path confidence score and semantic consistency verification to dynamically generate reasoning answers that conform to natural language specifications, and visually annotates the answer process, thereby enhancing the interpretability and user trust of the question-answering system. The system can not only output the final reasoning conclusion, but also fully display each entity node, relationship node and reasoning step in the reasoning chain, supporting users to trace back and verify the answer generation process. Compared with the traditional system that only outputs isolated answers and is essentially a black box reasoning method, the present invention significantly improves the controllability, auditability and ease of use of the intelligent question-answering system through the visualization of the reasoning chain and the transparency of the process. It is particularly suitable for application scenarios with high requirements for reasoning interpretability, such as medical decision-making, legal consulting, and financial analysis, and expands the application depth and industry adaptability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0088] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0089] Figure 1 This is the overall flow chart of the intelligent question-answering system and method for a large-scale traffic engineering model based on knowledge graph proposed in the present invention;

[0090] Figure 2 This is a schematic diagram of the retrieval intention vector generation and dynamic retrieval path selection process of the knowledge graph-based traffic engineering large-scale model intelligent question-answering system and method proposed in the present invention;

[0091] Figure 3 This is a processing flow chart of the reasoning chain construction and large model reasoning gap filling mechanism of the knowledge graph-based intelligent question-answering system and method for large-scale traffic engineering models proposed in the present invention. DETAILED DESCRIPTION

[0092] The present invention will now be described in further detail with reference to the accompanying drawings, which are simplified schematic diagrams that illustrate the basic structure of the present invention in a schematic manner.

[0093] refer to Figure 1 ,The intelligent question answering method for a large model of traffic engineering based on knowledge graph includes the following steps:

[0094] S1. Receive a natural language query statement input by the user, parse the natural language query statement, and extract structured degree features, semantic fuzziness features, and contextual association features as query intent representation features;

[0095] In a specific embodiment of the present invention, the query parsing module receives a natural language query statement input by a user and first performs preliminary word segmentation on the natural language query statement to identify key phrases, entity terms, and grammatical structure. Subsequently, based on dependency parsing in natural language processing technology, the dependency relationships between entities in the query statement are further analyzed to extract a tree-like representation of the sentence structure. Based on this, the proportion of identifiable structured entities and relationships in the query statement is evaluated using a predefined structured degree scoring standard to generate a structured degree feature. Simultaneously, based on a semantic ambiguity detection model, ambiguous expressions and uncertain vocabulary (such as "maybe," "approximately," and "related") in the query statement are identified and quantified to generate a semantic ambiguity feature. Furthermore, using query statement context window analysis technology, the strength of contextual dependencies between entities, verbs, and modifiers is evaluated to extract contextual association features. Finally, the structured degree feature, semantic ambiguity feature, and contextual association feature are fused and encoded to form a unified query intent representation feature, which is used to guide subsequent search path decisions and search input construction.

[0096] Through the above-mentioned implementation mode, the present invention can systematically extract multi-dimensional query intent features in the natural language query parsing stage, fully capture key information such as the degree of structured expression, semantic fuzziness and contextual coherence in the query statement, and effectively support the dynamic decision-making of subsequent retrieval paths and the adaptive selection of retrieval modes. Compared with traditional query parsing methods based only on keywords or entity recognition, the present invention can more finely distinguish different query intent characteristics, realize accurate switching of knowledge graph retrieval, vector database retrieval or hybrid retrieval paths, and greatly improve the retrieval accuracy and answer relevance. In addition, the present invention lays a solid foundation for the subsequent reasoning chain construction and reasoning answer generation by introducing contextual association analysis in the parsing stage, significantly enhancing the overall intelligent reasoning ability and answer interpretability of the system.

[0097] S2. Generate a retrieval intent vector based on the query intent representation features, and dynamically select a retrieval path through a preset intent classification model;

[0098] In this embodiment, S2 specifically includes:

[0099] S21. Based on the query intent representation features, a segmented quantization coding method is used for the structured degree feature to map different structured levels into discrete vectors. A normalized numerical coding method is used for the semantic fuzziness feature to normalize the fuzziness value to a standard interval to generate a vector. A sliding window statistical coding method is used for the context-related feature to extract the context continuity feature vector, and a first sub-feature vector, a second sub-feature vector, and a third sub-feature vector are generated respectively.

[0100] S22, concatenating the first sub-feature vector, the second sub-feature vector, and the third sub-feature vector in the order of structured degree feature, semantic fuzziness feature, and contextual association feature to form a unified multi-dimensional combined feature vector, wherein the vector concatenation method is linear concatenation in a fixed order of feature categories;

[0101] S23, performing Min-Max normalization processing on the multidimensional combined feature vector, scaling each dimension value to the interval [0, 1], and then performing feature transformation on the normalized multidimensional combined feature vector by linear mapping using a linear feature mapping function to obtain a retrieval intent vector;

[0102] S24. Input the retrieval intention vector into the intent classification model, classify the retrieval intention vector through the intent classification model, and determine the retrieval path corresponding to the natural language query statement based on the classification result. The retrieval path includes a knowledge graph retrieval path, a vector database retrieval path, and a hybrid collaborative retrieval path.

[0103] The intent classification model is a shallow neural network classifier:

[0104] Receiving a retrieval intention vector as input, wherein the retrieval intention vector retains a structured degree feature value, a semantic fuzziness feature value, and a contextual relevance feature score as dimension information;

[0105] Inputting the retrieval intention vector into a first linear transformation layer for feature compression, and outputting a first latent feature vector;

[0106] The ReLU activation function is used to perform nonlinear transformation on the first latent eigenvector to obtain the activated eigenvector;

[0107] The activated feature vector is input into the second linear transformation layer, and the matrix multiplication operation is performed with the weight matrix of the second linear transformation layer and the bias vector is superimposed to extract the combined features of the structural degree feature, the semantic ambiguity feature and the context association feature, and the classification feature vector is output;

[0108] Perform Softmax normalization on the classification feature vector to generate three-category probability distribution, corresponding to the knowledge graph retrieval path, vector database retrieval path, and hybrid collaborative retrieval path respectively;

[0109] Based on the structured degree feature value, semantic ambiguity feature value and contextual relevance feature score retained in the retrieval intent vector, the retrieval path is determined according to the following classification criteria:

[0110] When the structured degree eigenvalue is greater than 0.7 and the semantic fuzziness eigenvalue is less than 0.3, it is classified as a knowledge graph retrieval path;

[0111] When the structured degree eigenvalue is less than 0.4 and the semantic fuzziness eigenvalue is greater than 0.6, it is classified as a vector database retrieval path;

[0112] When the structured degree feature value is between 0.4 and 0.7, the semantic ambiguity feature value is between 0.3 and 0.6, and the contextual relevance feature score is greater than 0.5, it is classified as a hybrid collaborative retrieval path;

[0113] When the structured degree feature value, semantic fuzziness feature value, and contextual relevance feature score do not meet the classification criteria, it indicates that there is no relevant search content.

[0114] Based on the query intent representation features, the present invention can fully extract multi-dimensional feature information such as the degree of structure, semantic ambiguity, and contextual relevance in natural language query statements to form a standardized, multi-dimensional representation of retrieval intent vector. Compared with traditional intent parsing methods that rely on manual feature selection or simple entity extraction, the present invention uses standardized quantitative coding and normalization processing to achieve consistent fusion and unified expression of different types of feature data, providing a high-precision, low-bias input foundation for subsequent intelligent retrieval path decision-making, significantly improving the accuracy and generalization ability of retrieval intent modeling.

[0115] By introducing a shallow neural network intent classification model, the present invention performs deep feature conversion and classification attribution determination on the retrieval intent vector, and can automatically distinguish between suitable knowledge graph retrieval paths, vector database retrieval paths, or hybrid collaborative retrieval paths based on the query intent characteristics. Compared to the existing methods that rely on fixed rules or manual experience to select paths, the present invention uses a trained classification model to dynamically determine the retrieval path, taking into account both retrieval efficiency and answer accuracy. It can adaptively adjust the retrieval strategy based on the structural and semantic complexity of different query statements, significantly improving the intelligent question-answering system's ability to handle complex, ambiguous, and cross-domain questions and the quality of its answers.

[0116] S3. Based on the query intent representation features and in accordance with the search path requirements, a structured query statement corresponding to the knowledge graph search path and a semantic vector corresponding to the vector database search path are constructed respectively;

[0117] In this embodiment, S3 specifically includes:

[0118] S31. When the search path is a knowledge graph search path, based on the query intent representation feature, parse the natural language query statement, perform entity recognition operations, and extract entity terms with clear semantic references in the natural language query statement;

[0119] S32, natural language query statements, identify the relationship phrases between entity terms, and build a preliminary set of entity-relationship-entity triples based on the knowledge graph preset pattern library;

[0120] The knowledge graph preset pattern library is used to store standardized definitions of entity types and relationship patterns between entities in the knowledge graph, specifically including multiple groups of entity type-relationship type-entity type triple pattern templates. Each pattern template specifies the legal connection rules between the starting entity type, relationship category and end entity type, and records the semantic meaning, directional attributes and optional relationship constraints of the relationship. The knowledge graph preset pattern library can be generated by annotation by domain knowledge experts, statistical analysis of existing knowledge graph data, or automatic induction of high-frequency relationship patterns based on machine learning models. When applied, when parsing natural language query statements, the system searches the knowledge graph preset pattern library based on the identified entity terms and relationship phrases to determine the standard triple structure that meets the semantics of the starting entity type and relationship phrase. If there is a match, a structured query statement is constructed based on the standard pattern. If there is no direct match, a semantic extension match is performed in the pattern library according to the semantic approximate extension rules of the relationship category to improve the adaptability of natural language parsing to complex expressions and semantic variant expressions of entity relationships, thereby ensuring the consistency of natural language query intent and knowledge graph structure, and providing a high-quality, standardized triple foundation for subsequent entity linking, relationship reasoning and reasoning chain construction.

[0121] S33, standardizing the preliminary triple set, including performing standardized name mapping on entity nodes and applying synonymous relationship expansion rules on relationship edges, to form a structured query statement that complies with the knowledge graph query specification;

[0122] S34. When the search path is a vector database search path, perform BiLSTM-CRF context-aware word segmentation processing on the natural language query statement based on the query intent representation feature, remove stop words, and extract a keyword set;

[0123] S35, encoding the keyword set using a bidirectional context-aware mechanism to generate a preliminary semantic vector capable of representing deep semantic features of the query statement;

[0124] S36, performing normalization processing and vector space mapping on the preliminary semantic vector to obtain a semantic vector for vector database retrieval;

[0125] S37. When the search path is a hybrid collaborative search path, simultaneously execute S31 to S33 to generate a structured query statement, and execute S34 to S36 to generate a semantic vector.

[0126] The present invention can accurately construct structured query statements corresponding to the knowledge graph retrieval path and semantic vectors corresponding to the vector database retrieval path based on the query intent characterization features and in combination with the needs of different retrieval paths. Under the knowledge graph retrieval path, the present invention constructs a structured entity-relationship-entity set that complies with the knowledge graph query specification through entity recognition, relationship recognition and triple standardization processing, which significantly improves the conversion efficiency and accuracy of natural language queries to knowledge graph retrieval language. In particular, by performing standardized naming mapping on the extracted entity nodes and expanding and regularizing them in combination with the existing pattern rules in the knowledge graph, the structured query statements are more in line with the knowledge graph indexing logic, ensuring the accuracy and consistency of subsequent entity links and relationship reasoning, and reducing retrieval errors caused by fuzzy expressions in natural language.

[0127] Under the vector database retrieval path, the present invention effectively extracts key semantic units in query statements through context-aware word segmentation processing based on the BiLSTM-CRF model, generates high-quality semantic vector representations after encoding and normalization, and can comprehensively characterize the deep semantic features of the query statement. In addition, the present invention also ensures that the generated semantic vectors can fully capture the deep semantic associations between the query statement and the candidate vectors in the database through multiple rounds of vector screening and reordering mechanisms, thereby improving the retrieval recall and accuracy in open and fuzzy query scenarios. In summary, the present invention realizes the dynamic adaptation of structured query statements and semantic vector generation paths in the retrieval input construction stage, effectively supports the accuracy and stability of subsequent hybrid retrieval and reasoning chain construction, and significantly improves the robustness and scalability of the overall intelligent question-answering system under diversified query requirements.

[0128] S4. When a hybrid collaborative search path is adopted, entity linking and relationship reasoning are performed in the knowledge graph based on the structured query statement to obtain the first search result, and similarity search is performed in the vector database based on the semantic vector to obtain the second search result;

[0129] In this embodiment, the S4 specifically includes:

[0130] The process of obtaining the first search result is:

[0131] Receive structured query statements, parse the query target entity, query condition relationship and target entity type in the query statement, and use them as the starting point of retrieval reasoning, reasoning path constraints and target node screening basis;

[0132] Based on the knowledge graph entity index library, the query target entity is linked to the entity. By combining entity name similarity matching with entity attribute cross-validation, the corresponding starting entity node in the knowledge graph is determined, and the entity mapping relationship between the query statement and the knowledge graph is established.

[0133] Starting from the successfully linked starting entity node, the relationship expansion reasoning is performed in the knowledge graph according to the query condition relationship, starting from the starting entity. Multi-hop expansion is allowed during the reasoning process, and each hop reasoning must meet the relationship semantic consistency requirements;

[0134] During the reasoning process, a path confidence score is calculated for each extended reasoning path. The path confidence score comprehensively considers the relationship semantic matching degree, the path hop penalty factor, and the node connection weight. Reasoning paths with a path confidence score below a preset threshold are dynamically pruned.

[0135] The preset threshold is used to dynamically trim the path confidence during the reasoning chain expansion process to improve the accuracy and rationality of the reasoning path. Specifically, the path confidence comprehensively considers the relationship semantic matching degree, the path jump number penalty factor and the entity node connection weight. The relationship semantic matching degree reflects the degree of consistency between the current expanded relationship and the semantics of the relationship phrase in the query intent. The path jump number penalty factor deducts 0.1 points for each jump based on the number of intermediate nodes passed by the expansion path. The entity node connection weight is increased by 0.05 to 0.2 points based on the node's connectivity in the knowledge graph and the node importance assessment. The path confidence threshold is preset to 0.6, that is, only expansion paths with a comprehensive confidence score higher than 0.6 are retained. When the confidence score of an expansion path is lower than 0.6, it is determined to be an invalid reasoning path and pruning is performed, thereby effectively controlling the correctness and coherence of the reasoning chain extension during the reasoning process, avoiding interference from irrelevant path noise, and ensuring that the reasoning chain can accurately and coherently reach the end entity required by the query intent, while maintaining a reasonable jump range and reasoning logic consistency.

[0136] For all entity nodes at the end of the reasoning path that pass the confidence screening, further screening is performed according to the target entity type requirements to eliminate entity nodes that do not match the target entity type;

[0137] The entity node set after further screening is used as the first search result.

[0138] The process of obtaining the second search result is:

[0139] Receive a semantic vector generated by the query intent representation feature as a query vector for vector database retrieval;

[0140] Input the query vector into the vector database index and quickly locate the set of candidate vectors that are close to the query vector semantic space based on the preset vector inverted index mechanism;

[0141] The preset vector inverted index mechanism is used to accelerate the neighbor retrieval of the semantic vector of the query statement in the vector database, specifically including an inverted file index structure constructed based on vector clustering. In the offline stage, the system performs clustering division on the entire semantic vector set in the database, and distributes the semantic vectors to multiple cluster centers according to their feature similarity. Each cluster center corresponds to an inverted list, which records all semantic vectors belonging to the cluster center and their index identifiers; in the online retrieval stage, the semantic vector generated by the query statement is first quickly and approximately matched with each cluster center, and several cluster centers closest to the query vector are selected as candidate clusters. Then, similarity calculation is performed only within the inverted list corresponding to the candidate cluster, thereby greatly reducing the number of vector comparisons while maintaining high retrieval recall and accuracy. The preset vector inverted index mechanism can significantly reduce retrieval latency, improve the efficiency of the system in performing semantic neighbor retrieval in large-scale vector databases, and support the present invention to achieve real-time response and efficient retrieval under complex query tasks.

[0142] The cosine similarity measurement method is used to calculate the similarity between the query vector and each vector in the candidate vector set, and the similarity score between each candidate vector in the candidate vector set and the query vector is obtained;

[0143] Based on the similarity score, candidate vectors with scores higher than the preset similarity threshold are screened out to form the first round of similar candidate sets;

[0144] The preset similarity threshold is used to screen the first round of candidate sets during the vector database retrieval process based on the semantic similarity scores between the query vector and each candidate vector in the candidate vector set. Specifically, the system uses cosine similarity as the similarity metric to calculate the similarity between each candidate vector and the query vector. The calculated similarity score is between 0 and 1. The preset similarity threshold is set to 0.7, that is, when the similarity score between the candidate vector and the query vector is greater than or equal to 0.7, it is determined to be a valid candidate in the first round. If the similarity score is lower than 0.7, it is deemed to have insufficient relevance and is eliminated, thereby effectively filtering out candidate vectors that are irrelevant or weakly associated with the query intent, improving the semantic relevance and accuracy of the retrieval results, while maintaining a high query recall rate and ensuring the basic data quality for the subsequent reasoning chain construction.

[0145] Based on the first round of similar candidate sets, the context relevance re-ranking mechanism is used to perform weighted sorting based on the frequency of occurrence and association strength of candidate entities in the original context to generate the final candidate set;

[0146] The entity node or document object corresponding to the final candidate set is used as the second retrieval result.

[0147] The present invention can obtain the first search result by executing entity linking and relationship reasoning in the knowledge graph based on the structured query statement, and obtain the second search result by performing similarity search in the vector database based on the semantic vector when the search path is selected as a hybrid collaborative search, giving full play to the respective advantages of structured search and semantic search. In the knowledge graph search part, the present invention can accurately infer the entity set that meets the query intent in a complex knowledge network through entity recognition, relationship reasoning and reasoning path confidence scoring, effectively improving the search accuracy in the rule-based reasoning scenario; and in the vector database search part, the present invention can quickly recall the candidate entity set that is semantically closest to the query intent through cosine similarity calculation and context relevance reordering mechanism, significantly improving the search recall rate and coverage when facing open, ambiguous natural language queries.

[0148] During the hybrid search process, the present invention can comprehensively utilize the structured results obtained by knowledge graph reasoning and the semantically related results obtained by vector search, forming a basis for bidirectional supplementation and mutual verification, providing a high-quality and diverse source of candidate entities for the subsequent bidirectional verification module. Compared with the retrieval blind spot problem caused by single-path retrieval in traditional intelligent question-answering systems, the present invention effectively reduces the probability of retrieval failure caused by incomplete knowledge bases, ambiguous query expressions, or interrupted knowledge reasoning chains through a hybrid retrieval strategy, significantly improving the system's robustness, retrieval accuracy, and reliability of the final answer in diverse query environments.

[0149] S5. Perform bidirectional verification on the first search result and the second search result based on entity consistency, semantic similarity, and relationship connectivity indicators, and select a candidate result set that passes the bidirectional verification;

[0150] In this embodiment, the S5 specifically includes:

[0151] S51, receiving the first search result and the second search result, respectively extracting the standardized name, contextual semantic representation and knowledge graph entity node identifier of each entity;

[0152] S52. Based on standardized name matching, for each entity in the first search result, search for entity nodes in the second search result that have the same or semantically similar standardized names to form preliminary entity consistency matching pairs;

[0153] S53: For the preliminary entity consistency matching pairs, extract the corresponding contextual semantic representations, calculate the cosine similarity between the semantic vectors, select the matching pairs with similarity scores higher than a first preset threshold, and mark them as having passed the semantic similarity verification;

[0154] The first preset threshold is used to screen out matching items with highly relevant contextual semantic representations in the first round of preliminary entity consistency matching pairs during the semantic similarity verification process. Specifically, the system calculates the cosine similarity between entity node pairs based on the contextual semantic vector, and the similarity score is between 0 and 1. The first preset threshold is set to 0.75, that is, when the contextual semantic similarity score of the preliminary matching pair is greater than or equal to 0.75, it is determined that the semantic consistency verification has passed. If the score is lower than 0.75, it is deemed that the semantic relevance is insufficient, and the corresponding entity matching pairs are eliminated, thereby effectively ensuring that the final screened entity node set has high consistency at the semantic level, improving the coherence of the reasoning chain and the accuracy of the reasoning path.

[0155] S54. For the matching pairs that have passed the semantic similarity verification, connectivity verification is performed based on the knowledge graph relationship network to retrieve the shortest path between the two entity nodes. When there is a connected path with a hop count not exceeding a preset maximum hop count and the path semantics conforming to the inference relationship constraint, it is determined that the relationship connectivity verification has passed.

[0156] The preset maximum number of hops is used to limit the allowable hop range of the connection path between entity nodes during the relationship connectivity verification process, so as to prevent the rationality of the reasoning chain from decreasing due to excessively long paths or cross-domain jumps. Specifically, the system sets the maximum allowable number of hops to 3 hops, that is, when there is a relationship path of no more than 3 hops (that is, connected through no more than two relay nodes) between two entity nodes, and each hop relationship meets the semantic consistency requirements, the relationship connectivity verification is determined to have passed. If the number of hops exceeds 3 hops, it is deemed to be insufficiently connected and is eliminated. In this way, while ensuring the coverage capability of the reasoning chain, the complexity of the reasoning chain is controlled, and the rationality and explainability of the reasoning process are maintained.

[0157] S55. The set of entity nodes that have passed the entity consistency verification, the semantic similarity verification, and the relationship connectivity verification is used as a candidate result set that has passed the bidirectional verification.

[0158] The present invention can systematically perform two-way verification and screening based on the triple indicators of entity consistency, semantic similarity and relationship connectivity during the fusion stage of the first search result and the second search result, thereby greatly improving the accuracy and reliability of the search results. In the entity consistency verification process, the present invention ensures that entity nodes from different search paths (knowledge graph retrieval and vector retrieval) can reach consistency at the naming level through standardized name matching strategies, reducing the entity recognition error rate caused by entity aliases, synonyms, etc.; in the semantic similarity verification process, the present invention further eliminates matches that are superficially consistent but lack semantic relevance through contextual semantic vector similarity calculation, significantly improving the semantic consistency screening effect; in the relationship connectivity verification process, the present invention verifies the rationality of the logical path between entity pairs based on the actual connection relationship of the knowledge graph, effectively avoiding the generation of erroneous reasoning chains with no actual connection or excessive jumps between entity pairs.

[0159] The present invention uses a triple verification mechanism for comprehensive screening, ensuring that the final set of candidate entities retained not only has high consistency in name and semantics, but also has high connectivity in the knowledge graph reasoning path, greatly improving the coherence and accuracy of the subsequent reasoning chain construction. Compared with the traditional retrieval fusion method that simply relies on similarity scoring or manual rule screening, the two-way verification process proposed in this invention is systematic, detailed, and standardized. It can significantly reduce noise interference when processing complex, open-ended, multi-hop reasoning queries, and improve the accuracy, explainability, and user trust of the final answer of the intelligent question-answering system.

[0160] S6. Build an inference chain for the candidate result set. If there is a break in the inference chain, generate relay nodes based on the large model inference gap filling mechanism to form a complete inference chain.

[0161] In this embodiment, S6 specifically includes:

[0162] S61: Receive the candidate result set that has passed the bidirectional verification, and extract the starting entity and the ending entity according to the reasoning target in the query intent as the starting and ending nodes for constructing the reasoning chain;

[0163] S62: Based on the existing relationship network of the knowledge graph, starting from the starting entity, along the relationship path that matches the query intent semantics, expand the reasoning chain hop by hop, give priority to the relationship edges with high path confidence, and try to gradually connect to the end entity;

[0164] S63. During the reasoning chain expansion process, the connectivity between adjacent entity nodes is detected in real time. When no connection path that meets the semantic consistency and hop count limit exists in a certain expansion step, this position is recorded as a reasoning gap and the current reasoning chain expansion is suspended.

[0165] S64. For each reasoning gap, extract the context information, existing path information, and reasoning intention constraints of the entities at both ends of the reasoning gap as input to the large model reasoning gap completion mechanism;

[0166] S65. Generate a relay node that can connect entities at both ends of the reasoning gap through a large model reasoning gap completion mechanism;

[0167] S66: insert the selected relay node into the reasoning gap position, update the reasoning chain structure, and continue to expand and connect the reasoning chain until reaching the terminal entity;

[0168] S67. After the reasoning chain is fully connected, the complete reasoning chain is confirmed based on the confidence score of the overall reasoning path and semantic consistency verification.

[0169] The large model reasoning gap filling mechanism specifically includes:

[0170] Extract the standardized names, entity types, contextual semantic descriptions, and historical path information of the entities at both ends of the reasoning gap, and combine them with the query intent to form the reasoning gap completion input dataset;

[0171] Analyze the reasoning gap type and identify whether the reasoning gap is entity missing, relationship missing, or path broken based on the entities at both ends of the reasoning gap and the historical path information;

[0172] Dynamically generate reasoning completion hints based on the reasoning gap type and query intent. The hints include the reasoning starting entity, end entity, contextual relationship requirements, reasoning hop limit, and expected reasoning target description.

[0173] Input the completion hint content into the inference engine, limit the inference scope to the entity types and relationship categories supported by the current knowledge graph structure, and generate multiple relay node candidates. Each relay node candidate is accompanied by a relationship description path between the corresponding starting entity and the end entity;

[0174] For each relay node candidate, a comprehensive evaluation score is calculated in a weighted manner based on the confidence score of reasoning rationality, relationship coherence test, entity context consistency analysis, and knowledge graph existing connection verification;

[0175] The relay node with the highest comprehensive evaluation score is selected as the formal filling node in the reasoning chain completion process.

[0176] The present invention can construct a complete reasoning chain according to the query intent target for the set of candidate entities that have passed bidirectional verification, and detect the connectivity between entity nodes in real time during the reasoning chain expansion process. When encountering a break in the reasoning chain, that is, when there is no connection path that meets the hop limit and semantic consistency requirements, the present invention introduces a large model reasoning gap filling mechanism to dynamically generate appropriate relay nodes for insertion and filling, thereby achieving a coherent extension of the reasoning chain. Compared with the existing method of relying solely on the existing structure of the knowledge graph to forcibly expand or interrupt the reasoning chain, the present invention can effectively repair the reasoning chain break problem caused by sparse knowledge base, heterogeneous entity naming or missing implicit relationships through reasoning gap filling, significantly improving the connectivity and integrity of the reasoning chain, and ensuring that the intelligent question-answering system can complete end-to-end reasoning and answer generation in complex query scenarios.

[0177] During the reasoning gap completion process, the present invention combines the standardized names, contextual descriptions, and historical path information of the entities at both ends of the reasoning gap to dynamically generate reasoning completion prompts, guide large-scale model controlled reasoning, generate multiple candidate relay nodes, and screen the optimal relay node as the official completion node based on the confidence level of reasoning rationality, relationship consistency verification, and entity context matching score. Through this controlled completion and refined screening process, the present invention not only ensures the semantic rationality and logicality of the reasoning path after the repair, but also effectively suppresses the reasoning noise caused by the introduction of irrelevant nodes, further improving the interpretability of the system's reasoning process, the accuracy of answers, and user trust.

[0178] S7. Based on the complete reasoning chain, generate and output the final reasoning answer.

[0179] In this embodiment, the S7 specifically includes:

[0180] Receive the complete reasoning chain after bidirectional verification and reasoning gap filling, and extract the entity nodes, the relationship between entity nodes and the confidence information of the reasoning path in the complete reasoning chain;

[0181] Based on the starting and ending entities of the complete reasoning chain, combined with the question type and target in the query intent, the reasoning focus and answer style of the generated answer are determined, including whether to focus on the final answer or to present the complete reasoning process.

[0182] Based on the complete reasoning chain, the reasoning steps are expanded hop by hop in the order of entity nodes and relationship nodes to form a set of reasoning path descriptions. The reasoning path descriptions in the set include each entity transformation and relationship description;

[0183] Based on the set of reasoning path descriptions, the system dynamically constructs the reasoning answer structure, selects the appropriate answer template, and integrates the complete reasoning chain information to generate a draft of the reasoning answer that conforms to the natural language expression standard.

[0184] Based on the initial draft of the reasoning answer, we perform answer optimization processing, including improving language fluency, adjusting contextual coherence, and checking logical consistency. We also generate annotations for visual information of the reasoning process based on the query intent requirements.

[0185] Output the final reasoning answer text, along with interpretable annotation information for the reasoning chain.

[0186] The present invention organizes the reasoning process through reasoning path description fragments, dynamically constructs the reasoning answer structure, and can adaptively select a variety of answer styles such as concise answers, reasoning process descriptions, or detailed reasoning chain displays according to different query intentions. At the same time, the present invention performs natural language optimization processing in the answer generation process, including language fluency improvement, context coherence enhancement, and semantic consistency verification, to ensure that the generated reasoning answers are not only logically reasonable and clearly expressed, but also have a good user reading experience. Ultimately, the reasoning answer text output by the system is accompanied by complete reasoning chain structured annotation information, providing users with traceable and verifiable reasoning basis, greatly improving the credibility and professionalism of the system's answers, and further enhancing users' trust and satisfaction with the intelligent question-answering system.

[0187] In this embodiment, the traffic engineering large model intelligent question-answering system based on the knowledge graph includes:

[0188] The query parsing module is used to receive natural language query statements, extract structured degree features, semantic fuzziness features and contextual association features, and generate query intent representation features;

[0189] The retrieval path decision module is used to generate a retrieval intent vector based on the query intent representation features, and dynamically select the knowledge graph retrieval path, vector database retrieval path, or hybrid collaborative retrieval path through the intent classification model;

[0190] The retrieval input construction module is used to generate structured query statements based on entity recognition and relationship extraction in the knowledge graph retrieval path, and to generate semantic vectors based on context-aware word segmentation and semantic encoding in the vector database retrieval path;

[0191] A hybrid search execution module is used to perform entity linking and relationship reasoning in the knowledge graph based on the structured query statement under the hybrid collaborative search path to obtain a first search result, and to perform similarity search in the vector database based on the semantic vector to obtain a second search result;

[0192] A two-way verification module is used to perform two-way verification on the first search result and the second search result based on entity consistency, semantic similarity and relationship connectivity indicators, and screen out candidate result sets that pass the two-way verification;

[0193] The inference chain construction module is used to build an inference chain based on the candidate result set that has passed bidirectional verification, detect the connectivity of the inference chain, and if there is an inference gap, call the large model inference gap filling mechanism to generate a relay node and insert it into the gap position of the inference chain to form a complete inference chain;

[0194] The large-model reasoning gap completion module is used to extract the context and historical path information of the entities at both ends of the reasoning gap, generate completion prompts, call large-model reasoning to generate a set of relay node candidates, and based on a comprehensive evaluation of the confidence level of reasoning rationality, relationship coherence, and context consistency, select the relay node with the highest score to complete the reasoning chain;

[0195] The inference-based answer generation module is used to parse the inference path steps based on the complete inference chain, determine the answer focus and style based on the query intent, generate a set of inference path descriptions, perform natural language optimization processing, integrate the inference chain information to generate the final inference-based answer text, and attach the explainable annotation information of the inference chain, and output it to the user interface.

[0196] In the retrieval input construction module, the present invention can accurately generate structured query statements or deep semantic vectors according to the retrieval path requirements, and cooperate with the hybrid retrieval execution module to give full play to the complementary advantages of knowledge reasoning and semantic similarity retrieval, and effectively improve the recall rate and accuracy of the retrieval results. Through the two-way verification module, the system integrates entity consistency, semantic similarity and relationship connectivity indicators to screen high-credibility candidate entities in the dual-path retrieval results, greatly improving the correctness and stability of the reasoning chain construction. In response to the problem of broken reasoning chains, the present invention introduces a large-model reasoning gap filling mechanism, which can dynamically generate relay nodes to repair chain breakpoints and ensure the consistency and integrity of the reasoning process. Finally, based on the complete reasoning chain, the system dynamically generates an inference-type answer text, and attaches the reasoning chain structure annotation information, which significantly enhances the explainability, credibility and user experience of the answer.

[0197] Embodiment 1:

[0198] To verify the practical application of this invention, it was deployed and tested on the integrated traffic data service platform of the Provincial Transportation Planning Institute of H Province (hereinafter referred to as "H Transportation Planning Institute"). H Transportation Planning Institute is responsible for urban transportation planning, transportation infrastructure layout optimization, and traffic information service system construction across the province. It has accumulated a large amount of structured transportation infrastructure data, road network topology data, as well as unstructured travel survey reports, transportation policy documents, and historical traffic operation monitoring data. However, due to the complex data types, diverse terminology, and high real-time requirements, traditional question-answering systems based on keyword retrieval or static rule reasoning generally suffer from inaccurate retrieval, broken reasoning chains, and delayed knowledge updates in scenarios such as intelligent travel consultation and transportation planning decision support, making it difficult to meet the current intelligent requirements of integrated transportation construction.

[0199] To address these issues, the H Traffic Planning Institute introduced the present invention's knowledge graph-based intelligent question-answering system for large-scale traffic engineering models into its intelligent traffic question-answering platform. The system is deployed at the provincial data center, supported by an AI computing cluster consisting of 80 GPU nodes. This system has customized and constructed a traffic knowledge graph covering six major entity categories: road nodes, bus stops, rail transit lines, transportation hubs, planning policy documents, and congestion level assessment standards. Over 400,000 entity relationships have been established. Furthermore, a traffic semantic vector database has been constructed based on nearly five years of provincial travel survey data, trajectory data, and traffic operation monitoring reports, with over 6 million vector entries.

[0200] In a real-world application scenario, a transportation planner enters a natural language query, such as "Which bus routes should be located near the G107 National Highway expansion and reconstruction section in the next three years?" The system first extracts query intent features through the query parsing module, identifying the question as moderately structured, with moderate semantic ambiguity and high contextual relevance. The search path decision module, based on the intent classification model, determines the appropriate hybrid collaborative search path, triggering both a knowledge graph search and a vector database search. Using "G107 National Highway expansion and reconstruction section" as the starting entity node in the knowledge graph, the system infers associated transportation hub nodes, existing bus route nodes, and planning adjustment policy nodes, establishing a preliminary inference chain linking the road-bus station-route adjustment relationship. The vector database then retrieves transportation planning reports and research materials with high similarity to the keywords "national highway expansion and reconstruction," "bus planning adjustment," and "new bus route demand." The bidirectional verification module selects a set of high-quality candidate entities based on entity consistency, semantic similarity (preset threshold 0.75), and inference chain connectivity (maximum 3 hops). For breaks in the reasoning chain, such as the lack of direct connection between the road reconstruction and expansion section and the newly added bus stops, the system calls the large model reasoning completion mechanism and generates the relay node "Proposal for Reasonable Layout of New Stations 2024 Edition" based on contextual reasoning to complete the reasoning chain closure.

[0201] After the system was launched on the H Traffic Planning Institute platform, it ran continuously for five months, processing a total of 15,800 natural language travel consultation and planning assistance requests. The average response time was reduced from 12.5 seconds on the traditional system to 4.1 seconds, and the search accuracy rate increased to 94.7%. To truly reflect the application's effectiveness, key data is summarized in Table 1 below.

[0202] Table 1 Application effect report of H Traffic Planning Institute's intelligent traffic question-answering system

[0203] ;

[0204] As can be seen from Table 1, after the deployment of the present invention, significant improvements have been achieved in core indicators such as the number of consultations, response speed, answer accuracy, and reasoning chain coherence. For example, in a complex actual query "Suggestions for optimizing the traffic organization of the S232 Provincial Road connecting the urban sub-center before 2025?", the system can automatically infer the urban sub-center development plan node, the S232 traffic flow change node, and the future bus expansion plan node, generate a multi-hop reasoning chain, and finally derive traffic optimization suggestions, and attach a reasoning chain structure diagram for expert review. For another example, in the query freely entered by citizens, "How to connect to the bus near the newly built subway station?", the system can recognize the "connection" intention, infer and recommend specific and feasible bus route adjustment plans, and at the same time cite the latest urban transportation special planning documents as supporting evidence.

[0205] During its application, the system dynamically adjusted the rationality evaluation criteria for the reasoning chain (including the weighted average score of path confidence), ultimately achieving an average score of 0.87 for each reasoning chain path, effectively ensuring the logic of the reasoning process and the authoritativeness of the output answers. The reasoning path display rate in the reasoning-based answer text reached 100%, significantly enhancing the trust and decision-making value of transportation professionals. By deploying this invention, the H Traffic Planning Institute has achieved significant results in areas such as traffic planning decision support, intelligent travel information question-and-answer services, and policy analysis and reasoning applications, providing solid support for the development of intelligent transportation information services.

[0206] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.

Claims

1. A large-scale intelligent question-answering method for traffic engineering based on knowledge graph, characterized by: The steps include: S1. Receive a natural language query statement input by the user, parse the natural language query statement, and extract structured degree features, semantic fuzziness features, and contextual association features as query intent representation features; S2. Generate a retrieval intent vector based on the query intent representation features, and dynamically select a retrieval path through a preset intent classification model; S3. Based on the query intent representation features and in accordance with the search path requirements, a structured query statement corresponding to the knowledge graph search path and a semantic vector corresponding to the vector database search path are constructed respectively; S4. When a hybrid collaborative search path is adopted, entity linking and relationship reasoning are performed in the knowledge graph based on the structured query statement to obtain the first search result, and similarity search is performed in the vector database based on the semantic vector to obtain the second search result; S5. Perform bidirectional verification on the first search result and the second search result based on entity consistency, semantic similarity, and relationship connectivity indicators, and select a candidate result set that passes the bidirectional verification; S6. Build an inference chain for the candidate result set. If there is a break in the inference chain, generate relay nodes based on the large model inference gap filling mechanism to form a complete inference chain. S7. Based on the complete reasoning chain, generate and output the final reasoning answer.

2. The intelligent question-answering method for a large-scale traffic engineering model based on knowledge graph according to claim 1 is characterized in that: The S2 specifically includes: S21. Based on the query intent representation features, a segmented quantization coding method is used for the structured degree feature to map different structured levels into discrete vectors. A normalized numerical coding method is used for the semantic fuzziness feature to normalize the fuzziness value to a standard interval to generate a vector. A sliding window statistical coding method is used for the context-related feature to extract the context continuity feature vector, and a first sub-feature vector, a second sub-feature vector, and a third sub-feature vector are generated respectively. S22, concatenating the first sub-feature vector, the second sub-feature vector, and the third sub-feature vector in the order of structured degree feature, semantic fuzziness feature, and contextual association feature to form a unified multi-dimensional combined feature vector, wherein the vector concatenation method is linear concatenation in a fixed order of feature categories; S23, performing Min-Max normalization processing on the multidimensional combined feature vector, scaling each dimension value to the interval [0, 1], and then performing feature transformation on the normalized multidimensional combined feature vector by linear mapping using a linear feature mapping function to obtain a retrieval intent vector; S24. Input the retrieval intention vector into the intent classification model, classify the retrieval intention vector through the intent classification model, and determine the retrieval path corresponding to the natural language query statement based on the classification result. The retrieval path includes a knowledge graph retrieval path, a vector database retrieval path, and a hybrid collaborative retrieval path.

3. The intelligent question-answering method for a large-scale traffic engineering model based on knowledge graph according to claim 2 is characterized in that: The intent classification model is a shallow neural network classifier: Receiving a retrieval intention vector as input, wherein the retrieval intention vector retains a structured degree feature value, a semantic fuzziness feature value, and a contextual relevance feature score as dimension information; Inputting the retrieval intention vector into a first linear transformation layer for feature compression, and outputting a first latent feature vector; The ReLU activation function is used to perform nonlinear transformation on the first latent eigenvector to obtain the activated eigenvector; The activated feature vector is input into the second linear transformation layer, and the matrix multiplication operation is performed with the weight matrix of the second linear transformation layer and the bias vector is superimposed to extract the combined features of the structural degree feature, the semantic ambiguity feature and the context association feature, and the classification feature vector is output; Perform Softmax normalization on the classification feature vector to generate three-category probability distribution, corresponding to the knowledge graph retrieval path, vector database retrieval path, and hybrid collaborative retrieval path respectively; Based on the structured degree feature value, semantic ambiguity feature value and contextual relevance feature score retained in the retrieval intent vector, the retrieval path is determined according to the following classification criteria: When the structured degree eigenvalue is greater than 0.7 and the semantic fuzziness eigenvalue is less than 0.3, it is classified as a knowledge graph retrieval path; When the structured degree eigenvalue is less than 0.4 and the semantic fuzziness eigenvalue is greater than 0.6, it is classified as a vector database retrieval path; When the structured degree feature value is between 0.4 and 0.7, the semantic ambiguity feature value is between 0.3 and 0.6, and the contextual relevance feature score is greater than 0.5, it is classified as a hybrid collaborative retrieval path; When the structured degree feature value, semantic fuzziness feature value, and contextual relevance feature score do not meet the classification criteria, it indicates that there is no relevant search content.

4. The intelligent question-answering method for a large-scale traffic engineering model based on a knowledge graph according to claim 1 is characterized in that: The S3 specifically includes: S31. When the search path is a knowledge graph search path, based on the query intent representation feature, parse the natural language query statement, perform entity recognition operations, and extract entity terms with clear semantic references in the natural language query statement; S32, natural language query statements, identify the relationship phrases between entity terms, and build a preliminary set of entity-relationship-entity triples based on the knowledge graph preset pattern library; S33, standardizing the preliminary triple set, including performing standardized name mapping on entity nodes and applying synonymous relationship expansion rules on relationship edges, to form a structured query statement that complies with the knowledge graph query specification; S34. When the search path is a vector database search path, perform BiLSTM-CRF context-aware word segmentation processing on the natural language query statement based on the query intent representation feature, remove stop words, and extract a keyword set; S35, encoding the keyword set using a bidirectional context-aware mechanism to generate a preliminary semantic vector capable of representing deep semantic features of the query statement; S36, performing normalization processing and vector space mapping on the preliminary semantic vector to obtain a semantic vector for vector database retrieval; S37. When the search path is a hybrid collaborative search path, simultaneously execute S31 to S33 to generate a structured query statement, and execute S34 to S36 to generate a semantic vector.

5. The intelligent question-answering method for a large-scale traffic engineering model based on knowledge graph according to claim 1 is characterized in that: The process of obtaining the first search result is: Receive structured query statements, parse the query target entity, query condition relationship and target entity type in the query statement, and use them as the starting point of retrieval reasoning, reasoning path constraints and target node screening basis; Based on the knowledge graph entity index library, the query target entity is linked to the entity. By combining entity name similarity matching with entity attribute cross-validation, the corresponding starting entity node in the knowledge graph is determined, and the entity mapping relationship between the query statement and the knowledge graph is established. Starting from the successfully linked starting entity node, the relationship expansion reasoning is performed in the knowledge graph according to the query condition relationship, starting from the starting entity. Multi-hop expansion is allowed during the reasoning process, and each hop reasoning must meet the relationship semantic consistency requirements; During the reasoning process, a path confidence score is calculated for each extended reasoning path. The path confidence score comprehensively considers the relationship semantic matching degree, the path hop penalty factor, and the node connection weight. Reasoning paths with a path confidence score below a preset threshold are dynamically pruned. For all entity nodes at the end of the reasoning path that pass the confidence screening, further screening is performed according to the target entity type requirements to eliminate entity nodes that do not match the target entity type; The entity node set after further screening is used as the first search result.

6. The intelligent question-answering method for a large-scale traffic engineering model based on knowledge graph according to claim 1 is characterized in that: The process of obtaining the second search result is: Receive a semantic vector generated by the query intent representation feature as a query vector for vector database retrieval; Input the query vector into the vector database index and quickly locate the set of candidate vectors that are close to the query vector semantic space based on the preset vector inverted index mechanism; The cosine similarity measurement method is used to calculate the similarity between the query vector and each vector in the candidate vector set, and the similarity score between each candidate vector in the candidate vector set and the query vector is obtained; Based on the similarity score, candidate vectors with scores higher than the preset similarity threshold are screened out to form the first round of similar candidate sets; Based on the first round of similar candidate sets, the context relevance re-ranking mechanism is used to perform weighted sorting based on the frequency of occurrence and association strength of candidate entities in the original context to generate the final candidate set; The entity node or document object corresponding to the final candidate set is used as the second retrieval result.

7. The intelligent question-answering method for a large-scale traffic engineering model based on knowledge graph according to claim 1 is characterized in that: The S5 specifically includes: S51, receiving the first search result and the second search result, respectively extracting the standardized name, contextual semantic representation and knowledge graph entity node identifier of each entity; S52. Based on standardized name matching, for each entity in the first search result, search for entity nodes in the second search result that have the same or semantically similar standardized names to form preliminary entity consistency matching pairs; S53: For the preliminary entity consistency matching pairs, extract the corresponding contextual semantic representations, calculate the cosine similarity between the semantic vectors, select the matching pairs with similarity scores higher than a first preset threshold, and mark them as having passed the semantic similarity verification; S54. For the matching pairs that have passed the semantic similarity verification, connectivity verification is performed based on the knowledge graph relationship network to retrieve the shortest path between the two entity nodes. When there is a connected path with a hop count not exceeding a preset maximum hop count and the path semantics conforming to the inference relationship constraint, it is determined that the relationship connectivity verification has passed. S55. The set of entity nodes that have passed the entity consistency verification, the semantic similarity verification, and the relationship connectivity verification is used as a candidate result set that has passed the bidirectional verification.

8. The intelligent question-answering method for a large-scale traffic engineering model based on knowledge graph according to claim 1 is characterized in that: The S6 specifically includes: S61: Receive the candidate result set that has passed the bidirectional verification, and extract the starting entity and the ending entity according to the reasoning target in the query intent as the starting and ending nodes for constructing the reasoning chain; S62: Based on the existing relationship network of the knowledge graph, starting from the starting entity, along the relationship path that matches the query intent semantics, expand the reasoning chain hop by hop, give priority to the relationship edges with high path confidence, and try to gradually connect to the end entity; S63. During the reasoning chain expansion process, the connectivity between adjacent entity nodes is detected in real time. When no connection path that meets the semantic consistency and hop count limit exists in a certain expansion step, this position is recorded as a reasoning gap and the current reasoning chain expansion is suspended. S64. For each reasoning gap, extract the context information, existing path information, and reasoning intention constraints of the entities at both ends of the reasoning gap as input to the large model reasoning gap completion mechanism; S65. Generate a relay node that can connect entities at both ends of the reasoning gap through a large model reasoning gap completion mechanism; S66: insert the selected relay node into the reasoning gap position, update the reasoning chain structure, and continue to expand and connect the reasoning chain until reaching the terminal entity; S67. After the reasoning chain is fully connected, the complete reasoning chain is confirmed based on the confidence score of the overall reasoning path and semantic consistency verification.

9. The intelligent question-answering method for a large-scale traffic engineering model based on knowledge graph according to claim 8 is characterized in that: The large model reasoning gap filling mechanism specifically includes: Extract the standardized names, entity types, contextual semantic descriptions, and historical path information of the entities at both ends of the reasoning gap, and combine them with the query intent to form the reasoning gap completion input dataset; Analyze the reasoning gap type and identify whether the reasoning gap is entity missing, relationship missing, or path broken based on the entities at both ends of the reasoning gap and the historical path information; Dynamically generate reasoning completion hints based on the reasoning gap type and query intent. The hints include the reasoning starting entity, end entity, contextual relationship requirements, reasoning hop limit, and expected reasoning target description. Input the completion hint content into the inference engine, limit the inference scope to the entity types and relationship categories supported by the current knowledge graph structure, and generate multiple relay node candidates. Each relay node candidate is accompanied by a relationship description path between the corresponding starting entity and the end entity; For each relay node candidate, a comprehensive evaluation score is calculated in a weighted manner based on the confidence score of reasoning rationality, relationship coherence test, entity context consistency analysis, and knowledge graph existing connection verification; The relay node with the highest comprehensive evaluation score is selected as the formal filling node in the reasoning chain completion process.

10. A traffic engineering large model intelligent question answering system based on knowledge graph, which executes the traffic engineering large model intelligent question answering method based on knowledge graph according to any one of claims 1 to 9, characterized in that: include: The query parsing module is used to receive natural language query statements, extract structured degree features, semantic fuzziness features and contextual association features, and generate query intent representation features; The retrieval path decision module is used to generate a retrieval intent vector based on the query intent representation features, and dynamically select the knowledge graph retrieval path, vector database retrieval path, or hybrid collaborative retrieval path through the intent classification model; The retrieval input construction module is used to generate structured query statements based on entity recognition and relationship extraction in the knowledge graph retrieval path, and to generate semantic vectors based on context-aware word segmentation and semantic encoding in the vector database retrieval path; A hybrid search execution module is used to perform entity linking and relationship reasoning in the knowledge graph based on the structured query statement under the hybrid collaborative search path to obtain a first search result, and to perform similarity search in the vector database based on the semantic vector to obtain a second search result; A two-way verification module is used to perform two-way verification on the first search result and the second search result based on entity consistency, semantic similarity and relationship connectivity indicators, and screen out candidate result sets that pass the two-way verification; The inference chain construction module is used to build an inference chain based on the candidate result set that has passed bidirectional verification, detect the connectivity of the inference chain, and if there is an inference gap, call the large model inference gap filling mechanism to generate a relay node and insert it into the gap position of the inference chain to form a complete inference chain; The large-model reasoning gap completion module is used to extract the context and historical path information of the entities at both ends of the reasoning gap, generate completion prompts, call large-model reasoning to generate a set of relay node candidates, and based on a comprehensive evaluation of the confidence level of reasoning rationality, relationship coherence, and context consistency, select the relay node with the highest score to complete the reasoning chain; The inference-based answer generation module is used to parse the inference path steps based on the complete inference chain, determine the answer focus and style based on the query intent, generate a set of inference path descriptions, perform natural language optimization processing, integrate the inference chain information to generate the final inference-based answer text, and attach the explainable annotation information of the inference chain, and output it to the user interface.

Citation Information

Patent Citations

  • Medical auxiliary question and answer method and system based on knowledge calibration and retrieval enhancement

    CN117573843A

  • Man-machine dialog method and man-machine dialog apparatus based on knowledge graph

    WO2021003819A1