Medical logic knowledge extraction method and medical auxiliary system

By generating medical logic rules in first-order logical formula format based on a large language model based on prompt engineering, and performing entity verification and similarity analysis, the problem of difficult to represent complex medical logic and semantic relationships in the existing technology is solved, and more accurate and Complete medical information representation.

CN119476462AActive Publication Date: 2025-02-18HARBIN INST OF TECH

Patent Information

Application Number
CN202411621993.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-02-18
Estimated Expiration
2044-11-14

AI Technical Summary

Technical Problem

The prior art is difficult to effectively represent complex logical and semantic relationships in medical information, especially by representing binary relationships through simple triples, making it difficult to capture complex conditional logic and time dimension changes.

Method used

A large language model based on prompt engineering is used to generate medical logic rules in the first-order logical formula format, and the integrity and accuracy of the rules are ensured through entity verification and similarity analysis.

Benefits of technology

It can effectively represent many-to-many relationships, nested relationships and complex conditional logic, support quantitative words and variables, accurately describe complex medical conditions and suggestions, and represent the time changes of medical information, improving the representation and processing of medical logic knowledge ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476462A_ABST
    Figure CN119476462A_ABST
Patent Text Reader

Abstract

The invention provides a medical logic knowledge extraction method and a medical auxiliary system, and relates to the technical field of medical data processing.The method comprises the steps that based on a prompt project, an obtained medical natural language text is input into a large language model, a medical logic rule is generated, and the format of the medical logic rule is a first-order logic formula; performing entity verification on the medical logic rule to generate a verification result, and regenerating the medical logic rule by the large language model when the verification result is wrong; when the verification result is correct, determining the similarity between the medical logic rule and the medical natural language text; and generating a final medical logic rule according to the similarity and the medical logic rule. According to the method, the problem that complex logic and semantic relationships in medical information are difficult to effectively represent due to the fact that a triple represents a binary relationship in the prior art can be solved. And the integrity of medical logic rules can be ensured, and the accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of medical data processing technology, and in particular to a medical logic knowledge extraction method and a medical auxiliary system. Background Art

[0002] Medical logic knowledge refers to the text information that uses logical reasoning and formal methods to represent knowledge in the medical field, such as the cause of the disease, pathophysiological process, and mechanism of action of drugs.

[0003] At present, medical logic knowledge is mainly represented and processed through knowledge graphs and logical reasoning methods to represent and process complex information in the medical field. Most medical knowledge is in the form of knowledge graphs, which use simple triples to represent binary relationships. Although this can represent simple medical knowledge, it is difficult to effectively represent the complex logic and semantic relationships in medical information and has limitations. Summary of the invention

[0004] The problem solved by the present invention is how to effectively represent the complex logical and semantic relationships in medical information.

[0005] In order to solve the above problems, the present invention provides a medical logic knowledge extraction method and a medical auxiliary system.

[0006] In a first aspect, the present invention provides a method for extracting medical logic knowledge, comprising:

[0007] Based on the prompt engineering, the acquired medical natural language text is input into the large language model to generate medical logic rules, wherein the format of the medical logic rules is a first-order logic formula;

[0008] Performing entity verification on the medical logic rule to generate a verification result, and when the verification result is wrong, the large language model regenerates the medical logic rule;

[0009] When the verification result is correct, determining the similarity between the medical logic rule and the medical natural language text;

[0010] A final medical logic rule is generated according to the similarity and the medical logic rule.

[0011] Optionally, the prompt-based engineering inputs the acquired medical natural language text into a large language model to generate medical logic rules, including:

[0012] Based on the prompt project, determining the extraction task of the large language model;

[0013] Using a least-to-most-hint strategy, the extraction task is decomposed into at least one subtask;

[0014] The subtasks are executed sequentially through the large language model to generate subtask results for each subtask, wherein the input of the first subtask is the medical natural language text, the input of other subtasks is the subtask results output by executing the previous subtask, and the subtask result output by the last subtask is the medical logic rule.

[0015] Optionally, executing the subtasks in sequence through the large language model to generate a subtask result for each subtask includes:

[0016] For one of the subtasks, a thinking chain strategy is adopted to decompose the subtask into at least one sub-step;

