Search

CN-122024995-A - Method and device for evaluating medical prescription risk by using intelligent agent

CN122024995ACN 122024995 ACN122024995 ACN 122024995ACN-122024995-A

Abstract

The embodiment of the specification provides a method and a device for evaluating medical prescription risk by using an agent, wherein in the method for evaluating medical prescription risk, a target medical prescription to be evaluated is input into the agent, and multi-step reasoning is performed by the agent. In the single-step reasoning, the intelligent agent calls tools in the tool set according to the current thinking text to obtain a single-step reasoning result. The tool set comprises a first tool and a second tool, wherein the first tool is used for inquiring a dynamic medical knowledge graph and determining whether the medication information contained in the thinking text has a first risk. The triples in the dynamic medical knowledge graph are updated over time. The second tool is based on bayesian network construction and is used for calculating risk probability of medication information aiming at preset risks. And obtaining a risk assessment result of the target medical prescription according to target output of the intelligent agent, wherein the target output comprises an reasoning link of multi-step reasoning.

Inventors

  • ZHOU JING
  • LIN JINZHEN
  • YE XIANG
  • GUAN MENGYU
  • Ying Chenzhe
  • LI CHENGZE
  • MENG CHANGHUA
  • WANG WEIQIANG

Assignees

  • 支付宝(杭州)数字服务技术有限公司

Dates

Publication Date
20260512
Application Date
20260114

