Medical index correlation analysis method based on knowledge graph

CN122889421APending Publication Date: 2026-10-09SOFTTEK INFORMATION SYST (WUXI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611086352.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-21
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0004]为了解决现有技术在医疗关联分析方面的置信度与实用价值较低的问题,本发明提出基于知识图谱的医疗指标关联分析方法,该方法包括:

Benefits of technology

本发明通过将医疗指标实体及其伴随数值映射为临床指标状态概率分布,能够表征医疗数据在实际诊断场景中的复杂性和不确定性;其中,统一采用正常、偏高、偏低、危急重症的固定维度顺序构建状态概率分布向量,避免了状态名称、排列顺序及向量维度含义不一致;在特征提取阶段,利用核心句法依存路径过滤不影响医学关系语义的冗余词汇,并结合词性权重、上下文语义特征和状态分布信息进行加权聚合,使生成的关系表示向量更加聚焦实体间的核心语义关联;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122889421A_ABST
    Figure CN122889421A_ABST
Patent Text Reader

Abstract

The application provides a medical index correlation analysis method based on a knowledge graph, which comprises the following steps: collecting medical texts, extracting medical index entities with numerical values, combining a knowledge base containing normal values and clinical grades to generate index clinical state probability distribution and obtain probabilistic state index entities; extracting a syntactic dependency path of an intra-sentence entity pair, removing stop word nodes that do not affect the semantic of medical relations, obtaining a core syntactic path, assigning an initial weight according to a part of speech, extracting a node context vector, and obtaining an initial relation vector through weighted fusion; iteratively performing hierarchical clustering to generate a relation cluster and a prototype vector, updating the weight and recalculating the vector according to the part of speech information gain; optimizing the distance between the vector and the cluster prototype until the weight and the cluster division converge, and outputting a stable relation cluster; and building a medical knowledge graph with the index entities as nodes and the relation clusters as edges, calculating the edge weight according to the authority degree and the appearance frequency of the text source, and performing index correlation analysis. The application improves the accuracy of the medical index correlation analysis result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical indicator analysis technology, specifically to a method for medical indicator association analysis based on knowledge graphs. Background Technology

[0002] With the continuous improvement of medical informatization, medical institutions have accumulated a large amount of unstructured text data such as electronic medical records, clinical diagnostic reports, and medical literature. These texts contain rich medical indicator information, which has high mining value for assisting clinical decision-making, disease risk assessment, and medical research. Existing medical relationship extraction methods usually rely on predefined schemas. However, the medical knowledge system is complex and updated rapidly, and clinical texts are expressed in diverse ways. Methods based on fixed schemas are difficult to generalize and cover the constantly emerging new medical indicator relationships. At the same time, existing extraction methods focus more on surface text features such as indicator names, and easily ignore the specific values ​​that medical indicators usually accompany. They cannot effectively integrate indicator values ​​with the actual clinical grading status, resulting in the extracted association information lacking practical clinical interpretive value.

[0003] Existing technologies attempt to apply schema-free open relation extraction methods to the medical field, but they still have several shortcomings when processing professional medical texts: First, medical texts are often long and syntactically complex, making it difficult for existing methods to effectively eliminate redundant vocabulary interference when representing entity relationships. They also lack adaptive awareness of the importance of different parts-of-speech nodes in the core syntactic dependency paths, resulting in relation representation vectors that fail to accurately depict the deep semantic logic between medical indicators. Second, existing clustering algorithms use a single feature aggregation method when dividing relation clusters, lacking continuous iterative optimization and semantic alignment mechanisms. This leads to insufficient stability in relation cluster division results, making them susceptible to text noise and hindering the formation of high-quality indicator relation categories. Furthermore, when constructing medical knowledge graphs based on the extraction results and conducting association analysis, existing technologies often fail to adequately distinguish the medical authority of different text source regions, treating all text sources together. This results in graph edge weights that fail to accurately reflect the reliability of medical indicator associations. Therefore, a medical indicator association analysis method is needed that can integrate clinical status information, identify syntactic and semantic features, and combine text source authority for graph construction to improve the credibility and practical value of medical relation extraction and association analysis results. Summary of the Invention

[0004] To address the issue of low confidence and practical value of existing technologies in medical correlation analysis, this invention proposes a knowledge graph-based method for medical indicator correlation analysis, which includes:

[0005] S1. Obtain medical text and extract medical indicator entities and accompanying values; based on a knowledge base including normal ranges and clinical grading, map the entity and value combination to a probability distribution of clinical indicator states to obtain probabilistic state indicator entities; S2. Analyze the syntactic dependency path between any pair of probabilistic state indicator entities within the same sentence, and remove stop word nodes that do not affect the semantics of medical relations to obtain the core syntactic path; initialize weight parameters for the part-of-speech tags of each node, and obtain the context word vectors of each node through a pre-trained language model; use the weight parameters to weight and aggregate the word vectors, and fuse the state distribution information to generate an initial relation representation vector; S3. Apply the initial relation representation vector... Iterative clustering is performed to obtain relation clusters and cluster prototype vectors through initial hierarchical clustering. The weight parameters are updated by calculating part-of-speech information gain, and relation representation vectors are regenerated. A contrastive learning function is used to optimize the position and update the cluster prototype vectors based on the distance between the vector and the cluster prototype vectors of the relation clusters to and from which it belongs, until the weight change is less than the threshold and the relation cluster allocation is stable, or the number of iterations reaches the preset maximum number of iterations, thus obtaining relation clusters. In S4, a knowledge graph is constructed with medical indicator entities as nodes and relation clusters as edge types. The regional authority score is found according to the source region type of the relation in the text, and the edge weight is determined according to the cumulative value, frequency and maximum value of the score, and then association analysis is performed.

