Medical knowledge graph construction and reasoning dataset generation method, device and medium

CN123014120APending Publication Date: 2026-10-30GUANGZHOU HUAYIN HEALTH MEDICAL GRP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611314586.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]为解决上述现有技术存在的医学知识层级约束丢失及复杂多跳推理训练数据匮乏等技术问题,本发明在如下的多个方面中提供方案

Benefits of technology

[0021]本发明的有益效果在于:本发明通过基于层级深度的上下文路径嵌入机制,将医学文档中隐含的章节约束显式编码为向量表示,并与知识三元组深度融合形成扩展知识单元,从根本上克服了传统知识抽取技术将层级化医学内容扁平化处理所导致的适用边界丢失问题,使构建的知识图谱具备情境感知能力,为后续精准推理提供了可靠的语义基座。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123014120A_ABST
    Figure CN123014120A_ABST
Patent Text Reader

Abstract

The application relates to the field of artificial intelligence and medical information processing technology, and provides a medical knowledge graph construction and reasoning data set generation method, which comprises the following steps: based on a medical document hierarchical structure, content nodes and parent title sequences are extracted and weighted fusion is carried out, an extended knowledge triple carrying a context constraint vector is generated to construct a high-credibility knowledge graph; multi-source heterogeneous medical data are acquired, source credibility is evaluated based on graph structure characteristics, and content logical relationship is evaluated based on the graph, based on which, the graph is updated and a negative sample library is constructed; based on the updated graph, a multi-hop reasoning path is determined by path walking which meets context consistency constraints, interference information is injected, and situational reasoning data is reversely generated by using a language model to obtain a structured question and answer training sample. The application effectively retains a medical knowledge application boundary, and improves the generation quality of complex reasoning data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and medical information processing technology, specifically to a method, device, and medium for constructing a medical knowledge graph and generating a reasoning dataset. Background Technology

[0002] Currently, in the construction of training data for large-scale medical models, general data cleaning tools are typically used to process medical textbooks, guidelines, and other texts, and the extracted knowledge is stored in the form of flattened triples. However, medical knowledge has a strong hierarchical nesting characteristic, and existing processing methods easily lose key parent-level constraints and diagnostic logic constraints, resulting in context-deficient knowledge graphs. Furthermore, while multi-source heterogeneous medical data from the internet can supplement timely knowledge, it lacks effective authenticity verification mechanisms and is prone to introducing noise; and existing question-answering datasets are mostly limited to simple single-hop question-answering, making it difficult to support the model's complex multi-hop reasoning capabilities in scenarios such as differential diagnosis and management of multiple coexisting diseases.

[0003] Therefore, there is an urgent need for a method that can preserve the applicable boundaries of medical knowledge hierarchy, effectively integrate multi-source heterogeneous data, and automatically generate high-quality complex inference datasets. Summary of the Invention

[0004] To address the technical problems of lost medical knowledge hierarchy constraints and lack of training data for complex multi-hop reasoning in the existing technology, the present invention provides solutions in the following aspects.

[0005] In a first aspect, the present invention provides a method for constructing a medical knowledge graph and generating a reasoning dataset, comprising: S1: extracting content nodes and their corresponding parent title node sequences based on the hierarchical structure of medical documents, and performing weighted fusion of the parent title node sequences based on hierarchical depth to generate extended knowledge triples carrying context constraint vectors, thereby constructing a high-reliability knowledge graph; S2: acquiring multi-source heterogeneous medical data, evaluating the source reliability of the multi-source heterogeneous medical data based on graph structure features, evaluating the content logical relationship of the multi-source heterogeneous medical data based on the high-reliability knowledge graph, and performing diversion processing on the multi-source heterogeneous medical data according to the source reliability and the content logical relationship, thereby updating the high-reliability knowledge graph and constructing a negative sample library; S3: performing path walking that satisfies context consistency constraints based on the updated high-reliability knowledge graph, determining multi-hop reasoning paths, extracting interference information from the negative sample library and injecting it into the multi-hop reasoning paths, and using a language model to reverse-generate contextualized reasoning data based on the multi-hop reasoning paths after injecting interference information, thereby obtaining structured question-answering training samples.

[0006] Further, in step S1, generating the extended knowledge triplet carrying the context constraint vector includes: parsing the medical document into a semantic tree, the semantic tree containing title nodes and content nodes; for the target content node in the semantic tree, tracing back up along the semantic tree and collecting the title nodes along the path as the parent title node sequence; calculating the hierarchical weight of each title node in the parent title node sequence based on the hierarchical depth of the target content node; performing a weighted summation of the semantic vectors of each title node in the parent title node sequence based on the hierarchical weights, and fusing it with the semantic vector of the target content node to obtain the context constraint vector; combining the medical knowledge triplet corresponding to the target content node with the context constraint vector to generate the extended knowledge triplet.

[0007] Furthermore, the context constraint vector is obtained by proportionally fusing the weighted path vector with the semantic vector of the target content node according to a preset context strength coefficient, and is calculated using the following formula:

[0008]

[0009] in, For the context constraint vector, The context strength coefficient is, and , This is the weighted path vector of the parent title node sequence. The semantic vector of the target content node.

[0010] Further, the step of calculating the hierarchical weight of each title node in the parent title node sequence based on the hierarchical depth of the target content node includes: The hierarchical weights are calculated using the following formula:

[0011] in, This refers to the hierarchical weight of the i-th level title node in the parent title node sequence. is the hierarchy importance decay coefficient, i is the hierarchy index of the current title node, L is the total number of hierarchy levels of the target content node, j is the summation index, and e is a natural constant.

[0012] Further, in step S2, evaluating the content logical relationship of the multi-source heterogeneous medical data includes: constructing a heterogeneous graph network containing article nodes, publisher nodes, and entity nodes; aggregating the features of neighbor nodes in the heterogeneous graph network based on a graph neural network; calculating the source credibility score of the multi-source heterogeneous medical data corresponding to the article node; mapping the multi-source heterogeneous medical data into query vectors; calculating the similarity between the query vectors and the context constraint vectors of each extended knowledge triple in the high-credibility knowledge graph; selecting candidate anchors that meet preset similarity conditions; converting the candidate anchors into anchor knowledge in natural language form; using the language model to determine the logical implication relationship between the multi-source heterogeneous medical data and the anchor knowledge; and obtaining the content logical relationship.

