Knowledge graph-combined intelligent question-answering system and method for drug use knowledge

By combining a knowledge graph with an intelligent question-and-answer system for medication knowledge, the system analyzes patients' medication needs in real time and generates a structured query graph. By utilizing dynamic knowledge graphs and multi-dimensional assessments, it solves the problems of immediacy and personalized recommendation in existing technologies for obtaining medication information, and achieves efficient and personalized medication advice.

CN121191682APending Publication Date: 2025-12-23CHINESE PEOPLES LIBERATION ARMY KET FORCE CHARACTERISTIC MEDICAL CENT

Patent Information

Application Number
CN202511343970.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-19
Publication Date
2025-12-23

AI Technical Summary

Technical Problem

Existing methods for obtaining medication knowledge suffer from problems such as difficulty in obtaining timely consultations, inconsistent information quality, and inability to provide personalized and accurate recommendations.

Method used

The intelligent question-and-answer system for medication knowledge, which combines knowledge graphs, obtains patients' medication needs in real time, performs multimodal parsing to generate a structured demand query graph, pre-builds a dynamic knowledge graph, performs multi-path search, and combines patient information sets for multi-dimensional parallel evaluation to generate personalized medication question-and-answer text.

Benefits of technology

It improves the accuracy and flexibility of medication problem analysis, can handle complex multi-hop queries, and generate personalized medication recommendations to meet diverse needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121191682A_ABST
    Figure CN121191682A_ABST
Patent Text Reader

Abstract

The invention discloses a drug use knowledge intelligent question answering system and method combined with a knowledge graph, belongs to the technical field of drug use management, and solves the problems that only single-path matching is supported and complex multi-hop query cannot be processed when an answer is determined by adopting similarity matching between a regularized question and a template library in an existing method; in order to solve the problem that personalized accurate recommendation cannot be realized according to actual conditions of different patients, the method comprises the steps of performing multi-modal analysis on drug use demands of the patients, generating a structured demand query graph, pre-constructing a drug use question and answer model based on a dynamic knowledge graph, and performing multi-dimensional parallel evaluation on a candidate answer set. According to the method, multi-modal analysis is carried out on the medication demand of the patient, and multi-dimensional parallel evaluation is carried out on the candidate answer set, so that complex multi-hop query can be processed, diversified demands of the patient can be met more comprehensively, the personalized degree and practicability of the answers can be improved, and personalized accurate recommendation can be realized according to actual conditions of different patients.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of medication management technology, specifically relating to an intelligent question-and-answer system and method for medication knowledge that combines knowledge graphs. Background Technology

[0002] Currently, with the improvement of the national cultural literacy level, the safe and rational use of drugs is receiving increasing attention. Whether ordinary patients or elderly patients, they often encounter questions regarding drug indications, dosage, interactions, adverse reactions, contraindications, use in special populations, and drug storage during daily medication use. Therefore, timely access to accurate, professional, and easy-to-understand medication guidance information is crucial to avoid medication errors, reduce potential risks of inappropriate medication use, ensure medication safety, improve treatment adherence, and optimize treatment outcomes.

[0003] Currently, patients mainly obtain medication knowledge through traditional channels such as manual consultation, paper instructions, traditional search engines, and medical databases. However, using traditional methods is limited by factors such as working hours, geographical distance, and the limited number of professional personnel, making it difficult to obtain timely consultation. Furthermore, the information is often mixed, of varying quality, and filled with errors, outdated, or advertising content, making it difficult for users to distinguish between true and false information. This can lead to inappropriate medication use by patients, thereby affecting their medication safety.

[0004] In recent years, question-answering systems based on knowledge graphs have become a hot topic in academic and industrial research and applications. The high semantic understanding, data accuracy, and efficient retrieval capabilities of knowledge graphs have led to their widespread use. As a structured semantic knowledge base, knowledge graphs organize and describe real-world concepts and their interrelationships using a graph structure (entity-relationship-entity), making them an ideal tool for representing complex domain knowledge (such as healthcare). They can integrate fragmented medication knowledge into a cohesive whole.

[0005] Chinese patent CN111966793B discloses a knowledge graph-based intelligent question-answering method, system, and knowledge graph update system. The method includes: receiving user questions; converting user questions into rule-based questions; matching the rule-based questions with a template library generated from a knowledge graph based on a heterogeneous information model; and determining the highest similarity match as the answer. This method fully utilizes the characteristics of heterogeneous information networks for modeling and combines ranking-based collaborative clustering algorithms with meta-path similarity algorithms to provide richer knowledge and relationship reasoning. However, existing methods use similarity matching between rule-based questions and template libraries to determine answers, supporting only single-path matching and unable to handle complex multi-hop queries. Furthermore, they ignore individual patient characteristics, resulting in a lack of personalization in the determined answers and an inability to provide personalized and accurate recommendations based on different patients' actual situations. To address these issues, we propose an intelligent question-answering system and method for medication knowledge that incorporates a knowledge graph. Summary of the Invention

[0006] The purpose of this invention is to address the shortcomings of existing technologies by providing an intelligent question-and-answer system and method for medication knowledge that combines knowledge graphs. This solves the problems of existing methods that use similarity matching between rule-based questions and template libraries to determine answers, which only support single-path matching and cannot handle complex multi-hop queries, and ignore individual patient characteristics, resulting in a lack of personalization in the determined answers and an inability to achieve personalized and accurate recommendations based on the actual situation of different patients.

[0007] This invention is implemented by combining a knowledge graph-based intelligent question-and-answer method for medication knowledge, the method comprising: Real-time acquisition of patients' medication needs, multimodal analysis of patients' medication needs, and generation of structured demand query graphs; A medication question-answering model based on a dynamic knowledge graph is pre-built. A medication knowledge set is crawled using web crawling technology. The medication knowledge set is used to iteratively train the medication question-answering model. The dynamic knowledge graph is updated in real time based on graph neural network. Load the structured demand query graph, use the demand query graph as an index, and perform multi-path search in the dynamic knowledge graph to generate a set of candidate answers; A candidate answer set is obtained, and the candidate answer set is evaluated in parallel across multiple dimensions based on the medication question-and-answer model and the patient information set to generate the final medication question-and-answer text.

[0008] Preferably, the method for multimodal analysis of patient medication needs includes: Obtain medication demand information, extract preliminary semantic understanding of medication demand information based on the large language model Claude, and index patient information set based on medication demand information; The initial semantic understanding is mapped to the prompt word template, and deep semantic parsing is performed on the initial semantic understanding to extract the core medical entities, user intent, and limiting conditions from the deep semantic parsing. The core medical entities include drug name, disease name, biochemical indicators, special population type, and medical operation / surgery name. The user intent includes indication query, medication plan query, medication contraindication query, adverse drug reaction query, medication recommendation and usage dosage, and personalized consultation. The limiting conditions include medication time conditions, interaction conditions, personalized attribute conditions, and scenario constraint conditions. The system acquires core medical entities, user intents, and constraints; performs data alignment on these entities; maps the aligned entities to a predefined structured requirements template; and automatically generates a standard requirements document containing the core medical entities, user intents, and constraints. Load the requirements standard document, construct the skeleton nodes of the query graph based on the requirements standard document, where the skeleton nodes include core entity nodes, intent type nodes and limiting condition nodes, and fill the skeleton node relationship chain in the query graph with the deep semantic parsing results to form a traversable query path. Based on the relational chain associated with the query path, the reasoning rule set is indexed from the dynamic knowledge graph, the reasoning rule set is dynamically bound to the query graph to generate a structured demand query graph, and the demand query graph is compiled into dynamic knowledge graph interaction instructions.

