Medical question-answering system based on time sequence knowledge graph and question-answering method thereof

By using a medical question-answering system based on a time-series knowledge graph and employing a hierarchical graph neural network and an LLM collaborative reasoning module, the problem of static knowledge graphs being unable to capture the dynamic evolution of medical knowledge is solved. This enhances the ability to distinguish nodes and integrate long-term and short-term dependencies, resulting in higher question-answering accuracy and robustness.

CN121009990APending Publication Date: 2025-11-25CHENGDU UNIV OF INFORMATION TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511125809.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-12
Publication Date
2025-11-25

AI Technical Summary

Technical Problem

Existing medical question-answering systems based on knowledge graphs suffer from problems such as static knowledge graphs failing to capture the dynamic evolution of medical knowledge, insufficient temporal reasoning ability, weak node differentiation ability, insufficient integration of long-term and short-term dependencies, and poor knowledge integration and interpretability.

Method used

A medical question-answering system based on temporal knowledge graphs is adopted. By integrating a hierarchical graph neural network with positional encoding, the temporal evolution of medical knowledge is dynamically modeled, enhancing the node differentiation ability. It also effectively combines long-term and short-term dependencies, uses an LLM collaborative reasoning module to generate answers in conjunction with an external medical knowledge base, supports voice question answering, and dynamically expands the temporal knowledge graph through a self-evolving knowledge update module.

Benefits of technology

It significantly improves the accuracy and robustness of the question-answering system, enabling it to adapt to scenarios such as new diseases and new therapies, enhances its ability to correlate drug efficacy with disease development stages, and improves the accuracy and decision-making capabilities in complex question-answering scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121009990A_ABST
    Figure CN121009990A_ABST
Patent Text Reader

Abstract

The invention discloses a medical question-answering system based on a time sequence knowledge graph and a question-answering method thereof, and the system comprises a TKG construction module which is used for constructing the time sequence knowledge graph in the medical field and comprises entities, relationships and timestamp information; the hierarchical graph neural network module fused with position coding comprises a sub-graph layer and a global graph layer, the sub-graph layer is used for capturing a structural dependency relationship of concurrent facts under the same timestamp, and the global graph layer is used for capturing time correlation between cross-timestamp entities; the LLM collaborative reasoning module adopts RAG retrieval and combines the reasoning result of the TKG with an external medical knowledge base to generate an answer; the multi-mode interaction module integrates voice recognition and synthesis and supports voice questions and answers; according to the scheme, the position codes are fused into the message propagation process of the relation perception graph convolutional neural network, the distinguishing capacity of the target node for the neighbor nodes is greatly enhanced, and therefore the expression capacity of embedding of the target node is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical artificial intelligence technology, specifically to a medical question-answering system and method based on temporal knowledge graphs. Background Technology

[0002] With the rapid development of artificial intelligence technology, the demand for intelligent medical solutions is growing. Large language models have demonstrated powerful language understanding and generation capabilities in the field of natural language processing. However, their application in the medical field still faces a series of challenges, such as the incompleteness of medical knowledge, the limitations of reasoning ability, and insufficient consistency of facts. Traditional medical question-answering systems are mainly based on keyword matching or simple rule engines, which are difficult to handle complex medical knowledge and multi-turn question-answering scenarios. In recent years, the introduction of knowledge graph (KG) technology has provided a new solution for medical question-answering systems. Knowledge graphs can structurally represent medical entities and their relationships, such as diseases, symptoms, drugs, and treatment methods, thereby supporting more accurate semantic understanding and reasoning.

[0003] However, existing knowledge graph-based medical question-answering systems still face the following problems: 1. Limitations of static knowledge graphs: Traditional knowledge graphs are mostly statically constructed and cannot capture the dynamic evolution of medical knowledge, such as the emergence of new diseases and the updating of treatment methods.