[0017] The sub-steps are executed through the large language model to generate sub-step results of all the sub-steps and the corresponding sub-task results at one time.

[0018] Optionally, executing the subtasks in sequence through the large language model to generate a subtask result for each subtask includes:

[0019] The large language model sequentially executes the subtasks. For one of the subtasks, a thought chain self-verification strategy is adopted to repeatedly execute the subtask multiple times through the large language model to construct a subtask result data set of the subtask, wherein the subtask result data set includes multiple candidate subtask results;

[0020] The self-consistency of each of the candidate subtask results in the subtask result data set is determined, and the subtask result of the subtask is determined based on the self-consistency.

[0021] Optionally, determining the self-consistency of each of the candidate subtask results in the subtask result data set includes:

[0022] Determine the self-consistency of each of the candidate subtask results in the subtask result data set according to a self-consistency formula group, wherein the self-consistency formula group includes:

[0023]

[0024] in, is the self-consistency of the i-th candidate subtask result, A is the subtask result dataset, α i is the result of the candidate subtask of the ith type, α j is the jth candidate subtask result, is the number of elements in the subtask result dataset.

[0025] Optionally, determining the similarity between the medical logic rule and the medical natural language text includes:

[0026] Using a recursive grammar analysis algorithm to extract the grammatical structure of the medical logic rule;

[0027] Recursively parsing the grammatical structure, and generating a logical natural language text according to the grammatical structure based on a natural language template;

[0028] A similarity model is used to determine the similarity between the logical natural language text and the medical natural language text.

[0029] Optionally, generating a final medical logic rule according to the similarity and the medical logic rule includes:

[0030] When the similarity is greater than or equal to a preset threshold, taking the medical logic rule as the final medical logic rule;

[0031] When the similarity is less than the preset threshold, the above steps are iterated.

[0032] Optionally, performing entity verification on the medical logic rule to generate a verification result includes:

[0033] The degree of overlap between the medical logic rule and the medical natural language text is determined according to the entity verification formula group, wherein the entity verification formula group includes:

[0034]

[0035] Wherein, α is the overlap degree, M is the logical entity set of the medical natural language text, M' is the logical entity set of the medical logic rule, e is an entity, N is the number of entities in M, and N' is the number of entities in M';

[0036] The medical logic rule is physically verified according to the overlap degree to generate the verification result.

[0037] In a second aspect, the present invention provides a medical assistance system, applying the medical logic knowledge extraction method as described in the first aspect, the medical assistance system comprising:

[0038] A generation module, for inputting the acquired medical natural language text into a large language model based on a prompting project to generate medical logic rules, wherein the format of the medical logic rules is a first-order logic formula;

[0039] A verification module, used for performing entity verification on the medical logic rule and generating a verification result. When the verification result is wrong, the large language model regenerates the medical logic rule;

[0040] A similarity module, for determining the similarity between the medical logic rule and the medical natural language text when the verification result is correct;

[0041] The final module is used to generate a final medical logic rule according to the similarity and the medical logic rule.

[0042] Optionally, the medical assistance system further comprises a prediction module, which is used to determine the symptom similarity between the final medical logic rule and each clinical data in the clinical entity data set.

[0043] In a third aspect, the present invention provides an electronic device, including a memory and a processor;

[0044] The memory is used to store computer programs;

[0045] The processor is used to implement the medical logic knowledge extraction method as described in the first aspect when executing the computer program.

[0046] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the medical logic knowledge extraction method as described in the first aspect is implemented.

[0047] The beneficial effects of the medical logic knowledge extraction method and medical assistance system of the present invention are:

[0048] Based on the prompt engineering, the medical logic rules in the first-order logic formula format obtained by the large language model can not only express many-to-many relationships, nested relationships and complex conditional logic, but also support quantifiers and variables, and can express general rules and individual situations. Moreover, the medical logic rules in the first-order logic formula format support compound logic operators, which can accurately describe complex medical conditions and suggestions. At the same time, by introducing context variables and time dimensions, they can accurately express the time changes of medical information, such as the efficacy of drugs under different conditions, solving the problem that the existing technology triples represent binary relationships and are difficult to effectively express the complex logic and semantic relationships in medical information. In addition, by performing entity verification on the medical logic rules, it can be determined whether the medical logic rules generated by the large language model contain all the entities in the medical natural language text. If the verification result is wrong, that is, the medical logic rules do not contain all the entities in the medical natural language text, the large language model will re-extract and generate until all are included, thereby ensuring the integrity of the medical logic rules to improve accuracy. When the verification result is correct, the similarity between the medical logic rules and the medical natural language text is judged to determine whether the logic of the medical logic rules and the medical natural language text is the same through the similarity, so as to further improve the accuracy and obtain the most accurate final medical logic rules. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A schematic diagram of a process for extracting medical logic knowledge provided by an embodiment of the present invention;