[0009] Preferably, the dynamic knowledge graph construction method includes: The system pre-determines the knowledge website address, knowledge database, constraints, and collection frequency for knowledge extraction from the graph. It then uses web crawling technology combined with the context protocol of the large language model to call the context protocol service and establish a communication and interaction channel with the knowledge website address and knowledge database. Based on the communication interaction channel, the complete DOM structure is obtained from the knowledge website address and knowledge database. The complete DOM structure is identified and analyzed, and medical databases, drug instruction texts, adverse drug reaction monitoring reports, and medical literature are extracted from the complete DOM structure. Entity extraction, attribute extraction, and entity relation extraction are performed on pharmaceutical databases, drug instruction texts, adverse drug reaction monitoring reports, and medical literature. The extracted entities are then aligned with their attributes based on a similarity algorithm. Based on the entity attribute alignment results, top-down linking and modeling are performed. The modeled entities and entity relationships are stored in a graph database queried by graph structure, forming a structured dynamic knowledge graph. The dynamic knowledge graph is then learned and updated in real time based on graph neural networks.

[0010] Preferably, the method for aligning entity attributes of extracted entities based on a similarity algorithm includes: Obtain entity or attribute extraction results, perform character statistics on the entity or attribute extraction results, organize the character statistics results into an extracted character set, and preset a first similarity threshold and a second similarity threshold; The extracted character set is classified based on text similarity / semantic similarity, and the similarity between the extracted character set and entity nodes in the dynamic knowledge graph is compared. If the similarity between the extracted character set and the entity node in the dynamic knowledge graph exceeds the preset first similarity threshold, the extracted character set will be linked and aligned to the corresponding entity node in the dynamic knowledge graph. If the similarity between the extracted character set and the entity nodes in the dynamic knowledge graph does not exceed the preset first similarity threshold, a combined similarity algorithm is used to align the entity attributes of the extracted character set.

[0011] Preferably, the method for aligning entity attributes of the extracted character set using a combined similarity algorithm includes: The extracted character set is identified and analyzed to determine the text similarity weight and semantic similarity weight in the extracted character set; The similarity between the extracted character set and entity nodes is measured using the Jaccard coefficient. Cosine similarity is used to calculate the semantic similarity between the extracted character set and entity nodes; Load the text similarity and semantic similarity between the extracted character set and the entity node, and combine the text similarity weight and semantic similarity weight to determine the comprehensive similarity between the extracted character set and the entity node; Determine whether the overall similarity between the extracted character set and the entity node exceeds a preset second similarity threshold. If the overall similarity between the extracted character set and the entity node exceeds the preset second similarity threshold, link the extracted character set to the corresponding dynamic knowledge graph entity node.

[0012] Preferably, the method for training the medication question-and-answer model includes: Based on web crawling technology, a set of medication knowledge is crawled from a dynamic knowledge graph. The set of medication knowledge is preprocessed and converted into tensor data that can be processed by the medication question-and-answer model. The set of medication knowledge is divided into a training set and a test set. A pre-built medication question-answering model is constructed, using the BioBERT model as the initial model. The initial model also includes an input layer and an output layer. A multi-behavior learning method is introduced into the BioBERT model. A multi-dimensional parallel evaluation layer is introduced between the BioBERT model and the output layer. The multi-dimensional parallel evaluation layer is based on the TCN-GRU model, and a cross-modal fusion mechanism is introduced into the TCN-GRU model. The TCN-GRU model is used to generate parallel fusion features. The global model parameters and training rounds of the medication question-and-answer model are preset, and the global model parameters are initialized. The initialized global model parameters are then sent to the medication question-and-answer model. Load the training set, iteratively train the medication question-answering model using the training set, optimize the hyperparameters of the medication question-answering model based on the online learning mechanism, and update the optimized medication question-answering model. Obtain the test set, use the test set as input, execute the medication question-and-answer model, output the test results, determine whether the test results meet the preset accuracy threshold, and if the test results meet the preset accuracy threshold, output the converged medication question-and-answer model.

[0013] Preferably, the method for generating a candidate answer set by performing multi-path search in a dynamic knowledge graph includes: Obtain the demand query graph, execute dynamic knowledge graph interaction commands based on the demand query graph, and perform hierarchical traversal of the dynamic knowledge graph based on depth-first search (DFS). A combined similarity algorithm is used to align entity nodes in the demand query graph with those in the dynamic knowledge graph. Entity nodes in the dynamic knowledge graph whose similarity to the demand query graph is greater than the query threshold are extracted and set as candidate entity nodes. The graph neural network reads candidate entity nodes from the dynamic knowledge graph, performs implicit knowledge inference on the candidate entity nodes based on the index inference rule set, and converts the implicit knowledge inference of the candidate entity nodes into candidate connection embedding vectors. Cypher is used to dynamically match the demand query graph and candidate entity nodes, extract the candidate connection embedding vectors of candidate entity nodes in the knowledge graph, and label the candidate connection embedding vectors probabilistically based on the Conditional Random Field (CRF). Based on the probability annotation results of candidate connection embedding vectors, link similar context information, and integrate the connection embedding vectors and similar context information into a candidate answer set, and output the candidate answer set.

[0014] Preferably, the method for multi-dimensional parallel evaluation of the candidate answer set based on a medication question-and-answer model combined with a patient information set includes: Obtain patient information set and candidate answer set, and learn multiple behavioral characteristics of patient information set and candidate answer set based on BioBERT model, respectively learn the medication plan dimension feature, intention dimension feature, medication time dimension feature, and scenario constraint dimension feature of candidate answer set; Using the patient information set as a constraint, the weight coefficients of the medication regimen dimension feature, intent dimension feature, medication time dimension feature, and scenario constraint dimension feature are adaptively adjusted, and the weight coefficients of the medication regimen dimension feature, intent dimension feature, medication time dimension feature, and scenario constraint dimension feature are output. The TCN-GRU model performs cross-modal fusion processing on the features of medication plan dimension, intent dimension, medication time dimension, and scenario constraint dimension based on the cross-modal fusion mechanism, and outputs a dynamic fusion score for the candidate answer set; The dynamic fusion score is obtained and adjusted based on the objective confidence level of the number of supporting evidence, the authority of the data source, and the freshness of the evidence, to obtain the fusion correction score. The fusion correction scores are ranked, and the candidate answer set with the highest fusion correction score is used as the final medication question and answer text that matches the patient information features.

[0015] On the other hand, the present invention also provides an intelligent question-and-answer system for medication knowledge that incorporates knowledge graphs, the intelligent question-and-answer system for medication knowledge that incorporates knowledge graphs, comprising: The query graph generation module is used to obtain patients' medication needs in real time, perform multimodal parsing of patients' medication needs, and generate a structured demand query graph. The graph construction module is used to pre-build a medication question-and-answer model based on a dynamic knowledge graph. It crawls a medication knowledge set based on web crawling technology, uses the medication knowledge set to iteratively train the medication question-and-answer model, and learns and updates the dynamic knowledge graph in real time based on a graph neural network. The candidate answer recommendation module is used to load a structured demand query graph, and use the demand query graph as an index to perform multi-path search in the dynamic knowledge graph to generate a set of candidate answers; The question-and-answer text generation module is used to obtain a set of candidate answers. Based on the medication question-and-answer model and combined with the patient information set, the candidate answer set is evaluated in a multi-dimensional parallel manner to generate the final medication question-and-answer text.