[0004] 2. Insufficient temporal reasoning ability: Existing temporal knowledge graph (TKG) reasoning methods (such as CyGNet and RE-NET) ignore the structural dependencies and long-term temporal dependencies of concurrent events, resulting in low prediction accuracy.

[0005] 3. Weak node differentiation ability: In knowledge graphs, it is difficult to distinguish isomorphic nodes (such as different instances of the same symptoms), which leads to a decrease in the accuracy of question answering systems in complex scenarios.

[0006] 4. Insufficient integration of long-term and short-term dependencies: Medical problems usually require a comprehensive judgment based on long-term medical history and short-term symptoms, but existing systems have difficulty effectively integrating long-term and short-term dependencies.

[0007] 5. Poor knowledge integration and interpretability: Traditional question-answering systems struggle to effectively combine structured knowledge graphs with unstructured medical texts, and the reasoning process lacks transparency, impacting the trust of doctors and patients. Summary of the Invention

[0008] To address the aforementioned shortcomings of existing technologies, this invention provides a medical question-answering system and method based on temporal knowledge graphs. By integrating a hierarchical graph neural network with positional encoding, the system can dynamically model the temporal evolution of medical knowledge, enhance node differentiation capabilities, and effectively combine long-term and short-term dependencies, thereby significantly improving the accuracy and robustness of question answering.

[0009] To achieve the above objectives, the technical solution adopted by the present invention is as follows: Firstly, a medical question-answering system based on a temporal knowledge graph is provided, comprising: a TKG construction module, which is used to construct a temporal knowledge graph in the medical field, including entity, relation, and timestamp information; a hierarchical graph neural network module with fused position encoding, which includes sub-layers and a global layer. The sub-layers are used to capture the structural dependencies of concurrent facts at the same timestamp, and the global layer is used to capture the temporal correlation between entities across timestamps; an LLM collaborative reasoning module, which uses RAG retrieval and combines the reasoning results of TKG with an external medical knowledge base to generate answers; a multimodal interaction module, which integrates speech recognition and synthesis to support voice question answering; and a self-evolving knowledge update module, which dynamically expands the temporal knowledge graph based on user feedback.

[0010] Furthermore, the representation method of the hierarchical graph neural network module is as follows: S1: Construct a global graph based on the knowledge graph sequence prior to the current time point, connecting the same entities at different timestamps through virtual edges; S2: In the sub-layer, aggregate neighbor node information through a relational graph convolutional network, and fuse random walk layout position encoding to generate short-term entity representations for message propagation; S3: In the global layer, introduce temporal difference encoding and attention mechanisms, and fuse global position encoding to generate long-term entity representations for message propagation; S4: Dynamically fuse the outputs of the sub-layer and global layer through a gating mechanism to generate unified dynamic embeddings of entities and relationships.

[0011] Secondly, a question-answering method for a medical question-answering system based on temporal knowledge graphs is provided, which includes the following steps: Receive text or voice input from the user and parse it into a structured query; Retrieve historical events from time-series knowledge graphs and predict future states, and combine RAG retrieval to supplement domain knowledge; Generate answers and attach explanations of the reasoning path, outputting them via text or voice; It accepts subsequent user feedback and dynamically expands the time-series knowledge graph.

[0012] The beneficial effects of this invention are as follows: This solution utilizes temporal knowledge graphs and hierarchical graph neural networks to capture the dynamic evolution of medical knowledge, adapting to scenarios such as new diseases and treatments. By introducing temporal difference encoding, attention mechanisms, and global graph construction, it effectively models the temporal sensitivity of medical knowledge, enhancing the association capabilities of different entities, such as drug efficacy and disease development stages. Sub-layer fusion with random walk position encoding significantly enhances the ability of entities to distinguish between different relational events, improving accuracy in complex question-answering scenarios. Through a gating mechanism that dynamically combines long-term and short-term representations, it supports comprehensive reasoning based on medical history and symptoms, improving the decision-making capabilities of the question-answering system. Attached Figure Description

[0013] Figure 1 This is a flowchart of the method for representing modules in a hierarchical graph neural network.