[0006] Further, obtaining the probabilistic state indicator entity includes: for normal, high, and low states, calculating the absolute distance between the extracted accompanying value and the center value of the corresponding clinical grading interval of the corresponding medical indicator in the knowledge base; standardizing the absolute distance by combining the scale parameter of the corresponding medical indicator, and then converting it into a non-normalized probability score for the normal, high, and low states using a Gaussian kernel function; for critical and severe states, calling the critical threshold boundary of the corresponding medical indicator in the knowledge base, calculating the standardized out-of-bounds deviation of the accompanying value from the critical threshold boundary, and generating a non-normalized probability score for the critical and severe state using a monotonically increasing risk function positively correlated with the standardized out-of-bounds deviation; normalizing the non-normalized probability scores for the normal, high, low, and critical and severe states to generate a probability distribution vector composed of multiple state probabilities, and concatenating the vector with the semantic features of the medical indicator entity as the probabilistic state indicator entity.

[0007] Further, generating the initial relation representation vector includes: extracting part-of-speech tags for each node on the core syntactic path; calling the corresponding part-of-speech weight parameters based on the part-of-speech tags of each node; and generating a node-level query vector for that node through a linear projection matrix; calculating the node score based on the node-level query vector and the key vector of the corresponding context word vector; normalizing the scores of all nodes on the same core syntactic path to obtain the attention weight of each node; concatenating the weighted summed path aggregation vector with the probability distribution vector of the first and last probabilistic state index entities; and inputting the concatenated vector into a multilayer perceptron for feature dimensionality reduction, and outputting the initial relation representation vector.

[0008] Furthermore, the optimization of position and updating of cluster prototype vectors includes: constructing a contrastive loss function containing positive sample pairs and negative sample pairs, wherein positive sample pairs are the relation representation vector and the cluster prototype vector of its own relation cluster, and negative sample pairs are the relation representation vector and the cluster prototype vector of other non-relation clusters; by minimizing the contrastive loss function, the relation representation vector moves closer to the cluster prototype vector of its own relation cluster in the representation space, while moving away from the cluster prototype vector of non-relation clusters, thereby achieving joint optimization of intra-relation cluster compactness and inter-relation cluster separation.

[0009] Further, the calculation of part-of-speech information gain update weight parameters includes: in each iteration, calculating the difference between the prior entropy and the conditional entropy of each part of speech under the current relation cluster partitioning result to obtain the information gain value of the part of speech; applying the Softmax function to normalize the information gain values ​​of all parts of speech, and using the calculated normalized information gain value and the weight parameters of the previous iteration to perform an exponential moving average update to obtain the part-of-speech weight parameters of the current iteration.

[0010] Further, determining the edge weights based on the accumulated value, frequency, and maximum value of the scores includes: statistically analyzing all relation extraction instances that connect the same node pairs and belong to the same relation cluster, and extracting the regional authority score of the text region where each instance is located; multiplying the accumulated value of all regional authority scores by the logarithm of the frequency, and adding the maximum value among the regional authority scores to obtain a comprehensive score; and mapping the comprehensive score to between 0 and 1 using a Sigmoid function with a preset bias parameter, which serves as the edge weight of the knowledge graph.

[0011] Further, the association analysis includes: generating a node sequence in the knowledge graph using a random walk algorithm with restart, wherein the walk transition probability is proportional to the edge weight; determining the context neighborhood sampling set of each medical indicator entity based on the node sequence, and using a graph neural network to aggregate and encode the context neighborhood sampling set to calculate the topological similarity between any two medical indicator entities; extracting entity pairs with a topological similarity greater than a set threshold, and outputting them as clinical medical indicator pairs with potential causal clues or concurrent associations.

[0012] The present invention has the following technical effects: This invention maps medical indicator entities and their accompanying values ​​to clinical indicator state probability distributions, thereby characterizing the complexity and uncertainty of medical data in actual diagnostic scenarios. Specifically, it uses a fixed-dimensional order of normal, high, low, and critical illness to construct state probability distribution vectors, avoiding inconsistencies in state names, order, and vector dimension meanings. In the feature extraction stage, redundant words that do not affect the semantics of medical relationships are filtered using core syntactic dependency paths, and weighted aggregation is performed by combining part-of-speech weights, contextual semantic features, and state distribution information, making the generated relational representation vectors more focused on the core semantic connections between entities. This invention continuously optimizes the spatial distance between the relation representation vector and the relation cluster prototype vector through iterative clustering, part-of-speech information gain weight update, and contrastive learning optimization mechanism. Under the condition of no predefined schema, it enhances the discriminative ability of relation extraction and the stability of clustering results. In the knowledge graph construction stage, the graph edge weights are comprehensively calculated based on the authority scores corresponding to the text source region types. This enables the edge weights to reflect the evidence strength of the association between different source texts and medical indicators, thereby improving the confidence and practical value of the medical indicator association analysis results. Attached Figure Description

[0013] Figure 1 This is a flowchart of a medical indicator association analysis method based on knowledge graphs provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of syntactic path attention provided in an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating the comparative clustering effects provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the ablation experiment results provided in an embodiment of the present invention. Detailed Implementation

[0014] This invention provides a method for medical indicator correlation analysis based on knowledge graphs, referring to... Figure 1 This includes steps S1-S4: S1: Data Acquisition and Preprocessing.

[0015] Specifically, the process involves acquiring medical text, extracting medical indicator entities and their accompanying values, and mapping the entity and value combination to a probability distribution of clinical indicator states based on a knowledge base that includes normal ranges and clinical grading, thereby obtaining probabilistic state indicator entities.

[0016] First, the electronic medical record text document is read using Python's built-in file reading function to obtain medical text; then, the named entity recognition model is called to extract medical indicator entities, and the regular expression module re or the medical numerical recognition model is used to identify Arabic numerals, range values, comparison operators, units, and composite numerical forms within a preset character window before and after the medical indicator entities, and to extract the accompanying numerical values ​​corresponding to the medical indicator entities.

[0017] Next, the medical knowledge base constructed in the MySQL database contains the normal range and abnormal grading intervals of the indicator. The medical knowledge base pre-stores the interval center value, scale parameter and critical threshold boundary corresponding to the normal state, high state and low state for the same medical indicator. The dimension order of the probability distribution vector of the clinical indicator state in the whole text is fixed as normal, high, low and critical.