[0016] Preferably, the query graph generation module includes: The preliminary understanding unit is used to obtain medication demand information. It extracts preliminary semantic understanding of medication demand information based on the large language model Claude, and indexes the patient information set based on the medication demand information. The deep understanding unit is used to map the initial semantic understanding to the prompt word template, perform deep semantic parsing on the initial semantic understanding, and extract the core medical entities, user intent, and limiting conditions from the deep semantic parsing. The standard document generation unit is used to obtain core medical entities, user intents, and limiting conditions, perform data alignment on the core medical entities, user intents, and limiting conditions, and map the data-aligned core medical entities, user intents, and limiting conditions to a predefined requirement structure template, automatically generating a standard requirement document containing the core medical entities, user intents, and limiting conditions. The requirement query graph construction unit is used to load the requirement standard document, construct the skeleton nodes of the query graph based on the requirement standard document, and fill the relationship chain of the skeleton node in the query graph with the result of deep semantic parsing to form a traversable query path. Based on the relationship chain associated with the query path, the unit indexes the reasoning rule set from the dynamic knowledge graph, dynamically binds the reasoning rule set to the query graph, generates a structured requirement query graph, and compiles the requirement query graph into dynamic knowledge graph interaction instructions.

[0017] Compared with the prior art, the embodiments of this application have the following main advantages: In this embodiment of the invention, by performing multimodal analysis on patients' medication needs, a structured demand query graph is generated, which can more comprehensively understand user questions, improve the accuracy and flexibility of question analysis, and generally perform multi-path search in a dynamic knowledge graph to generate a set of candidate answers. Based on the medication question-and-answer model and combined with the patient information set, the candidate answer set is evaluated in a multi-dimensional parallel manner, which can handle complex multi-hop queries, more comprehensively meet the diverse needs of patients, and make the generated answers better fit the patient's medication history, disease history and other personal characteristics, improve the personalization and practicality of the answers, and achieve personalized and accurate recommendations according to the actual situation of different patients.

[0018] In this embodiment of the invention, when performing multimodal parsing of patient medication needs, a preliminary semantic understanding of medication need information is first extracted based on the Claude large language model. Then, deep semantic parsing is performed on the preliminary semantic understanding to extract core medical entities, user intent, and limiting conditions from the deep semantic parsing. Finally, based on the relational chain associated with the query path, the inference rule set is indexed from the dynamic knowledge graph. The inference rule set is dynamically bound to the query graph to generate a structured demand query graph. This can handle the ambiguity and vagueness of language, thereby improving the accuracy of parsing. Moreover, the final structured demand query graph can clearly express the logical structure of patient needs, which facilitates interaction with the dynamic knowledge graph and meets the needs of personalized intelligent question answering for medication knowledge.

[0019] In this embodiment of the invention, during the construction of the dynamic knowledge graph, not only is entity extraction performed, but also attribute extraction and entity relation extraction are performed, thereby constructing a dynamic knowledge graph containing rich relations and attributes. Furthermore, based on a similarity algorithm, entity attributes are aligned to ensure semantic consistency and accuracy of knowledge from different sources, helping to eliminate knowledge redundancy and conflicts and improve the quality of the knowledge graph. At the same time, real-time learning and updating of the dynamic knowledge graph based on graph neural networks enables the knowledge graph to be continuously updated and optimized as new knowledge emerges. Moreover, the rich knowledge system in the dynamic knowledge graph allows the question-answering system to provide personalized medication recommendations based on the patient's specific situation.

[0020] In this embodiment of the invention, when aligning entity attributes of extracted entities based on a similarity algorithm, presetting a first similarity threshold and a second similarity threshold can effectively eliminate textual / semantic ambiguity, thereby avoiding problems such as drug confusion, dosage unit ambiguity, and missing contraindication associations. Furthermore, presetting the first and second similarity thresholds can balance the efficiency and accuracy of entity attribute alignment. For extracted character sets whose similarity does not exceed the first similarity threshold, a combined similarity algorithm is used for entity attribute alignment. Employing a hierarchical alignment strategy can handle more complex and ambiguous situations, ensuring that the most suitable alignment result is found even when the similarity is low.

[0021] In this embodiment of the invention, when aligning entity attributes of the extracted character set using a combined similarity algorithm, the comprehensive similarity between the extracted character set and the entity node is determined by combining textual similarity weights and semantic similarity weights. This allows for the evaluation of the similarity between the extracted character set and the entity node from multiple dimensions. Textual similarity focuses on character-level matching, while semantic similarity focuses on semantic-level association. The multi-dimensional evaluation used in this application more comprehensively reflects the similarity between the two. Furthermore, by setting a second similarity threshold, the extracted character set is only linked to the corresponding dynamic knowledge graph entity node when the comprehensive similarity exceeds this threshold. This high-confidence alignment strategy effectively reduces misalignment and improves the accuracy and reliability of the alignment results.

[0022] This invention provides a medication question-answering model and its training method. The medication question-answering model uses BioBERT as the initial model, enabling it to better understand and process medication-related questions and knowledge. This provides the model with powerful language understanding capabilities. Furthermore, the introduction of a multi-behavior learning method into the BioBERT model allows for the simultaneous learning of multiple behavioral features, such as medication interaction, intent recognition, and time constraints, improving the model's ability to understand complex problems. A multi-dimensional parallel evaluation layer is introduced, based on the TCN-GRU model architecture and combined with a cross-modal fusion mechanism, to generate parallel fused features. This allows for the evaluation of candidate answers from multiple dimensions, improving the model's comprehensive evaluation capability.

[0023] In this embodiment of the invention, dynamic knowledge graph interaction instructions are executed based on the demand query graph, and a depth-first search is used to perform hierarchical traversal of the dynamic knowledge graph. This enables efficient exploration of multiple paths within the knowledge graph. Furthermore, a combined similarity algorithm is employed to align entity nodes in the demand query graph with those in the dynamic knowledge graph, accurately identifying entity nodes with a similarity greater than a query threshold. By comprehensively considering textual and semantic similarity, the accuracy of alignment is improved. Finally, similar contextual information is linked based on the probability annotation results of candidate connection embedding vectors, and these are integrated into a candidate answer set. This generates a more comprehensive and accurate candidate answer set, improving the quality and reliability of the answers. Attached Figure Description

[0024] Figure 1 This is a schematic diagram illustrating the implementation process of the intelligent question-and-answer method for medication knowledge that combines knowledge graphs, provided by this invention.

[0025] Figure 2 A schematic diagram illustrating the process of implementing a method for multimodal analysis of patient medication needs is shown.

[0026] Figure 3 A schematic diagram illustrating the implementation process of the dynamic knowledge graph construction method is shown.

[0027] Figure 4 The diagram illustrates the implementation process of a method for aligning entity attributes of extracted entities based on a similarity algorithm.

[0028] Figure 5 The diagram illustrates the implementation process of aligning entity attributes of an extracted character set using a combined similarity algorithm.

[0029] Figure 6 A schematic diagram of the training process for the medication question-and-answer model is shown.

[0030] Figure 7 The diagram illustrates the implementation flow of a method for generating a candidate answer set by performing multi-path search in a dynamic knowledge graph.

[0031] Figure 8 The diagram illustrates the implementation process of a method for multi-dimensional parallel evaluation of candidate answer sets based on a medication question-and-answer model combined with patient information sets.

[0032] Figure 9 A schematic diagram of the structure of an intelligent question-and-answer system for medication knowledge that incorporates a knowledge graph is shown. Detailed Implementation

[0033] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.

