Drug safety large model method and system based on medical knowledge graph
By constructing a medical knowledge graph and a dual-way evidence retrieval strategy using large language models, automated drug safety assessment is achieved, and the problem that drug safety judgments in the existing technology rely on professionals is solved, which improves the efficiency and accuracy of the evaluation.
Patent Information
- Application Number
- CN202510089911.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-02-28
AI Technical Summary
In the prior art, drug safety judgments rely on professionals' clinical experience and literature screening, and lack of automated and efficient evidence integration methods, resulting in the accuracy of drug use decisions being affected.
Using a large language model method based on medical knowledge graph, automated drug safety assessment is achieved by collecting literature data from public medical databases, constructing medical knowledge graphs, and using dual-way evidence retrieval strategies to generate drug safety conclusions.
It improves the efficiency and accuracy of drug safety assessment, reduces the work burden of professionals, and uses the evidence retrieval and reasoning ability of large language models to enhance the credibility of answers and avoids "illusion" problems.
Smart Images

Figure CN119541902A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medication safety retrieval, and more specifically, to a medication safety big model method and system based on medical knowledge graph. Background Art
[0002] In actual medical scenarios, pharmacists, doctors and other relevant practitioners mainly rely on clinical experience to judge drug safety. There is a lack of sufficient evidence support in the clinical decision-making stage, which may affect the accuracy of medication decisions. Similarly, for ordinary patients, due to the lack of relevant professional knowledge, the judgment of drug safety often comes from online searches, and there is a lack of reliable and convenient sources of drug safety information. At present, the integration of drug safety evidence mainly relies on staff with relevant medical knowledge. By collecting a large number of authoritative literature and screening and filtering the literature based on relevant medical knowledge, a high-quality literature data set is obtained, and then the literature data set is integrated based on medical statistical methods to finally obtain the safety conclusion of the drug. However, the above scheme is highly dependent on the participation of staff with relevant medical knowledge, which increases the workload of practitioners.
[0003] With the development of computer hardware, artificial intelligence services based on large language models have received more and more attention. In the field of natural language processing, ordinary patients can also easily obtain safety knowledge of relevant drugs through large language models. However, large language models currently generally have the problem of "answering irrelevant questions", that is, the content generated by large language models may conflict with facts or contain completely non-existent content, and the mode of large language models using internal knowledge for reasoning cannot guarantee the correctness of evidence, which seriously reduces its reliability in the medical industry. Therefore, it is imperative to build large models in the medical field. Summary of the invention
[0004] The present invention provides a method and system for a large model of medication safety based on a medical knowledge graph to solve the technical problems in the above-mentioned background technology.
[0005] The present invention provides a drug safety big model method based on medical knowledge graph, comprising the following steps: Step S101, collecting medical literature data from a public medical database and parsing it into text in markdown format using a parsing tool; Step S102, slicing the text in the markdown format according to the chapters to obtain text slices, and judging whether the number of characters in the text slices is greater than or equal to a preset threshold, segmenting the text slices according to the delimiter priority until the number of characters in the segment is less than the preset threshold; if the length of the text slice is less than the preset threshold, merging adjacent slices until the preset threshold is reached, and using all processed segments as the basic text library; Step S103, constructing a medical knowledge graph based on the basic text library and the large language model; The medical knowledge graph includes: entities, their features, and the connections between them; An entity consists of the entity name, entity type, and entity description information; Types of entities include: drugs, diseases, and symptoms; The characteristics of entities are represented by word vectors, which are extracted by medical language models. The connection relationship between entities consists of source entity, target entity and relationship description; Step S104, obtaining the evidence chain through a local combined with online two-way evidence retrieval strategy according to the input question; The chain of evidence is represented by the locally retrieved chain of evidence or the online retrieved chain of evidence; The evidence chain retrieved locally consists of entity evidence and relation evidence in K paths; Entity evidence consists of the name of the entity, the type of the entity, and the description of the entity; Relation evidence consists of source entities, target entities, and relationship descriptions; The evidence chain retrieved online consists of M web page evidences; Web page evidence consists of web page title and web page information; Step S105, generating a drug safety conclusion through a large language model based on the input question and the evidence chain; Conclusions on drug safety include: current evidence shows that the drug is unsafe, current evidence shows that the drug will not cause adverse reactions, and there is no clear evidence to show whether it is safe.
[0006] Furthermore, the preset threshold, the number K of entity evidence and relationship evidence, and the number M of web page evidence are all custom parameters.
[0007] Furthermore, the order of delimiter priority from largest to smallest is paragraph separator, period, semicolon, colon, comma, where the paragraph separator is a tag beginning with a pound sign in markdown.
[0008] Furthermore, a medical knowledge graph is constructed based on the basic text library and the large language model, including the following steps: Step S201, extracting entities from a basic text library through a large language model; The format of entity is as follows: ("entity"<|><entity_name> <|><entity_type> <|><entity_description> ); entity_name indicates the name of the entity, entity_type indicates the type of the entity, and entity_description indicates the description of the entity. If the name of the entity is in English, it is returned in the format of "English entity name (Chinese entity name)". If the English entity name is uncertain, only the English entity name is returned. If the type of the entity cannot be identified, "Unknown Entity" is returned. If the description of the entity cannot be identified, an empty string is directly returned. Step S202, extracting the connection relationship between entities in the basic text library through the large language model; The format of the connection relationship between entities is as follows: ("relationship"<|><source_entity> <|><target_entity> <|><relationship_description> <|><relationship_score> ); source_entity represents the source entity, target_entity represents the target entity, relationship_description represents the relationship description, relationship_score represents the strength of the connection relationship, and the value range is between 0 and 100. The larger the value of the connection relationship strength, the stronger the association between the two entities. ## is used as the separator for multiple relationships. After the extraction is completed, it ends with <|COMPLETE|>; Step S203, deduplication of entities is performed using a two-stage merging strategy; The cosine similarity between the features of each entity and the features of other entities is calculated, and entities with a similarity threshold greater than or equal to the similarity threshold are selected as the candidate entity set. Entities that are completely equivalent to the current entity are extracted through the large language model and form a cluster with the current entity. Clusters with intersections are then merged, and the entity with the highest frequency is selected as the merged entity node.
[0009] Furthermore, the medical language model is BioBERT.
[0010] Furthermore, according to the input question, the evidence chain is obtained through a local combined with online two-way evidence retrieval strategy, including the following steps: Step S301, initialize the current iteration number to 0, and obtain K entities as starting nodes through the large language model according to the input question; The drug entity in the input question is extracted through the large language model, and the cosine similarity between the characteristics of the drug entity and the characteristics of all entities in the constructed medical knowledge graph is calculated. The first N entities are selected as the candidate entity set, and then the K most relevant entity nodes are selected from the candidate entity set as the starting nodes through the large language model, where N is a custom parameter; Step S302, obtaining all adjacent nodes and connection relationships of the starting node from the constructed medical knowledge graph to form a set of candidate search paths, and then selecting K paths that are most relevant to the input question from the candidate search paths through the large language model; Step S303, extracting entity evidence and relationship evidence from the K paths, and judging through the large language model whether the entity evidence and relationship evidence are sufficient to answer the input question, then outputting the entity evidence and relationship evidence as the local search evidence chain, otherwise proceeding to step S304; Step S304: if the current number of iterations is greater than or equal to the preset maximum number of path explorations, then the process proceeds to step S305; otherwise, the current number of iterations is incremented by 1, and the process returns to step S302 to continue execution; The preset maximum number of path explorations is a custom parameter; Step S305, obtaining the titles and information of the first M web pages as web page evidence through online search according to the input question.
[0011] Furthermore, while generating the drug safety conclusion through the large language model, the locally retrieved evidence chain or the online retrieved evidence chain will be returned to the user.
[0012] The present invention provides a medication safety model system based on a medical knowledge graph, comprising: The data collection module is used to collect medical literature data from public medical databases and parse it into text in markdown format through parsing tools; A basic text library construction module is used to slice the text in markdown format according to chapters to obtain text slices, and to determine if the number of characters in the text slice is greater than or equal to a preset threshold, and then to segment it in descending order of delimiter priority until the number of characters in the segment is less than the preset threshold, and all the segments less than the preset threshold are used as the basic text library; Medical knowledge graph construction module, which is used to build a medical knowledge graph based on the basic text library combined with a large language model; An evidence chain retrieval module is used to obtain the evidence chain according to the input question through a local combined with online two-way evidence retrieval strategy; The drug safety conclusion generation module is used to generate drug safety conclusions based on the input questions and the evidence chain through a large language model.
[0013] The beneficial effects of the present invention are as follows: the present invention realizes automatic construction of a medical knowledge graph through a large language model, which is more efficient than the traditional drug safety evaluation model with the full participation of professionals, and generates drug safety conclusions through comprehensive evidence retrieval of the medical knowledge graph and the reasoning ability of the large language model, thereby solving the problems of low credibility of answers and model "hallucination" caused by lack of evidence in medical scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is a flow chart of a drug safety big model method based on medical knowledge graph of the present invention; Figure 2 It is a flowchart of the present invention for constructing a medical knowledge graph based on a basic text library combined with a large language model; Figure 3 It is a flow chart of the present invention for obtaining an evidence chain through a local combined with online two-way evidence retrieval strategy according to an input question; Figure 4 It is a schematic diagram of a large model system for medication safety based on a medical knowledge graph of the present invention.
[0015] In the figure: data collection module 401, basic text library construction module 402, medical knowledge graph construction module 403, evidence chain retrieval module 404, drug safety conclusion generation module 405. DETAILED DESCRIPTION
[0016] The subject matter described herein will now be discussed with reference to example embodiments. It should be understood that the discussion of these embodiments is only to enable those skilled in the art to better understand and implement the subject matter described herein, and the functions and arrangements of the elements discussed may be changed without departing from the scope of protection of the contents of this specification. Each example may omit, replace or add various processes or components as needed. In addition, the features described relative to some examples may also be combined in other examples.
[0017] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in one or more embodiments of the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in one or more embodiments of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0018] like Figure 1 to Figure 4 As shown, a drug safety big model method based on medical knowledge graph includes the following steps: Step S101, collecting medical literature data from a public medical database and parsing it into text in markdown format using a parsing tool; Step S102, slicing the text in the markdown format according to the chapters to obtain text slices, and judging whether the number of characters in the text slices is greater than or equal to a preset threshold, segmenting the text slices according to the delimiter priority until the number of characters in the segment is less than the preset threshold; if the length of the text slice is less than the preset threshold, merging adjacent slices until the preset threshold is reached, and using all processed segments as the basic text library; Step S103, constructing a medical knowledge graph based on the basic text library and the large language model; The medical knowledge graph includes: entities, their features, and the connections between them; An entity consists of the entity name, entity type, and entity description information; Types of entities include: drugs, diseases, and symptoms; The characteristics of entities are represented by word vectors, which are extracted by medical language models. The connection relationship between entities consists of source entity, target entity and relationship description; Step S104, obtaining the evidence chain through a local combined with online two-way evidence retrieval strategy according to the input question; The chain of evidence is represented by the locally retrieved chain of evidence or the online retrieved chain of evidence; The evidence chain retrieved locally consists of entity evidence and relation evidence in K paths; Entity evidence consists of the name of the entity, the type of the entity, and the description of the entity; Relation evidence consists of source entities, target entities, and relationship descriptions; The evidence chain retrieved online consists of M web page evidences; Web page evidence consists of web page title and web page information; Step S105, generating a drug safety conclusion through a large language model based on the input question and the evidence chain; Conclusions on drug safety include: current evidence shows that the drug is unsafe, current evidence shows that the drug will not cause adverse reactions, and there is no clear evidence to show whether it is safe.
[0019] It should be noted that public medical databases can be PubMed (provided by the U.S. National Library of Medicine), Medline (a subset of PubMed, covering articles in the fields of medicine, nursing, dentistry, veterinary medicine, and health care systems), Cochrane Library (provides high-quality systematic reviews and meta-analyses, focusing on evidence-based medicine), etc. Parsing tools can be llama-parse (supports parsing of multiple document formats such as PDF and HTML), Pandoc (can convert documents in PDF, HTML, LaTeX and other formats into Markdown format), BeautifulSoup (a Python library for parsing HTML or XML format documents, which can extract text information from web pages), etc., which will not be elaborated here.
[0020] In one embodiment of the present invention, the preset threshold, the number K of entity evidence and relationship evidence, and the number M of web page evidence are all custom parameters. Preferably, the preset threshold is set to 2000, the number K of entity evidence and relationship evidence is set to 6, and the number M of web page evidence is set to 6.
[0021] In one embodiment of the present invention, the order of separator priority from high to low is paragraph separator, period, semicolon, colon, comma, where the paragraph separator in markdown is a mark beginning with a pound sign, such as #, ##, ###, etc.
[0022] In one embodiment of the present invention, Figure 2 As shown in the figure, building a medical knowledge graph based on the basic text library combined with a large language model includes the following steps: Step S201, extracting entities from a basic text library through a large language model; The format of entity is as follows: ("entity"<|><entity_name> <|><entity_type> <|><entity_description> ); entity_name indicates the name of the entity, entity_type indicates the type of the entity, and entity_description indicates the description of the entity. If the name of the entity is in English, it is returned in the format of "English entity name (Chinese entity name)". If the English entity name is uncertain, only the English entity name is returned. If the type of the entity cannot be identified, "Unknown Entity" is returned. If the description of the entity cannot be identified, an empty string is directly returned. For example: ("entity"<|>"ivermectin"<|>"drug"<|>A widely used antiparasitic drug, global demand for ivermectin is expected to remain high as it is licensed for use against nematodes, scabies, as part of a three-drug combination (with albendazole and diethylcarbamide) with the potential to eliminate lymphatic filariasis, in combination regimens for soil-transmitted helminths, and as an endophytic insect growth regulator to reduce malaria transmission."); Step S202, extracting the connection relationship between entities in the basic text library through the large language model; The format of the connection relationship between entities is as follows: ("relationship"<|><source_entity> <|><target_entity> <|><relationship_description> <|><relationship_score> ); source_entity represents the source entity, target_entity represents the target entity, relationship_description represents the relationship description, relationship_score represents the strength of the connection relationship, and the value range is between 0 and 100. The larger the value of the connection relationship strength, the stronger the association between the two entities. ## is used as the separator for multiple relationships. After the extraction is completed, it ends with <|COMPLETE|>; For example: ("relationship"<|>"Ivermectin"<|>"River Blindness"<|>"Ivermectin is widely used to treat river blindness. Since 1987, Merck has donated more than 3.7 billion treatments through the Mectizan donation program with the goal of eliminating river blindness."<|>90)## ("relationship"<|>"Ivermectin"<|>"Lymphatic Filariasis"<|> "Ivermectin is also used to treat lymphatic filariasis. The donation program was expanded to include this disease in 1998."<|>85)##......<|COMPLETE|>; Step S203, deduplication of entities is performed using a two-stage merging strategy; Calculate the cosine similarity between the features of each entity and the features of other entities, and select entities greater than or equal to the similarity threshold as the candidate entity set. Then use the large language model to extract entities that are completely equivalent to the current entity and form a cluster with the current entity. Then merge the clusters with intersections and select the entity with the highest frequency as the merged entity node. For example, if the candidate entity set is {"arthritis", "osteoarthritis", "rheumatoid arthritis"}, cluster 1 is {"arthritis", "osteoarthritis"}, and cluster 2 is {"arthritis", "rheumatoid arthritis"}, then "arthritis" has the highest repetition frequency, and it is used as the merged entity node. The entities of "osteoarthritis" and "rheumatoid arthritis" and the connection relationship between the entities are merged into the "arthritis" entity.
[0023] It should be noted that the extraction of entities in the basic text library, the relationship between entities, and entity deduplication are all achieved through the few-sample strategy, that is, there is no need to build a large number of annotated data sets. The large language model is pre-trained on a massive corpus, and the above tasks can be completed through the few-sample strategy. The large language model can be the GPT series, Qwen2.5 (open source large language model), Llama3 (open source large language model), BioBERT (based on the BERT model, specially pre-trained for biomedical literature (such as PubMed and PMC)), ClinicalBERT (open source language model, specially optimized for clinical texts (such as electronic health records EHR), good at medical entity recognition, medical record classification and clinical relationship extraction), PubMedBERT (open source language model, specially pre-trained on PubMed dataset), etc., which will not be elaborated here.
[0024] In one embodiment of the present invention, the medical language model is BioBERT.
[0025] In one embodiment of the present invention, Figure 3As shown, according to the input question, the evidence chain is obtained by combining local and online two-way evidence retrieval strategy, including the following steps: Step S301, initialize the current iteration number to 0, and obtain K entities as starting nodes through the large language model according to the input question; The drug entity in the input question is extracted through the large language model, and the cosine similarity between the characteristics of the drug entity and the characteristics of all entities in the constructed medical knowledge graph is calculated, and the first N entities are selected as the candidate entity set. Then, the K most relevant entity nodes are selected from the candidate entity set as the starting nodes through the large language model, where N is a custom parameter, preferably, N is set to 20; Step S302, obtaining all adjacent nodes and connection relationships of the starting node from the constructed medical knowledge graph to form a set of candidate search paths, and then selecting K paths that are most relevant to the input question from the candidate search paths through the large language model; Step S303, extracting entity evidence and relationship evidence from the K paths, and judging through the large language model whether the entity evidence and relationship evidence are sufficient to answer the input question, then outputting the entity evidence and relationship evidence as the local search evidence chain, otherwise proceeding to step S304; Step S304: if the current number of iterations is greater than or equal to the preset maximum number of path explorations, then the process proceeds to step S305; otherwise, the current number of iterations is incremented by 1, and the process returns to step S302 to continue execution; The preset maximum number of path explorations is a custom parameter. Preferably, the preset maximum number of path explorations is set to 20; Step S305, obtaining the titles and information of the first M web pages as web page evidence through online search according to the input question.
[0026] It should be noted that the format of physical evidence is as follows: The name of the entity The type of the entity The description of the entity Entity 1 Drug Title 1 Description 1; Description 2 <sep>Title 5 Description 1... Entity 2 Disease Title 10 Description 1; Description 2 <sep>Title 22 Description 8... Entity 3 Symptoms《Title 2》Description 1; Description 2 <sep>《Title 8》Description information 1…… …… …… …… It should be noted that the format of relationship evidence is as follows: Source entity target entity relationship description Entity 1 Entity 3 Title 1 Description 1; Description 2 <sep>Title 5 Description 1... Entity 1 Entity 2 Title 10 Description 1; Description 2 <sep>Title 22 Description 8... Entity 2 Entity 3 Title 2 Description 1; Description 2 <sep>《Title 8》Description information 1…… …… …… …… It should be noted that the format of web page evidence is: "Web Page 1 Title" Evidence Information <sep>《Title of Web Page 2》Evidence information…….
[0027] In one embodiment of the present invention, while generating a drug safety conclusion through a large language model, the locally retrieved evidence chain or the online retrieved evidence chain is returned to the user for the user's reference.
[0028] In one embodiment of the present invention, Figure 4 As shown, a drug safety model system based on medical knowledge graph includes: The data collection module 401 is used to collect medical literature data from public medical databases and parse it into text in markdown format through a parsing tool; A basic text library construction module 402 is used to slice the text in the markdown format according to the chapters to obtain text slices, and determine whether the number of characters in the text slices is greater than or equal to a preset threshold, and then segment the text slices according to the order of delimiter priority from large to small until the number of characters in the segment is less than the preset threshold, and all the segments less than the preset threshold are used as the basic text library; A medical knowledge graph construction module 403 is used to construct a medical knowledge graph based on a basic text library combined with a large language model; An evidence chain retrieval module 404 is used to obtain an evidence chain according to an input question through a local combined with online two-way evidence retrieval strategy; The drug safety conclusion generation module 405 is used to generate a drug safety conclusion based on the input question and the evidence chain through a large language model.
[0029] The above describes an embodiment of the present embodiment, but the present embodiment is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present embodiment, ordinary technicians in this field can also make many forms, all of which are within the protection of the present embodiment.< / sep> < / sep> < / sep> < / sep> < / sep> < / sep> < / sep>
Claims
1. A drug safety big model method based on medical knowledge graph, characterized in that: The following steps are involved: Step S101, collecting medical literature data from a public medical database and parsing it into text in markdown format using a parsing tool; Step S102, slicing the text in the markdown format according to the chapters to obtain text slices, and judging whether the number of characters in the text slices is greater than or equal to a preset threshold, segmenting the text slices according to the delimiter priority until the number of characters in the segment is less than the preset threshold; if the length of the text slice is less than the preset threshold, merging adjacent slices until the preset threshold is reached, and using all processed segments as the basic text library; Step S103, constructing a medical knowledge graph based on the basic text library and the large language model; The medical knowledge graph includes: entities, their features, and the connections between them; An entity consists of the entity name, entity type, and entity description information; Types of entities include: drugs, diseases, and symptoms; The characteristics of entities are represented by word vectors, which are extracted by medical language models. The connection relationship between entities consists of source entity, target entity and relationship description; Step S104, obtaining the evidence chain through a local combined with online two-way evidence retrieval strategy according to the input question; The chain of evidence is represented by the locally retrieved chain of evidence or the online retrieved chain of evidence; The evidence chain retrieved locally consists of entity evidence and relation evidence in K paths; Entity evidence consists of the name of the entity, the type of the entity, and the description of the entity; Relation evidence consists of source entities, target entities, and relationship descriptions; The evidence chain retrieved online consists of M web page evidences; Web page evidence consists of web page title and web page information; Step S105, generating a drug safety conclusion through a large language model based on the input question and the evidence chain; Conclusions on drug safety include: current evidence shows that the drug is unsafe, current evidence shows that the drug will not cause adverse reactions, and there is no clear evidence to show whether it is safe.
2. According to claim 1, a large model method for medication safety based on medical knowledge graph is characterized in that: The preset threshold, the number of entity evidence and relationship evidence K, and the number of web page evidence M are all custom parameters.
3. According to claim 1, a large model method for medication safety based on medical knowledge graph is characterized in that: The order of delimiter priority from highest to lowest is paragraph separator, period, semicolon, colon, comma, where the paragraph separator in markdown is the tag that starts with a pound sign.
4. According to claim 1, a large model method for medication safety based on medical knowledge graph is characterized in that: Building a medical knowledge graph based on the basic text library and the large language model includes the following steps: Step S201, extracting entities from a basic text library through a large language model; The format of entity is as follows: ("entity"<|><entity_name> <|><entity_type> <|><entity_description> ); entity_name indicates the name of the entity, entity_type indicates the type of the entity, and entity_description indicates the description of the entity. If the name of the entity is in English, it is returned in the format of "English entity name (Chinese entity name)". If the English entity name is uncertain, only the English entity name is returned. If the type of the entity cannot be identified, "unknown entity" is returned. If the description of the entity cannot be identified, an empty string is directly returned. Step S202, extracting the connection relationship between entities in the basic text library through the large language model; The format of the connection relationship between entities is as follows: ("relationship"<|><source_entity> <|><target_entity> <|><relationship_description> <|><relationship_score> ); source_entity represents the source entity, target_entity represents the target entity, relationship_description represents the relationship description, relationship_score represents the strength of the connection relationship, and the value range is between 0 and 100. The larger the value of the connection relationship strength, the stronger the association between the two entities. ## is used as the separator for multiple relationships. After the extraction is completed, it ends with <|COMPLETE|>; Step S203, deduplication of entities is performed using a two-stage merging strategy; The cosine similarity between the features of each entity and the features of other entities is calculated, and entities with a similarity threshold greater than or equal to the similarity threshold are selected as the candidate entity set. Entities that are completely equivalent to the current entity are extracted through the large language model and form a cluster with the current entity. Clusters with intersections are then merged, and the entity with the highest frequency is selected as the merged entity node.
5. According to claim 1, a large model method for medication safety based on medical knowledge graph is characterized in that: The medical language model is BioBERT.
6. The method of a drug safety big model based on medical knowledge graph according to claim 1, characterized in that: According to the input question, the evidence chain is obtained through a local combined with online two-way evidence retrieval strategy, including the following steps: Step S301, initialize the current iteration number to 0, and obtain K entities as starting nodes through the large language model according to the input question; The drug entity in the input question is extracted through the large language model, and the cosine similarity between the characteristics of the drug entity and the characteristics of all entities in the constructed medical knowledge graph is calculated. The first N entities are selected as the candidate entity set, and then the K most relevant entity nodes are selected from the candidate entity set as the starting nodes through the large language model, where N is a custom parameter; Step S302, obtaining all adjacent nodes and connection relationships of the starting node from the constructed medical knowledge graph to form a set of candidate search paths, and then selecting K paths that are most relevant to the input question from the candidate search paths through the large language model; Step S303, extracting entity evidence and relationship evidence from the K paths, and judging through the large language model whether the entity evidence and relationship evidence are sufficient to answer the input question, then outputting the entity evidence and relationship evidence as the local search evidence chain, otherwise proceeding to step S304; Step S304: if the current number of iterations is greater than or equal to the preset maximum number of path explorations, then the process proceeds to step S305; otherwise, the current number of iterations is incremented by 1, and the process returns to step S302 to continue execution; The preset maximum number of path explorations is a custom parameter; Step S305, obtaining the titles and information of the first M web pages as web page evidence through online search according to the input question.
7. According to claim 1, a large model method for medication safety based on medical knowledge graph is characterized in that: While generating drug safety conclusions through the large language model, the locally retrieved evidence chain or the online retrieved evidence chain will be returned to the user.
8. A drug safety model system based on medical knowledge graph, characterized in that: Executing a medication safety big model method based on a medical knowledge graph as claimed in any one of claims 1 to 7, comprising: The data collection module is used to collect medical literature data from public medical databases and parse it into text in markdown format through parsing tools; A basic text library construction module is used to slice the text in markdown format according to chapters to obtain text slices, and to determine if the number of characters in the text slice is greater than or equal to a preset threshold, and then to segment it in descending order of delimiter priority until the number of characters in the segment is less than the preset threshold, and all the segments less than the preset threshold are used as the basic text library; Medical knowledge graph construction module, which is used to build a medical knowledge graph based on the basic text library combined with a large language model; An evidence chain retrieval module is used to obtain the evidence chain according to the input question through a local combined with online two-way evidence retrieval strategy; The drug safety conclusion generation module is used to generate drug safety conclusions based on the input questions and the evidence chain through a large language model.
Citation Information
Patent Citations
Open domain natural language reasoning question-answering system and method driven by large language model
CN116932708A
Digital intelligence pharmacist medication guidance system based on artificial intelligence
CN119230052A
Retrieval enhancement generation method based on medical map
CN119293179A
Cited By
Literature extraction method, system and equipment based on large language model and storage medium
CN120409450A
Method and device for detecting medication safety
CN121725974A
Veterinary clinical emergency decision support method and system based on mapping knowledge domain
CN122050868A