Knowledge-enhanced disease diagnosis method, device and system, and storage medium

By introducing knowledge graph retrieval and the use of BERT models in disease diagnosis methods, the shortcomings of existing methods in structured reasoning and data annotation efficiency are solved, and higher diagnostic accuracy and interpretability are achieved.

CN119418904APending Publication Date: 2025-02-11SHANGHAI SECOND POLYTECHNIC UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411470691.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

The existing disease diagnosis methods have insufficient in terms of structured reasoning and medical data labeling efficiency, resulting in insufficient diagnostic accuracy and interpretability.

Method used

Structured knowledge in the original clinical text is retrieved through the knowledge graph, characterized this knowledge, inserted into the prompt template of the BERT model, generate new clinical text, and use the BERT model to diagnose diseases.

Benefits of technology

Improves the accuracy of disease diagnosis and enhances the interpretability of predicted results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119418904A_ABST
    Figure CN119418904A_ABST
Patent Text Reader

Abstract

The invention discloses a knowledge-enhanced disease diagnosis method, device and system, and a storage medium. The method comprises the following steps: S1, retrieving structured knowledge in an original clinical text through a knowledge graph; s2, the searched structured knowledge is represented, and a text vector is obtained; s3, inputting the text vector into a preset prompt template to obtain a new clinical text; and S4, inputting the new clinical text into the BERT model for disease diagnosis. By adopting the technical scheme of the invention, the accuracy of disease diagnosis is effectively improved, and the interpretability of the prediction result is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of natural language processing technology, and in particular relates to a knowledge-enhanced disease diagnosis method and device, system, and storage medium. Background Art

[0002] With the rapid development of artificial intelligence and natural language processing technology, the use of deep learning models for text classification to assist disease diagnosis has become an important research direction. Among them, the BERT model, as a powerful natural language processing tool, has performed well in many text classification tasks. Onan et al. proposed an innovative hierarchical graph-based text classification framework that captures the complex relationships between nodes through contextual node embedding and the dynamic fusion mechanism of the BERT model. Although these methods have achieved good performance in classification accuracy and stability, they still have many problems in practical applications, mainly reflected in the poor structured reasoning and low efficiency of medical data annotation. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a knowledge-enhanced disease diagnosis method and device, system, and storage medium, which not only effectively improves the accuracy of disease diagnosis, but also enhances the interpretability of prediction results.

[0004] To achieve the above object, the present invention adopts the following technical solution:

[0005] A knowledge-enhanced disease diagnosis method, comprising:

[0006] Step S1, retrieving structured knowledge in the original clinical text through the knowledge graph;

[0007] Step S2: Represent the retrieved structured knowledge to obtain a text vector;

[0008] Step S3, inputting the text vector into a preset prompt template to obtain a new clinical text;

[0009] Step S4: Input the new clinical text into the BERT model for disease diagnosis.

[0010] Preferably, step S1 comprises:

[0011] For each entity extracted from the original clinical text, find the corresponding entity in the knowledge graph;

[0012] For each pair of matching entities, all possible reasoning paths are found in the knowledge graph.

[0013] Preferably, in step S2, each inference in the set of inference paths is concatenated as a piece of text, and represented as a text vector through the BERT model.

[0014] Preferably, in step S3, the text vector is input into a preset prompt template to obtain a template containing mask and The new clinical text of ; where mask is the mark used for a certain type of words in the original clinical text, is the updated soft token vector, k mask is the vector corresponding to the mask token, and k1, k2, k3, ... are the vocabulary vector representations corresponding to the original clinical text.

[0015] Preferably, in step S4, the new clinical text is input into the BERT model, forward reasoning is performed to obtain the representation of each token, and then verbalizer prediction is performed based on the representation at the mask position to obtain the disease type diagnosis result.

[0016] The present invention also provides a knowledge-enhanced disease diagnosis device, comprising:

[0017] The retrieval module is used to retrieve structured knowledge in the original clinical text through the knowledge graph;

[0018] The representation module is used to represent the retrieved structured knowledge and obtain text vectors;

[0019] A processing module, used for inputting the text vector into a preset prompt template to obtain a new clinical text;

[0020] The prediction module is used to input new clinical text into the BERT model for disease diagnosis.

[0021] The present invention also provides a knowledge-enhanced disease diagnosis system, comprising: a memory and a processor, wherein the memory stores a computer program executed by the processor, and the computer program executes a knowledge-enhanced disease diagnosis method when executed by the processor.

[0022] The present invention also provides a storage medium, on which a computer program is stored, and the computer program executes the knowledge-enhanced disease diagnosis method when running.