[0014] Figure 2 This is a dataset information table.

[0015] Figure 3 This table provides metrics for all models on entity prediction tasks.

[0016] Figure 4 The table shows the ablation experiment results for the entity prediction task.

[0017] Figure 5 The figure shows the experimental results of HGLS-PE performance under different local PE lengths.

[0018] Figure 6 The figure shows the experimental results of HGLS-PE performance under different local and global PE lengths. Detailed Implementation

[0019] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.

[0020] This solution's medical question-answering system based on temporal knowledge graphs includes: a TKG construction module, which constructs a temporal knowledge graph in the medical field, including entity, relation, and timestamp information; a hierarchical graph neural network module with fused positional encoding, which includes sub-layers and a global layer. The sub-layers are used to capture the structural dependencies of concurrent facts at the same timestamp, and the global layer is used to capture the temporal correlations between entities across timestamps; an LLM collaborative reasoning module, which uses RAG retrieval and combines the reasoning results of TKG with an external medical knowledge base to generate answers; a multimodal interaction module, which integrates speech recognition and synthesis to support voice question answering; and a self-evolving knowledge update module, which dynamically expands the temporal knowledge graph based on user feedback.

[0021] like Figure 1 As shown, the hierarchical graph neural network module is represented as follows: S1: Construct a global graph based on the knowledge graph sequence prior to the current time point, connecting the same entities at different timestamps through virtual edges; S2: In the sub-layer, aggregate neighbor node information through a relational graph convolutional network, and fuse random walk layout position encoding to generate short-term entity representations for message propagation; S3: In the global layer, introduce temporal difference encoding and attention mechanisms, and fuse global position encoding to generate long-term entity representations for message propagation; S4: Dynamically fuse the outputs of the sub-layer and global layer through a gating mechanism to generate unified dynamic embeddings of entities and relationships.

[0022] In practice, the expression for integrating the random walk layout position encoding into the sub-layer during message propagation is as follows:

[0023] in, and Representing nodes respectively In the l+ 1 and l Layer embedding representation; Represents a node In subgraph The set of neighbors in; Indicates the source node In the l Layer embedding representation; Representing relations r Static embedding; Indicates the source node Local position encoding; and Indicates the first l The trainable weight matrix of the layer; Indicates a vector concatenation operation; It is the activation function ReLU.

[0024] In practical implementation, the relationship representation of global layers incorporates time difference encoding, satisfying the expression:

[0025]

[0026] in, Indicates cross-timestamp and Relationship representation; Represents the absolute value of the time difference; Indicates the time encoding function; Represents a learnable parameter vector; d Indicates the embedding dimension; t This indicates the time difference input.

[0027] In practical implementation, the expression for the attention coefficient in the attention mechanism is:

[0028] in, Represents a node and Attention weights between them; and They represent and In the l Global embedding of layers; It is a node The set of neighboring nodes in the global graph; Represents a learnable attention vector; Indicates the first l The learnable weight matrix of the layer; This represents the LeakyReLU activation function; This indicates a vector concatenation operation.

[0029] In practice, the expression for fusing global location encoding into the global layer during message propagation is as follows:

[0030] in, and Representing nodes respectively In the l+ 1 and l Layer embedding; Represents the activation function ReLU; Indicates the source node In the l Global embedding of layers; Representation of relationships across timestamps; Indicates the source node Global positional encoding; and It is the first l Layer weight parameter matrix.

[0031] In practice, the expression for dynamically fusing the output of sub-layers and the global layer using the gating mechanism is as follows:

[0032]

[0033] in, and These represent the final dynamic embeddings of entities and relationships, respectively. and These represent the long-term representations of entities and relationships output from the global layer, respectively. and These represent short-term representations of entities and relationships output by the sublayer, respectively. and These represent the gate vector parameters for entity and relation hierarchy representations, respectively; This represents the Sigmoid function, which maps variables to... Control weight allocation; This indicates element-wise multiplication.