[0034] Existing methods determine answers by matching regularized questions with a template library based on similarity. This only supports single-path matching and cannot handle complex multi-hop queries. Furthermore, it ignores individual patient characteristics, resulting in a lack of personalization in the determined answers and an inability to provide personalized and accurate recommendations based on different patients' specific situations. To address these issues, we propose a medication knowledge intelligent question-answering system and method incorporating knowledge graphs. In short, the method first acquires patients' medication needs in real-time, performs multimodal parsing of these needs, and generates a structured demand query graph. Then, a medication question-answering model based on a dynamic knowledge graph is pre-built. A medication knowledge set is crawled using web scraping technology. Using the demand query graph as an index, a multi-path search is performed within the dynamic knowledge graph to generate a candidate answer set. Finally, the candidate answer set is evaluated in parallel across multiple dimensions based on the medication question-answering model and the patient information set to generate the final medication question-answer text. In this embodiment of the invention, by performing multimodal analysis on patients' medication needs, a structured demand query graph is generated, which can more comprehensively understand user questions, improve the accuracy and flexibility of question analysis, and generally perform multi-path search in a dynamic knowledge graph to generate a set of candidate answers. Based on the medication question-and-answer model and combined with the patient information set, the candidate answer set is evaluated in a multi-dimensional parallel manner, which can handle complex multi-hop queries, more comprehensively meet the diverse needs of patients, and make the generated answers better fit the patient's medication history, disease history and other personal characteristics, improve the personalization and practicality of the answers, and achieve personalized and accurate recommendations according to the actual situation of different patients.

[0035] This invention provides an intelligent question-and-answer method for medication knowledge that combines knowledge graphs. Figure 1 The diagram illustrates the implementation process of an intelligent question-and-answer method for medication knowledge that incorporates knowledge graphs. Specifically, this method includes: S10: Real-time acquisition of patient medication needs, multimodal analysis of patient medication needs, and generation of structured demand query graph; S20: A medication question-and-answer model based on a dynamic knowledge graph is pre-built. A medication knowledge set is crawled using web crawling technology. The medication knowledge set is used to iteratively train the medication question-and-answer model. The dynamic knowledge graph is updated in real time based on a graph neural network. S30: Load the structured demand query graph, use the demand query graph as an index, and perform multi-path search in the dynamic knowledge graph to generate a set of candidate answers; S40: Obtain a set of candidate answers. Based on the medication question-and-answer model and the patient information set, perform multi-dimensional parallel evaluation of the candidate answer set to generate the final medication question-and-answer text.

[0036] In this embodiment of the invention, by performing multimodal analysis on patients' medication needs, a structured demand query graph is generated, which can more comprehensively understand user questions, improve the accuracy and flexibility of question analysis, and generally perform multi-path search in a dynamic knowledge graph to generate a set of candidate answers. Based on the medication question-and-answer model and combined with the patient information set, the candidate answer set is evaluated in a multi-dimensional parallel manner, which can handle complex multi-hop queries, more comprehensively meet the diverse needs of patients, and make the generated answers better fit the patient's medication history, disease history and other personal characteristics, improve the personalization and practicality of the answers, and achieve personalized and accurate recommendations according to the actual situation of different patients.

[0037] This invention provides a method for multimodal analysis of patient medication needs. Figure 2 A schematic diagram illustrating the implementation process of a method for multimodal analysis of patient medication needs is shown. The method for multimodal analysis of patient medication needs specifically includes: S101, Obtain medication demand information, extract preliminary semantic understanding of medication demand information based on the large language model Claude, and index the patient information set based on medication demand information; It should be noted that medication need information includes, but is not limited to, basic patient information (age, gender, weight, pregnancy status, allergy history, chronic disease history), current medication information, disease-related information, and specific questions regarding medication consultation (indication search, medication regimen search, contraindication search, adverse reaction search, medication recommendations, and dosage). In this embodiment, a large language model (such as Claude) is used to perform preliminary semantic understanding of the medication need information, which can quickly grasp the general intent and key information of the patient's questions, laying the foundation for subsequent in-depth analysis.

[0038] S102, the preliminary semantic understanding is mapped to the prompt word template, and deep semantic analysis is performed on the preliminary semantic understanding to extract the core medical entities, user intent, and limiting conditions from the deep semantic analysis. The core medical entities include drug names, disease names, biochemical indicators, special population types, and medical operation / surgery names. User intents include indication queries, medication regimen queries, contraindication queries, adverse reaction queries, medication recommendations and dosage, and personalized consultations. The limiting conditions include medication time conditions, combination conditions, personalized attribute conditions, and scenario constraint conditions. Mapping the preliminary semantic understanding to the prompt word template for deep semantic analysis can more accurately understand the semantic details of the patient's questions and avoid misunderstandings caused by linguistic ambiguity.

[0039] S103: Obtain the core medical entity, user intent, and limiting conditions; perform data alignment on the core medical entity, user intent, and limiting conditions; and map the aligned core medical entity, user intent, and limiting conditions to a predefined requirement structured template, automatically generating a standard requirement document containing the core medical entity, user intent, and limiting conditions. In this embodiment, data alignment of the core medical entity, user intent, and limiting conditions ensures semantic and structural consistency of data from different sources and formats, avoiding data conflicts and redundancy. Mapping the aligned data to the predefined requirement structured template and automatically generating a standard requirement document realizes the conversion from unstructured data to structured data, facilitating subsequent processing and querying.

[0040] S104: Load the requirements standard document and construct the skeleton nodes of the query graph based on it. These skeleton nodes include core entity nodes, intent type nodes, and limiting condition nodes. The relationship chains of these skeleton nodes in the query graph are then filled in using the deep semantic parsing results, forming a traversable query path. Constructing the skeleton nodes of the query graph based on the requirements standard document clarifies the core entities, intent types, and limiting conditions of the query, providing a clear framework for subsequent query path generation. Furthermore, filling the relationship chains of the skeleton nodes in the query graph with the deep semantic parsing results fully expresses the logical relationships and semantic connections in the patient's needs, forming a traversable query path and providing accurate navigation for efficient queries within the knowledge graph.

[0041] S105: Index the reasoning rule set from the dynamic knowledge graph based on the relational chain associated with the query path, dynamically bind the reasoning rule set with the query graph, generate a structured demand query graph, and compile the demand query graph into dynamic knowledge graph interaction instructions.

[0042] In this embodiment, the demand query graph is a graph-structured data structure used to accurately express medical intentions and constraints. It plays a core role as a "demand translator" in the intelligent question-and-answer system for medication knowledge. Nodes represent entities (such as drugs, diseases, biochemical indicators, etc.), and edges represent relationships between entities (such as the indication relationship between drugs and diseases, interactions between drugs, etc.). This graph structure can clearly express the logical relationships and semantic associations in patient needs.

[0043] In this embodiment of the invention, when performing multimodal parsing of patient medication needs, a preliminary semantic understanding of medication need information is first extracted based on the Claude large language model. Then, deep semantic parsing is performed on the preliminary semantic understanding to extract core medical entities, user intent, and limiting conditions from the deep semantic parsing. Finally, based on the relational chain associated with the query path, the inference rule set is indexed from the dynamic knowledge graph. The inference rule set is dynamically bound to the query graph to generate a structured demand query graph. This can handle the ambiguity and vagueness of language, thereby improving the accuracy of parsing. Moreover, the final structured demand query graph can clearly express the logical structure of patient needs, which facilitates interaction with the dynamic knowledge graph and meets the needs of personalized intelligent question answering for medication knowledge.