[0018] Based on the interval center value, scale parameter, and critical threshold boundary, non-normalized probability scores are calculated for normal state, high state, low state, and critical illness state, respectively. Among them, the non-normalized probability scores for normal state, high state, and low state are calculated using the interval center distance and Gaussian kernel function, while the non-normalized probability score for critical illness state is calculated using a monotonically increasing risk function positively correlated with the out-of-bounds deviation. Subsequently, the non-normalized probability scores of the four states are normalized to obtain the probability distribution vectors belonging to normal, high, low, and critical illness states.

[0019] The semantic features of the extracted medical indicator entities are concatenated with the probability distribution vector along a specified dimension, and the concatenation result is used as a probabilistic state indicator entity.

[0020] In some embodiments, based on a knowledge base containing normal ranges and clinical grading, entities and numerical combinations are mapped to a probability distribution of clinical indicator states to obtain probabilistic state indicator entities. This includes: for normal, high, and low states, calculating the absolute distance between the extracted accompanying numerical value and the center value of the corresponding clinical grading interval of the corresponding medical indicator in the knowledge base; standardizing the absolute distance by combining the scale parameter of the corresponding medical indicator, and then converting it into non-normalized probability scores for normal, high, and low states using a Gaussian kernel function; for critical and severe states, calling the critical threshold boundary of the corresponding medical indicator in the knowledge base, calculating the standardized out-of-bounds deviation of the accompanying numerical value exceeding the critical threshold boundary, and generating non-normalized probability scores for critical and severe states using a monotonically increasing risk function positively correlated with the standardized out-of-bounds deviation. The non-normalized probability scores of normal, high, low and critical illness states are normalized to generate a probability distribution vector composed of multiple state probabilities. The vector is then concatenated with the semantic features of the medical indicator entity to form a probabilistic state indicator entity.

[0021] The above probability mapping process is based on the preset index grading parameters in the clinical knowledge base. For the accompanying values ​​extracted from medical text, such as a fasting blood glucose value of 7.5 mmol / L, the absolute distance between the value and the center value of the three non-critical grading intervals of normal, high, and low is calculated. For example, the center value of the normal state of fasting blood glucose can be set to 5, the center value of the high state can be set to 6.55, and the center value of the low state can be set to 3. For critical and severe states, the critical center value is no longer set to participate in the Gaussian kernel distance calculation. Instead, the critical threshold boundary preset in the knowledge base is called, such as the critical upper boundary Tcrit.

[0022] The specific scaling parameter for this medical indicator is obtained to measure its sensitivity to fluctuations. The value range is, for example, between 0.1 and 10; for example, a scaling parameter of 1.2 is used for fasting blood glucose. For normal, elevated, and low values, the absolute distance between the accompanying value and the corresponding interval center value is divided by the scaling parameter for standardization, and then input into a Gaussian kernel function to convert it into a non-normalized probability score. For critical and severe conditions, the standardized out-of-bounds deviation δ is calculated first. When the indicator belongs to the high-value critical type... Where x is the associated value, The upper boundary of the critical condition is defined by s, where s is the scale parameter; when the index belongs to the low-value critical type, ,in The lower boundary was in danger; subsequently, it was utilized A nonnormalized probability score for critical and severe illness is generated, where ε is a small constant to prevent the probability from being completely zero, and λ is the risk growth coefficient. Thus, the higher the value exceeds the critical threshold boundary, the higher the nonnormalized probability score for critical and severe illness, which is consistent with the logic that clinical risk increases with the degree of abnormality.

[0023] After obtaining the non-normalized probability scores of the four graded states, probability normalization is performed by normalizing the scores, that is, dividing the non-normalized probability score of each state by the sum of the scores of the four states, so that the sum of the four is equal to 1. When the sum of the scores of the four states is close to zero, a preset small constant is introduced to avoid division by zero, thereby generating a four-dimensional state probability distribution vector. The order of this four-dimensional vector is fixed as [normal probability, high probability, low probability, critical probability]. For example, when the fasting blood glucose value is 7.5 mmol / L and has not exceeded the critical threshold boundary, it is closer to the center value of the high state. After normalization, it can form a four-dimensional state probability distribution vector of the form [0.10, 0.87, 0.01, 0.02], where the maximum probability is located in the second dimension, corresponding to the high state.

[0024] The semantic features of the medical indicator entity in the hidden layer of a pre-trained language model, such as the clinical version of BERT, are typically 768-dimensional dense floating-point vectors. The structure of the pre-trained language model includes an embedding layer and a multi-layer bidirectional Transformer encoder layer. Each Transformer encoder layer consists of a multi-head self-attention sub-layer and a fully connected feedforward network sub-layer connected in series. There are residual connections and layer normalization modules between the layers.

[0025] The input to the pre-trained language model is a sequence of text morphemes containing medical indicator entities, and the output is a hidden layer semantic feature vector mapped to a high-dimensional representation space. Its mathematical expression can be represented as H=BERT(X), where X is the input sequence and H is the output semantic feature. After obtaining the hidden layer semantic features, the aforementioned four-dimensional probability distribution vector is concatenated to the end of the semantic feature vector. Through this concatenation step, the entity representation that originally only had text features is upgraded to 772 dimensions, generating a probabilistic state indicator entity vector that has both semantic attributes and numerical severity features.

[0026] S2: Initial relation representation vector generation.

[0027] Specifically, the syntactic dependency path between any pair of probabilistic state index entities within the same sentence is analyzed, and stop word nodes that do not affect the semantics of medical relations are removed to obtain the core syntactic path; weight parameters are initialized for the part-of-speech tags of each node, and context word vectors of each node are obtained through a pre-trained language model; the word vectors are weighted and aggregated using the weight parameters, and the state distribution information is fused to generate an initial relation representation vector.