[0013] Further, in step S2, the multi-source heterogeneous medical data is processed by diverting data according to the source credibility and the content logical relationship, including: when the content logical relationship is a conflict relationship, the multi-source heterogeneous medical data is marked as erroneous knowledge and stored in the negative sample library; when the content logical relationship is an implication relationship and the source credibility score is greater than or equal to a preset source reliability threshold, the multi-source heterogeneous medical data is fused into the high-credibility knowledge graph; when the content logical relationship is a neutral relationship, or the content logical relationship is an implication relationship and the source credibility score is less than the preset source reliability threshold, the multi-source heterogeneous medical data is marked as questionable knowledge and a manual review process is triggered.

[0014] Further, in step S3, extracting interference information and injecting it into the multi-hop inference path includes: determining the starting entity node and the ending entity node in the updated high-confidence knowledge graph; starting the path transfer from the starting entity node, calculating the similarity between the context constraint vector of the current node and the candidate next node at each transfer, and when the similarity is greater than a preset relevance threshold, taking the candidate next node as the transfer target until the ending entity node is reached, thus obtaining the multi-hop inference path; and extracting erroneous knowledge related to the semantics of key nodes in the multi-hop inference path from the negative sample library and injecting it into the multi-hop inference path as interference information.

[0015] Furthermore, the relation type constraint includes limiting the relation type sequence and direction of each jump transition edge in the path, so as to distinguish candidate paths with different treatment directions or different clinical categories that exist between the same pair of starting entity nodes and ending entity nodes.

[0016] Further, in step S3, the method for obtaining the structured question-answering training samples includes: inputting the multi-hop reasoning path and the interference information into the language model, instructing the language model to reverse-generate a contextualized medical record containing the interference information as misleading noise, a thought chain analysis simulating clinical thinking, and a final diagnostic conclusion; assembling the contextualized medical record, the thought chain analysis, and the final diagnostic conclusion according to a preset data format to generate a structured question-answering training sample containing instructions, input, and output fields.

[0017] Furthermore, before extracting content nodes and their corresponding parent title node sequences based on the hierarchical structure of the medical document, the method further includes: acquiring source data from a standard medical terminology database, extracting entity identifiers, terminology descriptions, and relation types, and constructing a basic graph network containing entity nodes and relation edges; using a unified concept identifier to align synonyms and abbreviations in the basic graph network, and associating and fusing entities from different terminology systems that represent the same medical concept to obtain a baseline graph; the high-confidence knowledge graph is constructed based on the baseline graph and the extended knowledge triples.

[0018] In a second aspect, the present invention also provides a medical knowledge graph construction and reasoning dataset generation system, comprising: a knowledge graph construction module, used to extract content nodes and their corresponding parent title node sequences based on the hierarchical structure of medical documents, and to perform weighted fusion of the parent title node sequences based on hierarchical depth to generate extended knowledge triples carrying context constraint vectors, thereby constructing a high-confidence knowledge graph; and a data verification and fusion module, used to acquire multi-source heterogeneous medical data, evaluate the source credibility of the multi-source heterogeneous medical data based on graph structure features, and evaluate the data based on the high-confidence knowledge graph. The system describes the logical relationships of multi-source heterogeneous medical data. Based on the source credibility and the logical relationships of the content, the system performs triage processing on the multi-source heterogeneous medical data to update the high-credibility knowledge graph and construct a negative sample library. The inference data generation module is used to perform path walking that satisfies contextual consistency constraints based on the updated high-credibility knowledge graph, determine multi-hop inference paths, extract interference information from the negative sample library and inject it into the multi-hop inference paths, and use a language model to reverse-generate contextualized inference data based on the multi-hop inference paths after injecting interference information, so as to obtain structured question answering training samples.

[0019] In a third aspect, the present invention also provides a computer device including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the method described in one or more embodiments of the first aspect.

[0020] In a fourth aspect, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in one or more embodiments of the first aspect.

[0021] The beneficial effects of this invention are as follows: This invention explicitly encodes the implicit chapter constraints in medical documents into vector representations through a hierarchical depth-based context path embedding mechanism, and deeply integrates them with knowledge triples to form extended knowledge units. This fundamentally overcomes the problem of loss of applicable boundaries caused by the flattening of hierarchical medical content in traditional knowledge extraction techniques, enabling the constructed knowledge graph to have context awareness capabilities and providing a reliable semantic foundation for subsequent accurate reasoning.

[0022] This invention constructs a heterogeneous graph network to evaluate the credibility of data sources and uses a high-credibility graph as a semantic anchor to drive a language model for logical implication verification, achieving dual collaborative verification of source credibility and content correctness. The diversion processing mechanism built on this basis not only automatically integrates high-quality knowledge into the graph but also transforms conflicting knowledge into negative sample resources, effectively solving the pain point of mixed quality and difficulty in direct use of Internet medical data, and maximizing the potential value of multi-source data while ensuring knowledge security.

[0023] This invention introduces a path-walking mechanism with contextual consistency constraints and a negative sample interference injection mechanism, combined with a reverse thinking chain generation strategy, to automatically construct a structured reasoning dataset containing realistic clinical scenarios, misleading noise, and complete thinking chain analysis. This dataset not only covers complex reasoning logic across knowledge points and multiple steps, but also enhances the model's clinical discrimination ability through interference item design, significantly improving the accuracy and robustness of large-scale medical models in real diagnosis and treatment scenarios. Attached Figure Description

[0024] The above and other objects, features, and advantages of exemplary embodiments of the present invention will become readily apparent upon reading the following detailed description with reference to the accompanying drawings. In the drawings, several embodiments of the invention are illustrated by way of example and not limitation, and like or corresponding reference numerals denote like or corresponding parts, wherein: Figure 1 This is a flowchart illustrating a method for constructing a medical knowledge graph and generating an inference dataset according to an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the composition of a computer device according to an embodiment of the present invention. Detailed Implementation

[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0027] Example 1 like Figure 1 As shown, this embodiment of the invention provides a method for constructing a medical knowledge graph and generating an inference dataset. This method is mainly applied to the training data preparation stage of large-scale models in the medical field. The method flow of this embodiment mainly includes the following three core steps.

[0028] Step S1: Based on the hierarchical structure of the medical document, extract the content nodes and their corresponding parent title node sequences, and perform weighted fusion on the parent title node sequences based on the hierarchical depth to generate extended knowledge triples carrying context constraint vectors in order to construct a high-confidence knowledge graph.