[0034] In practical implementation, the LLM collaborative reasoning module specifically includes: Question parsing layer: Utilizes LLM to parse user natural language questions, identifying intent, key entities, and relationships; Knowledge Reasoning Layer: Generates candidate answers by combining TKG dynamic reasoning with RAG retrieval of external medical knowledge; Answer generation layer: By adjusting the LLM to integrate the reasoning results and the retrieved content, an interpretable answer is output.

[0035] The LLM collaborative reasoning module uses a vector database to store medical literature and enhances the accuracy of RAG retrieval through cosine similarity; the TKG construction module guides the LLM collaborative reasoning module to perform controlled knowledge extraction through predefined medical ontology and dynamic subgraph context.

[0036] This solution also provides a question-answering method for a medical question-answering system based on temporal knowledge graphs, which includes the following steps: Receive text or voice input from the user and parse it into a structured query; Retrieve historical events from time-series knowledge graphs and predict future states, and combine RAG retrieval to supplement domain knowledge; Generate answers and attach explanations of the reasoning path, outputting them via text or voice; It accepts subsequent user feedback and dynamically expands the time-series knowledge graph.

[0037] This approach evaluates the proposed medical question-answering system by conducting experiments on two typical time-series knowledge graph datasets.

[0038] Two widely used temporal knowledge graph reasoning datasets, ICEWS14 and ICEWS18, were selected for the experiment. These datasets originate from the Integrated Crisis Early Warning System (ICEWS) and record significant global events from 2014 and 2018, respectively, covering dynamic information on politics, economics, and military affairs in different countries and regions. Each fact triple is timestamped, enabling it to capture evolving entity interaction patterns over time. Regarding dataset partitioning, it was strictly divided according to chronological order to ensure the model cannot access future information during training. Specifically, the training, validation, and test sets were divided chronologically into 80%, 10%, and 10% sets, respectively. The training set contains the earliest 80% of the time frame, allowing the model to learn patterns of entity relationship evolution; the 10% validation set is used for hyperparameter tuning and early stopping strategy selection; and the remaining 10% of events serve as the test set, used for final model evaluation to measure the model's ability to predict future events.

[0039] like Figure 2 As shown, the ICEWS14 and ICEWS18 datasets contain specific statistical information (including the amount of entity data, types of relations, timestamp distribution, number of triples in the training, validation, and testing sets, and event intervals). Due to their extensive time span and high-quality annotations, these datasets have become important datasets for temporal knowledge graph reasoning tasks.

[0040] This approach compares the entity prediction performance of the HGLS-PE model of a medical question-answering system on two datasets with previously proposed TKG inference models, including CyGNet, RE-Net, RE-GCN, TITer, SiMFy, and HGLS. For SiMFy, RE-GCN, and HGLS, these models can be rerun on both datasets using their open-source code and default parameter settings. In the experiments, the widely used metrics MRR and HITs@{1,10} were used to evaluate the model's entity prediction performance on the two datasets in raw settings.

[0041] The metrics of all models on the entity prediction task are as follows: Figure 3As shown, the HGLS-PE model outperforms other TKG models across all three metrics on both datasets, validating the effectiveness of the proposed model. Specifically, CyGNet ignores the structural dependencies of concurrent facts, RE-NET only considers some historical interactions of the target entity for prediction, and RE-GCN ignores event dependencies across timestamps. SiMFy has a simple structure and cannot capture complex temporal dependencies. Although HGLS can model the representation of entities and relationships in both the short and long term, the constructed graph only considers the KG sequence after the current time point, ignoring previous dependencies and neglecting the relative positional dependencies of source nodes during message propagation at both levels.