[0050] Figure 2 One of the structural schematic diagrams of the medical assistance system provided by an embodiment of the present invention;

[0051] Figure 3 A second structural diagram of the medical assistance system provided by an embodiment of the present invention;

[0052] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0053] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be interpreted as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not intended to limit the scope of protection of the present invention.

[0054] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.

[0055] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to"; the term "based on" means "based at least in part on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments"; the term "optionally" means "optional embodiments". The relevant definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc. mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0056] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0057] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes, and are not used to limit the scope of these messages or information.

[0058] In the prior art, medical knowledge is mainly represented by binary relations through simple triples. For example, the Unified Medical Language System (UMLS) is a knowledge graph that integrates various medical vocabulary, terms, diseases, drugs, and medical concepts. SNOMED CT is an international medical terminology and coding system used to describe diseases, symptoms, processes, drugs, and medical procedures. The I2B2 2010 corpus is a knowledge base built for empirical knowledge in the medical field. These are difficult to effectively represent medical text knowledge, such as the complex logic and semantic relationships in electronic medical records, medical books, professional medical website texts, and medical literature. They do not support stronger explanatory and in-depth reasoning methods, and are difficult to capture contextual dependencies and time dimension changes in medical literature. In addition, existing logic knowledge mining methods, whether rule-based or deep learning-based, have poor generalization capabilities and rely on a large amount of labeled data. These problems limit the effectiveness and reliability of medical logic knowledge in practical applications.

[0059] In view of the problems existing in the above-mentioned related technologies, this embodiment provides a medical logic knowledge extraction method and a medical auxiliary system.

[0060] like Figure 1 As shown, a medical logic knowledge extraction method provided by an embodiment of the present invention includes:

[0061] Based on the prompt engineering, the acquired medical natural language text is input into the large language model to generate medical logic rules, wherein the format of the medical logic rules is a first-order logic formula.

[0062] Specifically, first order logic (FOL) formulas are used to describe and reason about relationships involving individuals and predicates. By introducing symbols such as quantifiers, predicates, and functions, first order logic formulas expand the functionality of propositional logic and can handle more complex logical relationships. Prompt projects are used to provide prompts for the data processing process of large language models (LLMs). The performance of the generated results of large language models is very sensitive to prompts. Different prompt inputs may lead to large differences in the quality of the output results of large models. Prompts are instructions issued to large language models to execute rules, automate processes, and ensure the specific quality (and quantity) of the generated output. Prompts are also a form of programming that can customize output and interaction with large language models. Prompt projects include task requirements, logical rule formats and type definitions, FOL definitions, input and output examples, and the text that needs to be processed currently. Prompt projects define the FOL format, describe the task context and purpose, define the relationship types represented by FOL formulas, and standardize the output content format of large language models, which can facilitate subsequent programs to process the text output by large language models. Based on the prompt engineering, the obtained pre-processed medical natural language text is input into the large language model, and the large language model performs knowledge mining on the medical natural language text to generate medical logic rules in the format of first-order logic formulas. Medical logic rules are logic rules of medical text knowledge, for example, logic rules of electronic medical records, medical books, professional medical website texts, and medical literature. For example, if the medical natural language text is "Female patients with chronic bacterial cystitis often have symptoms of frequent urination and urgent urination", the medical logic rule can be "Female (x) ^ Frequent urination (x) ^ Urgent urination (x) → Chronic bacterial cystitis (x, True)".

[0063] The medical logic rule is physically verified to generate a verification result. When the verification result is wrong, the large language model regenerates the medical logic rule.