Claims (18)

  1. 1. A method of assessing medical prescription risk with an agent, comprising: Inputting a target medical prescription to be evaluated into an agent, and executing multi-step reasoning by the agent, wherein in the single-step reasoning, the agent calls tools in a tool set according to the current thinking text to obtain a single-step reasoning result, wherein the tool set comprises a first tool and a second tool, the first tool is used for inquiring a dynamic medical knowledge graph to determine whether the medication information contained in the thinking text has a first risk or not, and triples in the dynamic medical knowledge graph are updated with time; And obtaining a risk assessment result of the target medical prescription according to the target output of the intelligent agent, wherein the target output comprises an reasoning link of the multi-step reasoning.
  2. 2. The method of claim 1, wherein the tool set further comprises: And a third tool for extracting source text from the dynamic medical knowledge graph for a specified risk and generating interpretation text.
  3. 3. The method of claim 1, wherein the target medical prescription includes patient information, the risk probability calculated by: Splitting the patient information into a plurality of first features which are mutually independent, and carrying out probabilistic reasoning based on the plurality of first features to obtain a first probability; splitting the medication information into a plurality of mutually independent second features, and carrying out probability reasoning based on the plurality of second features to obtain second probability; Multiplying the prior probability of the preset risk with the first probability and the second probability to obtain posterior probability of the preset risk as the risk probability.
  4. 4. The method of claim 1, wherein the dynamic medical knowledge-graph is constructed by: Extracting medical entities and relation categories from the medical related text corpus by using a large model, and forming triples based on the medical entities and the relation categories to obtain a triplet set; and selecting each triplet with the corresponding trust score larger than a preset threshold value from the triplet set, and constructing the dynamic medical knowledge graph based on the triples, wherein the trust score is determined according to knowledge sources, evidence types and timeliness.
  5. 5. The method of claim 4, further comprising: And updating the dynamic medical knowledge graph, wherein the updating comprises the following steps: acquiring new triples according to the new text corpus, adding the new triples to the dynamic medical knowledge graph, and/or; and deleting a first triplet from the dynamic medical knowledge graph, wherein the trust score of the first triplet is lower than the preset threshold value due to timeliness factors.
  6. 6. The method of claim 4, wherein the constructing of the dynamic medical knowledge-graph further comprises: And inputting the text corpus and the triplet set into a large model, so that the large model can judge whether each triplet can be directly or indirectly supported in the text corpus, and deleting the triples which are not supported.
  7. 7. The method of claim 4, wherein, The entity categories to which an individual medical entity belongs include any of drugs, ingredients, diseases, symptoms, patient populations, laboratory examinations, and genes; The single relationship category includes any of adverse drug-to-symptom relationship, drug-to-disease taboo relationship, drug-to-patient population taboo relationship, drug-to-drug/component interaction relationship, drug-to-laboratory test monitoring relationship, drug-to-patient population/disease dose adjustment relationship, and drug-to-gene metabolic relationship.
  8. 8. The method of claim 1, wherein any first node in the dynamic medical knowledge graph has a standard name of the represented first medical entity, the standard name being obtained by querying a standard term library using a large model based on a text string of the first medical entity.
  9. 9. A method of training an agent for assessing risk of a medical prescription, the method comprising: Inputting a simulated prescription sample into an agent, and executing multi-step reasoning by the agent, wherein in the single-step reasoning, the agent calls tools in a tool set according to the current thinking text to obtain a single-step reasoning result, wherein the tool set comprises a first tool and a second tool, the first tool is used for inquiring a dynamic medical knowledge graph to determine whether the medication information contained in the thinking text has a first risk or not, triples in the dynamic medical knowledge graph are updated with time, and the second tool is constructed based on a Bayesian network and is used for calculating the risk probability of the medication information aiming at a preset risk; obtaining a target evaluation result of the simulated prescription sample according to the target output of the intelligent agent, wherein the target output comprises a target reasoning link of the multi-step reasoning; Determining each missing report risk and/or each false report risk by comparing a plurality of real risks and a plurality of prediction risks corresponding to the simulation prescription sample; Calculating a target reward score of the target reasoning link according to the respective weight of each false alarm risk and/or each false alarm risk, wherein the weight of the false alarm risk is smaller than that of the false alarm risk; Training the agent using a human feedback based reinforcement learning RLHF algorithm based on the target bonus points.
  10. 10. The method of claim 9, wherein the calculating the target prize score for the target inference link comprises: Subtracting the sum of the weights of the missing report risks and/or the false report risks from a first value under the condition that the real risks and the predicted risks are consistent, and subtracting the product of the step number contained in the target reasoning link and the target weight from the obtained first difference value to obtain the target rewarding score; And under the condition that the real risks and the predicted risks are inconsistent, subtracting the sum of the weights of the miss-reporting risks and/or the false-reporting risks from a second numerical value, and subtracting the product of the step number contained in the target reasoning link and the target weight from the obtained second difference value to obtain the target rewarding score, wherein the second numerical value is smaller than the first numerical value.
  11. 11. The method of claim 9, wherein the number of simulated prescription samples is a plurality, and wherein the training the agent comprises: Subtracting the average value of the reward points of each reasoning link output by the intelligent agent for each simulation prescription sample from the target reward points to obtain a target difference value; Acquiring first probabilities of tool calling codes in a labeling reasoning link of the intelligent agent aiming at the simulated prescription sample; Calculating the product of the first probabilities to obtain a target probability; and determining an objective function value according to the objective probability and the objective difference value, and adjusting the parameter of the intelligent agent based on the objective function value.
  12. 12. The method of claim 11, wherein the determining the objective function value comprises: multiplying the logarithmic value of the target probability with the target difference value, and taking the obtained product as the target function value.
  13. 13. The method of claim 11, wherein the training the agent comprises a plurality of iterations and the objective probability is calculated based on an agent of an ith round, the determining an objective function value comprising: Acquiring each second probability of each tool calling code in the labeling inference link of the simulated prescription sample aiming at the initial agent, and calculating the product of each second probability to obtain the initial probability; determining a sampling ratio according to the ratio of the target probability to the initial probability; Calculating a first product of the sampling ratio and the target difference value, and calculating a second product of the clipped sampling ratio and the target difference value; a minimum of the first product and the second product is determined as the objective function value.
  14. 14. The method of claim 9, wherein the agent is a pre-training model trained based on at least one of the following training samples: The system comprises a first training sample, a second training sample, a third training sample, a fourth training sample, a fifth training sample and a sixth training sample, wherein the sample is characterized by an abnormal medical prescription, and a sample label is a corresponding first reasoning link; the second training sample is characterized by a normal medical prescription extracted from service data, and a sample label is a corresponding second reasoning link; the system comprises a dynamic medical knowledge graph, a third training sample, a first reasoning link, a second reasoning link, a third training sample, a third reasoning link and a relation category, wherein the sample characteristic of the complex medical prescription is a complex medical prescription, the complex medical prescription is generated by using a large model based on a second sub image extracted from the dynamic medical knowledge graph, the second sub image comprises a plurality of medicine entities and a plurality of component entities, and the relation category is interaction.
  15. 15. An apparatus for assessing medical prescription risk with an agent, comprising: An input unit for inputting a target medical prescription to be evaluated into an agent through which multi-step reasoning is performed; in the single-step inference, an agent calls tools in a tool set according to a current thinking text to obtain a single-step inference result, wherein the tool set comprises a first tool and a second tool, the first tool is used for inquiring a dynamic medical knowledge graph to determine whether the medication information contained in the thinking text has a first risk or not; The acquisition unit is used for acquiring a risk assessment result of the target medical prescription according to the target output of the intelligent body, wherein the target output comprises an reasoning link of the multi-step reasoning.
  16. 16. An apparatus for training an agent for assessing risk of a medical prescription, the method comprising: An input unit for inputting a simulated prescription sample into an agent, through which multi-step reasoning is performed; in the single-step inference, an agent calls tools in a tool set according to a current thinking text to obtain a single-step inference result, wherein the tool set comprises a first tool and a second tool, the first tool is used for inquiring a dynamic medical knowledge graph to determine whether the medication information contained in the thinking text has a first risk or not; The acquisition unit is used for acquiring a target evaluation result of the simulated prescription sample according to the target output of the intelligent agent, wherein the target output comprises a target reasoning link of the multi-step reasoning; the comparison unit is used for determining each missing report risk and/or each false report risk by comparing a plurality of real risks and a plurality of prediction risks corresponding to the simulation prescription sample; the calculation unit is used for calculating the target reward score of the target reasoning link according to the respective weight of each false alarm risk and/or each false alarm risk, wherein the weight of the false alarm risk is smaller than that of the false alarm risk; and the training unit is used for training the intelligent agent by using a reinforcement learning RLHF algorithm based on human feedback according to the target reward points.
  17. 17. A computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed in a computer, causes the computer to perform the method of any of claims 1-14.
  18. 18. A computing device comprising a memory and a processor, wherein the memory has executable code stored therein, which when executed by the processor, implements the method of any of claims 1-14.