[0023] The present invention retrieves knowledge from the original clinical text through an external knowledge graph, then encodes the retrieved structured knowledge and inserts it into the prompt template to enhance the language model's understanding and reasoning ability of the task, and ultimately achieves a more accurate disease diagnosis effect; the technical solution of the present invention not only effectively improves the accuracy of disease diagnosis, but also enhances the interpretability of prediction results. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0025] Figure 1 Flow chart of the knowledge-enhanced disease diagnosis method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0028] Embodiment 1:

[0029] like Figure 1 As shown, an embodiment of the present invention provides a knowledge-enhanced disease diagnosis method, comprising:

[0030] Step S1, retrieving structured knowledge in the original clinical text through the knowledge graph;

[0031] Step S2: Represent the retrieved structured knowledge to obtain a text vector;

[0032] Step S3, inputting the text vector into a preset prompt template to obtain a new clinical text;

[0033] Step S4: Input the new clinical text into the BERT model for disease diagnosis.

[0034] Furthermore, the embodiment of the present invention predicts the type of disease suffered by the patient based on the content of the patient's original clinical text x (clinical information and electronic medical records) Therefore, it can be expressed as learning a model f(·) with parameters θ. Given an x, f(x; θ) outputs a prediction result in, is the label set of all candidate disease types. The embodiment of the present invention predicts disease types based on prompt learning. The original classification problem is to fit Y = P (X; θ), and the converted language modeling problem is to fit Y = (T (X); θ), where T (X) represents the encapsulation of the original clinical text as a new input using a prompt template.

[0035] As an implementation method of an embodiment of the present invention, step S1 is specifically as follows: the original clinical text contains a lot of conceptual structured knowledge, such as symptoms, diagnosis and treatment plans. Knowledge retrieval can identify and extract key medical concepts and relationships. For example, "type 2 diabetes" is a common chronic disease, the main feature of which is a continuous increase in blood sugar levels; the diagnostic criteria are: fasting blood sugar, HbAlc level, etc.; common symptoms include: polydipsia, polyphagia, polyuria, weight loss, fatigue, etc. The structured knowledge that can be extracted through knowledge retrieval also includes causes, related complications, risk factors, etc. This type of knowledge plays an important auxiliary role in disease prediction. Therefore, the embodiment of the present invention uses the following method to achieve knowledge retrieval of the original clinical text:

[0036] Given the original clinical text x of the patient, x is processed including word segmentation and part-of-speech tagging to obtain the vocabulary set x of the original clinical text = {w1, w2, ..., w n}, First, apply the named entity recognition (NER) model f NER , identify the entity set E x ={e1, e2, ...e m}.

[0037] E x →f NER (x) (1)