[0028] First, the dependency parsing module in the Stanford CoreNLP toolkit is called to parse sentences containing the aforementioned entities. Then, Dijkstra's shortest path algorithm is used to find the shortest connected path between two probabilistic state indicator entities on the dependency parsing tree. The path nodes are traversed, and meaningless nodes are removed by referring to a pre-defined Chinese medical stop word list, leaving the remaining nodes to obtain the core syntactic path. The pre-defined Chinese medical stop word list does not include negation words, degree words, direction trigger words, causal trigger words, or concurrent relation trigger words. Nodes that change the polarity or direction of medical relations, such as those containing "not," "none," "not seen," "deny," "cause," "induce," "accompany," and "exclude," are retained and participate in subsequent relation representation calculations.

[0029] Next, the Stanford CoreNLP Chinese model, HanLP toolkit, or LTP Chinese language processing tool are used to perform part-of-speech tagging on the nodes in the core syntactic path. For different part-of-speech categories such as verbs, nouns, adjectives, and prepositions, a low-dimensional part-of-speech weight vector is generated as the initial weight parameter, for example, a 128-dimensional vector. The vector elements can follow a normal distribution with a mean of 0 and a variance of 1, or be randomly initialized in the range of -1 to 1. Thus, the part-of-speech weight parameters in the entire text are uniformly in vector form, instead of mixing scalars and vectors.

[0030] Subsequently, the HuggingFaceTransformers library is called to load the RoBERTa pre-trained language model. Sentences containing entities are input into the model for forward propagation, and feature vectors corresponding to the path node positions in the output sequence of the last hidden layer are extracted as context word vectors.

[0031] For the i-th node in the core syntax path, extract the part-of-speech weight vector corresponding to its part-of-speech tag, and generate a node-level query vector through a linear projection matrix; map the context word vectors of the node to key vectors and value vectors respectively, and calculate the dot product score between the node-level query vector and the corresponding key vector; perform Softmax normalization on the dot product scores of all nodes on the same core syntax path to obtain the attention weight of each node, and then perform weighted summation of the value vectors according to the attention weights to obtain the path aggregation vector.

[0032] The weighted aggregation vector is concatenated with the probability distribution vectors corresponding to the two entities, and then input into a multilayer perceptron network for linear transformation and feature dimensionality reduction. The network output is the initial relation representation vector.

[0033] In some embodiments, word vectors are weighted and aggregated using weight parameters, and state distribution information is fused to generate an initial relation representation vector. This includes: extracting part-of-speech tags for each node on the core syntactic path; calling the corresponding part-of-speech weight parameters based on the part-of-speech tags of each node; generating a node-level query vector for that node using a linear projection matrix; calculating node scores based on the node-level query vector and the key vector of the corresponding context word vectors; normalizing the scores of all nodes on the same core syntactic path to obtain the attention weights of each node; concatenating the weighted summed path aggregation vector with the probability distribution vectors of the first and last probabilistic state index entities; and inputting the concatenated vector into a multilayer perceptron for feature dimensionality reduction to output the initial relation representation vector.

[0034] The part-of-speech tags of each node in the core syntactic path, such as nouns, verbs, and prepositions, are parsed, and the feature weight parameters of each part of speech in the current iteration are retrieved. In this embodiment, the part-of-speech weight parameters are represented as low-dimensional floating-point vectors, such as 128-dimensional vectors. For each node in the core syntactic path, the part-of-speech weight vector corresponding to its part-of-speech tag is called, and mapped to the node-level query vector Q of that node through a learnable linear projection matrix. i ; linearly transform the context word vector of this node into the key vector K i Sum vector V i Calculate Q i With K i The dot product score is calculated; Softmax normalization is performed on the dot product scores of all nodes on the same core syntax path to obtain the attention weights of each node, and then the corresponding value vector V is adjusted according to the attention weights of each node. i The attention weights of each node along the syntactic path are distributed as follows after weighted summation. Figure 2 As shown.

[0035] After obtaining the attention weights of all nodes, a weighted summation operation is performed on all value vectors to generate a path aggregation vector that integrates global dependency structure information, maintaining a dimension of 768. This aggregation vector is then horizontally concatenated with the probability distribution vectors of the first and last probabilistic state indicator entities located at both ends of the dependency path. Since each probability distribution vector is 4-dimensional and the order is uniformly [normal probability, high probability, low probability, critical probability], the dimension of the concatenated high-dimensional hybrid vector is 768+4+4=776.

[0036] The concatenated vector is fed into a multilayer perceptron containing two hidden layers for feature compression. For example, the first layer is reduced to 512 dimensions with the ReLU activation function, and the second layer is reduced to 256 dimensions. The structure of the multilayer perceptron includes an input layer, one or more hidden layers, and an output layer. Neurons in adjacent layers are fully connected by weighted synapses and a non-linear activation function is used for mapping calculation.

[0037] The input to the multilayer perceptron is the aforementioned concatenated high-dimensional mixture vector, and the output is the initial relation representation vector after feature dimensionality reduction processing. Its mathematical expression can be represented as follows: Where X is the input vector, and This is the weight matrix. and For bias terms, Let Z be the activation function and Z be the output representation vector. It can be seen that the initial relation representation vector with structural redundancy information removed is output by the multilayer perceptron.

[0038] S3: Determine the relation cluster and cluster prototype vector.

[0039] Specifically, iterative clustering is performed on the initial relation representation vector to obtain relation clusters and cluster prototype vectors through initial hierarchical clustering; the weight parameters are updated by calculating part-of-speech information gain, and relation representation vectors are regenerated; a contrastive learning function is used to optimize the position and update the cluster prototype vectors based on the distance between the vector and the cluster prototype vectors of the relation clusters to and from which it belongs, until the weight change is less than the threshold and the relation cluster allocation is stable, or the number of iterations reaches the preset maximum number of iterations, thus obtaining the relation clusters.

[0040] First, an agglomerative hierarchical clustering algorithm is used to perform initial hierarchical clustering on all initial relation representation vectors. Euclidean distance is used as the metric, and Ward's linking method is used to minimize the intra-cluster variance. After clustering, multiple relation clusters are obtained. For each relation cluster, the arithmetic mean of all relation representation vectors contained therein is calculated and used as the cluster prototype vector of that relation cluster.