[0042] The experimental results are analyzed below: To investigate the impact of different mapping methods and positional encoding on the model's entity prediction performance, the performance of different variants of HGLS-PE in terms of MRR was compared: HGLS-All considers all sequences except the current time point when constructing the full graph; HGLS-After only considers sequences after the current time point; HGLS-NoPE does not use positional encoding; the results of the variant models are as follows: Figure 4 As shown; specifically, HGLS-After only considers the sequence after the current time point, but ignores previous entity relationships and cannot capture the dependencies of event evolution. Although HGLS-All considers the global sequence, the sequence after the current time point may introduce irrelevant noise data. Conversely, HGLS-PE only considers the sequence before the current time point, which can effectively capture the event dependencies before the current time point. HGLS-NoPE does not use positional encoding in message propagation at both levels, so entities cannot distinguish between neighbor information and global information when aggregating, thus reducing the impact of global information on node representation.

[0043] To further explore the sensitivity of HGLS-PE to important hyperparameters, the impact of positional encoding length on HGLS-PE performance can be studied. By adjusting the positional encoding length, the specific impact of this hyperparameter on model performance at different lengths can be analyzed, thereby evaluating the model's adaptability and optimization effect to changes in positional encoding length.

[0044] To investigate the impact of positional encoding length on entity prediction performance, experiments were conducted using positional encodings of different lengths on the ICEWS14 and ICEWS8 datasets. Figure 5 As shown, it presents experimental results of performance under different local PE lengths, such as... Figure 6 As shown, it presents experimental results on performance under different global PE lengths; when the length of one PE is adjusted, the other PE maintains its optimal configuration.

[0045] Experimental results demonstrate that local PEs have a significant advantage in capturing short-term dependencies. Shorter local PEs can more efficiently learn dependencies between events with similar time intervals, especially when the time intervals between events are small. In this case, sublayers can capture these subtle dependencies more accurately, thereby improving the model's prediction accuracy. In contrast, global PEs are more suitable for learning long-term dependencies. PEs with long time spans can help the model understand the deep associations between historical and current events, especially when the time intervals between events are long. Longer global PEs can effectively capture these long-term evolutionary patterns and relationships, thereby enhancing the modeling ability for complex dependencies.

[0046] Experimental results on two benchmark datasets demonstrate that the proposed graph construction method and positional encoding have significant effects on the TKG entity prediction task. Ablation experiments further prove the effectiveness of each module, while sensitivity analysis explores the impact of positional encoding of different lengths on model performance.

[0047] In summary, this scheme effectively captures the dependencies of events by constructing a global graph that explicitly associates the knowledge graph sequence prior to the current time point. Furthermore, by integrating position encoding into the message propagation process of the relation-aware graph convolutional neural network, this scheme significantly enhances the target node's ability to distinguish neighboring nodes, thereby further enhancing the representational capabilities of the target node embedding.

Claims

1. A medical question-answering system based on temporal knowledge graphs, characterized in that, include: The TKG building block is used to build time-series knowledge graphs in the medical field, including entity, relation and timestamp information; The hierarchical graph neural network module with fused positional encoding includes a sub-layer and a global layer. The sub-layer is used to capture the structural dependencies of concurrent facts at the same timestamp, and the global layer is used to capture the temporal correlations between entities across timestamps. The LLM collaborative reasoning module uses RAG retrieval and combines the reasoning results from TKG with external medical knowledge bases to generate answers. A multimodal interaction module that integrates speech recognition and synthesis, supporting voice question answering; The self-evolving knowledge update module dynamically expands the time-series knowledge graph based on user feedback.

2. The medical question-answering system based on time-series knowledge graphs according to claim 1, characterized in that, The hierarchical graph neural network module is represented as follows: S1: Construct a global graph based on the knowledge graph sequence prior to the current time point, and connect the same entities at different timestamps through virtual edges; S2: In the sub-layer, neighbor node information is aggregated through a relational graph convolutional network, and random walk layout position encoding is fused to generate short-term entity representations for message propagation; S3: In the global layer, temporal difference coding and attention mechanism are introduced, and global position coding is fused to generate long-term entity representations for message propagation; S4: Dynamically merge the outputs of sub-layers and global layers through a gating mechanism to generate unified entities and dynamically embedded relationships.