[0064] Specifically, entity verification methods such as similarity verification, overlap verification, and Hamming distance verification are used to perform entity verification on medical logic rules and generate verification results to determine whether the medical logic rules generated by the large language model have mined all entities in the medical natural language text. When the verification result is wrong, it means that the large language model has not mined all entities in the medical natural language text. The large language model needs to be re-mined to generate new medical logic rules, and the new medical logic rules need to be verified until all entities in the medical natural language text are mined, thereby improving the completeness and accuracy of the medical logic rules.

[0065] When the verification result is correct, the similarity between the medical logic rule and the medical natural language text is determined.

[0066] Specifically, when the verification result is correct, it means that the large language model has mined all entities in the medical natural language text. At this time, the medical logic rules need to be logically verified to determine whether the medical logic rules are correct. The medical logic rules can be logically verified by calculating the similarity between the medical logic rules and the medical natural language text, and it is convenient to perform corresponding steps based on the similarity in the subsequent steps.

[0067] A final medical logic rule is generated according to the similarity and the medical logic rule.

[0068] Specifically, the medical logic rules may include logic rules for different outputs of the same input medical natural language text. Among the different logic rules of the same input medical natural language text, the logic rules with similarity greater than the high-quality preset threshold are selected as the high-quality final medical logic rules. Among the different logic rules of the same input medical natural language text, if there are multiple similarities greater than the high-quality preset threshold, the logic rule with the highest similarity is selected as the final medical logic rule. Among the different logic rules of the same input medical natural language text, if all logic rules are less than the low-quality preset threshold, the large language model is used to regenerate the medical logic rules, and the above steps are re-executed until the final medical logic rules are obtained. Exemplarily, when the above steps are re-executed for the number of predictions, the corresponding medical natural language text is deleted.

[0069] In this embodiment, based on the prompt engineering, the medical logic rules in the first-order logic formula format obtained by the large language model can not only express many-to-many relationships, nested relationships and complex conditional logic, but also support quantifiers and variables, and can express general rules and individual situations. Moreover, the medical logic rules in the first-order logic formula format support compound logic operators, which can accurately describe complex medical conditions and suggestions. At the same time, by introducing context variables and time dimensions, they can accurately express the time changes of medical information, for example, the efficacy of drugs under different circumstances, which solves the problem that the prior art triples represent binary relationships and are difficult to effectively express the complex logic and semantic relationships in medical information. In addition, by performing entity verification on the medical logic rules, it can be determined whether the medical logic rules generated by the large language model contain all the entities in the medical natural language text. If the verification result is wrong, that is, the medical logic rules do not contain all the entities in the medical natural language text, the large language model will re-extract and generate until all are included, thereby ensuring the integrity of the medical logic rules to improve accuracy. When the verification result is correct, the similarity between the medical logic rules and the medical natural language text is judged to determine whether the logic of the medical logic rules and the medical natural language text is the same through the similarity, so as to further improve the accuracy and obtain the most accurate final medical logic rules.

[0070] Optionally, the prompt-based engineering inputs the acquired medical natural language text into a large language model to generate medical logic rules, including:

[0071] Based on the prompt project, determining the extraction task of the large language model;

[0072] Using a least-to-most-hint strategy, the extraction task is decomposed into at least one subtask;

[0073] The subtasks are executed sequentially through the large language model to generate subtask results for each subtask, wherein the input of the first subtask is the medical natural language text, the input of other subtasks is the subtask results output by executing the previous subtask, and the subtask result output by the last subtask is the medical logic rule.

[0074] Specifically, when the large language model is mining knowledge, if the complexity of the task to be completed is more difficult than the example given in the prompt project, the quality of the logical rules mined by the large language model will drop significantly. At this time, the least-to-most prompting strategy is adopted to decompose the complex extraction task of the large language model into a series of simpler subtasks, and then solve these subtasks in sequence, where the input of the first subtask is the medical natural language text, the input of other subtasks is the subtask result output by executing the previous subtask, and the subtask result output by the last subtask is the medical logic rule, that is, using progressive prompts to guide the mining of the large language model, which can help the large language model to solve problems that are more difficult than the example more calmly. Using the least-to-most prompting strategy for logical knowledge mining tasks can avoid the problem of incorrect classification of logical knowledge rule types by the large language model to a certain extent. Exemplarily, the extraction task of the large language model can be decomposed into three subtasks: sentence logic type classification, named entity recognition, and logical knowledge mining. Sentence logical type classification, that is, analyzing each input sentence to determine whether it contains the logical relationship of interest to the task, for example, for the input "Symptoms of cerebral hypoperfusion: headache, dizziness, worse after exercise, emotional excitement and stress;" determine whether it contains clinical symptoms; named entity recognition, that is, for sentences containing specified logical relationships, identify the target entities of interest. For example, if the above sentence contains clinical symptoms, extract the disease and symptom entities, that is, headache, dizziness, etc.; logical knowledge mining, that is, based on the output results of the previous two subtasks, extract the logical types in the sentences containing the target logical type. In this process, the entities identified by the second subtask are used for constraints.