[0041] Next, based on the information entropy calculation formula, the information gain value of each part-of-speech node relative to the current relation cluster partitioning result is calculated; the information gain value of each part-of-speech is normalized by Softmax and used as the relative contribution of that part-of-speech in the current clustering result, and the corresponding part-of-speech weight parameters are updated using the exponential moving average method. This part-of-speech weight update process adopts explicit numerical update, does not use the information gain value as the backpropagation error signal, and does not use the Adam optimizer to directly update the part-of-speech weight parameters.

[0042] Using the updated weight parameters, the context word vectors are re-attention-weighted and summed, and then the probability distribution vectors are concatenated to regenerate the relation representation vector.

[0043] Subsequently, the InfoNCE loss function is constructed as the contrastive learning function. When calculating similarity, L2 normalization is first performed on the regenerated relation representation vector and the cluster prototype vector of each relation cluster. The normalized dot product similarity is equivalent to the cosine similarity. Thus, the dot product similarity and cosine similarity remain consistent within the contrastive learning loss, and no longer cause conflict in the measurement standards. The similarity between the regenerated relation representation vector and the cluster prototype vector of its own relation cluster is calculated as the positive sample similarity. The similarity between the relation representation vector and the cluster prototype vector of a non-relation cluster is calculated as the negative sample similarity. The contrastive learning function is minimized through the backpropagation algorithm to adjust the position of the relation representation vector in the multidimensional space. Based on the relation representation vector updated with the new position, the arithmetic mean is recalculated or the cluster prototype vector of each relation cluster is updated using an exponential moving average strategy. Based on the similarity or distance between the updated relation representation vector and the prototype vector of each relation cluster, the relation cluster number to which each relation representation vector belongs is re-determined. If the re-determined relation cluster number is consistent with the previous round, the relation cluster assignment is considered stable.

[0044] Set a very small floating-point number as the convergence threshold. After each iteration, calculate the L2 difference between the current part-of-speech weight vector and the part-of-speech weight vector of the previous round, or calculate the maximum value of the absolute values ​​of the differences in each dimension. At the same time, check whether the relation cluster numbers to which all current representation vectors belong are consistent with those of the previous round. When the L2 difference or the maximum absolute difference is less than the threshold and the relation cluster assignments of all relation representation vectors no longer change, stop the iteration. If the above convergence conditions are not met but the number of iterations reaches the preset maximum number of iterations, stop the iteration and output the relation cluster partitioning results of the current round as the relation clusters.

[0045] In some embodiments, a contrastive learning function is used to optimize the position and update the cluster prototype vector based on the distance between the vector and the cluster prototype vectors of its own and non-owning relation clusters. This includes: constructing a contrastive loss function containing positive sample pairs and negative sample pairs, where the positive sample pairs are the relation representation vector and the cluster prototype vector of its own relation cluster, and the negative sample pairs are the relation representation vector and the cluster prototype vectors of other non-owning relation clusters; by minimizing the contrastive loss function, the relation representation vector moves closer to the cluster prototype vector of its own relation cluster in the representation space, while moving away from the cluster prototype vectors of non-owning relation clusters, thereby achieving joint optimization of intra-relation cluster compactness and inter-relation cluster separation.

[0046] During the clustering optimization execution phase, the InfoNCE contrastive learning framework is used to construct a contrastive loss function that includes temperature hyperparameters. In the batch computation of a single iteration of the model, for a specific initial relation representation vector, the centroid vector corresponding to its current hard clustering assignment label is regarded as the cluster prototype vector of the relation cluster to which it belongs, i.e., a positive sample pair, and is marked as a positive sample. At the same time, the centroid vectors of all other non-relation clusters in the vector space are set as the cluster prototype vectors of non-relation clusters, i.e., negative sample pairs. The number of negative samples is usually configured to be between 10 and 50.

[0047] When calculating the similarity metric, both the relation representation vector and the cluster prototype vector are L2 normalized, and then their dot product is used as the similarity metric in the InfoNCE loss. Since the normalized dot product is equivalent to cosine similarity, this similarity metric can also be called cosine similarity. The temperature hyperparameter ranges from 0.05 to 0.15, with a typical value of 0.07, and is used to sharpen the probability distribution between different categories. The backpropagation algorithm and gradient optimizer are used, with the initial learning rate set to 1× AdamW minimizes the above contrastive loss function, driving the relational representation vector of the current batch to produce a directional geometric shift in the representation space.

[0048] In each parameter iteration, each representation vector is brought closer to the high-dimensional region where the positive sample prototype is located in the coordinate system, while being pushed away from the position where all negative sample prototypes are located. During this tug-of-war, the cluster prototype vector of each relation cluster is also recalculated and updated synchronously according to the changes in the sample vectors assigned to that cluster, in conjunction with the exponential moving average strategy decay rate parameter, for example, 0.99, to achieve joint stable optimization of minimizing intra-cluster variance and maximizing inter-cluster distance. The trend of clustering iterative optimization is compared as follows: Figure 3 As shown, with the increase of the number of optimization iterations, the intra-cluster distance represented by the relation continuously decreases, while the inter-cluster separation continuously increases.

[0049] In some embodiments, updating the weight parameters by calculating part-of-speech information gain includes: in each iteration, calculating the difference between the prior entropy and the conditional entropy of each part of speech under the current relation cluster partitioning result to obtain the information gain value of the part of speech; applying the Softmax function to normalize the information gain values ​​of all parts of speech; and using the calculated normalized information gain value and the weight parameters of the previous iteration to update the weight parameters of the part of speech in the current iteration by performing an exponential moving average.

[0050] The part-of-speech weight parameter update mechanism is based on the quantitative calculation of the node distinguishing ability in information theory. After the model completes each hierarchical clustering and updates the cluster labels, the prior information entropy is calculated based on the probability distribution of the current relation cluster category. All discrete part-of-speech categories, such as nouns, verbs, and adverbs, appear in the full syntactic path are traversed, and the conditional probability distribution of each part of speech is statistically analyzed and the corresponding conditional entropy is calculated.