[0044] This invention provides a method for constructing dynamic knowledge graphs. Figure 3 The diagram illustrates the implementation flow of a dynamic knowledge graph construction method, which specifically includes: S201, presets the knowledge website address, knowledge database, constraints, and collection frequency for graph knowledge extraction. The crawler technology, combined with the context protocol of the large language model, calls the context protocol service to establish a communication and interaction channel with the knowledge website address and knowledge database. In this embodiment of the invention, the web crawling technology used can be focused crawlers, incremental crawlers, or distributed crawling technology. By combining web crawling technology with the context protocol invocation service of a large language model, a communication and interaction channel with the knowledge source can be automatically established, thereby realizing the automated extraction of knowledge from medical databases, drug instruction manuals, adverse drug reaction monitoring reports, medical literature, etc. This greatly reduces the workload of manual data collection and organization, and improves the efficiency of knowledge acquisition.

[0045] S202: Based on the communication interaction channel, the complete DOM structure is obtained from the knowledge website address and knowledge database. The complete DOM structure is identified and analyzed, and medical databases, drug instruction manuals, adverse drug reaction monitoring reports, and medical literature are extracted from it. In this embodiment, compared to traditional text crawling methods, obtaining the complete DOM structure from the knowledge website address and knowledge database, and then identifying and analyzing it, can extract the required information more comprehensively and accurately. It can better handle the complex structures of web pages and documents, ensuring that the extracted knowledge is more complete and accurate.

[0046] S203 performs entity extraction, attribute extraction, and entity relation extraction on pharmaceutical databases, drug instruction texts, adverse drug reaction monitoring reports, and medical literature, and performs entity attribute alignment on the extracted entities based on a similarity algorithm. S204 performs top-down linking and modeling based on entity attribute alignment results, stores the modeled entities and entity relationships in a graph database queried by graph structure, forming a structured dynamic knowledge graph, and learns and updates the dynamic knowledge graph in real time based on graph neural networks.

[0047] In this embodiment of the invention, during the construction of the dynamic knowledge graph, not only is entity extraction performed, but also attribute extraction and entity relation extraction are performed, thereby constructing a dynamic knowledge graph containing rich relations and attributes. Furthermore, based on a similarity algorithm, entity attributes are aligned to ensure semantic consistency and accuracy of knowledge from different sources, helping to eliminate knowledge redundancy and conflicts and improve the quality of the knowledge graph. At the same time, real-time learning and updating of the dynamic knowledge graph based on graph neural networks enables the knowledge graph to be continuously updated and optimized as new knowledge emerges. Moreover, the rich knowledge system in the dynamic knowledge graph allows the question-answering system to provide personalized medication recommendations based on the patient's specific situation.

[0048] This invention provides a method for aligning entity attributes of extracted entities based on a similarity algorithm. Figure 4 The diagram illustrates a flowchart of a method for aligning entity attributes of extracted entities based on a similarity algorithm. Specifically, the method includes: S301, Obtain entity or attribute extraction results, perform character statistics on the entity or attribute extraction results, and organize the character statistics results into an extracted character set. Preset a first similarity threshold and a second similarity threshold. It should be noted that the first similarity threshold can be 0.85-0.9, while the second similarity threshold can be 0.6-0.8. The first similarity threshold setting is suitable for high-frequency, fast matching scenarios, while the second similarity threshold setting is used for complex conflict deep analysis scenarios. By presetting the first and second similarity thresholds, textual / semantic ambiguity can be effectively eliminated, thereby avoiding problems such as drug confusion, dosage unit ambiguity, and missing contraindication associations.

[0049] S302, classify the extracted character set based on text similarity / semantic similarity, and compare the similarity between the extracted character set and entity nodes in the dynamic knowledge graph; S303, if the similarity between the extracted character set and the entity node in the dynamic knowledge graph exceeds the preset first similarity threshold, the extracted character set is linked and aligned to the corresponding entity node in the dynamic knowledge graph. S304. If the similarity between the extracted character set and the entity nodes in the dynamic knowledge graph does not exceed the preset first similarity threshold, the combined similarity algorithm is used to align the entity attributes of the extracted character set.

[0050] In this embodiment of the invention, when aligning entity attributes of extracted entities based on a similarity algorithm, presetting a first similarity threshold and a second similarity threshold can effectively eliminate textual / semantic ambiguity, thereby avoiding problems such as drug confusion, dosage unit ambiguity, and missing contraindication associations. Furthermore, presetting the first and second similarity thresholds can balance the efficiency and accuracy of entity attribute alignment. For extracted character sets whose similarity does not exceed the first similarity threshold, a combined similarity algorithm is used for entity attribute alignment. Employing a hierarchical alignment strategy can handle more complex and ambiguous situations, ensuring that the most suitable alignment result is found even when the similarity is low.

[0051] This invention provides a method for aligning entity attributes of extracted character sets using a combined similarity algorithm. Figure 5 This diagram illustrates the implementation process of a method for aligning entity attributes of an extracted character set using a combined similarity algorithm. The method specifically includes: S401, perform identification and analysis on the extracted character set to determine the text similarity weight and semantic similarity weight in the extracted character set; S402, based on the Jaccard coefficient, extracts the text similarity between the character set and the entity node; S403, uses cosine similarity to calculate the semantic similarity between the extracted character set and entity nodes; S404, Load the text similarity and semantic similarity between the extracted character set and the entity node, and combine the text similarity weight and semantic similarity weight to determine the comprehensive similarity between the extracted character set and the entity node; The text similarity between the extracted character set and the entity node is represented as follows: The semantic similarity between the extracted character set and entity nodes is represented as follows: The combined similarity between the extracted character set and entity nodes is represented as: in, , These represent the character sets to be extracted. With entity nodes Text similarity, semantic similarity between extracted character sets and entity nodes, Extracting character sets respectively With entity nodes The character embedding vector, These represent text similarity weights and semantic similarity weights, respectively. S405, determine whether the overall similarity between the extracted character set and the entity node exceeds the preset second similarity threshold; S406, if the overall similarity between the extracted character set and the entity node exceeds the preset second similarity threshold, the extracted character set will be linked and aligned to the corresponding dynamic knowledge graph entity node.

[0052] In this embodiment of the invention, when aligning entity attributes of the extracted character set using a combined similarity algorithm, the comprehensive similarity between the extracted character set and the entity node is determined by combining textual similarity weights and semantic similarity weights. This allows for the evaluation of the similarity between the extracted character set and the entity node from multiple dimensions. Textual similarity focuses on character-level matching, while semantic similarity focuses on semantic-level association. The multi-dimensional evaluation used in this application more comprehensively reflects the similarity between the two. Furthermore, by setting a second similarity threshold, the extracted character set is only linked to the corresponding dynamic knowledge graph entity node when the comprehensive similarity exceeds this threshold. This high-confidence alignment strategy effectively reduces misalignment and improves the accuracy and reliability of the alignment results.

[0053] This invention provides a method for training a medication question-and-answer model. Figure 6 The diagram illustrates the implementation process of a medication question-and-answer model training method, which specifically includes: S501 uses web crawling technology to extract a drug knowledge set from a dynamic knowledge graph, preprocesses the drug knowledge set into tensor data that can be processed by the drug question-and-answer model, and divides the drug knowledge set into a training set and a test set, wherein the ratio of the training set to the test set can be 4:1. S502, a pre-built medication question-answering model, uses the BioBERT model as the initial model. The initial model also includes an input layer and an output layer. A multi-behavior learning method is introduced into the BioBERT model. A multi-dimensional parallel evaluation layer is introduced between the BioBERT model and the output layer. The multi-dimensional parallel evaluation layer is based on the TCN-GRU model and introduces a cross-modal fusion mechanism into the TCN-GRU model. The TCN-GRU model is used to generate parallel fusion features. S503: Preset the global model parameters and training rounds of the medication question-and-answer model, initialize the global model parameters, and send the initialized global model parameters to the medication question-and-answer model. The training rounds can be 200-250. S504, Load the training set, use the training set to iteratively train the medication question-and-answer model, optimize the hyperparameters of the medication question-and-answer model based on the online learning mechanism, and update the optimized medication question-and-answer model; When optimizing the hyperparameters of the medication question-answering model based on an online learning mechanism, the online learning mechanism is represented as follows: in, These represent the updated hyperparameters and the hyperparameters at the current time step, respectively. Let these represent the learning rate and gradient operator, respectively. Indicates sample Evaluation results in parallel with the sample The likelihood probability, These are regularization functions for the regularization coefficient and hyperparameter, respectively. Indicates the sample's resistance to perturbation factor; S505: Obtain the test set, use the test set as input, execute the medication question-and-answer model, and output the test results; S506, determine whether the test result meets the preset accuracy threshold, wherein the accuracy threshold can be 0.9-0.93; S507: If the test results meet the preset accuracy threshold, output the converged medication question-and-answer model.