[0075] Optionally, executing the subtasks in sequence through the large language model to generate a subtask result for each subtask includes:

[0076] For one of the subtasks, a thinking chain strategy is adopted to decompose the subtask into at least one sub-step;

[0077] The sub-steps are executed through the large language model to generate sub-step results of all the sub-steps and the corresponding sub-task results at one time.

[0078] Specifically, when processing each subtask, a thinking chain strategy can be adopted. The thinking chain can guide the large language model to generate correct reasoning steps based on the input medical natural language text and subtasks, that is, the logical knowledge mining task is decomposed into multiple intermediate steps, namely sub-steps. The large language model executes all the intermediate steps of each subtask in sequence to generate sub-step results of each of the sub-steps, as well as the sub-task results of the subtask. Through the thinking chain strategy, the subtask is decomposed into at least one sub-step, which can reduce the burden of the large language model in analyzing the reasoning steps, while constraining the large language model's solution to the problem, thereby making the output more stable.

[0079] Optionally, executing the subtasks in sequence through the large language model to generate a subtask result for each subtask includes:

[0080] The large language model sequentially executes the subtasks. For one of the subtasks, a thought chain self-verification strategy is adopted to repeatedly execute the subtask multiple times through the large language model to construct a subtask result data set of the subtask, wherein the subtask result data set includes multiple candidate subtask results;

[0081] The self-consistency of each of the candidate subtask results in the subtask result data set is determined, and the subtask result of the subtask is determined based on the self-consistency.

[0082] Specifically, since the large language model may output multiple seemingly reasonable answers for the logical knowledge mining task, the answer with the greatest consistency is more likely to be the correct answer. On the contrary, the wrong answer due to the wrong reasoning path or wrong reasoning step is unlikely to appear multiple times in multiple rounds of output. In other words, even if the correct reasoning paths are diverse, the final answer derived from them tends to be consistent. Therefore, when calculating the subtask results of each subtask, the thinking chain self-verification strategy can be adopted to make the large language model repeatedly execute the subtask multiple times to obtain the corresponding multiple different or identical candidate subtask results for the same input, and construct a subtask result data set, while judging the self-consistency of the candidate subtask results in the subtask result data set, and taking the candidate subtask results whose self-consistency exceeds the preset threshold as the final subtask result. If all self-consistencies do not exceed the preset threshold, the thinking chain self-verification strategy is re-executed to obtain a new subtask result data set until the final subtask result is obtained. Through the thinking chain self-verification strategy, the randomness of the results generated by the large language model can be significantly reduced, thereby improving the reliability and accuracy of logical rule extraction.

[0083] Optionally, determining the self-consistency of each of the candidate subtask results in the subtask result data set includes:

[0084] Determine the self-consistency of each of the candidate subtask results in the subtask result data set according to a self-consistency formula group, wherein the self-consistency formula group includes:

[0085]

[0086] in, is the self-consistency of the i-th candidate subtask result, A is the subtask result dataset, α i is the result of the candidate subtask of the ith type, α j is the jth candidate subtask result, is the number of elements in the subtask result dataset.

[0087] Specifically, a self-consistency formula group may be used to determine the self-consistency between the candidate subtask results in the subtask result data set.

[0088] Optionally, determining the similarity between the medical logic rule and the medical natural language text includes:

[0089] Using a recursive grammar analysis algorithm to extract the grammatical structure of the medical logic rule;

[0090] Recursively parsing the grammatical structure, and generating a logical natural language text according to the grammatical structure based on a natural language template;

[0091] A similarity model is used to determine the similarity between the logical natural language text and the medical natural language text.