[0051] By subtracting the conditional entropy of each category from the prior entropy, the information gain value of each specific part of speech is obtained. For example, verbs contribute greatly to defining association relationships, with an information gain value of 1.45, while conjunctions, as connecting components, have an information gain value of 0.12. After calculating the information gain values ​​of all parts of speech, this tensor sequence is input into a Softmax function layer with a temperature scaling mechanism to perform nonlinear mapping processing, thereby converting the information contribution of each part of speech into normalized relative weights with a sum of 1.0 and a range between 0 and 1.

[0052] Since the normalized information gain value is a part-of-speech scalar, and the part-of-speech weight parameter is a 128-dimensional vector in this embodiment, the normalized information gain scalar value for each part of speech is first calculated before performing the exponential moving average update. Expand it to a target vector with the same dimension as the part-of-speech weight parameter; specifically, it can be... Copy to 128 dimensions ·1, or will The input linear mapping layer generates a 128-dimensional target weight vector; then according to... Perform exponential moving average updates, where This represents the weight vector of part-of-speech p in the t-th round, where β is the momentum decay coefficient. This represents a target vector of the same dimension generated by the normalized information gain scalar.

[0053] When applying the exponential moving average function to update parameters, the momentum decay coefficient is set in a high smoothing range, such as 0.85 to 0.95, with a typical value of 0.9. For example, the current round weight vector is equal to 0.9 times the weight vector of the previous round plus 0.1 times the information gain target vector of the current round. This ensures that the part-of-speech weight parameters are calculable in dimension, evolve smoothly in numerical value, and are connected in a closed loop with the subsequent linear projection attention calculation.

[0054] S4: Knowledge graph construction and association analysis execution.

[0055] Specifically, a knowledge graph is constructed using medical indicator entities as nodes and relationship clusters as edge types. The regional authority score is found based on the source region type of the text according to the relationship. The edge weight is determined based on the cumulative value, frequency and maximum value of the score, and then the association analysis is performed.

[0056] First, using the Cypher query language of the Neo4j graph database, all medical indicator entities extracted from medical texts are created as nodes in the graph database by creating statements. For two nodes belonging to the same sentence, edges are created to connect the two entities using their respective relation clusters as relation category labels, thus constructing an initial knowledge graph. When the core syntactic path corresponding to the relation cluster contains directional trigger words such as "cause," "induce," and "appear after elevation," the cause entity and the result entity are determined by combining dependency syntactic relations, the direction of trigger word domination, and semantic role labeling results, and directed edges are established from the cause entity to the result entity. When a stable direction cannot be determined, the edge is marked as an undirected concurrent association edge.

[0057] The system predefines regional authority scores for source region types such as chief complaint region, present medical history region, diagnostic conclusion region, and laboratory report region using a Python dictionary structure. Based on the source region type of two co-occurring sentences of medical indicator entities in the electronic medical record text, it matches the corresponding authority scores in the dictionary. It iterates through all edge instances of the same node pairs belonging to the same relation cluster in the graph, calculating the sum of the corresponding authority scores and the total number of occurrences of the directed or associated edge, while also identifying the maximum historical score. The system multiplies the sum of all regional authority scores by the logarithm of their frequencies and adds the maximum regional authority score to obtain the comprehensive score, i.e., Score = Sum × ln(N) + Max, where Score is the comprehensive score, Sum is the sum of regional authority scores, N is the frequency, and Max is the maximum regional authority score. Subsequently, this comprehensive score is input into a Sigmoid activation function with preset bias parameters, mapped to a numerical range of 0 to 1, and the output is assigned to the corresponding edge as edge weights.

[0058] Next, a random walk algorithm with restart is used to generate a node sequence, where the walk transition probability is proportional to the edge weight. Based on the node sequence, a context neighborhood sampling set for each medical indicator entity is determined, and a graph neural network is used to aggregate and encode the context neighborhood sampling set to calculate the topological similarity between any two medical indicator entities. Entity pairs with a topological similarity greater than a set threshold are extracted, and the output is a pair of clinical medical indicator pairs with potential causal clues or concurrent associations. It should be noted that this potential causal clue does not indicate that rigorous clinical causal inference has been completed, but rather that the indicator pair simultaneously satisfies conditions such as directional relation clusters, high edge weights, and high topological similarity in the graph, possessing value for subsequent clinical validation or statistical causal analysis. For entity pairs without directional relation cluster support, the output is a candidate for concurrent association or co-occurrence association.

[0059] In some embodiments, the process of finding regional authority scores in the source region type of the text based on the relationship, and determining edge weights based on the accumulated value, frequency, and maximum value of the scores, includes: counting all relation extraction instances that connect the same node pairs and belong to the same relation cluster; extracting the regional authority score of the text region where each instance is located; multiplying the accumulated value of all regional authority scores by the logarithm of the frequency, and adding the maximum value among the regional authority scores to obtain a comprehensive score; and mapping the comprehensive score to between 0 and 1 using a Sigmoid function with a preset bias parameter, which serves as the edge weight of the knowledge graph.

[0060] This edge weight quantization calculation method combines evidence-based medicine logic to ensure the reliability of graph connectivity strength. It traverses the parsed medical document data set, filters and counts all discrete text extraction instances that connect the same pair of medical indicator entities, such as high uric acid and gout, and are classified into the same relation category in the network space, such as inducing relations. It obtains the total co-occurrence frequency of this set of relations in the global corpus, for example, frequency N equals 5.

[0061] The internal medical record source weight dictionary is called to extract the regional authority scores of the source text regions corresponding to these 5 extracted instances. The parameter library is set, for example, the chief complaint region score is 0.6, the present illness history is 0.8, and the laboratory report region score is 1. In the specific scalar synthesis stage, the obtained score arrays corresponding to the instances, such as arrays 1, 0.6, 0.8, 1, and 0.7, are aggregated to calculate the arithmetic sum of all scores in the sequence, which is 4.1 in this example. The maximum authority value within the array is then selected, which is 1 in this example.