Description

Method and device for evaluating medical prescription risk by using intelligent agent Technical Field One or more embodiments of the present disclosure relate to the field of artificial intelligence, and more particularly, to a method and apparatus for assessing risk of a medical prescription using an agent. Background Currently, digital health services represented by internet diagnosis and treatment and online medicine purchasing are spreading at a rapid speed, and the accessibility and convenience of medical services are greatly improved. However, this convenience also underlies an increasingly prominent medication safety risk. Compared with the traditional offline diagnosis and treatment scene, the interaction links of doctors and patients in Internet diagnosis and treatment are simplified, and the key information (especially the physical sign performance, the allergy history, the combined medication history and the like) of patients is often incomplete, so that the automation and high-precision safety audit of medical prescriptions become a key defense line indispensable for guaranteeing the medication safety of patients. The current widely used medication safety guarantee technology mainly depends on a Clinical Decision Support System (CDSS) based on a rule engine. Such systems match and alert known medication risks (e.g., explicit drug interactions or allergy taboos) via a pre-set "IF-THEN" rule base. However, the updating of the traditional rule base is completely dependent on manual work, the period is long, the cost is high, and a huge time difference exists between the knowledge base of the online wind control system and the latest clinical evidence, so that the new risk cannot be effectively intercepted. Thus, there is a need for a more efficient and reliable medical prescription risk assessment method. Disclosure of Invention One or more embodiments of the present disclosure describe a method and apparatus for assessing risk of a medical prescription using an agent, which may significantly improve the effectiveness and reliability of the outcome of the risk assessment. In a first aspect, there is provided a method for assessing medical prescription risk using an agent, comprising: Inputting a target medical prescription to be evaluated into an agent, and executing multi-step reasoning by the agent, wherein in the single-step reasoning, the agent calls tools in a tool set according to the current thinking text to obtain a single-step reasoning result, wherein the tool set comprises a first tool and a second tool, the first tool is used for inquiring a dynamic medical knowledge graph to determine whether the medication information contained in the thinking text has a first risk or not, and triples in the dynamic medical knowledge graph are updated with time; And obtaining a risk assessment result of the target medical prescription according to the target output of the intelligent agent, wherein the target output comprises an reasoning link of the multi-step reasoning. In a second aspect, a method of training an agent for assessing risk of a medical prescription is provided, the method comprising: Inputting a simulated prescription sample into an agent, and executing multi-step reasoning by the agent, wherein in the single-step reasoning, the agent calls tools in a tool set according to the current thinking text to obtain a single-step reasoning result, wherein the tool set comprises a first tool and a second tool, the first tool is used for inquiring a dynamic medical knowledge graph to determine whether the medication information contained in the thinking text has a first risk or not, triples in the dynamic medical knowledge graph are updated with time, and the second tool is constructed based on a Bayesian network and is used for calculating the risk probability of the medication information aiming at a preset risk; obtaining a target evaluation result of the simulated prescription sample according to the target output of the intelligent agent, wherein the target output comprises a target reasoning link of the multi-step reasoning; Determining each missing report risk and/or each false report risk by comparing a plurality of real risks and a plurality of prediction risks corresponding to the simulation prescription sample; Calculating a target reward score of the target reasoning link according to the respective weight of each false alarm risk and/or each false alarm risk, wherein the weight of the false alarm risk is smaller than that of the false alarm risk; Training the agent using a human feedback based reinforcement learning RLHF algorithm based on the target bonus points. In a third aspect, there is provided an apparatus for assessing medical prescription risk using an agent, comprising: An input unit for inputting a target medical prescription to be evaluated into an agent through which multi-step reasoning is performed; in the single-step inference, an agent calls tools in a tool set acc