3. The medical question-answering system based on time-series knowledge graphs according to claim 2, characterized in that, The expression for fusing the random walk layout position encoding in the message propagation process for the sub-layer is: in, and Representing nodes respectively In the l+ 1 and l Layer embedding representation; Represents a node In subgraph The set of neighbors in; Indicates the source node In the l Layer embedding representation; Representing relations r Static embedding; Indicates the source node Local position encoding; and Indicates the first l The trainable weight matrix of the layer; Indicates a vector concatenation operation; It is the activation function ReLU.

4. The medical question-answering system based on time-series knowledge graphs according to claim 3, characterized in that, The relationship between the global layers is represented by time difference encoding, satisfying the expression: in, Indicates cross-timestamp and Relationship representation; Represents the absolute value of the time difference; Indicates the time encoding function; Represents a learnable parameter vector; d Indicates the embedding dimension; t This indicates the time difference input.

5. The medical question-answering system based on time-series knowledge graphs according to claim 4, characterized in that, The expression for the attention coefficient in the attention mechanism is: in, Represents a node and Attention weights between them; and They represent and In the l Global embedding of layers; It is a node The set of neighboring nodes in the global graph; Represents a learnable attention vector; Indicates the first l The learnable weight matrix of the layer; This represents the LeakyReLU activation function; This indicates a vector concatenation operation.

6. The medical question-answering system based on time-series knowledge graphs according to claim 5, characterized in that, The expression for fusing global location encoding into the global layer during message propagation is: in, and Representing nodes respectively In the l+ 1 and l Layer embedding; Represents the activation function ReLU; Indicates the source node In the l Global embedding of layers; Representation of relationships across timestamps; Indicates the source node Global positional encoding; and It is the first l Layer weight parameter matrix.

7. The medical question-answering system based on time-series knowledge graphs according to claim 2, characterized in that, The expression for the output of the gating mechanism that dynamically merges sub-layers and the global layer is: in, and These represent the final dynamic embeddings of entities and relationships, respectively. and These represent the long-term representations of entities and relationships output from the global layer, respectively. and These represent short-term representations of entities and relationships output by the sublayer, respectively. and These represent the gate vector parameters for entity and relation hierarchy representations, respectively; This represents the Sigmoid function, which maps variables to... Control weight allocation; This indicates element-wise multiplication.

8. The medical question-answering system based on time-series knowledge graphs according to claim 1, characterized in that, The LLM collaborative reasoning module specifically includes: Question parsing layer: Utilizes LLM to parse user natural language questions, identifying intent, key entities, and relationships; Knowledge Reasoning Layer: Generates candidate answers by combining TKG dynamic reasoning with RAG retrieval of external medical knowledge; Answer generation layer: By adjusting the LLM to integrate the reasoning results and the retrieved content, an interpretable answer is output.

9. The medical question-answering system based on time-series knowledge graphs according to claim 1, characterized in that, The LLM collaborative reasoning module uses a vector database to store medical literature and enhances the accuracy of RAG retrieval through cosine similarity; the TKG construction module guides the LLM collaborative reasoning module to perform controlled knowledge extraction through predefined medical ontology and dynamic subgraph context.

10. A question-answering method for a medical question-answering system based on temporal knowledge graphs, characterized in that, Includes the following steps: Receive text or voice input from the user and parse it into a structured query; Retrieve historical events from time-series knowledge graphs and predict future states, and combine RAG retrieval to supplement domain knowledge; Generate answers and attach explanations of the reasoning path, outputting them via text or voice; It accepts subsequent user feedback and dynamically expands the time-series knowledge graph.

Citation Information

Cited By

  • Ultra-long-range medical record diagnosis and treatment question-answering system and method based on dynamic time sequence semantic map

    CN121439290A

  • Long-range medical record diagnosis and treatment question-answering system and method based on dynamic timing semantic graph

    CN121439290B