[0054] If the test results do not meet the preset accuracy threshold, return to S504 and continue iteratively training the model until convergence.

[0055] This invention provides a medication question-answering model and its training method. The medication question-answering model uses BioBERT as the initial model, enabling it to better understand and process medication-related questions and knowledge. This provides the model with powerful language understanding capabilities. Furthermore, the introduction of a multi-behavior learning method into the BioBERT model allows for the simultaneous learning of multiple behavioral features, such as medication interaction, intent recognition, and time constraints, improving the model's ability to understand complex problems. A multi-dimensional parallel evaluation layer is introduced, based on the TCN-GRU model architecture and combined with a cross-modal fusion mechanism, to generate parallel fusion features. This allows for the evaluation of candidate answers from multiple dimensions, improving the model's comprehensive evaluation capabilities. Moreover, the model can generate personalized medication recommendations based on the patient's specific information, enhancing the service's relevance and practicality.

[0056] This invention provides a method for generating a candidate answer set by performing multi-path search in a dynamic knowledge graph. Figure 7 The diagram illustrates the implementation flow of a method for generating a candidate answer set through multi-path search in a dynamic knowledge graph. The method specifically includes: S601, obtain the demand query graph, execute dynamic knowledge graph interaction instructions based on the demand query graph, and perform hierarchical traversal of the dynamic knowledge graph based on depth-first search (DFS). S602, a combined similarity algorithm is used to align the entity nodes in the demand query graph with the entity nodes in the dynamic knowledge graph, extract the entity nodes in the dynamic knowledge graph whose similarity to the demand query graph is greater than the query threshold, and set the entity nodes whose similarity to the demand query graph is greater than the query threshold as candidate entity nodes. S603, the graph neural network reads candidate entity nodes in the dynamic knowledge graph, performs implicit knowledge inference on the candidate entity nodes based on the index inference rule set, and converts the implicit knowledge inference of the candidate entity nodes into candidate connection embedding vectors; S604 utilizes Cypher to dynamically match the demand query graph and candidate entity nodes, extracts candidate connection embedding vectors of candidate entity nodes in the knowledge graph, and performs probability labeling of candidate connection embedding vectors based on Conditional Random Field (CRF). S605 links similar context information based on the probability labeling results of candidate connection embedding vectors, integrates the connection embedding vectors and similar context information into a candidate answer set, and outputs the candidate answer set.

[0057] In this embodiment of the invention, dynamic knowledge graph interaction instructions are executed based on the demand query graph, and a depth-first search is used to perform hierarchical traversal of the dynamic knowledge graph. This enables efficient exploration of multiple paths within the knowledge graph. Furthermore, a combined similarity algorithm is employed to align entity nodes in the demand query graph with those in the dynamic knowledge graph, accurately identifying entity nodes with a similarity greater than a query threshold. By comprehensively considering textual and semantic similarity, the accuracy of alignment is improved. Finally, similar contextual information is linked based on the probability annotation results of candidate connection embedding vectors, and these are integrated into a candidate answer set. This generates a more comprehensive and accurate candidate answer set, improving the quality and reliability of the answers.

[0058] This invention provides a method for multi-dimensional parallel evaluation of candidate answer sets based on a medication question-and-answer model combined with patient information sets. Figure 8 This document illustrates a flowchart of a method for multi-dimensional parallel evaluation of candidate answer sets based on a medication question-and-answer model combined with patient information sets. The method specifically includes: S701: Obtain the patient information set and candidate answer set. Based on the BioBERT model, learn multiple behavioral characteristics of the patient information set and candidate answer set, specifically learning the medication regimen dimension features, intent dimension features, medication time dimension features, and scenario constraint dimension features of the candidate answer set. This multi-dimensional assessment comprehensively considers the patient's specific needs and constraints, ensuring that the generated medication recommendations are more closely aligned with the patient's actual situation. S702, constrained by the patient information set, adaptively adjusts the weight coefficients of the medication regimen dimension features, intent dimension features, medication time dimension features, and scenario constraint dimension features, and outputs the weight coefficients of the medication regimen dimension features, intent dimension features, medication time dimension features, and scenario constraint dimension features. Moreover, by using the patient information set as a constraint, the adaptive adjustment of the weight coefficients of each dimension features can dynamically adjust the importance of each dimension according to the specific information of the patient, ensuring that the evaluation results are more personalized and accurate. The S703, TCN-GRU model performs cross-modal fusion processing on the features of medication plan dimension, intent dimension, medication time dimension, and scenario constraint dimension based on the cross-modal fusion mechanism, and outputs a dynamic fusion score for the candidate answer set; The dynamic fusion score of the candidate answer set is calculated using the following formula: in, This represents the dynamic fusion score of the candidate answer set. Indicates the number of feature dimensions. This indicates cross-attention fusion. This is the cross-attention fusion value. These represent the weighting coefficients for patient-adaptive medication regimens, intent, medication time, or scenario constraints. These represent the confidence decay factor, the confidence level based on dynamic knowledge graph embedding, and the personalized enhancement value based on the patient information set, respectively. These are, respectively, the overall feature vector of the candidate answer set, the feature vector of the feature dimension of the candidate answer set, and the learnable parameter matrix. These represent the quantity of supporting evidence and the freshness of the evidence, respectively. Embedding of the answer subgraph Represents the intersection-union ratio function. Indexed by feature dimensions, These represent the clinical characteristics and patient information characteristics of the candidate answers, respectively. S704, obtain the dynamic fusion score. With the objective confidence level of the number of supporting evidence, the authority of the data source, and the freshness of the evidence as constraints, adjust the dynamic fusion score of the candidate answer set to obtain the fusion correction score. In this embodiment, adjusting the dynamic fusion score with the objective confidence level of the number of supporting evidence, the authority of the data source, and the freshness of the evidence as constraints can ensure that the evaluation results are not only based on the internal evaluation of the model, but also combined with external objective evidence, thereby improving the reliability and credibility of the results. S705, rank the fusion correction scores, and use the candidate answer set with the highest fusion correction score as the final medication question and answer text that matches the patient information features.

[0059] On the other hand, embodiments of the present invention also provide an intelligent question-and-answer system for medication knowledge that incorporates knowledge graphs. Figure 9 A schematic diagram of a knowledge graph-based intelligent question-and-answer system for medication knowledge is shown. This system specifically includes: The query graph generation module 100 is used to obtain patients' medication needs in real time, perform multimodal parsing of patients' medication needs, and generate a structured demand query graph. The graph construction module 200 is used to pre-build a medication question-and-answer model based on a dynamic knowledge graph. It crawls a medication knowledge set based on web crawling technology, uses the medication knowledge set to iteratively train the medication question-and-answer model, and learns and updates the dynamic knowledge graph in real time based on a graph neural network. The candidate answer recommendation module 300 is used to load a structured demand query graph, and use the demand query graph as an index to perform multi-path search in the dynamic knowledge graph to generate a set of candidate answers; The question-and-answer text generation module 400 is used to obtain a set of candidate answers. Based on the medication question-and-answer model and combined with the patient information set, the candidate answer set is evaluated in a multi-dimensional parallel manner to generate the final medication question-and-answer text.