[0029] Specifically, authoritative knowledge in the medical field usually exists in the form of textbooks, clinical guidelines, or expert consensus. These documents have a strong hierarchical nesting characteristic. For example, a specific diagnosis and treatment recommendation often depends on the chapter path it is in (such as "Internal Medicine - Diabetes - Type 2 Diabetes - Drug Treatment") to have a precise medical meaning.

[0030] In this step, the layout and table of contents of the medical document are first parsed and transformed into a semantic tree structure containing title nodes and content nodes. For each content node in the semantic tree that carries a specific knowledge point, the algorithm traces back up the tree structure to the root node, collecting all parent title nodes along the path to form a complete context sequence.

[0031] Subsequently, considering the varying degrees of constraint that different levels of headings exert on the underlying knowledge, the system calculates the weight of each parent heading node based on its hierarchical depth. Generally, headings closer to the content node have higher weights, reflecting the decisive influence of the nearest context on the semantics of the knowledge. Through this weighted fusion mechanism, the semantic information of the parent heading sequence is deeply integrated with the semantic information of the content nodes themselves, generating a contextual constraint vector that can represent the complete applicability boundary of the knowledge point.

[0032] Finally, this context constraint vector is combined with the traditional head entity, relation, and tail entity triples to form extended knowledge triples, and a high-confidence knowledge graph is constructed based on this. This approach fundamentally overcomes the context loss problem caused by the flattening of hierarchical medical content in traditional knowledge extraction techniques, ensuring that each piece of knowledge in the graph has a precise scope of application, providing a reliable foundation for subsequent accurate reasoning.

[0033] Step S2: Obtain multi-source heterogeneous medical data, evaluate the source credibility of the multi-source heterogeneous medical data based on graph structure features, evaluate the content logical relationship of the multi-source heterogeneous medical data based on high-credibility knowledge graph, and perform diversion processing on the multi-source heterogeneous medical data according to the source credibility and content logical relationship in order to update the high-credibility knowledge graph and construct a negative sample library.

[0034] Specifically, to address the shortcomings of outdated knowledge in authoritative textbooks, the system proactively acquires heterogeneous medical data from multiple sources, including internet forums, health science articles, and social media. Due to the varying quality of this data, a dual verification mechanism is employed for cleaning and fusion. Firstly, a heterogeneous graph network containing articles, publishers, and medical entities is constructed. Graph neural networks are used to aggregate neighbor node features, assessing the data's source credibility from the perspectives of propagation structure and account reputation. Secondly, the data to be verified is mapped to query vectors. Semantically similar extended knowledge triples are retrieved from a high-confidence knowledge graph as anchor points, and a language model is used to determine whether there are implicit, conflicting, or neutral logical relationships between the data to be verified and the anchor knowledge.

[0035] Based on the evaluation results from these two dimensions, the system implements a refined traffic splitting strategy: For data with correct content and reliable sources, it is integrated into a high-reliability knowledge graph to expand knowledge; for data whose content conflicts with authoritative knowledge, it is judged as erroneous knowledge regardless of its source and stored in the negative sample library as material for generating interference items in the future. Data with neutral content or questionable sources is marked as questionable knowledge and triggers a manual review process. This mechanism not only achieves accurate noise reduction and dynamic updates of multi-source data, but also transforms conflicting data into valuable negative sample resources, maximizing data utilization efficiency.

[0036] Step S3: Based on the updated high-confidence knowledge graph, perform path walking that satisfies contextual consistency constraints to determine multi-hop inference paths. Extract interference information from the negative sample library and inject it into the multi-hop inference paths. Then, use the language model to generate contextualized inference data in reverse based on the multi-hop inference paths after injecting interference information, so as to obtain structured question answering training samples.

[0037] Specifically, in order to improve the model's deep reasoning ability in complex clinical scenarios, this step uses a reverse thinking chain strategy to automatically generate high-quality training data.

[0038] First, the starting and ending entities are selected in the updated high-confidence knowledge graph, and context consistency constraints are introduced during the path walking process. That is, the transfer is only allowed when the similarity of the context constraint vectors of adjacent nodes meets the preset conditions, thereby ensuring that the generated reasoning path is coherent and reasonable in medical logic.

[0039] Next, erroneous knowledge or common misconceptions related to the semantics of key nodes in the reasoning path are extracted from the negative sample library constructed in step S2 and injected into the reasoning path as interference information to simulate the decision-making challenges of mixed information and difficulty in distinguishing truth from falsehood in a real clinical environment.

[0040] Then, the path containing the correct reasoning skeleton and interference traps is input into the language model, which is instructed to generate a contextualized medical record containing misleading noise, a thought chain analysis simulating the doctor's differential diagnosis thinking, and the final diagnostic conclusion.

[0041] Finally, these generated contents are assembled into structured question-answering training samples according to the standard format of instructions, inputs, and outputs. Through this reverse generation method of "first defining the skeleton, then filling in the flesh and implanting interference", the system can automatically and in batches produce complex multi-hop inference datasets with high discrimination and clinical practical value, effectively solving the problems of high cost and narrow coverage of manual writing, and significantly improving the accuracy and robustness of auxiliary decision-making of large medical vertical models.

[0042] Example 2 Based on Example 1, this example further details the hierarchical construction mechanism of high-reliability knowledge graphs.

[0043] As one implementation, before extracting the content nodes and their corresponding parent title node sequences based on the hierarchical structure of the medical document, a baseline atlas initialization and entity alignment step may also be included.

[0044] Specifically, the system first obtains source data from the standard medical terminology database, such as the latest version data files of SNOMEDCT (Systematic Medical Nomenclature) and UMLS (Unified Medical Language System) obtained from official channels, extracts key fields such as entity identifiers, term descriptions and relation types, and constructs a basic graph network containing entity nodes and relation edges.

[0045] Subsequently, the system uses a Uniform Concept Identifier (CUI) to align synonyms and abbreviations in the basic atlas network, linking and fusing entities from different terminology systems that represent the same medical concept to obtain the baseline atlas. For example, if "myocardial infarction" and "heart attack" exist in different data sources, the system uses CUI to map them to the same entity node and attaches each category name as an attribute.

[0046] This baseline knowledge graph provides a standardized and unambiguous semantic skeleton for the injection of subsequent hierarchical constraint information, effectively avoiding knowledge fragmentation caused by inconsistent terminology. The high-reliability knowledge graph is constructed based on this baseline knowledge graph and subsequently generated extended knowledge triples.