[0062] According to predefined logical rules, a composite score is output using a computational expression, expressed as Score = Sum × ln(N) + Max, where Score is the overall score, Sum is the cumulative value, N is the frequency, and Max is the maximum value, which is approximately 7.6 in this example. Since the overall score exhibits an unbounded distribution, a Sigmoid nonlinear activation function with a preset bias parameter is applied to compress and project the discrete wide-area score of 7.6 into a real solution of 0.93, as shown in the formula. The bias term b is usually set to 5, and this real number is used as the weight of the normalized continuous edges in the network topology.

[0063] In some embodiments, performing association analysis based on a knowledge graph includes: generating a node sequence in the knowledge graph using a random walk algorithm with restart, wherein the walk transition probability is proportional to the edge weight; determining a context neighborhood sampling set for each medical indicator entity based on the node sequence, and using a graph neural network to aggregate and encode the context neighborhood sampling set to calculate the topological similarity between any two medical indicator entities; extracting entity pairs with a topological similarity greater than a set threshold, and outputting them as clinical medical indicator pairs with potential causal clues or concurrent associations.

[0064] A random walk algorithm with restart is deployed on the framework of a medical knowledge graph with continuous edge weights to obtain deep local and global dependency information of the network. During this process, the restart probability hyperparameter set by the algorithm controls the range of near and far boundary parameters of the detection range, for example, between 0.1 and 0.25, with a value of 0.15. In the random walk, the probability of the current walking cursor jumping from a specific node to the next connected neighbor is proportional to the normalized edge weight of the connection between them. With this mechanism, dozens of discrete walking node sequences with a set step size, such as 80 steps, are generated in parallel for all target entities to serve as the high-order context of the entity in the graph space.

[0065] After identifying the random walk node sequence information, the high-frequency context nodes of the same target node are first counted based on multiple random walk sequences corresponding to the same target node, and a context neighborhood sampling set of the target node is constructed. Then, the context neighborhood sampling set is input into the GraphSAGE network layer for neighborhood aggregation encoding. The graph neural network structure contains multiple graph aggregation layers. Each layer updates the feature representation of the node by aggregating the feature vectors of the node's neighbors and applies nonlinear transformations.

[0066] The input to the graph neural network is a context neighborhood sample set determined by a random walk node sequence generated based on edge weights, and initial feature representations of entities in the graph. The output is a continuous topological embedding vector for each medical indicator entity. The core update formula can be expressed as follows: ,in Let v be the feature vector of node v in the l-th layer. Let W be the set of neighboring nodes, and B be the learnable parameter matrices. This is the activation function.

[0067] During the training phase of the graph neural network, training samples are constructed based on the node sequences generated by random walks with restart. Node pairs within a preset window range in the same node sequence are taken as positive sample pairs, and negative sample pairs are sampled from non-neighborhood nodes or low-weight nodes in the graph. With the goal of increasing the embedding similarity of positive sample pairs and decreasing the embedding similarity of negative sample pairs, a negative sampling contrastive loss function is constructed to train the learnable parameter matrix in the GraphSAGE network. When the loss function converges or reaches the preset training rounds, the topological embedding vectors of each medical indicator entity are output using the trained graph neural network.

[0068] The model calculates the information aggregation of neighbor nodes within the context neighborhood sampling set, transforming all discrete medical indicator entities into 256-dimensional or 512-dimensional topological embedding vectors with continuous feature spatial distribution. It then uses a cosine similarity calculation mechanism to derive the topological similarity score between each entity pair. The similarity score of each entity pair is compared with a manually set confidence threshold, typically a floating-point value between 0.75 and 0.85, with a typical threshold of 0.8. High-scoring topologically overlapping entity combinations that meet the threshold constraints are extracted and exported as candidate results for the clinical medical indicator association analysis report.

[0069] Regarding the interpretation of the output, if the high similarity between entity pairs mainly comes from undirected co-occurrence edges or concurrent relation clusters, then the entity pair is marked as a concurrent association candidate; if the entity pair simultaneously possesses directional relation clusters, high authority edge weights in the source region, and high topological similarity, then the entity pair is marked as a potential causal clue candidate. This output is used to prompt subsequent clinical review, statistical validation, or causal inference modeling, and is not directly equivalent to a confirmed medical causal conclusion.

[0070] The ablation experiment was evaluated on a publicly available Chinese clinical electronic medical record entity relation dataset. During the model training phase, an RTX 4090 graphics card was used, the batch size was set to 32, the initial learning rate was set to 0.0001, and the Adam optimizer was used. The evaluation metrics were precision and recall of relation extraction, and the comprehensive evaluation metric F1 score. The baseline model used a conventional clinical pre-trained language model with the addition of a common multilayer perceptron and graph aggregation network. This model did not include a probabilistic state numerical mapping module, a contrastive learning clustering optimization mechanism, or a part-of-speech information gain weight update component.

[0071] The baseline model achieved a precision of 79.2%, a recall of 77.5%, and an F1 score of 78.3% on the test set. The first ablation variant, building upon the baseline model, added a numerical probabilistic state mapping mechanism and multi-dimensional feature concatenation, improving precision to 82.6%, recall to 80.1%, and an F1 score of 81.3%. The second ablation variant, building upon the first variant, added part-of-speech information gain updates and contrastive learning relation clustering modules, achieving a precision of 86.4%, a recall of 84.3%, and an F1 score of 85.3%. The complete technical solution employing all components achieved superior performance, specifically measuring a precision of 89.1%, a recall of 88.2%, and an F1 score of 88.6%. A comparison of the ablation test performance of each version is provided below. Figure 4 As shown, with the sequential addition of numerical probabilistic state mapping, part-of-speech information gain update, and contrastive clustering modules, the precision, recall, and F1 score all show a steady upward trend, and the complete model achieves superior overall performance.