[0038] Set up knowledge graph The entity set is V = {v1, v2, ..v k V may include entities such as “type 2 diabetes”, “hyperglycemia”, “insulin”, “weight gain”, etc.; E may include relations such as “is a symptom”, “used for treatment”, “leads to”, etc. Next, for each entity e extracted from the original clinical text, i , find the corresponding entity v in the knowledge graph i The key to this matching process is to judge e i and v i Whether it represents the same or similar concept. This process can be achieved through the similarity function sim = (e i , v i ) to achieve. i With v i Matching, when sim=(e i , v i) reaches a certain threshold θ, it is considered that entity e i With entity v i Match, that is and When they satisfy each other, they are considered to represent the same or related entities.

[0039] For each pair of matching entities, all possible reasoning paths P are found in the knowledge graph. The relationship in the knowledge graph can be represented as a triple form (v i , r, v j ), where v i , v j ∈G is an entity, r∈G R is a relationship. The reasoning goal is to find a possible path P from entity v i to v j :

[0040] P(v i , V) = {(v i , r1, v i1 ), (v i1 , r2, v i2 ),...,(v in , r n , v j )} (2)

[0041] For each pair of matching entities (v i , v j ), collect all possible reasoning paths P(v i , v j ), thereby obtaining the inter-entity structured knowledge extracted from the original clinical text, and using this knowledge for further analysis and application such as disease prediction and relationship inference. t = "Type 2 diabetes", the next step is to find the matching entity v in the knowledge graph t = "Type 2 Diabetes", similarity function sim(e t , v k )≥θ. Find the path P: (“Type2Diabetes”, “causes”, “High Blood Sugar”)→(“High Blood Sugar”, “leads to”, “Kidney Disease”), then collect and record the paths to build a reasoning chain from “Type 2 Diabetes” to “Kidney Disease”.

[0042] Paths(v i , v j )=U all valid P P(v i , vj ) (3)

[0043] As an implementation of the embodiment of the present invention, in step S2, the structured knowledge on the reasoning path is represented; each reasoning in the set of reasoning paths is concatenated and then regarded as a piece of text, which is represented as a text vector k. .

[0044] (1) Reasoning Path Representation

[0045] Each reasoning path P(g i , g j ) is converted into a readable text, where each path consists of a series of triples (g i , r, g j ). These triples can be converted into text, where each triple is expressed in the form of "entity 1 goes to entity 2 through a relationship". For example, there is a reasoning path (g1, r1, g2), (g2, r2, g3), which can be converted into text: "Entity g1 goes to entity g2 through relationship r1, and g2 goes to entity g3 through relationship r2". Suppose the knowledge graph has the following triples: ("type 2 diabetes", "causes", "hyperglycemia"), ("hyperglycemia", "leads to", "kidney disease"), which is converted into text: "Type 2 diabetes goes to hyperglycemia through causes, and leads to kidney disease through leads to".

[0046] After completing the path-to-text conversion, use the BERT model M to convert the text T p Convert to text vector k p .

[0047] (2) Text vectorization model selection (BERT)

[0048] Input text T p First, the input text is tokenized by BERT to split it into smaller sub-word units. For example, for the input text "Type 2 diabetes causes to high blood sugar, leads to kidney disease", the table planning process may split it into sub-word units such as "type 2", "diabetes", "through", "causes", "to", "high blood sugar", "through"... Then each token is converted into an ID in the BERT vocabulary. After tokenization, the next step is encoding or converting the token ID sequence into an embedding vector. The input embedding vector is then passed through BERT's multi-layer Transformer encoder to effectively capture the contextual relationship and dependency relationship between tokens. The formula is:

[0049]

[0050] Among them, TP is the input text sequence, x p is the text vector representation output by the BERT model. BERT The function is to convert the text sequence T p Convert to its vector representation x p Among them, x p Contains the input text T P semantic information.

[0051] BERT model outputs text T P The vector representation of is:

[0052] k p =M(x p ) (5)

[0053] Among them, x p The BERT model is used to train the input text sequence T p The vector representation obtained after processing captures the semantic information of the input text. M is an additional mapping function that accepts x p As input, and further process it. p It is the final text vector representation obtained after being processed by the mapping function M.

[0054] (3) Output vector extraction

[0055] In the text vectorization model selection, the BERT model is used to transform the input text sequence T p Convert to a vector representation x p In this process, we usually choose to use the special tag [CLS] to mark the corresponding vector as the comprehensive representation k of the entire input text. p , that is, k p [0].

[0056] As an implementation of the embodiment of the present invention, step S3 is specifically:

[0057] (1) Construction of prompt template

[0058] In order to effectively use the BERT model for text vectorization, the original clinical text x needs to be preprocessed first to construct a prompt template Template(x) in the qualified BERT input format. This prompt template Template(x) generates a new clinical text x′ containing special tags and specific vocabulary. x′ contains special tokens such as [MASK], soft tags (softtoken) and other related vocabulary.

[0059] For example:

[0060] Original clinical text x: "Type 2 diabetes is a chronic metabolic disease."

[0061] Tip Template(x): "Type 2 diabetes is a [MASK] [SOFT] disease."

[0062] Generate x′: "Type 2 diabetes is a [MASK] [SOFT] disease."

[0063] (2) Expression of template switching

[0064] x′=Template(x)=[w1, soft, w2, mask, w3,...] (6)

[0065] Among them, w i Represents the original clinical text or other words added according to the context. Assume that the original clinical text x is to be converted into a template x′, which can be achieved by inserting special markers and soft tags. The specific example is as follows:

[0066] Original clinical text x: "Type 2 diabetes is a chronic metabolic disease."

[0067] Transformed x′: “Type 2 diabetes is a [MASK] [SOFT] disease.”

[0068] It is expressed as:

[0069] x′=Template(x)

[0070] =["Type 2 diabetes", soft, "is a", mask, "nature", soft, "disease". ]

[0071] (3) Vector representation and processing

[0072] Use the BERT model M to transform x′ into a vector set {k1, k soft , k2, k mask , k3, ...}. Each vector k i Corresponding to a word or token in the preprocessed text x′, where k soft is the vector corresponding to the soft token, k mask is the vector corresponding to the mask token, and k1, k2, k3, ... are the vocabulary vector representations corresponding to the original clinical text.

[0073] For example, for the original clinical text x: "Type 2 diabetes is a chronic metabolic disease.", the generated vector set is described as follows:

[0074] k1: corresponds to the vector representation of the first word w1 in the original clinical text, i.e., “type 2 diabetes”.

[0075] k soft : The vector representation corresponding to the soft token

[0076] k2: corresponds to the vector representation of the second word w2 in the original clinical text, i.e. “is a kind of”.

[0077] k mask : The vector representation corresponding to the mask token

[0078] k3: corresponds to the vector representation of the third word w3 in the original clinical text, namely: "disease".

[0079] The same goes for other vectors.

[0080] (4) Vector processing

[0081] Calculate k soft and other vectors related to it (such as k i ) is used to replace the original k soft Vector. The specific formula is as follows:

[0082]

[0083] in, is the updated soft token vector, n is the number of vectors associated with soft, k i is the vector associated with the soft token.

[0084] Finally, the original k soft Replace with After that, we get the updated vector set:

[0085] As an implementation method of the present invention, in step S4, the mask and The x′ is input into a BERT module, forward reasoning is performed to obtain the representation of each token, and then the representation at the mask position is taken out to make a verbalizer prediction.

[0086] Given a modified input x′, formalized as:

[0087] x′=[w1, softnew, w2, mask, w3,...] (8)

[0088] Input x′ into the BERT module M and perform forward reasoning to obtain the vector representation of each token:

[0089]

[0090] Extract the representation k of the mask token from the model output mask .

[0091] Use a verbalizer function V to classify k mask Mapped to a specific vocabulary. Verbalizer V is a mapping from a vector space to a vocabulary, usually used to convert the vector predicted by the model into a specific vocabulary:

[0092] predicted word=V(k mask ) (10)

[0093] The specific steps are as follows:

[0094] (1) Calculate k mask The similarity between the embedding vector of each word in the vocabulary is obtained to obtain the possibility distribution. For example, if the embedding vector of each word in the vocabulary is e i , then the possibility distribution is:

[0095] similarity=k mask ·e i (11)

[0096] (2) Based on the calculated similarity, select the word with the highest probability as the prediction result.

[0097] Embodiment 2:

[0098] The embodiment of the present invention further provides a knowledge-enhanced disease diagnosis device, comprising:

[0099] The retrieval module is used to retrieve structured knowledge in the original clinical text through the knowledge graph;

[0100] The representation module is used to represent the retrieved structured knowledge and obtain text vectors;

[0101] A processing module, used for inputting the text vector into a preset prompt template to obtain a new clinical text;

[0102] The prediction module is used to input new clinical text into the BERT model for disease diagnosis.

[0103] Embodiment 3:

[0104] An embodiment of the present invention further provides a knowledge-enhanced disease diagnosis system, comprising: a memory and a processor, wherein the memory stores a computer program executed by the processor, and the computer program executes a knowledge-enhanced disease diagnosis method when executed by the processor.

[0105] Embodiment 4:

[0106] An embodiment of the present invention further provides a storage medium having a computer program stored thereon, wherein the computer program executes the knowledge-enhanced disease diagnosis method when running.

[0107] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.

Claims

1. A knowledge-enhanced disease diagnosis method, characterized in that: include: Step S1, retrieving structured knowledge in the original clinical text through the knowledge graph; Step S2: Represent the retrieved structured knowledge to obtain a text vector; Step S3, inputting the text vector into a preset prompt template to obtain a new clinical text; Step S4: Input the new clinical text into the BERT model for disease diagnosis.

2. The knowledge-enhanced disease diagnosis method according to claim 1, characterized in that: Step S1 includes: For each entity extracted from the original clinical text, find the corresponding entity in the knowledge graph; For each pair of matching entities, all possible reasoning paths are found in the knowledge graph.

3. The knowledge-enhanced disease diagnosis method according to claim 2, characterized in that: In step S2, each inference in the set of inference paths is concatenated as a piece of text, and represented as a text vector through the BERT model.

4. The knowledge-enhanced disease diagnosis method according to claim 3, characterized in that: In step S3, the text vector is input into the preset prompt template to obtain a mask and The new clinical text of ; where mask is the mark used for a certain type of words in the original clinical text, is the updated soft token vector, k mask is the vector corresponding to the mask token, and k1, k2, k3, ... are the vocabulary vector representations corresponding to the original clinical text.

5. The knowledge-enhanced disease diagnosis method according to claim 4, characterized in that: In step S4, the new clinical text is input into the BERT model, and forward reasoning is performed to obtain the representation of each token. Then, based on the representation at the mask position, verbalizer prediction is performed to obtain the disease type diagnosis result.

6. A knowledge-enhanced disease diagnosis device, characterized in that: include: The retrieval module is used to retrieve structured knowledge in the original clinical text through the knowledge graph; The representation module is used to represent the retrieved structured knowledge and obtain text vectors; A processing module, used for inputting the text vector into a preset prompt template to obtain a new clinical text; The prediction module is used to input new clinical text into the BERT model for disease diagnosis.

7. A knowledge-enhanced disease diagnosis system, characterized in that: include: A memory and a processor, wherein the memory stores a computer program executed by the processor, and when the computer program is executed by the processor, the knowledge-enhanced disease diagnosis method as described in any one of claims 1 to 5 is executed.

8. A storage medium, characterized in that: The storage medium stores a computer program, which, when run, executes the knowledge-enhanced disease diagnosis method according to any one of claims 1 to 5.

Citation Information

Cited By

  • Postoperative symptom prediction system and device, and storage medium

    CN121306422A