[0047] In one application scenario, a baseline graph entity and relational data model is defined. The source data parsed from the preceding steps forms the baseline graph for this invention. Define a structured data model. This model should contain at least the following core elements: (1) Entity node model: entity_id: A globally unique identifier for an entity.

[0048] entity_name: The canonical name of the entity, which can be mapped from the semantic network of UMLS or the hierarchy of SNOMED CT.

[0049] semantic_type: The semantic type of the entity.

[0050] source_vocabulary: The source of an entity (term).

[0051] (2) Relationship Edge Model: relation_id: Unique identifier for the relation source_entity_id: The unique ID of the head entity connected by the relation edge.

[0052] target_entity_id: The unique ID of the tail entity connected by the relation edge.

[0053] relation_type: Relation type.

[0054] Since SNOMED CT and UMLS may have different descriptions of the same medical concept, entity alignment is needed to eliminate redundancy. First, the CUI (Unified Concept Identifier) ​​provided by UMLS is used as a bridge to associate entities from different terminology systems that represent the same medical concept. If the same concept exists in both SNOMED CT and UMLS, the SNOMED CT ID is prioritized, and its synonyms, abbreviations, and other terms in UMLS are appended as attributes to the entity node to enrich the entity description. All relation triples with a relation_type of "Is-A" are filtered from the relation data of SNOMED CT and UMLS, and these triples are imported into the graph database neo4j.

[0055] After constructing the baseline atlas, in order to achieve contextualized knowledge storage, medical documents need to be parsed into semantic trees, which contain title nodes and content nodes.

[0056] Specifically, the layout and structure of the authoritative medical textbooks or clinical guidelines to be cleaned are analyzed to identify font size, indentation distance, and numbering rules (such as "1.", "1.1", "(1)"), and the unstructured document D is transformed into an ordered semantic tree. .in, Represents a set of nodes. This represents the set of parent-child relationship edges. For each node in the hierarchy tree... These can be divided into two categories: Title nodes: corresponding to chapter titles, carrying hierarchical constraint information. Content nodes: corresponding to body paragraphs or table cells, carrying specific medical knowledge.

[0057] For the target content node in the semantic tree, backtrack upwards along the semantic tree, collecting the title nodes along the path as a sequence of parent title nodes. For example, for a tree... any content node in ,definition This is its complete path context sequence. The algorithm starts from the current node. Starting from the root node, trace back up the tree structure until you reach the root node. Collect all parent title nodes along the path. :

[0058] in Indicates the book title or article title. This indicates the direct parent subheading of the current node. For example, when the leaf node in the tree that carries specific knowledge is "Metformin as the first choice", its complete path context sequence is: [Internal Medicine -> Endocrine System -> Diabetes -> Type 2 Diabetes -> Drug Treatment -> Normal Kidney Function].

[0059] To preserve the logical progression between levels, a special separator is used. Connect the text elements in the sequence to form path text. :

[0060] Path embedding computation based on weighted attention mechanism: Simple text concatenation may lead to long text inputs exceeding model limits, and generally, different levels of titles have different constraint weights on knowledge; for example, titles closer to child nodes have stronger constraints. Therefore, this invention introduces a position-weighted mechanism to generate the final embedding vector.

[0061] path text The input is fed into the Chinese vector model bge-large-zh-v1.5, for each level node in the path. Obtain its corresponding semantic vector representation. .

[0062] To accurately characterize the constraint strength of different heading levels on underlying knowledge, it is necessary to calculate the hierarchical weight of each heading node in the parent heading node sequence based on the hierarchical depth of the target content node. As a preferred implementation, the hierarchical weight can be calculated using the following formula:

[0063] in, This refers to the hierarchical weight of the i-th level title node in the parent title node sequence. is the hierarchy importance decay coefficient, i is the hierarchy index of the current title node, L is the total number of hierarchy levels of the target content node, j is the summation index, and e is a natural constant.

[0064] By setting a hierarchy importance attenuation coefficient This allows nodes with larger level index i to receive higher weights. For example, in practical applications, The value can be 0.5 or other positive real numbers, and the specific value can be adjusted according to the hierarchical span and semantic density of the medical document. This depth-based dynamic weighting mechanism conforms to the cognitive principle in medical textbooks that "nearest context determines specific meaning," thus more accurately representing the local applicability conditions of knowledge in vector space.

[0065] After calculating the weights of each level of headings, the semantic vectors of each heading node in the parent heading node sequence are weighted and summed based on the level weights, and then fused with the semantic vectors of the target content nodes to obtain the context constraint vector.

[0066] Specifically, a pre-trained semantic encoding model can be used to map each hierarchical node and target content node in the path into a dense vector. For example, the bge-large-zh-v1.5 model can be used as the vector encoder. It should be understood that this is only an optional example, and in other embodiments, it can be replaced with BERT, RoBERTa, or other encoding models with Chinese semantic understanding capabilities.

[0067] The system superimposes or concatenates the weighted parent title vector sequence with the content node vector, and generates the final context constraint vector through operations such as layer normalization.