[0060] In this embodiment, the query graph generation module 100 includes: The preliminary understanding unit 110 is used to obtain medication demand information. It extracts preliminary semantic understanding of medication demand information based on the large language model Claude, and indexes the patient information set based on the medication demand information. The deep understanding unit 120 is used to map the preliminary semantic understanding to the prompt word template, perform deep semantic parsing on the preliminary semantic understanding, and extract the core medical entities, user intent and limiting conditions from the deep semantic parsing. The standard document generation unit 130 is used to obtain core medical entities, user intentions and limiting conditions, perform data alignment on the core medical entities, user intentions and limiting conditions, and map the data-aligned core medical entities, user intentions and limiting conditions to a predefined requirement structure template, and automatically generate a requirement standard document containing core medical entities, user intentions and limiting conditions. The requirement query graph construction unit 140 is used to load the requirement standard document, construct the skeleton nodes of the query graph based on the requirement standard document, and fill the relationship chain of the skeleton nodes in the query graph with the deep semantic parsing results to form a traversable query path. Based on the relationship chain associated with the query path, the inference rule set is indexed from the dynamic knowledge graph, the inference rule set is dynamically bound to the query graph to generate a structured requirement query graph, and the requirement query graph is compiled into dynamic knowledge graph interaction instructions.

[0061] It should be noted that the intelligent question-and-answer system for medication knowledge combined with knowledge graphs provided in this embodiment of the invention corresponds to the intelligent question-and-answer method for medication knowledge combined with knowledge graphs described above. The explanations, examples, and beneficial effects of its relevant content can be referred to the corresponding content in the intelligent question-and-answer method for medication knowledge combined with knowledge graphs, and will not be repeated here.

[0062] In summary, this invention provides an intelligent question-answering system and method for medication knowledge that incorporates knowledge graphs. In the embodiments of this invention, by performing multimodal analysis of patients' medication needs to generate a structured demand query graph, it is possible to more comprehensively understand user questions, improve the accuracy and flexibility of question analysis, and generally perform multi-path search in a dynamic knowledge graph to generate a set of candidate answers. Based on the medication question-answering model and combined with the patient information set, the candidate answer set is evaluated in parallel from multiple dimensions, which can handle complex multi-hop queries, more comprehensively meet the diverse needs of patients, and make the generated answers better fit the patient's medication history, disease history and other personal characteristics, improve the personalization and practicality of the answers, and achieve personalized and accurate recommendations based on the actual situation of different patients.

[0063] It should be noted that, for the sake of simplicity, the foregoing embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to the present invention. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0064] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit the scope of protection of the invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on these embodiments, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art can still combine, add, delete, or otherwise adjust the features of the various embodiments of the present invention according to the circumstances without conflict or creative effort, thereby obtaining different technical solutions that do not fundamentally depart from the concept of the present invention. These technical solutions also fall within the scope of protection of the present invention.

Claims

1. A drug knowledge intelligent question-and-answer method combining knowledge graphs, characterized in that: The method includes: Real-time acquisition of patients' medication needs, multimodal analysis of patients' medication needs, and generation of structured demand query graphs; A medication question-answering model based on a dynamic knowledge graph is pre-built. A medication knowledge set is crawled using web crawling technology. The medication knowledge set is used to iteratively train the medication question-answering model. The dynamic knowledge graph is updated in real time based on graph neural network. Load the structured demand query graph, use the demand query graph as an index, and perform multi-path search in the dynamic knowledge graph to generate a set of candidate answers; A candidate answer set is obtained, and the candidate answer set is evaluated in parallel across multiple dimensions based on the medication question-and-answer model and the patient information set to generate the final medication question-and-answer text.

2. The intelligent question-and-answer method for medication knowledge combining knowledge graphs as described in claim 1, characterized in that: The method for multimodal analysis of patient medication needs includes: Obtain medication demand information, extract preliminary semantic understanding of medication demand information based on the large language model Claude, and index patient information set based on medication demand information; The initial semantic understanding is mapped to the prompt word template, and deep semantic parsing is performed on the initial semantic understanding to extract the core medical entities, user intent, and limiting conditions from the deep semantic parsing. The core medical entities include drug name, disease name, biochemical indicators, special population type, and medical operation / surgery name. The user intent includes indication query, medication plan query, medication contraindication query, adverse drug reaction query, medication recommendation and usage dosage, and personalized consultation. The limiting conditions include medication time conditions, interaction conditions, personalized conditions, and scenario constraint conditions. The system acquires core medical entities, user intents, and constraints; performs data alignment on these entities; maps the aligned entities to a predefined structured requirements template; and automatically generates a standard requirements document containing the core medical entities, user intents, and constraints. Load the requirements standard document, construct the skeleton nodes of the query graph based on the requirements standard document, where the skeleton nodes include core entity nodes, intent type nodes and limiting condition nodes, and fill the skeleton node relationship chain in the query graph with the deep semantic parsing results to form a traversable query path. Based on the relational chain associated with the query path, the reasoning rule set is indexed from the dynamic knowledge graph, the reasoning rule set is dynamically bound to the query graph to generate a structured demand query graph, and the demand query graph is compiled into dynamic knowledge graph interaction instructions.

3. The intelligent question-and-answer method for medication knowledge combining knowledge graphs as described in claim 1, characterized in that: The dynamic knowledge graph construction method includes: The system pre-determines the knowledge website address, knowledge database, constraints, and collection frequency for knowledge extraction from the graph. It then uses web crawling technology combined with the context protocol of the large language model to call the context protocol service and establish a communication and interaction channel with the knowledge website address and knowledge database. Based on the communication interaction channel, the complete DOM structure is obtained from the knowledge website address and knowledge database. The complete DOM structure is identified and analyzed, and medical databases, drug instruction texts, adverse drug reaction monitoring reports, and medical literature are extracted from the complete DOM structure. Entity extraction, attribute extraction, and entity relation extraction are performed on pharmaceutical databases, drug instruction texts, adverse drug reaction monitoring reports, and medical literature. The extracted entities are then aligned with their attributes based on a similarity algorithm. Based on the entity attribute alignment results, top-down linking and modeling are performed. The modeled entities and entity relationships are stored in a graph database queried by graph structure, forming a structured dynamic knowledge graph. The dynamic knowledge graph is then learned and updated in real time based on graph neural networks.

4. The intelligent question-and-answer method for medication knowledge combining knowledge graphs as described in claim 3, characterized in that: The method for aligning entity attributes of extracted entities based on a similarity algorithm includes: Obtain entity or attribute extraction results, perform character statistics on the entity or attribute extraction results, organize the character statistics results into an extracted character set, and preset a first similarity threshold and a second similarity threshold; The extracted character set is classified based on text similarity / semantic similarity, and the similarity between the extracted character set and entity nodes in the dynamic knowledge graph is compared. If the similarity between the extracted character set and the entity node in the dynamic knowledge graph exceeds the preset first similarity threshold, the extracted character set will be linked and aligned to the corresponding entity node in the dynamic knowledge graph. If the similarity between the extracted character set and the entity nodes in the dynamic knowledge graph does not exceed the preset first similarity threshold, a combined similarity algorithm is used to align the entity attributes of the extracted character set.