[0092] Specifically, medical logic rules include first-order logic operators, quantifiers, and Chinese characters. First, a small parser based on the first-order logic knowledge of the recursive parsing algorithm can be used, and the medical logic rules can be deconstructed into a grammatical structure according to the grammar of the first-order logic formula, for example, a tree structure composed of entities and logical relations. The parser recursively analyzes the grammatical structure with the compound formula as the basic unit. Let the parser function be GrammarRead. For an input first-order logic rule, first, the corresponding relationship of the brackets in is identified to extract the compound formula with the highest priority at present; then the structural relationship of the compound formula with the highest priority at present is analyzed. For example, if the compound formula with the highest priority at present is an or relationship (A∨B, where A and B represent a predicate combination with a lower priority), the current function output is [∨, GrammarRead(A), GrammarRead(B)], which represents the semantic relationship with the highest priority at present, where GrammarRead(A) is to recursively call the function to continue to analyze the semantic structural relationship of the compound formula A. In particular, if the current input of the semantic analyzer is not a conforming formula but an atomic formula, it means that the recursion has reached the leaf node and stopped recursion, and the output is directly obtained to obtain the grammatical structure of the medical logic rule. Using this recursive grammar analysis algorithm, the grammatical hierarchy of the first-order logic rules output by the model can be parsed and stored in the form of a tree structure, providing a data basis for the subsequent automatic generation of natural language text according to the first-order logic rule structure. Then, each grammatical structure is recursively parsed, and then a logical natural language text is generated based on the natural language template, where the logical rule formula of each grammatical structure corresponds to multiple natural language templates, which can avoid the problems caused by the single format of the automatic translation sentence, and then translate it into a logical natural language text. Exemplarily, when the input formula satisfies the form of P(c), it is translated into a corresponding subject-related pattern according to the predicate type, for example, "headache (x)" is translated into "x has clinical symptoms of headache"; when the input formula satisfies the form of P(c, True), it is also translated into a corresponding subject-related pattern according to the predicate type, for example, "diabetes (x, True)" is translated into "x has diabetes"; when the input formula is a compound formula including conjunctions such as "or", "and" and "if and only if", it is also translated into a specified pattern that follows their semantics, and the formulas below the current level are recursively analyzed, for example, A in A∨B. Finally, a similarity model, for example, a pre-trained language model based on transformer, is used to determine the similarity between the logical natural language text and the medical natural language text.

[0093] Optionally, generating a final medical logic rule according to the similarity and the medical logic rule includes:

[0094] When the similarity is greater than or equal to a preset threshold, taking the medical logic rule as the final medical logic rule;

[0095] When the similarity is less than the preset threshold, the above steps are iterated.

[0096] Specifically, when the similarity is greater than or equal to a preset threshold, the medical logic rule is used as the final medical logic rule; when the similarity is less than the preset threshold, the above steps are iterated and recalculated and determined to obtain the most accurate final medical logic rule.

[0097] Optionally, performing entity verification on the medical logic rule to generate a verification result includes:

[0098] The degree of overlap between the medical logic rule and the medical natural language text is determined according to the entity verification formula group, wherein the entity verification formula group includes:

[0099]

[0100] Wherein, α is the overlap degree, M is the logical entity set of the medical natural language text, M' is the logical entity set of the medical logic rule, e is an entity, N is the number of entities in M, and N' is the number of entities in M';

[0101] The medical logic rule is physically verified according to the overlap degree to generate the verification result.

[0102] Specifically, a group of entity verification formulas can be used to determine the overlap between medical logic rules and medical natural language texts for accurate verification.

[0103] like Figure 2 As shown, a medical assistance system 200 provided in an embodiment of the present invention includes:

[0104] A generation module 210, for inputting the acquired medical natural language text into a large language model based on a prompting project to generate medical logic rules, wherein the format of the medical logic rules is a first-order logic formula;

[0105] A verification module 220, used for performing entity verification on the medical logic rule and generating a verification result. When the verification result is wrong, the large language model regenerates the medical logic rule;

[0106] A similarity module 230, for determining the similarity between the medical logic rule and the medical natural language text when the verification result is correct;

[0107] The final module 240 is used to generate a final medical logic rule according to the similarity and the medical logic rule.

