Medical data processing method, device and storage medium
By generating medical record semantic vectors and combining preset disease sets and knowledge graphs, we determine the disease analysis vectors corresponding to medical record data, solving the problem of inefficient medical data processing and achieving more efficient and comprehensive data analysis.
Patent Information
- Application Number
- CN202210190188.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-28
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2042-02-28
AI Technical Summary
The prior art is inefficient in medical data processing, especially in the fields of medical electronic consultation platforms and medical data analysis and statistics, and it is difficult to effectively process and analyze large amounts of data.
By obtaining medical record data, a semantic vector of medical records is generated, and a preset disease set and knowledge graph are used to determine the disease analysis vector corresponding to the medical record data. The method includes generating a medical history semantic vector, calculating disease probability weights, and fusing weight vectors to obtain disease analysis vectors.
It realizes automated analysis and processing of medical data, improves data processing efficiency, and can more comprehensively reflect individual situations and general situations, thereby meeting different analysis needs.
Smart Images

Figure CN114550946B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a medical data processing method, device and storage medium. Background Art
[0002] As medical technology matures, there is an increasing need for automated analysis and processing of medical data in areas such as medical teaching and the construction of medical electronic consultation platforms to meet different analysis needs.
[0003] At present, due to the particularity of medical data, the processing of medical data still relies mainly on manual work, but the efficiency of manual processing is extremely low. Especially in areas such as medical electronic consultation platforms and medical data analysis and statistics where there are large amounts of data to be processed and analyzed, there are still great difficulties in improving the efficiency of medical data processing. Summary of the invention
[0004] The present disclosure provides a medical data processing method, the method comprising:
[0005] Obtain medical record data, and execute a target process to obtain a disease analysis vector corresponding to the medical record data, wherein the target process includes:
[0006] Generate a medical record semantic vector of the medical record data;
[0007] For each preset disease in the preset disease set, determining, according to the medical record semantic vector, a first possibility weight of the medical record data caused by the preset disease to obtain a first weight vector;
[0008] According to each medical record symptom and each medical record disease in the medical record data, determining a candidate disease that may generate the medical record data from a preset knowledge graph, wherein the preset knowledge graph includes entities and relationships related to the preset disease, and the candidate disease belongs to the preset disease set;
[0009] Determining a second likelihood weight of the medical record data due to the candidate disease to obtain a second weight vector;
[0010] The first weight vector and the second weight vector are merged to obtain a disease analysis vector corresponding to the medical record data.
[0011] Optionally, the medical record data includes text data and numerical data, and generating a medical record semantic vector of the medical record data includes:
[0012] Encoding the text data into a text semantic vector;
[0013] Convert the numerical data into a vector to obtain a numerical vector;
[0014] Concatenate the text semantic vector with the numerical vector to obtain a concatenated vector;
[0015] The concatenated vector is encoded through a multi-head self-attention mechanism to obtain a medical record semantic vector of the medical record data.
[0016] Optionally, determining candidate diseases that may generate the medical record data from a preset knowledge graph based on each medical record symptom and each medical record disease in the medical record data includes:
[0017] For each medical record symptom in the medical record data, determine a graph disease subset corresponding to the medical record symptom in a preset knowledge graph to form a graph disease set;
[0018] Based on the medical record disease set formed by each medical record disease in the medical record data and the atlas disease set, a candidate disease set that may generate the medical record data is determined.
[0019] Optionally, the determining of a candidate disease set that may generate the medical record data based on the medical record disease set formed by each medical record disease in the medical record data and the atlas disease set includes:
[0020] For each of the medical record diseases in the medical record disease set, if the negative factor coefficient of the medical record disease is a preset minimum value, the medical record disease is deleted from the medical record disease set, and the medical record disease set after deleting the medical record disease forms a target medical record disease set;
[0021] For each of the medical record diseases in the medical record disease set, if the negative factor coefficient of the medical record disease is the preset minimum value and the medical record disease exists in the atlas disease set, the medical record disease is deleted from the atlas disease set, and the atlas disease set after deleting the medical record disease forms an initial candidate disease set;
[0022] For each target medical record disease included in the target medical record disease set, if the target medical record disease does not exist in the initial candidate disease set, the target medical record disease is added to the initial candidate disease set to form a candidate disease set that may generate the medical record data.
[0023] Optionally, determining a second possibility weight of the medical record data due to the candidate disease to obtain a second weight vector includes:
[0024] Determine the initial second probability weight of the medical record data due to the candidate disease according to the negative factor coefficient of each medical record symptom, the probability of joint occurrence of each medical record symptom and the candidate disease, the number of diseases in the atlas disease subset to which the candidate disease belongs, and the number of diseases in the candidate disease set;
[0025] If the candidate disease meets a preset condition, the initial second possibility weight corresponding to the candidate disease is determined as the second possibility weight corresponding to the candidate disease, wherein the preset condition is that the candidate disease exists in the initial candidate disease set but does not exist in the medical record disease set;
[0026] If the candidate disease does not satisfy the preset condition, the initial second possibility weight corresponding to the candidate disease is modified to obtain the second possibility weight corresponding to the candidate disease.
[0027] Optionally, if the candidate disease does not meet the preset condition, the initial second possibility weight corresponding to the candidate disease is modified to obtain the second possibility weight corresponding to the candidate disease, including:
[0028] If the candidate disease exists in both the medical record disease set and the initial candidate disease set, then according to the occurrence probability of each candidate disease, the initial second possibility weight corresponding to the candidate disease is modified to obtain the second possibility weight corresponding to the candidate disease;
[0029] If the candidate disease exists in the medical record disease set but does not exist in the initial candidate disease set, the initial second possibility weight corresponding to the candidate disease is modified according to the negative factor coefficient of the candidate disease, the preset hyperparameters, and the number of diseases in the candidate disease set to obtain the second possibility weight corresponding to the candidate disease.
[0030] Optionally, before determining candidate diseases that may generate the medical record data from a preset knowledge graph based on each medical record symptom and each medical record disease in the medical record data, the method further includes:
[0031] Determine the negative factor coefficient of the medical record symptom according to the degree of negation of the medical record symptom by the first adjacent word located before the medical record symptom in the medical record data, wherein the negative factor coefficient of the medical record symptom is negatively correlated with the degree of negation of the medical record symptom by the first adjacent word;
[0032] The negative factor coefficient of the medical record disease is determined based on the degree of negation of the medical record disease by the second adjacent word located before the medical record disease in the medical record data, wherein the negative factor coefficient of the medical record disease is negatively correlated with the degree of negation of the medical record disease by the second adjacent word.
[0033] Optionally, if the candidate disease does not meet the preset condition, the initial second possibility weight corresponding to the candidate disease is modified, and after the second possibility weight corresponding to the candidate disease is obtained, the method further includes:
[0034] For the preset disease that does not belong to the candidate disease set, determining the second possibility weight corresponding to the preset disease to be 0;
[0035] The second possibility weight corresponding to each of the preset diseases is normalized to obtain a second weight vector.
[0036] Optionally, before determining the second possibility weight of the medical record data due to the candidate disease to obtain a second weight vector, the method further includes:
[0037] The joint occurrence probability of each of the medical record symptoms and the candidate disease is obtained from the preset knowledge graph.
[0038] Optionally, if the candidate disease does not meet the preset condition, the initial second possibility weight corresponding to the candidate disease is modified, and before obtaining the second possibility weight corresponding to the candidate disease, the method further includes:
[0039] The occurrence probability of each of the candidate diseases is obtained from the preset knowledge graph.
[0040] Optionally, before determining candidate diseases that may generate the medical record data from a preset knowledge graph based on each medical record symptom and each medical record disease in the medical record data, the method further includes:
[0041] Performing entity recognition on the medical record data to obtain each entity mention in the medical record data;
[0042] Performing entity linking on the entity mention in the preset knowledge graph to obtain matching entities of the entity mention in the preset knowledge graph;
[0043] Filtering out symptom entities representing symptoms from each of the matching entities to obtain each medical record symptom of the medical record data;
[0044] Disease entities representing diseases are screened out from each of the matching entities to obtain each medical record disease of the medical record data.
[0045] Optionally, performing entity linking on the entity mention in the preset knowledge graph to obtain matching entities of the entity mention in the preset knowledge graph includes:
[0046] For each entity included in the preset knowledge graph, calculating the similarity between the entity mention and each of the entities;
[0047] The entity mention is linked to a target entity corresponding to the maximum similarity, so as to use the target entity as a matching entity of the entity mention in the preset knowledge graph.
[0048] Optionally, calculating the similarity between the entity mention and each of the entities includes:
[0049] For any of the entities, respectively calculating an initial similarity between the entity mention and the entity by at least two similarity calculation methods;
[0050] The average of each of the calculated initial similarities is calculated to obtain the similarity between the entity mention and the entity.
[0051] Optionally, the initial similarity includes at least two of edit distance similarity, Jaccard similarity, longest common substring similarity, cosine similarity, explicit semantic analysis similarity and deep learning similarity.
[0052] Optionally, performing entity recognition on the medical record data to obtain each entity mention in the medical record data includes:
[0053] Entity recognition is performed on the medical record data according to a preset dictionary including a plurality of entity names to obtain entity mentions in the medical record data.
[0054] Optionally, performing entity recognition on the medical record data according to a preset dictionary including a plurality of entity names to obtain entity mentions in the medical record data includes:
[0055] According to a preset dictionary including a plurality of entity names, entity recognition is performed on the medical record data by using a bidirectional maximum matching algorithm to obtain entity mentions in the medical record data.
[0056] Optionally, the first weight vector and the second weight vector have the same dimension, the dimension being the number of diseases in the preset disease set, and fusing the first weight vector and the second weight vector to obtain the disease analysis vector corresponding to the medical record data includes:
[0057] The first possibility weight and the second possibility weight of the same dimension are weighted by different preset importance coefficients to obtain the weighting parameter, wherein the preset importance coefficient corresponding to the first possibility weight is negatively correlated with the preset importance coefficient corresponding to the second possibility weight;
[0058] The weighting parameters are calculated through a linear function or a nonlinear function to obtain a fusion weight, and each of the fusion weights forms a disease analysis vector corresponding to the medical record data, wherein the disease analysis vector has the same dimension as the first weight vector and the second weight vector.
[0059] Optionally, executing the target process to obtain the disease analysis vector corresponding to the medical record data includes:
[0060] Inputting the medical record data into a preset analysis model so that the preset analysis model executes the target process and outputs a disease analysis vector corresponding to the medical record data;
[0061] Before obtaining the medical record data, the method further includes:
[0062] Obtain a medical record data training set and a medical record data test set;
[0063] Training the original analysis model according to the medical record data training set and the preset loss function to obtain an intermediate analysis model;
[0064] The intermediate analysis model is tested according to the medical record data test set to obtain the preset analysis model.
[0065] The present disclosure also provides a prediction device for diabetes complications, including a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the medical data processing method as described above to obtain a disease analysis vector corresponding to the medical record data, wherein a preset disease set includes at least one diabetes complication, and each component in the disease analysis vector represents the disease probability corresponding to each of the diabetes complication.
[0066] The present disclosure also provides a computer non-volatile readable storage medium. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can perform the medical data processing method as described above.
[0067] The above description is only an overview of the technical solution of the present disclosure. In order to more clearly understand the technical means of the present disclosure, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present disclosure more obvious and easy to understand, the specific implementation methods of the present disclosure are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0069] Figure 1 A flowchart showing a method for processing medical data according to an embodiment of the present disclosure is shown;
[0070] Figure 2 A medical record data according to an embodiment of the present disclosure is shown;
[0071] Figure 3 Part of the knowledge in a diabetes knowledge graph according to an embodiment of the present disclosure is shown;
[0072] Figure 4 A flow chart of a training process of a model for implementing a medical data processing method according to an embodiment of the present disclosure is shown;
[0073] Figure 5 A flowchart showing a process of using a model for implementing a medical data processing method according to an embodiment of the present disclosure is shown;
[0074] Figure 6 A block diagram of a preset analysis model architecture of an embodiment of the present disclosure is shown;
[0075] Figure 7 A vector stitching flow chart of an embodiment of the present disclosure is shown. Specific embodiments
[0076] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0077] Unless otherwise defined, the technical terms or scientific terms used in the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, similar words such as "one", "one" or "the" do not indicate a quantitative limit, but indicate that there is at least one. Similar words such as "include" or "include" mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Similar words such as "connect" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Positional words such as "upper", "lower", "left", "right" are only used to indicate the relative position relationship based on the drawings. When the absolute position of the described object changes, the relative position relationship may also change accordingly.
[0078] Figure 1 A flowchart of a medical data processing method according to an embodiment of the present disclosure is shown. Figure 1 , the method comprises the following steps:
[0079] Step 10: Obtain medical record data, and execute a target process to obtain a disease analysis vector corresponding to the medical record data, wherein the target process includes the following steps 101-105.
[0080] In the embodiment of the present disclosure, the medical record data to be processed can be first obtained, wherein the medical record data is electronic data. Figure 2 A medical record data is shown as an example. Optionally, the medical record data can be obtained by converting a paper medical record into electronic data through text recognition or other methods. Optionally, the medical record data can also be obtained by exporting the electronic medical record data directly entered into the hospital medical record electronic platform by the doctor during the consultation. The disclosed embodiment does not specifically limit the method for obtaining the medical record data.
[0081] In practical applications, for medical record data that cannot be processed directly, some preprocessing can be performed according to processing requirements, and the preprocessing may include anonymization, abnormal data detection, structured processing, etc. Among them, through anonymization, private information such as the patient's name can be hidden to protect the patient's privacy; through abnormal data detection, missing data and data with abnormal values in the medical record data can be detected, and relevant prompts can be output to indicate that this medical record data cannot be analyzed due to data anomalies; through structured processing, medical record data can be converted into structured data for data storage, partial data extraction, etc.
[0082] Of course, when doctors consult, they can also standardize the way of filling in medical records to obtain medical record data that can be directly processed. For example, in the hospital medical record electronic platform, the filling rules of medical records can be standardized, such as which data must be filled in, which data positions cannot be missing, which data positions have minimum and maximum values that can be filled in, etc.
[0083] Step 101: Generate a medical record semantic vector for the medical record data.
[0084] In the target process, firstly, a medical record semantic vector of the medical record data is generated by using semantic analysis technology. In the embodiment of the present disclosure, the medical record semantic vector is a semantic representation of text and numbers in the medical record data.
[0085] Step 102: For each preset disease in the preset disease set, determine a first possibility weight of the medical record data due to the preset disease according to the medical record semantic vector to obtain a first weight vector.
[0086] In the disclosed embodiment, the relationship between medical record data and certain diseases can be analyzed. Specifically, at least two diseases can be preset to construct a preset disease set, for example, eight common complications of diabetes (diabetic retinopathy, diabetic nephropathy, diabetic peripheral neuropathy, diabetic autonomic neuropathy, diabetic foot, atherosclerosis, diabetic peripheral vascular disease and diabetic gastroparesis) are constructed as a preset disease set.
[0087] Based on the results of semantic analysis of the medical record data, the possibility that the condition corresponding to this medical record data is caused by each preset disease in the preset disease set can be calculated to obtain at least two first possibility weights, and then each first possibility weight can be converted into the required vector form to obtain a first weight vector.
[0088] Step 103: Based on each medical symptom and each medical disease in the medical record data, determine the candidate disease that may generate the medical record data from the preset knowledge graph, wherein the preset knowledge graph includes entities and relationships related to the preset disease, and the candidate disease belongs to the preset disease set.
[0089] Medical record data may include data such as the patient's self-reported medical history, main symptoms, as well as data such as the hospital's examination results and diagnosis results. These data may mention various symptoms and diseases. This article refers to the symptoms and diseases described in the medical record data as medical record symptoms and medical record diseases, respectively.
[0090] In the disclosed embodiment, a knowledge graph can be introduced to determine the candidate diseases that may cause the condition corresponding to the medical record data from another perspective. The knowledge graph can construct knowledge in the form of a multi-relationship graph, where knowledge is mainly based on entity (also called head entity)-relationship-entity (also called tail entity) as the smallest unit. For example, redness and swelling (symptom entity) for (pointing to) diabetic foot (disease entity), the relationship is that the former is the symptom of the latter.
[0091] Table 1 below provides an example of entities and relationships in a knowledge graph. It will be understood that the entities and relationships in the table do not constitute a limitation to the present disclosure.
[0092] Table 1
[0093]
[0094]
[0095] Figure 3 Part of the knowledge in a diabetes knowledge graph is shown as an example, and the relationship between entities is represented in the form of a relationship graph.
[0096] In the disclosed embodiment, the preset knowledge graph includes entities and relationships related to the preset disease, such as symptoms, examination methods, treatment methods, therapeutic drugs, etc. Among them, specific symptoms and disease names can be used as entities in the preset knowledge graph, and the relationship between the two can be constructed. The knowledge related to the preset disease in the preset knowledge graph is obtained based on a large amount of literature, big data analysis, etc., and is a collection of general knowledge.
[0097] In this step, according to the various symptoms and diseases mentioned in the medical record data, the candidate diseases that may cause the condition corresponding to the medical record data can be determined through the common knowledge in the preset knowledge graph. Since the preset knowledge graph includes common knowledge related to the preset diseases, all candidate diseases determined based on the preset knowledge graph belong to the preset disease set.
[0098] Step 104: Determine a second possibility weight of the medical record data due to the candidate disease to obtain a second weight vector.
[0099] In this step, based on the common knowledge related to each symptom and disease in the medical record data in the preset knowledge graph, the possibility that the corresponding condition of the medical record data is caused by each candidate disease can be calculated to obtain at least two second possibility weights. For the preset diseases other than the candidate diseases in the preset disease set, the second possibility weights of the medical record data caused by these preset diseases can be determined to be 0. Then, each second possibility weight is converted into the required vector form to obtain a second weight vector.
[0100] Step 105: The first weight vector and the second weight vector are merged to obtain a disease analysis vector corresponding to the medical record data.
[0101] In the disclosed embodiment, the first weight vector is the possibility that the corresponding condition of the medical record data is caused by each preset disease based on the semantic analysis of the medical record data, and the second weight vector is the possibility that the corresponding condition of the medical record data is caused by each preset disease based on the general knowledge in the knowledge graph. That is, the first weight vector is the analysis result obtained based on the individual situation, and the second weight vector is the analysis result obtained based on the general situation. The two are the analysis results of the same medical record data from different aspects.
[0102] In this step, the first weight vector and the second weight vector obtained by analyzing the medical record data based on different aspects can be fused, so as to obtain a comprehensive analysis result of the medical record data by combining individual conditions and general conditions, that is, the disease analysis vector corresponding to the medical record data. The disease analysis vector takes into account both individual differences and universal conditions. Therefore, the disease analysis vector can comprehensively reflect the medical record data from the two aspects of individual conditions and general conditions, thereby realizing a comprehensive analysis of the medical record data, making the analysis result more comprehensive. Therefore, the medical data processing method provided by the embodiment of the present disclosure can enhance the semantic representation of medical record data through the external knowledge of the knowledge graph, and can meet more comprehensive medical data analysis needs.
[0103] In the embodiments of the present disclosure, on the one hand, by performing semantic analysis on medical record data, the possibility that the condition corresponding to the medical record data is caused by each preset disease can be obtained, and a first weight vector can be generated; on the other hand, the medical record data can be analyzed through the general knowledge in the preset knowledge graph, and the possibility that the condition corresponding to the medical record data is caused by each preset disease can be obtained, and a second weight vector can be generated. Then, the first weight vector obtained based on individual conditions and the second weight vector obtained based on general conditions can be fused to obtain a disease analysis vector corresponding to the medical record data. The disease analysis vector can comprehensively reflect a medical record data from both individual conditions and general conditions, thereby enhancing the semantic representation of the medical record data through the external knowledge of the knowledge graph, and realizing a more comprehensive analysis demand for medical record data.
[0104] Figure 4 A flow chart of a training process of a model for implementing a medical data processing method according to an embodiment of the present disclosure is shown. Figure 5A flowchart of the use process of a model for implementing a medical data processing method according to an embodiment of the present disclosure is shown. The method can obtain a disease analysis vector corresponding to a medical record data by executing a target process, wherein the target process can be implemented by a preset analysis model. Optionally, the preset analysis model can include multiple sub-models with different functions, such as a semantic analysis model, a nonlinear fusion model, etc. Accordingly, the method may include Figure 4 The model training process shown and Figure 5 The model usage process shown.
[0105] 1. Model training process:
[0106] Step 201: Obtain a medical record data training set and a medical record data test set.
[0107] In this step, firstly, the medical record data can be obtained in the manner described in step 10 above to obtain unlabeled medical record data, and then standardized analysis labels can be added to the obtained medical record data to obtain labeled medical record data. The analysis label is the known disease analysis vector corresponding to the medical record data, and the type of the analysis label is the preset disease type in the preset disease set. Then, a part of the labeled medical record data is used as training data to form a medical record data training set, and the remaining labeled medical record data is used as test data to form a medical record data test set.
[0108] Step 202: Train the original analysis model based on the medical record data training set and the preset loss function to obtain an intermediate analysis model.
[0109] The loss function can be used to evaluate the degree to which the model's predicted value differs from the true value. The model can be trained and evaluated by minimizing the loss function.
[0110] In this step, each time a training data with an analysis label (i.e., true value) is input into the original analysis model, and the original analysis model outputs a result (i.e., predicted value), the function value of the preset loss function can be calculated according to the true value and predicted value corresponding to the training data, and the model parameters are adjusted according to the function value, and a training data is input into the model again after adjustment. The above process is repeated until all the training data in the medical record data training set are input, and an intermediate analysis model after multiple parameter adjustments is obtained.
[0111] Specifically, in an optional embodiment, the preset loss function L may be as follows:
[0112]
[0113] Where N is the number of types of analysis labels, that is, the number of preset diseases in the preset disease set; y i∈{0,1}, yi is the true value of the training data generated by the i-th preset disease. For example, when the analysis label indicates that a training data is generated by the first preset disease (assuming there are 8 preset diseases in total, N=8), y1 is 1, and y2-y8 are all 0; P i is the predicted value of the training data obtained by the model, and its size indicates the possibility that the training data is generated by the i-th preset disease.
[0114] Step 203: Test the intermediate analysis model based on the medical record data test set to obtain a preset analysis model.
[0115] In this step, each test data in the medical record data test set can be input into the trained intermediate analysis model in turn, so as to test the intermediate analysis model by comparing the difference between the true value and the predicted value of the test data. If the intermediate analysis model can also make effective predictions for the medical record data test set, the test passes, and the intermediate analysis model is deployed to the electronic device to obtain the preset analysis model; if the intermediate analysis model does not have a good prediction effect on the medical record data test set, the test fails, and the intermediate analysis model continues to be trained and adjusted until the test passes, and the model that passes the test is deployed to the electronic device to obtain the preset analysis model.
[0116] In practical applications, whether the intermediate analysis model can also effectively predict the medical record data test set can be judged by various existing model evaluation indicators, such as the area under the curve (Area Under Curve, AUC value for short) of the receiver operating characteristic curve (Receiver Operating Characteristic Curve, ROC curve for short), etc. The embodiments of the present disclosure are not intended to be limited to this.
[0117] 2. Model usage process:
[0118] The following combination Figure 6 The preset analysis model architecture shown is specifically explained.
[0119] Step 30: Obtain medical record data, and input the medical record data into a preset analysis model so that the preset analysis model executes a target process and outputs a disease analysis vector corresponding to the medical record data, wherein the target process includes the following steps 301-314.
[0120] The specific implementation method of obtaining medical record data can refer to the above step 10, which will not be repeated here.
[0121] Step 301: Generate a medical record semantic vector for medical record data.
[0122] In specific applications, medical record data usually includes text data such as medical history and numerical data such as examination results (such as blood sugar values, blood pressure values, etc.). Both text data and numerical data are important for the analysis of medical record data. Figure 7 In this step, the medical record semantic vector of the medical record data can be generated specifically through the following steps S11-S14:
[0123] S11: Encode text data into text semantic vectors.
[0124] Optionally, the text data can be encoded using a BERT (Bidirectional Encoder Representation from Transformers) model as an encoder to obtain a text semantic vector.
[0125] Specifically, the BERT model can first convert text data into vector representation and initialize the input vector, which includes: 1. Word vector (also known as word embedding), which is the vector representation of each word in the text, and the [cls] tag indicates the beginning of the text, and the [sep] tag indicates the end of a sentence; 2. Sentence vector (also known as sentence embedding), which is used to distinguish different sentences; 2. Position vector (also known as position embedding), which is used to enable the BERT model to learn the sequential properties of the text. Then the BERT model can encode the input vector through the self-attention mechanism and feedforward network, and output the text semantic vector. The text semantic vector can describe the semantic representation of the text in the medical record.
[0126] S12: Convert the numerical data into a vector to obtain a numerical vector.
[0127] As for the numerical data in the medical record data, it can be directly converted into a vector form. The meaning of each value in the vector is predetermined. For example, the first value in the vector represents the blood sugar value, and the second value in the vector represents the blood pressure value. Then, the vector can be normalized by softmax to obtain a numerical vector. After normalization, each component in the numerical vector is limited to a certain interval, such as [0,1]. The numerical vector is also the normalized vector of the numerical data.
[0128] S13: Concatenate the text semantic vector and the numerical vector to obtain a concatenated vector.
[0129] For example, the text semantic vector specifically includes n vectors, each vector has a components, and the numerical vector specifically includes m vectors, which also have a components. The numerical vector can be concatenated after the text semantic vector, and the resulting concatenated vector includes (n+m) vectors, where the last vector is the numerical vector.
[0130] When the number of numerical data in the medical record data is less than a, 0 can be filled into other positions in the numerical vector to make up a numerical value.
[0131] S14: Encode the concatenated vector through the multi-head self-attention mechanism to obtain the medical record semantic vector of the medical record data.
[0132] Next, a multi-head self-attention mechanism can be used to encode the splicing vector, thereby fusing the numerical information and text information in the medical record data. In this way, the semantic representation of the medical record data can be enhanced through the numerical information in the medical record data, which can meet further data analysis needs.
[0133] Specifically, the multi-head self-attention mechanism can be expressed as the following formula:
[0134] X = Concat([C]; Num 1...M )
[0135] (XW i Q , XW i K , XW i V )=(Q i , K i , V i )
[0136]
[0137] [C′]=Concat[(head1,...,head i , ..., head h )W O ]
[0138] Among them, Concat([C]; Num 1...M ) is the text semantic vector [C] and the numerical vector Num 1...M The concatenation vector of head i is the i-th head of the multi-head self-attention mechanism, with a total of h heads, [C′] is the obtained medical record semantic vector, and W i Q , W i K , W i V , W O is a trainable parameter. In an optional embodiment, h=8, d K =64.
[0139] The essence of the attention mechanism is the mapping of the query sentence query (i.e. Q in the formula) to the key-value pairs of the target sentence (i.e. K and V in the formula). By allocating limited attention to different feature vectors, key information that contributes most to auxiliary diagnosis can be quickly screened out. Since there are a large number of long sequences in medical record data, semantic attenuation is prone to occur. The self-attention mechanism can directly calculate the dependency between two characters at any position, breaking through the sentence length limit. Therefore, when calculating the attention score, the same self-attention of the query sentence and the target sentence is considered. The multi-head self-attention mechanism is based on the self-attention mechanism and is the result of multiple self-attention calculations, allowing the BERT model to learn semantic features from different semantic spaces.
[0140] In addition, the numerical information in medical record data also plays a strong decisive role in data analysis. Therefore, when constructing query statements and target statements, the text semantic vector is concatenated with the numerical vector, and then the multi-head attention mechanism is used. The dependency relationship between relatively distant text and examination values in the medical record text expression can be well extracted, which is conducive to the in-depth analysis of medical record data.
[0141] In another optional implementation of the above steps S13-S14, the potential connection between the text semantic vector and the numerical vector can also be found through the mutual attention mechanism. It should be noted that in the self-attention mechanism, the text semantic vector and the numerical vector are first concatenated, and then the concatenated vector is multiplied by Q and K respectively, while in the mutual attention mechanism, the text semantic vector can be multiplied by Q and the numerical vector can be multiplied by K without vector concatenation.
[0142] Step 302: For each preset disease in the preset disease set, determine a first possibility weight of the medical record data due to the preset disease according to the medical record semantic vector to obtain a first weight vector.
[0143] In this step, the first weight vector can be obtained through the classifier. Specifically, the medical record semantic vector obtained by fusion of the multi-head self-attention mechanism can be input into the softmax classifier, and the classification categories set in the softmax classifier are the preset diseases, so that the softmax classifier can output the first weight vector corresponding to the medical record data, and each component in the first weight vector is the first possibility weight.
[0144] Step 303: Perform entity recognition on the medical record data to obtain each entity mention in the medical record data.
[0145] In an optional embodiment, this step 303 may specifically include:
[0146] S21: Perform entity recognition on the medical record data according to a preset dictionary including multiple entity names to obtain entity mentions in the medical record data.
[0147] Among them, entity recognition of medical record data can specifically adopt a dictionary-based entity recognition method. The description of the same thing in medical record data is not necessarily standard. For example, the standard professional terms, common names, abbreviations, etc. of things all refer to the same thing and can be called entity mentions. The preset dictionary can include standard professional terms, common names, abbreviations, etc. of multiple specific things, so that each entity in the medical record data can be identified through the preset dictionary.
[0148] In the embodiments of the present disclosure, according to data analysis requirements, the preset dictionary can be the Chinese symptom knowledge graph, the disease set in the International Classification of Diseases ICD-10 (International Classification of Diseases), the disease symptom entity set in the diabetes knowledge graph released by Alibaba and Ruijin Hospital, etc., and the present disclosure does not limit this.
[0149] Further optionally, the above step S21 may specifically include:
[0150] According to a preset dictionary including multiple entity names, entity recognition is performed on the medical record data through a two-way maximum matching algorithm to obtain entity mentions in the medical record data.
[0151] Medical data is more professional than daily language. Therefore, it is more difficult to identify entities in medical data. The two-way maximum matching method can compare the word segmentation results obtained by the forward maximum matching method and the reverse maximum matching method to determine the correct word segmentation method. It can match as many medical-related entities as possible, which is more conducive to the analysis of medical data.
[0152] Step 304: Entity linking is performed on entity mentions in the preset knowledge graph to obtain matching entities of entity mentions in the preset knowledge graph.
[0153] In this step, you can find out which entity each entity mention in the medical record data corresponds to in the preset knowledge graph.
[0154] Optionally, this step 304 may specifically include the following steps S31-S32:
[0155] S31: For each entity included in the preset knowledge graph, calculate the similarity between the entity mention and each entity respectively.
[0156] S32: Link the entity mention to the target entity corresponding to the maximum similarity, so as to use the target entity as a matching entity of the entity mention in the preset knowledge graph.
[0157] In the disclosed embodiment, entity linking can be performed based on the similarity between entity mentions in medical record data and entities in a preset knowledge graph. Specifically, the similarity between the entity mentions and each entity in the preset knowledge graph can be calculated, and the graph entity corresponding to the maximum similarity value can be considered to be the entity indicated by the entity mention.
[0158] In an optional embodiment, step S31 includes:
[0159] S311: For any entity, calculate the initial similarity between the entity mention and the entity by using at least two similarity calculation methods respectively.
[0160] S312: Calculate the average of each calculated initial similarity to obtain the similarity between the entity mention and the entity.
[0161] Among them, the similarity between entity mentions and entities in the graph can be calculated in a variety of ways, and then the average of the similarities is obtained, thus improving the reliability of the entity linking results.
[0162] In specific applications, optionally, the initial similarity may include at least two of edit distance similarity, Jaccard similarity, longest common substring similarity, cosine similarity, explicit semantic analysis similarity and deep learning similarity.
[0163] For example, for any entity mention in the medical record data and any entity in the preset knowledge graph, the edit distance similarity Sim between the entity mention and the entity can be calculated by the following formula: ld , Jaccard Similarity Sim jacc Similarity with the longest common substring Sim lcs .
[0164]
[0165] In the above formula, Indicates how many times the entity is processed (including deletion, addition, and replacement) to be able to refer to E R Become an entity in the preset knowledge graph Indicates E R and The maximum length of bigram(|E R |) indicates E R The bigrams obtained after bigram segmentation; Indicates a mention of an entity The bigrams obtained after bigram segmentation; Indicates E R and Maximum length of identical substrings.
[0166] Entity Mention E R With entity The similarity between them can be calculated by the following formula:
[0167]
[0168] In the disclosed embodiment, when calculating the similarity between medical record entities and graph entities, multiple similarity results such as edit distance similarity, Jaccard similarity, and longest common substring similarity are comprehensively considered to measure the similarity between medical record entities and graph entities from different angles, and then the average of the similarities obtained from multiple different angles is taken, which can make the entity linking results more reliable.
[0169] Step 305: Filter out symptom entities representing symptoms from each matching entity to obtain each medical record symptom of the medical record data.
[0170] In the embodiment of the present disclosure, a list of various types of entities is constructed in the preset knowledge graph. In this step, entities in the symptom entity list in the preset knowledge graph can be screened from the matching entities obtained in step 304, thereby obtaining m symptoms mentioned in the medical record data (for example, mentioned in the chief complaint), which are called medical record symptoms S Ri , forming the following medical history symptom set S R .
[0171]
[0172] Step 306: Filter out disease entities representing diseases from various matching entities to obtain various medical record diseases in the medical record data.
[0173] Similar to step 305, in this step, entities in the disease entity list in the preset knowledge graph can be screened from the matching entities obtained in step 304, thereby obtaining p diseases mentioned in the medical record data (for example, mentioned in the preliminary diagnosis results), which are called medical record diseases d Ri , forming the following medical record disease set D R .
[0174]
[0175] Among them, f Ri The medical record disease d in the preset knowledge graph Ri The probability of occurrence of the medical record disease d Ri The probability of occurrence in life. The probability value of the occurrence probability can be used as the disease d Ri An attribute of is stored in the preset knowledge graph and can also be used as a medical record disease d RiA corresponding tail entity is stored in the preset knowledge graph.
[0176] Step 307: For each medical record symptom in the medical record data, determine the graph disease subset corresponding to the medical record symptom in the preset knowledge graph to form a graph disease set.
[0177] In this step, the medical record symptoms can be used as the head entity to match the disease tail entity in the preset knowledge graph, so as to obtain the graph disease corresponding to the medical record symptoms in the preset knowledge graph.
[0178] According to experience, a symptom may be a manifestation of more than one disease, so a medical history symptom S Ri There may be n graph diseases that can be matched in the preset knowledge graph, and these n graph diseases form the medical record symptom S Ri Corresponding atlas disease subset D i ={d i1 ,d i2 ,…,d ij ,…d in The atlas disease subsets corresponding to all medical record symptoms in a medical record data form the atlas disease set D.
[0179] Step 308: Determine a candidate disease set that may generate medical record data based on the medical record disease set formed by each medical record disease in the medical record data and the atlas disease set.
[0180] This step 308 can be implemented by the following steps S41-S43:
[0181] S41: For each medical record disease in the medical record disease set, if the negative factor coefficient of the medical record disease is a preset minimum value, the medical record disease is deleted from the medical record disease set, and the medical record disease set after deleting the medical record disease forms the target medical record disease set.
[0182] Among them, the negative factor coefficient f of the medical record disease negD , used to limit the negative impact of negative words on medical record diseases, the negative factor coefficient of medical record diseases f negD Indicates the degree of semantic negation of the disease in the medical record description. The negative factor coefficient f of a medical record disease negD is the preset minimum value, indicating that the medical record disease is completely denied in the medical record description. For example, if the medical record history describes "denied history of hepatitis", then the negative factor coefficient f of the medical record disease "hepatitis" is negD Will be set to a preset minimum value, such as -1.
[0183] Therefore, if the negative factor coefficient f of a medical record disease negD is the preset minimum value, then the medical record disease can be removed from the medical record disease set D RBy judging the medical record disease set D R The negative factor coefficients of all medical record diseases can be used to exclude the medical record diseases that are explicitly denied from the medical record disease set, thereby obtaining the target medical record disease set D R '. In this way, the target medical record disease set D R The diseases in ' are all possible diseases from the perspective of medical record description, and can be considered as diseases that may cause the condition corresponding to the medical record data.
[0184] In addition, the negative factor coefficient f of the medical history disease negD How to obtain the value will be introduced later.
[0185] S42: For each medical record disease in the medical record disease set, if the negative factor coefficient of the medical record disease is a preset minimum value, and the medical record disease exists in the atlas disease set, the medical record disease is deleted from the atlas disease set, and the atlas disease set after deleting the medical record disease forms the initial candidate disease set.
[0186] For the medical record diseases that are explicitly denied in the description of the medical record data, since the negative description of the medical record in the previous text affects the attributes of the medical record disease, the possibility that the medical record data is caused by the medical record disease is reversely excluded. Therefore, it is also necessary to exclude it from the atlas disease set D, that is, the second possibility weight corresponding to the medical record disease should be 0, so as to obtain the initial candidate disease set D'. In this way, the diseases in the initial candidate disease set D' are all possible diseases from the perspective of atlas knowledge description, and can be considered as diseases that may cause the corresponding condition of the medical record data.
[0187] S43: For each target medical record disease included in the target medical record disease set, if the target medical record disease does not exist in the initial candidate disease set, the target medical record disease is added to the initial candidate disease set to form a candidate disease set that may generate medical record data.
[0188] Afterwards, for each disease in the target medical record disease set, if the disease does not exist in the initial candidate disease set D', it means that although the disease is not possible from the perspective of graph knowledge, it is still possible from the perspective of medical record description. Therefore, the disease can be added to the initial candidate disease set D' to obtain all candidate diseases that may cause the corresponding condition of this medical record data from both the perspectives of graph knowledge and medical record description, thereby forming a candidate disease set D".
[0189] Through the above steps S41-S43, all candidate diseases that may cause the condition corresponding to a certain medical record data from both the perspectives of graph knowledge and medical record description can be screened out, which can avoid missing possible diseases, thereby improving the accuracy of the analysis results, and avoid unnecessary data processing for diseases that are clearly denied in the medical record description, thereby improving the efficiency of data processing.
[0190] Step 309: Determine the initial second possibility weight of the medical record data due to the candidate disease based on the negative factor coefficient of each medical record symptom, the probability of joint occurrence of each medical record symptom and the candidate disease, the number of diseases in the atlas disease subset to which the candidate disease belongs, and the number of diseases in the candidate disease set.
[0191] In an optional embodiment, for each candidate disease d in the candidate disease set D″ ij , according to each medical history symptom S Ri The negative factor coefficient f negS , each medical history symptom S Ri The candidate disease ij The joint occurrence probability p(S Ri ,d ij ), the candidate disease d ij The number of diseases in the atlas disease subset Di to which it belongs |D i |, and the number of diseases in the candidate disease set D" |D"|, the following formula is used to determine the probability of a medical record data being affected by the candidate disease d ij The initial second probability weight Wd generated ij .
[0192]
[0193] Among them, for each candidate disease d in the candidate disease set D” ij , there is a corresponding symptom set in the preset knowledge graph It contains M symptoms related to the disease in the preset knowledge graph. In the above formula,
[0194]
[0195] Negative factor coefficient f of medical history symptoms negS , used to limit the negative impact of negative words on medical history symptoms, the negative factor coefficient of medical history symptoms f negS Indicates the degree of semantic negation of the medical record symptom in the medical record description. The negative factor coefficient f of a medical record symptom negS is the preset minimum value, indicating that the medical record symptom is completely denied in the medical record description. For example, if the medical record physical examination result describes "no tremor in hands and feet", then the negative factor coefficient f of the medical record symptom "tremor in hands and feet" isnegS Will be set to a preset minimum value, such as -1.
[0196] Medical history symptoms Ri With candidate disease ij The joint occurrence probability p(S Ri ,d ij ) can be obtained from the preset knowledge graph, and the probability value of the joint occurrence probability can be used as the medical record symptom S Ri or medical history Ri An attribute of is stored in the preset knowledge graph and can also be used as a medical record symptom S Ri or medical history Ri A corresponding tail entity is stored in the preset knowledge graph.
[0197] Accordingly, before the step of determining the second possibility weight, the following steps may also be included: obtaining the joint occurrence probability of each medical record symptom and the candidate disease from a preset knowledge graph.
[0198] From the above formula, we can see that the medical history symptom S Ri The number of diseases in the corresponding atlas (i.e. |D i |)The less, The larger the f negS If the condition is greater than 0, the medical history symptom S Ri and candidate diseases ij The higher the probability of joint occurrence, The larger the f negS Less than 0 condition for medical history symptoms S Ri and candidate diseases ij The higher the probability of joint occurrence, The smaller.
[0199] In addition, the negative factor coefficient f of the medical history symptoms negS How to obtain the value will be introduced later.
[0200] Step 310: If the candidate disease meets the preset condition, the initial second possibility weight corresponding to the candidate disease is determined as the second possibility weight corresponding to the candidate disease, wherein the preset condition is that the candidate disease exists in the initial candidate disease set but does not exist in the medical record disease set.
[0201] According to the above steps S41-S42, the candidate diseases in the candidate disease set may come from the medical record disease set, that is, from the medical record description, or from the atlas disease set, that is, from the atlas knowledge, and the source of the candidate disease indicates whether the candidate disease focuses on individual conditions or universal knowledge. Therefore, in the embodiment of the present disclosure, the initial second possibility weight of the candidate disease needs to be readjusted in combination with the different sources of the candidate disease.
[0202] Specifically, if a candidate disease is derived from graph knowledge but is not mentioned in the medical record description, it can be considered that the candidate disease may be a disease determined based on universal conditions. In this case, the initial second possibility weight corresponding to the candidate disease can be directly determined as the second possibility weight corresponding to the candidate disease, that is, the second possibility weight of the medical record data can be analyzed directly based on the graph knowledge.
[0203] As for the case where the candidate disease also exists in the medical record description (including the case where the candidate disease exists in both the atlas disease set and the medical record disease set, and the case where the candidate disease only exists in the medical record disease set), it means that there is already a clearer analysis result for the individual situation in the medical record description. In this case, it is necessary to modify the initial second possibility weight corresponding to the candidate disease based on the individual situation, as shown in the following step 311 for details.
[0204] Step 311: If the candidate disease does not meet the preset condition, the initial second possibility weight corresponding to the candidate disease is modified to obtain the second possibility weight corresponding to the candidate disease.
[0205] This step 311 may specifically include the following steps S51--S52:
[0206] S51: If the candidate disease also exists in the medical record disease set D R and the initial candidate disease set D' (the candidate disease belongs to D R , denoted by d Ri ), then according to the probability of occurrence of each candidate disease f Ri , for this candidate disease Ri The corresponding initial second probability weight Wd Ri After modification, the candidate disease d is obtained. Ri The corresponding second possibility weight W'd Ri .
[0207] In step S51, the second possibility weight W'd ij It can be calculated by the following formula:
[0208]
[0209] Among them, Wd Ri That is, the candidate disease d in each initial second possibility weight Ri The corresponding initial second likelihood weight.
[0210] The above formula shows that the contribution of the diseases clearly described in the medical records to the analysis results is greater than the contribution of the symptoms described in the medical records to the analysis results.
[0211] Since the above formula uses the probability of occurrence of each candidate disease f Ri Accordingly, before modifying the initial second possibility weight corresponding to the candidate disease, it also includes: obtaining the occurrence probability of each candidate disease from a preset knowledge graph.
[0212] S52: If the candidate disease exists in the medical record disease set D R But it does not exist in the initial candidate disease set D' (the candidate disease belongs to D R , denoted by d Ri ), then according to the candidate disease d Ri The negative factor coefficient f negD , preset hyperparameter β, and the number of diseases |D″| in the candidate disease set D”, for the candidate disease d Ri The corresponding initial second probability weight Wd i After modification, the candidate disease d is obtained. Ri The corresponding second possibility weight W'd Ri .
[0213] In step S52, the second likelihood weight W'd ij It can be calculated by the following formula:
[0214]
[0215] Among them, Wd i That is, the candidate disease d in each initial second possibility weight i The corresponding initial second likelihood weight is: β is a preset hyperparameter, and β≥1. In an optional implementation, β=1.5 may be preset.
[0216] The above formula shows that the contribution of the diseases clearly described in the medical records to the analysis results is greater than the contribution of the symptoms described in the medical records to the analysis results.
[0217] In addition, before determining the candidate disease, the value of each medical record disease d can also be determined through the following steps S61-S62. Ri The negative factor coefficient f negD The value of, and each medical record symptom S Ri The negative factor coefficient f negS The value of .
[0218] S61: Determine the negative factor coefficient of the medical record symptom based on the degree of negation of the medical record symptom by the first adjacent word located before the medical record symptom in the medical record data, wherein the negative factor coefficient of the medical record symptom is negatively correlated with the degree of negation of the medical record symptom by the first adjacent word.
[0219] If the previous text of the medical record symptom completely changes the semantic information, the negative factor coefficient f of the medical record symptom can be negS Set it smaller. If the semantic information of the previous text of the medical record symptom is partially changed, the negative factor coefficient f of the medical record symptom can be negS Set it larger.
[0220] For example, for a medical symptom such as “no tremor in hands and feet”, the word “no” completely changes the meaning of “tremor in hands and feet”, changing the meaning from affirmation of “tremor in hands and feet” to negation of “tremor in hands and feet”. Therefore, the negative factor coefficient f of the medical symptom “tremor in hands and feet” can be negS Set to -1.
[0221] For another example, when the medical history symptom such as "involuntary tremor of hands and feet" is preceded by the second type of negative words such as "involuntary", the word "involuntary" partially changes the meaning of "tremor of hands and feet", which is a further limitation of "tremor of hands and feet" rather than a negation of "tremor of hands and feet". Therefore, the negative factor coefficient f of the medical history symptom "tremor of hands and feet" can be negS Set to 0.5.
[0222] S62: Determine the negative factor coefficient of the medical record disease based on the degree of negation of the medical record disease by the second adjacent word located before the medical record disease in the medical record data, wherein the negative factor coefficient of the medical record disease is negatively correlated with the degree of negation of the medical record disease by the second adjacent word.
[0223] Similar to step S61, if the medical record disease context completely changes the semantic information, the negative factor coefficient f of the medical record disease can be changed. negD Set it smaller. If the semantic information of the medical record disease preamble is partially changed, the negative factor coefficient f of the medical record disease can be negD Set it larger.
[0224] For example, in the case of a medical record symptom such as "deny history of hepatitis" where the preceding text is a first-class negation word such as "deny", the word "deny" completely changes the meaning of "hepatitis", changing the meaning from affirmation of "hepatitis" to negation of "hepatitis". Therefore, the negative factor coefficient f of the medical record disease "hepatitis" can be negD Set to -1.
[0225] In actual applications, since the terms in medical records are relatively fixed, the degree of negation of symptoms or diseases by the previous words can be determined by presetting various types of negative words.
[0226] Step 312: For a preset disease that does not belong to the candidate disease set, the second possibility weight corresponding to the preset disease is determined to be 0.
[0227] Through the above steps, the second possibility weight corresponding to each candidate disease belonging to the candidate disease set is obtained, and the candidate disease set may not completely cover the preset disease set. Therefore, the number of candidate diseases may be less than the number of preset diseases. When the number of candidate diseases is less than the number of preset diseases, it means that only the second possibility weights corresponding to some preset diseases are determined. For the preset diseases that do not belong to the candidate disease set, the second possibility weights corresponding to the preset diseases are directly determined to be 0.
[0228] Step 313: Normalize the second possibility weight corresponding to each preset disease to obtain a second weight vector.
[0229] The second possibility weight corresponding to each preset disease is subjected to softmax normalization processing to obtain each normalized second possibility weight, and each normalized second possibility weight is used as a vector component to form a second weight vector.
[0230] Step 314: Fuse the first weight vector and the second weight vector to obtain a disease analysis vector corresponding to the medical record data.
[0231] The first weight vector and the second weight vector have the same dimension, which is the number of diseases in the preset disease set. Accordingly, this step 314 specifically includes the following steps S71-S72:
[0232] S71: Weighting the first possibility weight and the second possibility weight of the same dimension by different preset importance coefficients to obtain a weighting parameter, wherein the preset importance coefficient corresponding to the first possibility weight is negatively correlated with the preset importance coefficient corresponding to the second possibility weight.
[0233] In an optional embodiment, the preset importance coefficient corresponding to the first possibility weight may be γ i , the preset importance coefficient corresponding to the second possibility weight can be (1-γ i ), thus achieving a negative correlation between the two.
[0234] In the case where the preset disease set includes q preset diseases, the first weight vector K and the second weight vector E are as follows:
[0235] K=[k1,k2,…,k i ,…,k q ]
[0236] E=[e1,e2,…,e i ,…,e q ]
[0237] The first possibility weight k of the same dimension can be calculated by the following formula:i and the second probability weight e i Perform linear weighting to obtain q weighting parameters z1-z q .
[0238] z i =γ i e i +(1-γ i ) i
[0239] Among them, γ i reflects the weighting parameter z i Is it more affected by medical record data or by the preset knowledge graph? i It can be manually adjusted as a hyperparameter, or it can be learned through a neural network, which is not limited in the embodiments of the present disclosure.
[0240] S72: Calculate the weighted parameters through a linear function or a nonlinear function to obtain a fusion weight, and each fusion weight forms a disease analysis vector corresponding to the medical record data, wherein the disease analysis vector has the same dimension as the first weight vector and the second weight vector.
[0241] Optionally, the weighting parameters z1-z q Calculate and get the fusion weight c1-c q Among them, c1-c q Indicates the probability of illness corresponding to the 1st to qth preset diseases.
[0242]
[0243] In an optional embodiment, the nonlinear function σ may be a sigmoid function.
[0244] The process described in the above steps S71-S72 can be expressed as the following formula:
[0245]
[0246] In the embodiments of the present disclosure, on the one hand, by performing semantic analysis on medical record data, the possibility that the condition corresponding to the medical record data is caused by each preset disease can be obtained, a first weight vector is generated, and the semantic representation of the medical record text is enhanced by numerical information; on the other hand, the medical record data can be analyzed by the general knowledge in the preset knowledge graph, the possibility that the condition corresponding to the medical record data is caused by each preset disease can be obtained, and a second weight vector is generated. Then, the first weight vector obtained based on individual conditions and the second weight vector obtained based on general conditions can be fused to obtain a disease analysis vector corresponding to the medical record data. The disease analysis vector can comprehensively reflect a medical record data from both individual conditions and general conditions, thereby enhancing the semantic representation of the medical record data through the external knowledge of the knowledge graph, and realizing a more comprehensive analysis demand for medical record data.
[0247] The following introduces some usage scenarios of the analysis results obtained through the above medical data processing method. It is understandable that the usage scenarios of the analysis results are not limited to the following scenario examples. It should be noted that the acquisition and use of medical record data and corresponding analysis results must obtain the patient's understanding and consent, and the medical record data and corresponding analysis results must be obtained and used legally and compliantly at the place where the plan is implemented.
[0248] Scenario 1: Medical teaching
[0249] In medical-related teaching, the analysis results provided by the embodiments of the present disclosure can be used as diagnostic analysis cases after manual verification by medical teachers, doctors and other professionals, thereby providing a large amount of teaching materials for the medical teaching field.
[0250] Scenario 2: Construction of an automated consultation platform
[0251] At present, more and more hospitals have launched automated consultation services. This platform can be provided to users through software, mini-programs, official accounts, etc., and provide users with preliminary diagnosis and suggestions through automated question-and-answer robots.
[0252] The analysis results provided by the embodiments of the present disclosure can be used as learning materials for the automated question-answering robot after being manually verified by professionals such as doctors, and a reply mechanism for the automated question-answering robot can be established. At the same time, in order to ensure the correctness and professionalism of the medical advice, the medical advice replied by the automated question-answering robot can first be reviewed by professionals before being presented to the user.
[0253] Scenario 3: Doctor’s consultation reference
[0254] Due to differences between individuals, a general situation may not be applicable to an individual situation, or the symptoms may be too complicated, which may lead to an insufficient diagnosis of common diseases. Therefore, the analysis results provided by the embodiments of the present disclosure can be used as a reference data for doctors' diagnosis to remind doctors. When the doctor's diagnosis result is too different from the analysis result, the doctor can be prompted to conduct a more careful examination and judgment.
[0255] The present disclosure also provides a prediction device for diabetes complications, including a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the medical data processing method as described above to obtain a disease analysis vector corresponding to the medical record data, wherein a preset disease set includes at least one diabetes complication, and each component in the disease analysis vector represents the disease probability corresponding to each of the diabetes complication.
[0256] Among them, each preset disease in the above medical data processing method can be set as various diabetic complications. Accordingly, each component in the first weight vector represents the possibility that the condition corresponding to the medical record data is caused by each diabetic complication based on the semantic analysis of the medical record data; each component in the second weight vector represents the possibility that the condition corresponding to the medical record data is caused by each diabetic complication based on the graph knowledge analysis of the medical record data; each component in the disease analysis vector represents the possibility of each diabetic complication obtained after integrating the medical record semantic analysis and the graph knowledge analysis.
[0257] In an optional embodiment, the device may be configured to directly output the disease analysis vector.
[0258] In another optional embodiment, the device may be configured to output the name of the diabetic complication corresponding to the component with the largest value in the disease analysis vector.
[0259] In a third optional embodiment, the device may be configured to output the name of the diabetes complication corresponding to the component with the largest value in the disease analysis vector and greater than a preset threshold value.
[0260] In a fourth optional embodiment, the device may also be configured to output the component with the largest value in the disease analysis vector (or the component with the largest value and greater than a preset threshold), as well as the name of the diabetes complication corresponding to the component.
[0261] The output method may be display, playback, etc., which is not limited in the embodiments of the present disclosure.
[0262] The results output by the device can be applied to the scenarios mentioned above.
[0263] The disclosed embodiment also discloses a computer non-volatile readable storage medium. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the medical data processing method as described above.
[0264] References herein to "one embodiment," "embodiment," or "one or more embodiments" mean that a particular feature, structure, or characteristic described in conjunction with the embodiment is included in at least one embodiment of the present disclosure. In addition, please note that examples of the term "in one embodiment" do not necessarily all refer to the same embodiment.
[0265] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present disclosure can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0266] In the claims, any reference signs placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present disclosure may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.
[0267] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. A medical data processing method, characterized in that: The method comprises: Obtain medical record data, and execute a target process to obtain a disease analysis vector corresponding to the medical record data, wherein the target process includes: Generate a medical record semantic vector of the medical record data; For each preset disease in the preset disease set, determining, according to the medical record semantic vector, a first possibility weight of the medical record data caused by the preset disease to obtain a first weight vector; According to each medical record symptom and each medical record disease in the medical record data, determining a candidate disease that may generate the medical record data from a preset knowledge graph, wherein the preset knowledge graph includes entities and relationships related to the preset disease, and the candidate disease belongs to the preset disease set; For each medical record symptom in the medical record data, determine a graph disease subset corresponding to the medical record symptom in a preset knowledge graph to form a graph disease set; Determining a candidate disease set that may generate the medical record data based on the medical record disease set formed by each medical record disease in the medical record data and the atlas disease set includes: For each of the medical record diseases in the medical record disease set, if the negative factor coefficient of the medical record disease is a preset minimum value, the medical record disease is deleted from the medical record disease set, and the medical record disease set after deleting the medical record disease forms a target medical record disease set; For each of the medical record diseases in the medical record disease set, if the negative factor coefficient of the medical record disease is the preset minimum value and the medical record disease exists in the atlas disease set, the medical record disease is deleted from the atlas disease set, and the atlas disease set after deleting the medical record disease forms an initial candidate disease set; For each target medical record disease included in the target medical record disease set, if the target medical record disease does not exist in the initial candidate disease set, the target medical record disease is added to the initial candidate disease set to form a candidate disease set that may generate the medical record data; Determining a second likelihood weight of the medical record data due to the candidate disease to obtain a second weight vector; The first weight vector and the second weight vector are merged to obtain a disease analysis vector corresponding to the medical record data.
2. The method according to claim 1, characterized in that The medical record data includes text data and numerical data, and the step of generating a medical record semantic vector for the medical record data includes: Encoding the text data into a text semantic vector; Convert the numerical data into a vector to obtain a numerical vector; Concatenate the text semantic vector with the numerical vector to obtain a concatenated vector; The concatenated vector is encoded through a multi-head self-attention mechanism to obtain a medical record semantic vector of the medical record data.
3. The method according to claim 1, characterized in that The step of determining a second possibility weight of the medical record data due to the candidate disease to obtain a second weight vector includes: Determine the initial second probability weight of the medical record data due to the candidate disease according to the negative factor coefficient of each medical record symptom, the probability of joint occurrence of each medical record symptom and the candidate disease, the number of diseases in the atlas disease subset to which the candidate disease belongs, and the number of diseases in the candidate disease set; If the candidate disease meets a preset condition, the initial second possibility weight corresponding to the candidate disease is determined as the second possibility weight corresponding to the candidate disease, wherein the preset condition is that the candidate disease exists in the initial candidate disease set but does not exist in the medical record disease set; If the candidate disease does not satisfy the preset condition, the initial second possibility weight corresponding to the candidate disease is modified to obtain the second possibility weight corresponding to the candidate disease.
4. The method according to claim 3, characterized in that If the candidate disease does not meet the preset condition, the initial second possibility weight corresponding to the candidate disease is modified to obtain the second possibility weight corresponding to the candidate disease, including: If the candidate disease exists in both the medical record disease set and the initial candidate disease set, then according to the occurrence probability of each candidate disease, the initial second possibility weight corresponding to the candidate disease is modified to obtain the second possibility weight corresponding to the candidate disease; If the candidate disease exists in the medical record disease set but does not exist in the initial candidate disease set, the initial second possibility weight corresponding to the candidate disease is modified according to the negative factor coefficient of the candidate disease, the preset hyperparameters, and the number of diseases in the candidate disease set to obtain the second possibility weight corresponding to the candidate disease.
5. The method according to claim 4, characterized in that Before determining the candidate diseases that may generate the medical record data from the preset knowledge graph according to the medical record symptoms and the medical record diseases in the medical record data, the method further includes: Determine the negative factor coefficient of the medical record symptom according to the degree of negation of the medical record symptom by the first adjacent word located before the medical record symptom in the medical record data, wherein the negative factor coefficient of the medical record symptom is negatively correlated with the degree of negation of the medical record symptom by the first adjacent word; The negative factor coefficient of the medical record disease is determined based on the degree of negation of the medical record disease by the second adjacent word located before the medical record disease in the medical record data, wherein the negative factor coefficient of the medical record disease is negatively correlated with the degree of negation of the medical record disease by the second adjacent word.
6. The method according to claim 3, characterized in that If the candidate disease does not meet the preset condition, the initial second possibility weight corresponding to the candidate disease is modified, and after the second possibility weight corresponding to the candidate disease is obtained, the method further includes: For the preset disease that does not belong to the candidate disease set, determining the second possibility weight corresponding to the preset disease to be 0; The second possibility weight corresponding to each of the preset diseases is normalized to obtain a second weight vector.
7. The method according to claim 3, characterized in that Before determining the second possibility weight of the medical record data due to the candidate disease to obtain a second weight vector, the method further includes: The joint occurrence probability of each of the medical record symptoms and the candidate disease is obtained from the preset knowledge graph.
8. The method according to claim 4, characterized in that If the candidate disease does not meet the preset condition, the initial second possibility weight corresponding to the candidate disease is modified, and before the second possibility weight corresponding to the candidate disease is obtained, the method further includes: The occurrence probability of each of the candidate diseases is obtained from the preset knowledge graph.
9. The method according to claim 1, characterized in that: Before determining the candidate diseases that may generate the medical record data from the preset knowledge graph according to the medical record symptoms and the medical record diseases in the medical record data, the method further includes: Performing entity recognition on the medical record data to obtain each entity mention in the medical record data; Performing entity linking on the entity mention in the preset knowledge graph to obtain matching entities of the entity mention in the preset knowledge graph; Filtering out symptom entities representing symptoms from each of the matching entities to obtain each medical record symptom of the medical record data; Disease entities representing diseases are screened out from each of the matching entities to obtain each medical record disease of the medical record data.
10. The method according to claim 9, characterized in that The performing entity linking on the entity mention in the preset knowledge graph to obtain matching entities of the entity mention in the preset knowledge graph includes: For each entity included in the preset knowledge graph, calculating the similarity between the entity mention and each of the entities; The entity mention is linked to a target entity corresponding to the maximum similarity, so as to use the target entity as a matching entity of the entity mention in the preset knowledge graph.
11. The method according to claim 10, characterized in that The calculating the similarity between the entity mention and each of the entities includes: For any of the entities, respectively calculating an initial similarity between the entity mention and the entity by at least two similarity calculation methods; The average of each of the calculated initial similarities is calculated to obtain the similarity between the entity mention and the entity.
12. The method according to claim 11, characterized in that The initial similarity includes at least two of edit distance similarity, Jaccard similarity, longest common substring similarity, cosine similarity, explicit semantic analysis similarity and deep learning similarity.
13. The method according to claim 9, characterized in that The performing entity recognition on the medical record data to obtain each entity mention in the medical record data includes: Entity recognition is performed on the medical record data according to a preset dictionary including a plurality of entity names to obtain entity mentions in the medical record data.
14. The method according to claim 13, characterized in that The performing entity recognition on the medical record data according to a preset dictionary including a plurality of entity names to obtain entity mentions in the medical record data includes: According to a preset dictionary including a plurality of entity names, entity recognition is performed on the medical record data by using a bidirectional maximum matching algorithm to obtain entity mentions in the medical record data.
15. The method according to claim 1, characterized in that The first weight vector and the second weight vector have the same dimension, the dimension being the number of diseases in the preset disease set, and fusing the first weight vector and the second weight vector to obtain a disease analysis vector corresponding to the medical record data, including: The first possibility weight and the second possibility weight of the same dimension are weighted by different preset importance coefficients to obtain a weighting parameter, wherein the preset importance coefficient corresponding to the first possibility weight is negatively correlated with the preset importance coefficient corresponding to the second possibility weight; The weighted parameters are calculated by a linear function or a nonlinear function to obtain fusion weights, and each fusion weight forms a disease analysis vector corresponding to the medical record data, wherein the disease analysis vector has the same dimension as the first weight vector and the second weight vector; The first weight vector is K, the second weight vector is E, the first possibility weight is ki, and the second possibility weight is ei, then K=[k1,k2,...,k i ,...,k q ] E=[e1,e2,...,e i ,...,the q ]。 16. The method according to claim 1, characterized in that The executing the target process to obtain the disease analysis vector corresponding to the medical record data includes: Inputting the medical record data into a preset analysis model so that the preset analysis model executes the target process and outputs a disease analysis vector corresponding to the medical record data; Before obtaining the medical record data, the method further includes: Obtain a medical record data training set and a medical record data test set; Training the original analysis model according to the medical record data training set and the preset loss function to obtain an intermediate analysis model; The intermediate analysis model is tested according to the medical record data test set to obtain the preset analysis model.
17. A device for predicting diabetic complications, characterized in that: It comprises a processor, a memory and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the medical data processing method according to any one of claims 1 to 16 are implemented to obtain a disease analysis vector corresponding to the medical record data, wherein the preset disease set includes at least one diabetic complication, and each component in the disease analysis vector represents the probability of illness corresponding to each diabetic complication.
18. A computer non-transitory readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the medical data processing method as described in any one of claims 1 to 16.
Citation Information
Patent Citations
Medical record knowledge graph constructing method based on dynamic graph sequence, and system
CN110189831A
Medical big data cloud service analysis platform
CN110415831A