5. The intelligent question-and-answer method for medication knowledge combining knowledge graphs as described in claim 4, characterized in that: The method for aligning entity attributes of the extracted character set using a combined similarity algorithm includes: The extracted character set is identified and analyzed to determine the text similarity weight and semantic similarity weight in the extracted character set; The similarity between the extracted character set and entity nodes is measured using the Jaccard coefficient. Cosine similarity is used to calculate the semantic similarity between the extracted character set and entity nodes; Load the text similarity and semantic similarity between the extracted character set and the entity node, and combine the text similarity weight and semantic similarity weight to determine the comprehensive similarity between the extracted character set and the entity node; Determine whether the overall similarity between the extracted character set and the entity node exceeds a preset second similarity threshold. If the overall similarity between the extracted character set and the entity node exceeds the preset second similarity threshold, link the extracted character set to the corresponding dynamic knowledge graph entity node.

6. The intelligent question-and-answer method for medication knowledge combining knowledge graphs as described in claim 1, characterized in that: The method for training the medication question-and-answer model includes: Based on web crawling technology, a set of medication knowledge is crawled from a dynamic knowledge graph. The set of medication knowledge is preprocessed and converted into tensor data that can be processed by the medication question-answering model. The set of medication knowledge is divided into a training set and a test set. A pre-built medication question-answering model is constructed, which uses the BioBERT model as the initial model. The initial model also includes an input layer and an output layer. A multi-behavior learning method is introduced into the BioBERT model. A multi-dimensional parallel evaluation layer is introduced between the BioBERT model and the output layer. The multi-dimensional parallel evaluation layer is based on the TCN-GRU model and introduces a cross-modal fusion mechanism into the TCN-GRU model. The TCN-GRU model is used to generate parallel fusion features. The global model parameters and training rounds of the medication question-and-answer model are preset, and the global model parameters are initialized. The initialized global model parameters are then sent to the medication question-and-answer model. Load the training set, iteratively train the medication question-answering model using the training set, optimize the hyperparameters of the medication question-answering model based on the online learning mechanism, and update the optimized medication question-answering model. Obtain the test set, use the test set as input, execute the medication question-and-answer model, output the test results, determine whether the test results meet the preset accuracy threshold, and if the test results meet the preset accuracy threshold, output the converged medication question-and-answer model.

7. The intelligent question-and-answer method for medication knowledge combining knowledge graphs as described in claim 6, characterized in that: The method for generating a candidate answer set by performing multi-path search in a dynamic knowledge graph includes: Obtain the demand query graph, execute dynamic knowledge graph interaction commands based on the demand query graph, and perform hierarchical traversal of the dynamic knowledge graph based on depth-first search (DFS). A combined similarity algorithm is used to align entity nodes in the demand query graph with those in the dynamic knowledge graph. Entity nodes in the dynamic knowledge graph whose similarity to the demand query graph is greater than the query threshold are extracted and set as candidate entity nodes. The graph neural network reads candidate entity nodes from the dynamic knowledge graph, performs implicit knowledge inference on the candidate entity nodes based on the index inference rule set, and converts the implicit knowledge inference of the candidate entity nodes into candidate connection embedding vectors. Cypher is used to dynamically match the demand query graph and candidate entity nodes, extract the candidate connection embedding vectors of candidate entity nodes in the knowledge graph, and label the candidate connection embedding vectors probabilistically based on the Conditional Random Field (CRF). Based on the probability annotation results of candidate connection embedding vectors, link similar context information, and integrate the connection embedding vectors and similar context information into a candidate answer set, and output the candidate answer set.

8. The intelligent question-and-answer method for medication knowledge combining knowledge graphs as described in claim 7, characterized in that: The method for multi-dimensional parallel evaluation of candidate answer sets based on a medication question-and-answer model combined with patient information sets includes: Obtain patient information set and candidate answer set, and learn multiple behavioral characteristics of patient information set and candidate answer set based on BioBERT model, respectively learn the medication plan dimension feature, intention dimension feature, medication time dimension feature, and scenario constraint dimension feature of candidate answer set; Using the patient information set as a constraint, the weight coefficients of the medication regimen dimension feature, intent dimension feature, medication time dimension feature, and scenario constraint dimension feature are adaptively adjusted, and the weight coefficients of the medication regimen dimension feature, intent dimension feature, medication time dimension feature, and scenario constraint dimension feature are output. The TCN-GRU model performs cross-modal fusion processing on the features of medication plan dimension, intent dimension, medication time dimension, and scenario constraint dimension based on the cross-modal fusion mechanism, and outputs a dynamic fusion score for the candidate answer set; The dynamic fusion score is obtained and adjusted based on the objective confidence level of the number of supporting evidence, the authority of the data source, and the freshness of the evidence, to obtain the fusion correction score. The fusion correction scores are ranked, and the candidate answer set with the highest fusion correction score is used as the final medication question and answer text that matches the patient information features.

9. A drug knowledge intelligent question-and-answer system combining knowledge graphs, used to implement the drug knowledge intelligent question-and-answer method combining knowledge graphs as described in any one of claims 1-8, characterized in that: The intelligent question-and-answer system for medication knowledge that incorporates knowledge graphs includes: The query graph generation module is used to obtain patients' medication needs in real time, perform multimodal parsing of patients' medication needs, and generate a structured demand query graph. The graph construction module is used to pre-build a medication question-and-answer model based on a dynamic knowledge graph. It crawls a medication knowledge set based on web crawling technology, uses the medication knowledge set to iteratively train the medication question-and-answer model, and learns and updates the dynamic knowledge graph in real time based on a graph neural network. The candidate answer recommendation module is used to load a structured demand query graph, and use the demand query graph as an index to perform multi-path search in the dynamic knowledge graph to generate a set of candidate answers; The question-and-answer text generation module is used to obtain a set of candidate answers. Based on the medication question-and-answer model and combined with the patient information set, the candidate answer set is evaluated in a multi-dimensional parallel manner to generate the final medication question-and-answer text.

10. The intelligent question-and-answer system for medication knowledge combining knowledge graphs as described in claim 9, characterized in that: The query graph generation module includes: The preliminary understanding unit is used to obtain medication demand information. It extracts preliminary semantic understanding of medication demand information based on the large language model Claude, and indexes the patient information set based on the medication demand information. The deep understanding unit is used to map the initial semantic understanding to the prompt word template, perform deep semantic parsing on the initial semantic understanding, and extract the core medical entities, user intent, and limiting conditions from the deep semantic parsing. The standard document generation unit is used to obtain core medical entities, user intents, and limiting conditions, perform data alignment on the core medical entities, user intents, and limiting conditions, and map the data-aligned core medical entities, user intents, and limiting conditions to a predefined requirement structure template, automatically generating a standard requirement document containing the core medical entities, user intents, and limiting conditions. The requirement query graph construction unit is used to load the requirement standard document, construct the skeleton nodes of the query graph based on the requirement standard document, and fill the relationship chain of the skeleton node in the query graph with the deep semantic parsing results to form a traversable query path. Based on the relationship chain associated with the query path, the unit indexes the reasoning rule set from the dynamic knowledge graph, dynamically binds the reasoning rule set to the query graph, generates a structured requirement query graph, and compiles the requirement query graph into dynamic knowledge graph interaction instructions.

Citation Information

Patent Citations

  • Intelligent question answering method, system and knowledge graph updating system based on knowledge graph

    CN111966793B

Cited By

  • Interaction quality guarantee method for improving question and answer reliability of large language model

    CN121388123A