[0108] Alternatively, if Figure 3 As shown, the medical assistance system further includes a prediction module 250, which is used to determine the symptom similarity between the final medical logic rule and each clinical data in the clinical entity data set.

[0109] Specifically, after obtaining the final medical logic rule, the prediction module can be used to determine the symptom similarity between the final medical logic rule and each clinical data in the clinical entity data set. The prediction module uses a probabilistic logic reasoning method to predict, calculate the symptom similarity between the final medical logic rule and each clinical data in the clinical entity data set, and obtain a preset number of symptoms with a high similarity ranking to assist the medical process. Exemplarily, based on the symptom similarity, an inference algorithm, such as ProbLog, can be used to calculate the probability of each symptom separately to obtain the final symptom prediction probability. In this way, the prediction model can give play to the powerful representation ability of logical knowledge and enhance the generalization ability so as to more flexibly handle incomplete information and unknown data, thereby improving the accuracy and robustness of reasoning, and by combining probabilistic logic and reasoning, it can better handle the complexity and uncertainty in medical data, which is convenient for assisting the medical process.

[0110] like Figure 4 As shown, an electronic device 400 provided by an embodiment of the present invention includes a memory 410 and a processor 420; the memory 410 is used to store a computer program; the processor 420 is used to implement the medical logic knowledge extraction method as described above when executing the computer program.

[0111] In other words, an electronic device 400 includes a memory 410 and a processor 420 coupled to the memory 410; the memory 410 is configured to store a computer program; and the processor 420 is configured to perform the following operations when executing the computer program:

[0112] Based on the prompt engineering, the acquired medical natural language text is input into the large language model to generate medical logic rules, wherein the format of the medical logic rules is a first-order logic formula;

[0113] Performing entity verification on the medical logic rule to generate a verification result, and when the verification result is wrong, the large language model regenerates the medical logic rule;

[0114] When the verification result is correct, determining the similarity between the medical logic rule and the medical natural language text;

[0115] A final medical logic rule is generated according to the similarity and the medical logic rule.

[0116] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the medical logic knowledge extraction method as described above is implemented.

[0117] In other words, a non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor performs the following operations:

[0118] Based on the prompt engineering, the acquired medical natural language text is input into the large language model to generate medical logic rules, wherein the format of the medical logic rules is a first-order logic formula;

[0119] Performing entity verification on the medical logic rule to generate a verification result, and when the verification result is wrong, the large language model regenerates the medical logic rule;

[0120] When the verification result is correct, determining the similarity between the medical logic rule and the medical natural language text;

[0121] A final medical logic rule is generated according to the similarity and the medical logic rule.

[0122] An electronic device 400 that can be used as a server or client of the present invention will now be described, which is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device 400 is intended to represent various forms of digital electronic computer equipment, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 400 can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples, and are not intended to limit the implementation of the present invention described and / or required herein.

[0123] The electronic device 400 includes a computing unit, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) or a computer program loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for the operation of the device can also be stored. The computing unit, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.

[0124] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. In the present application, the unit described as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment of the present invention. In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0125] Although the present invention is disclosed as above, the protection scope of the present invention is not limited thereto. Those skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention, and these changes and modifications will fall within the protection scope of the present invention.

Claims

1. A method for extracting medical logic knowledge, characterized in that: include: Based on the prompt engineering, the acquired medical natural language text is input into the large language model to generate medical logic rules, wherein the format of the medical logic rules is a first-order logic formula; Performing entity verification on the medical logic rule to generate a verification result, and when the verification result is wrong, the large language model regenerates the medical logic rule; When the verification result is correct, determining the similarity between the medical logic rule and the medical natural language text; A final medical logic rule is generated according to the similarity and the medical logic rule.

2. The medical logic knowledge extraction method according to claim 1, characterized in that: The prompt-based engineering method inputs the acquired medical natural language text into a large language model to generate medical logic rules, including: Based on the prompt project, determining an extraction task of the large language model; Using a least-to-most-hint strategy, the extraction task is decomposed into at least one subtask; The subtasks are executed sequentially through the large language model to generate subtask results for each subtask, wherein the input of the first subtask is the medical natural language text, the input of other subtasks is the subtask results output by executing the previous subtask, and the subtask result output by the last subtask is the medical logic rule.