[0072] By utilizing a numerical probabilistic state mapping mechanism, this invention employs an interval-centered Gaussian kernel function to identify the proximity of normal, high, and low states, and a monotonically increasing risk function of critical threshold deviation to identify the severity of critical illness states, thus improving the problem of traditional pure semantic text encoding easily losing the meaning of medical numerical fluctuations. Combined with an information entropy-based adaptive part-of-speech weight update and contrastive learning framework, the compactness of similar relationship clusters within the feature representation space is enhanced, and the exclusionary separation of non-belonging relationships is increased, enabling the model to focus on core syntactic nodes and remove structural redundancy noise. Furthermore, by combining a graph edge weight quantization mechanism based on evidence-based authority scores, the generated deep network topology feature representation more closely matches the strength of evidence in real medical texts, improving the accuracy of potential concurrent associations and potential causal clue analysis of clinical indicators.

[0073] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.

[0074] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art. The general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for medical indicator association analysis based on knowledge graphs, characterized in that, include: S1. Obtain medical text, extract medical indicator entities and accompanying values; based on a knowledge base containing normal ranges and clinical grading, map the entity and value combination to a probability distribution of clinical indicator status to obtain probabilistic state indicator entities. S2 parses the syntactic dependency path between any pair of probabilistic state index entities within the same sentence, removes stop word nodes that do not affect the semantics of medical relations, and obtains the core syntactic path; initializes weight parameters for the part-of-speech tags of each node, obtains the context word vectors of each node through a pre-trained language model; uses the weight parameters to weight and aggregate the word vectors, and fuses the state distribution information to generate the initial relation representation vector; S3, perform iterative clustering on the initial relation representation vector to obtain relation clusters and cluster prototype vectors by performing initial hierarchical clustering; update the weight parameters by calculating part-of-speech information gain and regenerate the relation representation vector; use a contrastive learning function to optimize the position and update the cluster prototype vector based on the distance between the vector and the cluster prototype vectors of the relation clusters to and from which it belongs, until the weight change is less than the threshold and the relation cluster allocation is stable, or the number of iterations reaches the preset maximum number of iterations, and the relation clusters are obtained; S4 constructs a knowledge graph using medical indicator entities as nodes and relationship clusters as edge types. Based on the relationship, the region authority score is found in the source region type of the text. The edge weight is determined based on the cumulative value, frequency and maximum value of the score, and then the association analysis is performed.

2. The method for medical indicator association analysis based on knowledge graphs according to claim 1, characterized in that, The process of obtaining the probabilistic state indicator entity includes: for normal, high, and low states, calculating the absolute distance between the extracted accompanying value and the center value of the corresponding clinical grading interval of the corresponding medical indicator in the knowledge base; standardizing the absolute distance by combining the scale parameter of the corresponding medical indicator, and then converting it into a non-normalized probability score for the normal, high, and low states using a Gaussian kernel function; for critical and severe states, calling the critical threshold boundary of the corresponding medical indicator in the knowledge base, calculating the standardized out-of-bounds deviation of the accompanying value from the critical threshold boundary, and generating a non-normalized probability score for the critical and severe state using a monotonically increasing risk function positively correlated with the standardized out-of-bounds deviation; normalizing the non-normalized probability scores for the normal, high, low, and critical and severe states to generate a probability distribution vector composed of multiple state probabilities, and concatenating the vector with the semantic features of the medical indicator entity to obtain the probabilistic state indicator entity.

3. The method for medical indicator association analysis based on knowledge graphs according to claim 1, characterized in that, The process of generating the initial relation representation vector includes: extracting part-of-speech tags from each node on the core syntactic path; calling the corresponding part-of-speech weight parameters based on the part-of-speech tags of each node; generating a node-level query vector for that node using a linear projection matrix; calculating the node score based on the node-level query vector and the key vector of the corresponding context word vector; normalizing the scores of all nodes on the same core syntactic path to obtain the attention weight of each node; concatenating the weighted summed path aggregation vector with the probability distribution vector of the first and last probabilistic state index entities; and inputting the concatenated vector into a multilayer perceptron for feature dimensionality reduction to output the initial relation representation vector.

4. The method for medical indicator association analysis based on knowledge graphs according to claim 1, characterized in that, The optimization of position and updating of cluster prototype vectors includes: constructing a contrastive loss function containing positive sample pairs and negative sample pairs, where the positive sample pair is the relation representation vector and the cluster prototype vector of its own relation cluster, and the negative sample pair is the relation representation vector and the cluster prototype vector of other non-relation clusters; by minimizing the contrastive loss function, the relation representation vector moves closer to the cluster prototype vector of its own relation cluster in the representation space, while moving away from the cluster prototype vector of non-relation clusters, thereby achieving joint optimization of intra-relation cluster compactness and inter-relation cluster separation.

5. The method for medical indicator association analysis based on knowledge graphs according to claim 1, characterized in that, The calculation of part-of-speech information gain update weight parameters includes: in each iteration, calculating the difference between the prior entropy and the conditional entropy of each part of speech under the current relation cluster partitioning result to obtain the information gain value of the part of speech; applying the Softmax function to normalize the information gain values ​​of all parts of speech, and using the calculated normalized information gain value and the weight parameters of the previous iteration to update the weight parameters of the part of speech in the current iteration.

6. The method for medical indicator association analysis based on knowledge graphs according to claim 1, characterized in that, The step of determining edge weights based on the accumulated value, frequency, and maximum value of scores includes: statistically analyzing all relation extraction instances that connect the same node pairs and belong to the same relation cluster, and extracting the regional authority score of the text region where each instance is located; multiplying the accumulated value of all regional authority scores by the logarithm of the frequency, and adding the maximum value among the regional authority scores to obtain a comprehensive score; and mapping the comprehensive score to between 0 and 1 using a Sigmoid function with a preset bias parameter, which serves as the edge weight of the knowledge graph.

7. The method for medical indicator association analysis based on knowledge graphs according to claim 1, characterized in that, The association analysis includes: generating a node sequence in the knowledge graph using a random walk algorithm with restart, wherein the walk transition probability is proportional to the edge weight; determining the context neighborhood sampling set of each medical indicator entity based on the node sequence, and using a graph neural network to aggregate and encode the context neighborhood sampling set to calculate the topological similarity between any two medical indicator entities; extracting entity pairs with a topological similarity greater than a set threshold, and outputting them as clinical medical indicator pairs with potential causal clues or concurrent associations.