[0068] In the context of computation, constraint vectors In this invention, a context strength coefficient is introduced. ( This is used to control the fusion ratio of the weighted semantic vector of the parent heading sequence and the semantic vector of the target content node. Specifically, the context constraint vector... The calculation formula is:

[0069] In the formula, This is the weighted path vector of the parent title node sequence. This is the semantic vector of the target content node. The larger the value, the stronger the constraint of the context path on entity knowledge; based on the hierarchical span and semantic density of the medical text, adjustments are made... It can dynamically balance the weight of global chapter limitations and local node semantics.

[0070] Finally, the medical knowledge triples corresponding to the target content node are combined with the context constraint vector to generate extended knowledge triples. These extended knowledge triples are no longer isolated (h, r, t) structures, but rather quadruples carrying complete applicable boundary information. In one application scenario, the weighted path embedding is calculated to obtain the final content node embedding vector. The calculation formula is as follows:

[0071] in, This is the context strength coefficient. The larger the value, the greater the impact of the context path on the entity.

[0072] The triples (h, r, t) extracted from the text are compared with the calculated context vector. Combine to generate a quadruple. And store it in the graph. Generate a quadruple (h, r, t, ... And save it into the atlas.

[0073] Through the above calculation process, the flat Upgraded to a high-reliability contextualized knowledge graph Each piece of knowledge in this graph carries its original source and scope of application, serving as a "standard of truth" for subsequent verification.

[0074] Example 3 Based on Example 1, this example further details the dual verification and intelligent triage mechanism for multi-source heterogeneous medical data.

[0075] As one implementation method, multi-source heterogeneous medical data is acquired, the source credibility of the multi-source heterogeneous medical data is evaluated based on graph structure features, and the content logical relationship of the multi-source heterogeneous medical data is evaluated based on a high-credibility knowledge graph.

[0076] Specifically, the authenticity of medical information on the Internet is often closely related to its dissemination structure. Relying solely on text semantic analysis is insufficient to identify erroneous content that appears coherent but has a questionable origin.

[0077] Therefore, this invention introduces a source reliability assessment mechanism based on graph neural networks. The system first constructs a heterogeneous graph network containing article nodes, publisher nodes, and entity nodes. Article nodes represent the internet text to be cleaned, publisher nodes represent the author or publishing platform account of the article, and entity nodes represent key medical concepts extracted from the article. Edge relationships include the "publishing" relationship connecting the article and the publisher, and the "mention" relationship connecting the article and the entity. In the feature initialization phase, for article nodes and entity nodes, a semantic encoding model such as bge-large-zh-v1.5 can be used to extract dense vectors as initial features; for publisher nodes, feature vectors are constructed based on statistical indicators such as historical posting count, average readership, and number of followers. It should be understood that the above feature extraction method is only an example; in practical applications, other encoding strategies can be selected according to the characteristics of the data.

[0078] After constructing the heterogeneous graph network, the source credibility score of the article node corresponding to the multi-source heterogeneous medical data is calculated by aggregating the features of neighboring nodes in the heterogeneous graph network based on the graph neural network. Specifically, this embodiment preferably uses the GraphSAGE algorithm for inductive learning. This algorithm updates the representation of the central node by sampling and aggregating the features of neighboring nodes, which can effectively capture the homogeneity principle of "one is influenced by one's surroundings." For example, if the publisher node of an article has historically been frequently associated with low-quality entities or cited by other low-credibility articles, even if the article itself is semantically fluent, its aggregated features will reflect a low credibility tendency. After multiple aggregations, the final feature vector of the article node is input into a fully connected layer and activated by the Sigmoid activation function to obtain a source credibility score α with a value between 0 and 1. This score comprehensively reflects the credibility level of the article in the propagation structure, and the closer the value is to 1, the more reliable the source. Compared with traditional independent classifiers, this graph-based evaluation method can utilize global association information to significantly improve the ability to identify hidden low-quality content.

[0079] In addition to source assessment, the logical correctness of the content itself also needs to be verified. Multi-source heterogeneous medical data is mapped to query vectors, and the similarity between the query vectors and the context constraint vectors of each extended knowledge triple in the high-confidence knowledge graph is calculated. Candidate anchor points that meet the preset similarity conditions are then selected.

[0080] Specifically, the system uses a semantic encoding model to convert the internet text to be verified into query vectors and then retrieves them from the vector index of a high-confidence knowledge graph. Because extended knowledge triples carry complete hierarchical contextual information, their context constraint vectors have more accurate semantic localization capabilities than traditional triples. The system typically selects the top-K extended knowledge triples with the highest cosine similarity as candidate anchor points to ensure the relevance of the comparison benchmark.

[0081] For example, based on the Chinese vector model bge-large-zh-v1.5, low-confidence text is... Mapped to query vector Calculate the query vector. With atlas The context vector stored on each relation edge. The similarity between them. This invention uses cosine similarity: .

[0082] Subsequently, the candidate anchors are transformed into anchor knowledge in natural language form. Based on the similarity calculated above, the top-K, i.e., the top k most similar context vectors, are selected as candidate anchors, and a quadruple (head entity, relation, tail entity, original context path) is returned. For example, a quadruple containing contextual constraints (metformin, indication, type 2 diabetes, Context: obesity with insulin resistance) is linearized into a complete statement such as "Metformin is an indicated drug for the treatment of type 2 diabetes in patients with obesity and insulin resistance." This transformation is to adapt to the input preferences of the language model, enabling it to fully understand the applicable boundaries of the knowledge.

[0083] Next, the system uses a language model to determine the logical implication relationship between multi-source heterogeneous medical data and anchor knowledge, thus obtaining the content logic relationship. Specifically, the system uses anchor knowledge as a premise and the internet text to be verified as a hypothesis, constructing a prompt word template which is then input into the language model for reasoning. The prompt word template typically includes role settings, judgment criteria, and a few examples. The judgment criteria are defined into three categories: entailment, indicating that the information to be verified is consistent with the facts or its reasonable inference; contradiction, indicating that the information to be verified has a logical contradiction with the facts, a contraindication conflict, or exaggerates the efficacy; and neutrality, indicating that the facts do not contain relevant information, and the truth or falsehood cannot be determined.

[0084] For example, when the anchor knowledge is "there is currently no cure for diabetes," and the text to be verified claims "taking bitter melon extract for two weeks can completely cure diabetes," the language model should determine it as a "conflict" and provide reasons. In this way, the system achieves a leap from shallow semantic matching to deep logical reasoning, and can accurately identify erroneous knowledge that, although seemingly reliable in origin, contradicts authoritative medical principles.

[0085] Based on the above dual verification results, the multi-source heterogeneous medical data are processed by sorting according to the source credibility and content logical relationship in order to update the high-credibility knowledge graph and construct a negative sample library.

[0086] Specifically, this invention establishes a set of refined three-level diversion rules.

[0087] In the first scenario, when the logical relationship between the content is conflicting, regardless of the source's credibility score, the multi-source heterogeneous medical data is marked as erroneous knowledge and stored in the negative sample library. Existing technologies typically discard conflicting data as noise, but this invention recognizes that this "erroneous knowledge" is precisely a typical fallacy existing in the real world. Retaining it in the negative sample library provides high-value distractor material for the reverse thinking chain generation described in subsequent embodiments, making the generated training data possess realistic clinical analytical difficulty, thereby maximizing the utilization of data value.

[0088] In the second scenario, when the logical relationship between the content is one of implication, and the source reliability score is greater than or equal to a preset source reliability threshold, the multi-source heterogeneous medical data is fused into a high-reliability knowledge graph. For example, the preset source reliability threshold τ... source It can be set to 0.7. This means that automatic graph expansion is only allowed when the content is verified by authoritative knowledge and the publisher has sufficient credibility. This dual-threshold mechanism effectively prevents the risk of misfusion that may arise from single-dimensional verification.

[0089] In the third scenario, when the logical relationship between the content is neutral, or when the logical relationship is implied but the source credibility score is less than the preset source reliability threshold, the multi-source heterogeneous medical data is marked as questionable knowledge and a manual review process is triggered. For new knowledge not covered by the atlas or correct knowledge from sources that are not authoritative enough, the system does not automatically process it rashly, but instead submits it to medical experts for review. If the expert review is approved, it is manually integrated into the atlas; otherwise, it is transferred to the negative sample library. This closed-loop quality control system of "automatic machine processing + manual backup" ensures both the efficiency of atlas updates and safeguards the bottom line of medical knowledge security. It should be understood that the threshold of 0.7 mentioned above is only an exemplary value and can be dynamically adjusted in actual deployment according to the need for balancing accuracy and recall.

[0090] Example 4 Based on Example 1, this example further details the generation mechanism of complex multi-hop reasoning datasets based on reverse thinking chains.

[0091] As one implementation method, a path walk that satisfies the context consistency constraint is performed based on the updated high-confidence knowledge graph to determine multi-hop reasoning paths.

[0092] Specifically, to construct a multi-hop reasoning framework with clinical logical coherence, the system first determines the starting and ending entity nodes in the updated high-reliability knowledge graph. For example, if the goal is to generate reasoning data of the "symptom-medication" type, the starting node could be "polydipsia" and the ending node could be "metformin". Then, path transitions begin from the starting entity node. At each transition, the similarity between the context constraint vectors of the current node and the candidate next node is calculated. When the similarity exceeds a preset relevance threshold, the candidate next node is used as the transition target until the ending entity node is reached, thus obtaining the multi-hop reasoning path.

[0093] The contextual consistency constraint introduced here is a key mechanism to ensure that the generated path conforms to medical principles. Since each node in the high-confidence knowledge graph carries a contextual constraint vector representing its applicable boundaries, calculating the cosine similarity of adjacent node vectors and comparing it with a preset relevance threshold τ can effectively filter out jumps that, while structurally connected, are semantically irrelevant in medicine. For example, although "diabetes" and "fracture" may have a weak association in the graph, because their contextual constraint vector similarity is below the threshold τ, the system will not include them in the reasoning path, thus ensuring the rigor and rationality of the generated reasoning link (e.g., "polyuria → type 2 diabetes → metformin") in clinical logic. It should be understood that the preset relevance threshold τ can be dynamically adjusted according to the knowledge density of specific diseases to ensure a balance between recall and precision in path search.

[0094] During path traversal, in addition to applying context consistency constraints and entity type constraints to nodes, this embodiment also explicitly introduces relation type constraints. Specifically, relation type constraints include limiting the relation type sequence and direction of each jump transition edge in the path, in order to distinguish candidate paths with different treatment directions or different clinical categories that exist between the same pair of starting entity nodes and ending entity nodes.

[0095] In a medical knowledge graph, there may be multiple candidate paths with different directions or clinical categories between the same pair of starting and ending entity nodes. For example, there may be both a preventive path of "inhibition-reduction-prevention" and a risk path of "weakening-causing-increasing risk" between "aspirin" and "myocardial infarction"; or there may be a "pharmacological adverse reaction chain" and a "lifestyle intervention chain" between "type 2 diabetes" and "hypoglycemia".

[0096] By further defining the sequence of relation types between the starting entity node and the ending entity node (e.g., defining the relation type as "therapeutic medication-stimulation-cause"), the clinical semantic direction of the path can be accurately locked, eliminating the path semantic confusion and logical conflict caused by random sampling, and ensuring that the generated question-answer training samples have unique logical interpretability and extremely high learnability.

[0097] In an exemplary scenario, in a medical knowledge graph, there are at least two three-hop paths in opposite directions between the node "Aspirin" (entity type: drug) and the node "myocardial infarction" (entity type: disease).

[0098] Path α (prevention direction, 3 jumps): Node sequence: Aspirin → COX-1 inhibition (platelet aggregation decreases) → thrombosis (coronary events decrease) → myocardial infarction; Relationship sequence: "Inhibition" → "Reduction" → "Prevention".

[0099] The triadic representation of the diagram is: (Aspirin, inhibition, COX-1)(COX-1, reduction, platelet aggregation)(platelet aggregation, prevention, myocardial infarction); Pathway semantics: Aspirin reduces platelet aggregation by inhibiting COX-1, thereby reducing thrombus formation and ultimately preventing myocardial infarction.

[0100] Path β (risk direction, 3 jumps): Node sequence: Aspirin → gastric mucosal protection (barrier ↓) → gastrointestinal bleeding → myocardial infarction; Relationship sequence: "weakening" → "causing" → "increasing risk".

[0101] The triad in the diagram represents: (Aspirin, weakens, gastric mucosal protection) (Gastric mucosal protection, leads to, gastrointestinal bleeding) (Gastrointestinal bleeding, increases the risk of, myocardial infarction); Path semantics: Aspirin weakens the gastric mucosal protective barrier, leading to gastrointestinal bleeding. Gastrointestinal bleeding causes anemia and hypoperfusion, ultimately increasing the risk of myocardial infarction.

[0102] In another exemplary scenario, in a medical knowledge graph, there are at least two three-hop paths between the node "Type 2 Diabetes" (entity type: disease) and the node "Hypoglycemia" (entity type: symptoms / signs), where the start and end points, number of hops, and end point answers are all the same, but the path semantics belong to different clinical categories.

[0103] Path α (adverse drug reaction chain, 3 hops): Node sequence: Type 2 diabetes → sulfonylurea hypoglycemic agents → increased insulin release → hypoglycemia; Relationship sequence: "Therapeutic drug" → "Stimulus" → "Cause".

[0104] The ternary group in the diagram represents: (Type 2 diabetes, treatment drugs, sulfonylureas) (sulfonylureas, stimulation, insulin release) (insulin release, causing, hypoglycemia); Path semantics: After type 2 diabetes patients are treated with sulfonylurea hypoglycemic drugs, the drugs stimulate insulin release, which eventually leads to hypoglycemia.

[0105] Clinical category: Adverse drug reactions (pharmacology).

[0106] Path β (lifestyle intervention chain, 3 hops): Node sequence: Type 2 diabetes → Exercise → Increased glucose utilization → Hypoglycemia; Relationship sequence: "Lifestyle intervention" → "Increase" → "Cause".

[0107] The diagram triplet represents: (Type 2 diabetes, lifestyle intervention, exercise) (exercise, increases glucose utilization) (glucose utilization, leads to hypoglycemia); Path semantics: Type 2 diabetes patients undergo lifestyle interventions through exercise, which increase peripheral glucose utilization and ultimately lead to hypoglycemia.

[0108] Clinical category: Lifestyle / Patient Education.

[0109] Given the aforementioned situation where multiple paths exist despite having the same start and end entity nodes, if only the start and end entity nodes are constrained without constraining the relationship type, the sampling algorithm may randomly sample any one of them, resulting in multiple inference paths with semantic conflicts or mixed categories. This invention, by introducing relationship type constraints, ensures that when the same pair of start and end entities is sampled, the semantic direction of the path is unique, the category is consistent, and it is learnable.

[0110] After determining the correct reasoning framework, interference information is extracted from the negative sample library and injected into the multi-hop reasoning path. Specifically, to simulate the decision-making challenges of mixed information and difficulty in distinguishing truth from falsehood in a real clinical environment, the system actively retrieves erroneous knowledge or common misconceptions semantically related to key nodes in the multi-hop reasoning path from the negative sample library constructed in Example 3, as interference information. For example, for a reasoning path containing the node "type 2 diabetes," the system may extract the erroneous knowledge "taking bitter melon extract for two weeks can completely cure diabetes" marked as conflicting from the negative sample library. This injection of interference information is not random splicing, but precise implantation based on semantic relevance, aiming to provide realistic misleading material for the subsequent generation of high-difficulty discrimination questions, so that the generated training data can effectively train the model's clinical reasoning ability to eliminate interference and distinguish truth from falsehood.

[0111] After completing path construction and interference injection, the language model is used to reverse-generate contextualized reasoning data based on the multi-hop reasoning path after the interference information is injected, in order to obtain structured question-answering training samples. Specifically, this invention adopts a reverse thinking chain strategy, that is, first establishing the correct reasoning logic and interference traps, and then instructing the language model to reverse-generate realistic clinical scenarios. The system inputs the multi-hop reasoning path and interference information into the language model, instructing the language model to reverse-generate contextualized medical records containing interference information as misleading noise, thought chain analysis simulating clinical thinking, and the final diagnostic conclusion.

[0112] In practice, this process can be achieved by constructing a structured cue word template. This template typically includes role settings (such as "senior clinical medical education expert"), task instructions, input slots for the golden logic chain, and input slots for distraction traps. Upon receiving these structured inputs, the language model generates a contextualized medical record containing the patient's chief complaint, present medical history, and examination results. This record naturally incorporates distracting information as misleading statements, while embedding key evidence supporting the golden logic chain within the examination results. Next, it generates a thought process analysis that progressively dissects how to eliminate distractors and utilize key clues to hit the correct path. Finally, it provides a final diagnostic conclusion that conforms to the logical chain. This reverse generation method fundamentally ensures the logical consistency and distinctiveness of the generated data, avoiding the logical breaks or forced insertion of distractors that are common in traditional forward generation methods.

[0113] Finally, the contextualized medical records, thought chain analysis, and final diagnostic conclusions are assembled according to a preset data format to generate structured question-and-answer training samples containing instruction, input, and output fields.

[0114] Specifically, to enable the generated data to be directly used for supervised fine-tuning (SFT) of large medical vertical models, this embodiment defines a standardized data assembly format. For example, the generated data can be constructed in JSONL format, where each line represents an independent training sample, containing "instruction" (such as "Please analyze the following case"), "input" (i.e., the generated contextualized medical record), and "output" (i.e., the combination of thought chain analysis and final diagnostic conclusion).

[0115] It should be understood that JSONL is only a preferred implementation; other implementations may use Parquet, CSV, or other data formats adapted to specific training frameworks. This standardized assembly process significantly reduces the cost and time required to construct high-quality medical training data.

[0116] This invention also provides a medical knowledge graph construction and reasoning dataset generation system, comprising: The knowledge graph construction module is used to extract content nodes and their corresponding parent title node sequences based on the hierarchical structure of medical documents, and to perform weighted fusion of the parent title node sequences based on the hierarchical depth to generate extended knowledge triples carrying context constraint vectors in order to construct a high-confidence knowledge graph. The data verification and fusion module is used to acquire multi-source heterogeneous medical data, evaluate the source credibility of the multi-source heterogeneous medical data based on graph structure features, evaluate the content logical relationship of the multi-source heterogeneous medical data based on the high-credibility knowledge graph, and perform diversion processing on the multi-source heterogeneous medical data according to the source credibility and the content logical relationship, so as to update the high-credibility knowledge graph and construct a negative sample library. The reasoning data generation module is used to perform path walking that satisfies contextual consistency constraints based on the updated high-confidence knowledge graph, determine multi-hop reasoning paths, extract interference information from the negative sample library and inject it into the multi-hop reasoning paths, and use a language model to reverse generate contextualized reasoning data based on the multi-hop reasoning paths after the interference information is injected, so as to obtain structured question answering training samples.

[0117] The various steps in this invention are achieved through the modules described above.

[0118] Furthermore, based on the above method, this embodiment of the invention also provides a computer device, such as... Figure 2 As shown, it includes a memory and a processor, the memory storing a computer program, characterized in that the processor executes the computer program to implement the methods described in one or more of the preceding embodiments.

[0119] This invention also provides a computer device and a computer-readable storage medium for supporting the execution and deployment of the aforementioned medical knowledge graph construction and inference dataset generation method at the hardware level.

Claims

1. A method for constructing a medical knowledge graph and generating a reasoning dataset, characterized in that, include: S1: Based on the hierarchical structure of medical documents, extract content nodes and their corresponding parent title node sequences, and perform weighted fusion on the parent title node sequences based on hierarchical depth to generate extended knowledge triples carrying context constraint vectors in order to construct a high-confidence knowledge graph. S2: Acquire multi-source heterogeneous medical data, evaluate the source credibility of the multi-source heterogeneous medical data based on graph structure features, evaluate the content logical relationship of the multi-source heterogeneous medical data based on the high-credibility knowledge graph, and perform diversion processing on the multi-source heterogeneous medical data according to the source credibility and the content logical relationship, so as to update the high-credibility knowledge graph and construct a negative sample library; S3: Based on the updated high-confidence knowledge graph, perform path walking that satisfies contextual consistency constraints to determine multi-hop inference paths. Extract interference information from the negative sample library and inject it into the multi-hop inference paths. Then, use a language model to reverse-generate contextualized inference data based on the multi-hop inference paths after injecting interference information to obtain structured question answering training samples.

2. The method according to claim 1, characterized in that, In step S1, an extended knowledge triple carrying a context constraint vector is generated, including: The medical document is parsed into a semantic tree, which contains title nodes and content nodes; For the target content node in the semantic tree, backtrack upwards along the semantic tree and collect the title nodes along the path as the parent title node sequence; Based on the layer depth of the target content node, calculate the layer weight of each title node in the parent title node sequence; The semantic vectors of each title node in the parent title node sequence are weighted and summed based on the hierarchical weights, and then fused with the semantic vector of the target content node to obtain the context constraint vector. The extended knowledge triple is generated by combining the medical knowledge triple corresponding to the target content node with the context constraint vector.

3. The method according to claim 2, characterized in that, The context constraint vector is obtained by proportionally fusing the weighted path vector with the semantic vector of the target content node according to a preset context strength coefficient, and is calculated using the following formula: in, For the context constraint vector, The context strength coefficient is, and , This is the weighted path vector of the parent title node sequence. The semantic vector of the target content node.

4. The method according to claim 2, characterized in that, The step of calculating the hierarchical weight of each title node in the parent title node sequence based on the hierarchical depth of the target content node includes: The hierarchical weights are calculated using the following formula: in, This refers to the hierarchical weight of the i-th level title node in the parent title node sequence. is the hierarchy importance decay coefficient, i is the hierarchy index of the current title node, L is the total number of hierarchy levels of the target content node, j is the summation index, and e is a natural constant.

5. The method according to claim 1, characterized in that, In step S2, evaluating the logical relationships of the content of the multi-source heterogeneous medical data includes: A heterogeneous graph network containing article nodes, publisher nodes, and entity nodes is constructed. Based on a graph neural network, the features of neighbor nodes in the heterogeneous graph network are aggregated, and the source credibility score of the multi-source heterogeneous medical data corresponding to the article node is calculated. The multi-source heterogeneous medical data is mapped to a query vector, and the similarity between the query vector and the context constraint vector of each extended knowledge triple in the high-confidence knowledge graph is calculated to select candidate anchor points that meet the preset similarity conditions. The candidate anchor points are converted into anchor point knowledge in natural language form. The language model is then used to determine the logical implication relationship between the multi-source heterogeneous medical data and the anchor knowledge, thereby obtaining the content logical relationship.

6. The method according to claim 5, characterized in that, In step S2, the multi-source heterogeneous medical data is processed by diverting data according to the source credibility and the content logical relationship, including: When the logical relationship of the content is conflicting, the multi-source heterogeneous medical data is marked as erroneous knowledge and stored in the negative sample library; When the logical relationship of the content is an implication relationship, and the source credibility score is greater than or equal to a preset source reliability threshold, the multi-source heterogeneous medical data is fused into the high-credibility knowledge graph. When the content logical relationship is a neutral relationship, or the content logical relationship is an implied relationship and the source credibility score is less than the preset source reliability threshold, the multi-source heterogeneous medical data is marked as questionable knowledge and a manual review process is triggered.

7. The method according to claim 1, characterized in that, In step S3, extracting interference information and injecting it into the multi-hop inference path includes: In the updated high-confidence knowledge graph, the starting entity node and the ending entity node are determined; The path transition begins from the starting entity node. During each transition, the similarity between the context constraint vector of the current node and the candidate next node is calculated. When the similarity is greater than a preset relevance threshold, the candidate next node is used as the transition target until the termination entity node is reached, thus obtaining the multi-hop reasoning path. Error knowledge related to the semantics of key nodes in the multi-hop inference path is extracted from the negative sample library and injected into the multi-hop inference path as interference information.

8. The method according to claim 7, characterized in that, The relation type constraint includes limiting the relation type sequence and direction of each jump transition edge in the path, so as to distinguish candidate paths with different treatment directions or different clinical categories that exist between the same pair of starting entity nodes and ending entity nodes.

9. The method according to claim 1, characterized in that, In step S3, the methods for obtaining structured question-answering training samples include: The multi-hop reasoning path and the interference information are input into the language model, which is then instructed to generate a contextualized medical record containing the interference information as misleading noise, a thought chain analysis simulating clinical thinking, and a final diagnostic conclusion. The contextualized medical record, the thought chain analysis, and the final diagnostic conclusion are assembled according to a preset data format to generate a structured question-and-answer training sample containing instruction, input, and output fields.

10. The method according to claim 1, characterized in that, Before extracting the content nodes and their corresponding parent title node sequences based on the hierarchical structure of the medical document, the method further includes: Obtain the source data of the standard medical terminology database, extract entity identifiers, term descriptions and relation types, and construct a basic graph network containing entity nodes and relation edges; By using a unified concept identifier to align synonyms and abbreviations in the basic atlas network, entities from different terminology systems that represent the same medical concept are associated and fused to obtain a baseline atlas; The high-reliability knowledge graph is constructed based on the baseline graph and the extended knowledge triples.

11. A system for constructing and generating a medical knowledge graph and reasoning dataset, characterized in that, include: The knowledge graph construction module is used to extract content nodes and their corresponding parent title node sequences based on the hierarchical structure of medical documents, and to perform weighted fusion of the parent title node sequences based on the hierarchical depth to generate extended knowledge triples carrying context constraint vectors in order to construct a high-confidence knowledge graph. The data verification and fusion module is used to acquire multi-source heterogeneous medical data, evaluate the source credibility of the multi-source heterogeneous medical data based on graph structure features, evaluate the content logical relationship of the multi-source heterogeneous medical data based on the high-credibility knowledge graph, and perform diversion processing on the multi-source heterogeneous medical data according to the source credibility and the content logical relationship, so as to update the high-credibility knowledge graph and construct a negative sample library. The reasoning data generation module is used to perform path walking that satisfies contextual consistency constraints based on the updated high-confidence knowledge graph, determine multi-hop reasoning paths, extract interference information from the negative sample library and inject it into the multi-hop reasoning paths, and use a language model to reverse generate contextualized reasoning data based on the multi-hop reasoning paths after the interference information is injected, so as to obtain structured question answering training samples.

12. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 10.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 10.