3. The medical logic knowledge extraction method according to claim 2, characterized in that: The step of sequentially executing the subtasks by using the large language model to generate a subtask result for each subtask includes: For one of the subtasks, a thinking chain strategy is adopted to decompose the subtask into at least one sub-step; The sub-steps are executed through the large language model to generate sub-step results of all the sub-steps and the corresponding sub-task results at one time.

4. The medical logic knowledge extraction method according to claim 2, characterized in that: The step of sequentially executing the subtasks by using the large language model to generate a subtask result for each subtask includes: The large language model sequentially executes the subtasks. For one of the subtasks, a thought chain self-verification strategy is adopted to repeatedly execute the subtask multiple times through the large language model to construct a subtask result data set of the subtask, wherein the subtask result data set includes multiple candidate subtask results; The self-consistency of each of the candidate subtask results in the subtask result data set is determined, and the subtask result of the subtask is determined based on the self-consistency.

5. The medical logic knowledge extraction method according to claim 4, characterized in that: The determining the self-consistency of each of the candidate subtask results in the subtask result data set includes: Determine the self-consistency of each of the candidate subtask results in the subtask result data set according to a self-consistency formula group, wherein the self-consistency formula group includes: in, is the self-consistency of the i-th candidate subtask result, A is the subtask result dataset, α i is the result of the candidate subtask of the i-th type, α j is the jth candidate subtask result, is the number of elements in the subtask result dataset.

6. The medical logic knowledge extraction method according to claim 1, characterized in that: The determining of the similarity between the medical logic rule and the medical natural language text includes: Using a recursive grammar analysis algorithm to extract the grammatical structure of the medical logic rule; Recursively parsing the grammatical structure, and generating a logical natural language text according to the grammatical structure based on a natural language template; A similarity model is used to determine the similarity between the logical natural language text and the medical natural language text.

7. The medical logic knowledge extraction method according to claim 1, characterized in that: Generating a final medical logic rule according to the similarity and the medical logic rule includes: When the similarity is greater than or equal to a preset threshold, taking the medical logic rule as the final medical logic rule; When the similarity is less than the preset threshold, the above steps are iterated.

8. The medical logic knowledge extraction method according to claim 1, characterized in that: The performing entity verification on the medical logic rule to generate a verification result includes: The degree of overlap between the medical logic rule and the medical natural language text is determined according to the entity verification formula group, wherein the entity verification formula group includes: Wherein, α is the overlap degree, M is the logical entity set of the medical natural language text, M' is the logical entity set of the medical logic rule, e is the entity, N is the number of entities in M, and N ′ is the number of entities in M'; The medical logic rule is physically verified according to the overlap degree to generate the verification result.

9. A medical assistance system, characterized in that: Applying the medical logic knowledge extraction method according to any one of claims 1 to 8, the medical assistance system comprises: A generation module, for inputting the acquired medical natural language text into a large language model based on a prompting project to generate medical logic rules, wherein the format of the medical logic rules is a first-order logic formula; A verification module, used for performing entity verification on the medical logic rule and generating a verification result. When the verification result is wrong, the large language model regenerates the medical logic rule; A similarity module, for determining the similarity between the medical logic rule and the medical natural language text when the verification result is correct; The final module is used to generate a final medical logic rule according to the similarity and the medical logic rule.

10. The medical assistance system according to claim 9, characterized in that: It also includes a prediction module, which is used to determine the symptom similarity between the final medical logic rule and each clinical data in the clinical entity data set.

Citation Information

Patent Citations

  • Method for solving reading comprehension question based on semantic analysis and SMT solution

    CN108829666A

  • Constraint solving method of symbolic execution system for vulnerability detection

    CN116382653A

  • Parsing and Interpretation of Logical Statements

    US20170046139A1

  • System for logic rule induction on knowledge graphs of engineering systems

    WO2022046086A1

Cited By

  • Intelligent operation and maintenance aid decision-making method and device based on large language model, and medium

    CN119739797A

  • Large model-based medical data compliance inspection method and system

    CN120179674A

  • A compliance inspection method and system for medical data based on large models

    CN120179674B

  • Rule base dynamic construction method and device based on large language model and medium

    CN120179811A

  • Method and system for automatically converting medical rule into executable rule graph

    CN122158185A