Medical text big data intelligent labeling and knowledge graph construction method and system

By using a deep two-way coding model and a multi-level entity recognition network for entity recognition in medical text processing, and combining a comparative learning algorithm to optimize relationship annotation, the knowledge graph is finally built using the medical rule base, which solves the accuracy and efficiency of the existing medical text annotation technology, and achieves efficient and accurate construction of medical knowledge graphs.

CN119851968AInactive Publication Date: 2025-04-18BAICHEN HEALTH TECH (NANJING) CO LTD

Patent Information

Application Number
CN202510330426.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-04-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing medical text annotation technology has problems such as low accuracy and recall of entity recognition, low efficiency and accuracy of relationship extraction, high cost and slow update speed, which is difficult to meet the needs of large-scale medical knowledge graph construction.

Method used

A method of intelligent annotation and knowledge graph construction for medical text big data is adopted. By obtaining medical text data and performing word segmentation processing, a context semantic vector is generated using a deep two-way coding model, a multi-level entity recognition network and entity representation enhancement module is used to perform entity recognition and annotation, and a re-labeling algorithm based on contrast learning is used to optimize relationship annotation, and finally a knowledge graph is constructed through inference verification through the medical rule base.

Benefits of technology

It improves the accuracy of entity recognition in medical text and the reliability of relationship extraction, reduces labeling costs, improves the efficiency and accuracy of knowledge graph construction, and can better meet the needs of large-scale medical knowledge graph construction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119851968A_ABST
    Figure CN119851968A_ABST
Patent Text Reader

Abstract

The invention provides a medical text big data intelligent labeling and knowledge graph construction method and system, and relates to the technical field of medical text processing, and the method comprises the steps: recognizing entities in a medical text through a pre-trained deep bidirectional coding model and a multi-level entity recognition network, and carrying out the normalization processing in combination with a medical knowledge base, according to the method, the semantic association degree between entities is calculated, a relation extraction result is optimized based on comparative learning, comprehensive relation representation is obtained through fusion of multi-granularity coding and a gating mechanism, the entity relation is determined in combination with an inference rule network, a medical knowledge graph is constructed based on an initial knowledge graph, and the accuracy of medical text entities and relation labeling can be effectively improved. And a more perfect medical knowledge graph is constructed, which is helpful for assisting medical diagnosis and decision making.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of medical text processing technology, and in particular to a method and system for intelligent annotation and knowledge graph construction of medical text big data. Background Art

[0002] Medical texts contain a wealth of medical knowledge. How to efficiently extract key information from massive medical texts and construct knowledge graphs is crucial to assisting clinical decision-making, promoting medical research, and improving the level of medical services. Traditional medical text processing methods mainly rely on manual annotation and rule matching, which are inefficient and difficult to adapt to complex medical scenarios. Existing medical text annotation technologies still have problems such as low accuracy and recall of entity recognition, low efficiency and accuracy of relationship extraction, high cost and slow update speed, which makes it difficult to meet the needs of building large-scale medical knowledge graphs. Therefore, a solution is urgently needed to solve the problems existing in the prior art. Summary of the invention

[0003] The embodiments of the present invention provide a method and system for intelligent annotation of medical text big data and construction of knowledge graph, which can at least solve some of the problems existing in the prior art.

[0004] A first aspect of an embodiment of the present invention provides a method for intelligently annotating medical text big data and constructing a knowledge graph, comprising: Acquire medical text data and perform word segmentation processing on the medical text data to obtain a word segmentation result, input the word segmentation result into a deep bidirectional encoding model pre-trained according to a mask prediction task and a context association task to generate a context semantic vector of the medical text, add the context semantic vector to a pre-built multi-level entity recognition network to identify entities in the medical text, and obtain a medical entity recognition result, input the medical entity recognition result into an entity representation enhancement module, calculate the semantic association between entities by constructing a similarity measurement matrix, generate an enhanced entity feature vector, and normalize the medical entities in combination with standard terms in a medical knowledge base to obtain a standardized entity labeling result; The entity nodes in the standardized entity annotation result are mapped into high-dimensional feature vectors, the attention scores between the entity nodes are calculated and weighted aggregation is performed to obtain fused features, the fused features are nonlinearly transformed by a multi-layer perceptron to obtain context representation, the context representation is input into a relationship classifier to calculate the probability distribution of the relationship type to obtain a preliminary relationship extraction result, the preliminary relationship extraction result is verified based on the semantic similarity of the entity pairs and medical knowledge rules, and according to the verification result, it is optimized in combination with a re-labeling algorithm based on contrastive learning to obtain an optimized relationship labeling result; The entities in the optimized relationship annotation results are multi-granularly encoded to obtain a hierarchical entity representation, the relationship vectors between entities are calculated based on the hierarchical entity representation and fused with a gating mechanism to obtain a comprehensive relationship representation, the comprehensive relationship representation is input into an inference rule network constructed based on a medical rule base, the entity relationship is determined through reasoning verification and an initial knowledge graph is constructed, and supplementary medical knowledge is determined based on the centrality of the initial knowledge graph and integrated to obtain a medical knowledge graph.

[0005] In an optional embodiment, Obtain medical text data and perform word segmentation processing on the medical text data to obtain a word segmentation result, input the word segmentation result into a deep bidirectional encoding model pre-trained according to a mask prediction task and a context association task to generate a context semantic vector of the medical text, add the context semantic vector to a pre-built multi-level entity recognition network to identify entities in the medical text, obtain a medical entity recognition result, input the medical entity recognition result into an entity representation enhancement module, calculate the semantic association between entities by constructing a similarity measurement matrix, generate an enhanced entity feature vector, and normalize the medical entities in combination with standard terms in a medical knowledge base, and obtain standardized entity annotation results including: Obtain medical text data and classify and organize it according to the time of consultation, department, and disease type, use string matching rules to identify and remove special characters, marking symbols, and repeated spaces, perform standardized format conversion processing on numbers, units, and time, and perform word segmentation processing on the medical text data to obtain word segmentation results; Input the word segmentation result into a deep bidirectional encoding model pre-trained according to a mask prediction task and a context association task, randomly select words for mask prediction and context association prediction, construct a pre-training task by replacing mask tags, random words and keeping them unchanged, and extract fragments from the text to determine context relevance, so as to generate a context semantic vector of the medical text; The context semantic vector is added to a pre-built multi-level entity recognition network, and the character-level representation is obtained by performing feature extraction and maximum pooling on the characters by setting convolution kernels of different sizes, and the word-level features are extracted by inputting the bidirectional recurrent neural network, and the character-level representation is adaptively fused with the word-level features by using the attention fusion layer to identify entities in the medical text and obtain the medical entity recognition result; The medical entity recognition result is input into an entity representation enhancement module, and the entity representation enhancement module constructs a similarity measurement matrix through a character similarity subnetwork, a semantic similarity subnetwork, and a context similarity subnetwork, wherein the character similarity subnetwork calculates character similarity based on an edit distance matrix, the semantic similarity subnetwork calculates semantic similarity based on a synonym dictionary, and the context similarity subnetwork calculates context similarity based on a context window, and the character similarity, the semantic similarity, and the context similarity are input into a multi-layer neural network to calculate the semantic association between entities; An entity relationship graph is constructed for entities with semantic association, and the connection relationship between entities is determined by setting a similarity threshold. A graph attention network is used for feature transfer and enhancement to generate an enhanced entity feature vector. The enhanced entity feature vector is aligned with the standard terminology in the medical knowledge base, and the medical entities are normalized by calculating the similarity between the entity features and the knowledge base nodes to obtain standardized entity labeling results.

[0006] In an optional embodiment, The context semantic vector is added to the pre-built multi-level entity recognition network, and the character-level representation is obtained by setting convolution kernels of different sizes to extract features and perform maximum pooling on the characters. The bidirectional recurrent neural network is input to extract word-level features, and the character-level representation is adaptively fused with the word-level features using the attention fusion layer to identify entities in the medical text. The medical entity recognition results include: Adding the context semantic vector to a multi-level entity recognition network, wherein the multi-level entity recognition network includes a character-level feature extraction branch, a word-level feature extraction branch, and an attention fusion layer; The character-level feature extraction branch includes a plurality of convolution units connected in series, each of the convolution units is provided with convolution kernels of different sizes, the convolution kernel of the first convolution unit extracts the combination features between adjacent characters, the convolution kernel of the second convolution unit extracts the character combination features at the word level, and the convolution kernel of the third convolution unit extracts the character association features across words, residual connection paths are provided between the convolution units to transfer the character features, and the features output by the convolution units are subjected to maximum pooling processing to obtain the character-level representation; The word-level feature extraction branch adopts a bidirectional recurrent neural network, including an input layer, a hidden layer and an output layer, wherein the hidden layer is provided with a word internal attention calculation unit, and the output layer is provided with a word-inter-word relationship attention calculation unit, wherein the word internal attention calculation unit generates a character weight vector according to a word internal character combination, and the word-inter-word relationship attention calculation unit generates a word weight vector according to a context word association degree, and the character weight vector is combined with the word weight vector to obtain a word-level feature; The attention fusion layer includes a feature selection unit, a feature combination unit and a global association unit. The feature selection unit uses a gating mechanism to dynamically calculate the weight coefficients of the character-level representation and the word-level feature. The feature combination unit combines the features after adding the weight coefficients. The global association unit uses a multi-head attention mechanism to calculate the long-range dependency between features. Performing entity recognition on the combined features, including an entity boundary recognition subtask and an entity category recognition subtask. The entity boundary recognition subtask uses a pointer network to locate the start position and the end position of the entity. The entity category recognition subtask uses a multi-layer perceptron to classify the entity category. During the training process, sampling weights are set for different types of entities according to their frequency of occurrence, and the sampling weights are inversely proportional to the frequency of occurrence of the entity type. Adversarial perturbations are applied to the training samples, wherein the adversarial perturbations construct adversarial samples through the gradient ascent method. The medical text is input into the trained multi-level entity recognition network, and the medical entity recognition results containing category labels, location coordinates and corresponding texts are output.

[0007] In an optional embodiment, Mapping the entity nodes in the standardized entity annotation result into high-dimensional feature vectors, calculating the attention scores between the entity nodes and performing weighted aggregation to obtain fused features, and performing nonlinear transformation on the fused features through a multi-layer perceptron to obtain context representation includes: The entity nodes in the standardized entity annotation results are mapped into high-dimensional feature vectors. Through the context-aware layer, a multi-scale sliding window whose size is adaptively adjusted according to the length of the text is used to capture the contextual information around the entity. Through the enhanced sequence modeling layer, the location information of the entity in the text and the syntactic dependency information based on the shortest path of the grammatical analysis tree are encoded into the high-dimensional feature vector. The semantic embedding vector of the entity node is extracted from the pre-trained medical knowledge graph and weightedly fused with the original feature vector to obtain an enhanced representation. Based on the enhanced representation, multiple parallel attention calculation units are set. Each attention calculation unit projects the input enhanced representation into multiple feature subspaces. In each subspace, the dot product of the query vector and the key vector is calculated to obtain the attention weight. The product of the attention weight and the value vector is weighted and summed to obtain the attention output. The dimension effect is eliminated through the feature normalization layer and the residual connection is introduced to retain the original information. The learnable temperature parameter is set to soften the attention distribution to obtain the attention score. The entity features are weightedly aggregated according to the attention scores to obtain the fused features. A multi-level skip connection path is set in the feature transmission process to directly transfer the shallow features to the deep network. A gating mechanism including a reset gate and an update gate is adopted to dynamically adjust the feature combination weights according to the input features at the current moment and the hidden state at the previous moment. The fused features are input into the multi-layer perceptron, dense connections are added between each layer, and nonlinear transformation is performed through mini-batch normalization and random dropout regularization to obtain context representation.

[0008] In an optional embodiment, The context representation is input into the relationship classifier to calculate the probability distribution of the relationship type to obtain a preliminary relationship extraction result, and the preliminary relationship extraction result is verified based on the semantic similarity of the entity pair and the medical knowledge rules. According to the verification result, the optimization is performed in combination with the re-labeling algorithm based on contrastive learning, and the optimized relationship labeling result includes: The context representation is input into the relationship classifier to calculate the probability distribution of the relationship type, a selective random inactivation unit based on the attention score is set in each layer of the classifier, the feature channel is adaptively recalibrated, and the relationship prediction task is decomposed into multiple subtasks using a tree classification structure. A dynamic weight adjustment mechanism is introduced in each subtask to solve the problem of imbalanced category samples, and a preliminary relationship extraction result is obtained; The preliminary relationship extraction results are verified based on the semantic similarity of entity pairs and medical knowledge rules. The angle cosine value and normalized Euclidean distance of the feature vector are calculated to obtain the semantic similarity score. A hierarchical constraint graph of entity types is constructed in combination with the pre-set medical ontology knowledge base. Knowledge verification is performed based on the logical constraint rules of the relationship type. The verification results are obtained by calculating the consistency of the mutual information evaluation between the relationship prediction results and the contextual semantic representation. According to the verification results, the re-labeling algorithm based on contrastive learning is combined for optimization. Based on the prediction error and sample density estimation, representative positive sample pairs are selected from the prediction results that have passed the verification, and negative sample pairs with a moderate distance from the positive sample pairs are selected from the results that have not passed the verification. The mutual information between the positive sample pairs is maximized in the feature space, while the mutual information with the negative sample pairs is minimized. The complexity of the training samples is gradually increased from easy to difficult. The comprehensive score of the prediction result is calculated by combining the confidence score of the model prediction, the consistency score of the multi-dimensional verification results, and the prior probability of the relationship type based on the historical annotation data statistics. The classification threshold is adaptively determined according to the data distribution to divide the prediction results into high-confidence prediction results, medium-confidence prediction results, and low-confidence prediction results. The high-confidence prediction result is confirmed as the final annotation result, the medium-confidence prediction result is submitted to experts for review, and the low-confidence prediction result is filtered. The optimized relationship annotation result is obtained through multiple rounds of alternating optimization.

[0009] In an optional embodiment, The entities in the optimized relationship annotation results are encoded at multiple granularities to obtain hierarchical entity representations, the relationship vectors between entities are calculated based on the hierarchical entity representations and are integrated with the gating mechanism to obtain comprehensive relationship representations, the comprehensive relationship representations are input into the inference rule network constructed based on the medical rule base, the entity relationship is determined through reasoning verification and an initial knowledge graph is constructed, and supplementary medical knowledge is determined based on the centrality of the initial knowledge graph and integrated to obtain a medical knowledge graph, including: The entities in the optimized relationship annotation results are input into a character-level convolutional network, local character combination features are captured through sliding windows of different sizes, the entity text is input into a word-level bidirectional gated recurrent network to extract word-level contextual semantic features, the entity phrase is input into an attention-enhanced converter network to obtain global semantic features, the character combination features, word-level contextual semantic features and global semantic features are adaptively normalized, and the character combination features, word-level contextual semantic features and global semantic features are combined through a residual connection and feature recalibration mechanism to obtain a hierarchical entity representation; A multi-channel interactive network is set up to process the hierarchical entity representation, a bidirectional attention module is constructed in each channel to calculate the relationship vector between entities, the product of the attention weight and the hierarchical entity representation is weightedly aggregated, candidate features are generated through a candidate content generation module, and the fusion weights of relationship vectors of different granularities are adaptively adjusted according to current input features and historical state information by combining an update gating module and a reset gating module in the gating mechanism, and a comprehensive relationship representation is obtained through multi-layer nonlinear transformation; Construct a medical rule library containing entity type constraint rules, relationship type constraint rules, entity attribute constraint rules and relationship combination constraint rules, use graph neural network to encode the rules into network nodes, encode the logical relationship between the rules into network edges, and construct an inference rule network by transmitting and aggregating information between rule nodes through message passing mechanism. Input the comprehensive relationship representation into the inference rule network, judge whether the relationship meets the medical knowledge constraint through the activation state of the rule node, and use the attention mechanism to dynamically assign importance weights to different rules. Determine entity relationships through reasoning and verification, establish connections and construct an initial knowledge graph, set attribute fields of entity nodes in the initial knowledge graph to store the hierarchical entity representation, set attribute fields of relationship edges to store the comprehensive relationship representation and rule verification scores, use graph embedding technology to map nodes and edges to continuous vector space, calculate node importance scores based on the centrality of the initial knowledge graph, combine local connection features of nodes and global network structure features, extract relevant knowledge of important nodes from a medical literature library through remote supervision, encode the extracted knowledge into entity nodes and relationship edges to be supplemented, and use existing knowledge to guide representation learning of new knowledge in combination with knowledge distillation mechanism; A progressive graph fusion strategy is adopted to add the medical knowledge to be supplemented into the initial knowledge graph and inherit the connection relationship of similar nodes. The nodes are transmitted and updated through the graph attention network, and the relationship projector is used to adjust the semantic representation of the supplementary relationship. A gated verification mechanism is set to evaluate the reliability of the newly added knowledge and dynamically adjust its weight. The integrated knowledge graph is globally optimized for consistency to obtain the medical knowledge graph.

[0010] In an optional embodiment, Determine the entity relationship through reasoning and verification and establish connections to build an initial knowledge graph. Set the attribute field of the entity node in the initial knowledge graph to store the hierarchical entity representation, set the attribute field of the relationship edge to store the comprehensive relationship representation and rule verification score, use graph embedding technology to map the nodes and edges to a continuous vector space, calculate the node importance score based on the centrality of the initial knowledge graph, combine the local connection characteristics of the nodes and the global network structure characteristics, extract the relevant knowledge of important nodes from the medical literature library through remote supervision, encode the extracted knowledge into entity nodes and relationship edges to be supplemented, and use the knowledge distillation mechanism to use existing knowledge to guide the representation learning of new knowledge, including: Construct a double-layer hash table storage structure, wherein the outer hash table of the double-layer hash table storage structure uses the entity as the key, and the inner hash table stores the relationship information related to the current entity, stores the relationship information of the entity relationship pair verified by reasoning into the inner hash table, establishes a reverse index, sets the attribute field of the entity node in the initial knowledge graph to store the hierarchical entity representation, and sets the attribute field of the relationship edge to store the comprehensive relationship representation and the rule verification score; The initial knowledge graph is used to construct training samples through a stratified sampling strategy, local structural information of nodes is obtained through breadth-first traversal, a fixed number of first-order neighbor nodes and second-order neighbor nodes are selected for each node to form a subgraph, a node sequence is generated in the subgraph through truncated random walks, co-occurring node pairs in the node sequence are constructed as positive samples, negative samples are generated by randomly replacing nodes, samples of multiple subgraphs are processed by batch iterative optimization, and nodes and edges are mapped to a continuous vector space using adversarial training; A multi-level parallel computing framework is constructed based on the continuous vector space, and the in-degree centrality, out-degree centrality, and betweenness centrality of the nodes are respectively calculated as local connection features. The in-degree centrality and out-degree centrality are accelerated by forward adjacency lists and backward adjacency lists. The betweenness centrality is obtained by dividing the graph into multiple subgraphs and processing them in parallel and then merging the results. The global network structure features are obtained by a random walk algorithm with restart and sparse matrix operations. The local connection features and the global network structure features are input into a multi-layer perceptron network, the feature combination relationship is learned through the nonlinear transformation of the intermediate layer, the node importance score is generated in the output layer, some features are randomly shielded through the feature denoising module during the training process, and the feature importance weights are dynamically adjusted through the adaptive feature weight mechanism according to the characteristics of different types of nodes; An attention-based text scanner is constructed for the nodes with higher importance scores, the medical literature is segmented and candidate knowledge is extracted at the paragraph level using a sliding window, entities are annotated using a pre-trained medical named entity recognition model, the relationship between entities is identified through a relation extractor based on dependency syntax, the extracted knowledge is filtered using entity type consistency check, relation logic constraint check, and knowledge duplication check, and the extracted knowledge is encoded into entity nodes and relationship edges to be supplemented; For the entity nodes and relationship edges to be supplemented, the teacher network guides the student network to learn the feature distribution of the node representation vector and the relationship pattern between the nodes, the dynamic temperature parameter is used to adjust the smoothness of the soft label, the contrastive learning loss is introduced to promote the semantic alignment of new and old knowledge, and the distillation intensity is dynamically adjusted through the performance indicators on the verification set.

[0011] A second aspect of an embodiment of the present invention provides a medical text big data intelligent annotation and knowledge graph construction system, including: The first unit is used to obtain medical text data and perform word segmentation processing on the medical text data to obtain a word segmentation result, input the word segmentation result into a deep bidirectional encoding model pre-trained according to a mask prediction task and a context association task to generate a context semantic vector of the medical text, add the context semantic vector to a pre-built multi-level entity recognition network to identify entities in the medical text, obtain a medical entity recognition result, input the medical entity recognition result into an entity representation enhancement module, calculate the semantic association between entities by constructing a similarity measurement matrix, generate an enhanced entity feature vector, and normalize the medical entities in combination with standard terms in a medical knowledge base to obtain a standardized entity labeling result; The second unit is used to map the entity nodes in the standardized entity annotation result into high-dimensional feature vectors, calculate the attention scores between the entity nodes and perform weighted aggregation to obtain fused features, perform nonlinear transformation on the fused features through a multi-layer perceptron to obtain context representation, input the context representation into a relationship classifier to calculate the probability distribution of the relationship type to obtain a preliminary relationship extraction result, verify the preliminary relationship extraction result based on the semantic similarity of the entity pair and the medical knowledge rules, and optimize it according to the verification result in combination with the re-labeling algorithm based on contrastive learning to obtain an optimized relationship labeling result; The third unit is used to perform multi-granularity encoding on the entities in the optimized relationship annotation results to obtain a hierarchical entity representation, calculate the relationship vectors between entities based on the hierarchical entity representation and fuse them in combination with a gating mechanism to obtain a comprehensive relationship representation, input the comprehensive relationship representation into an inference rule network constructed based on a medical rule base, determine the entity relationship through reasoning verification and construct an initial knowledge graph, and determine supplementary medical knowledge based on the centrality of the initial knowledge graph and integrate them to obtain a medical knowledge graph.

[0012] According to a third aspect of the embodiments of the present invention, An electronic device is provided, comprising: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the aforementioned method.

[0013] A fourth aspect of the embodiments of the present invention is: A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.

[0014] In the present invention, a pre-trained deep bidirectional encoding model is used to generate contextual semantic vectors of medical texts, and combined with a multi-level entity recognition network and an entity representation enhancement module, entities in medical texts can be more accurately identified, and normalized through a medical knowledge base to obtain standardized entity labeling results. A re-labeling algorithm based on contrastive learning is used to optimize the preliminary relationship extraction results, and verification is performed in combination with the semantic similarity of entity pairs and medical knowledge rules, which can effectively improve the reliability of relationship extraction. Hierarchical entity representation is obtained through multi-granularity encoding, and a comprehensive relationship representation is obtained by fusing relationship vectors in combination with a gating mechanism, and reasoning verification is performed using a medical rule base, ultimately constructing a more complete medical knowledge graph, and supplementing medical knowledge through centrality to make the medical knowledge graph more comprehensive. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a flowchart of a method for intelligent annotation of medical text big data and construction of a knowledge graph according to an embodiment of the present invention; Figure 2 This is a structural diagram of the medical text big data intelligent annotation and knowledge graph construction system according to an embodiment of the present invention.

[0016] Figure 3 This is a comparison chart of entity recognition accuracy of the medical text big data intelligent annotation and knowledge graph construction method according to an embodiment of the present invention; Figure 4This is a comparison chart of the accuracy of knowledge graph entity relationships of the medical text big data intelligent annotation and knowledge graph construction method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0017] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0018] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0019] Figure 1 Schematic diagram of the process of intelligent annotation and knowledge graph construction method of medical text big data according to an embodiment of the present invention. Figure 1 As shown, the method includes: S1. Obtain medical text data and perform word segmentation processing on the medical text data to obtain a word segmentation result, input the word segmentation result into a deep bidirectional encoding model pre-trained according to a mask prediction task and a context association task to generate a context semantic vector of the medical text, add the context semantic vector to a pre-built multi-level entity recognition network to identify entities in the medical text, and obtain a medical entity recognition result, input the medical entity recognition result into an entity representation enhancement module, calculate the semantic association between entities by constructing a similarity measurement matrix, generate an enhanced entity feature vector, and normalize the medical entities in combination with standard terms in a medical knowledge base to obtain a standardized entity labeling result; In an optional embodiment, Obtain medical text data and perform word segmentation processing on the medical text data to obtain a word segmentation result, input the word segmentation result into a deep bidirectional encoding model pre-trained according to a mask prediction task and a context association task to generate a context semantic vector of the medical text, add the context semantic vector to a pre-built multi-level entity recognition network to identify entities in the medical text, obtain a medical entity recognition result, input the medical entity recognition result into an entity representation enhancement module, calculate the semantic association between entities by constructing a similarity measurement matrix, generate an enhanced entity feature vector, and normalize the medical entities in combination with standard terms in a medical knowledge base, and obtain standardized entity annotation results including: Obtain medical text data and classify and organize it according to the time of consultation, department, and disease type, use string matching rules to identify and remove special characters, marking symbols, and repeated spaces, perform standardized format conversion processing on numbers, units, and time, and perform word segmentation processing on the medical text data to obtain word segmentation results; Input the word segmentation result into a deep bidirectional encoding model pre-trained according to a mask prediction task and a context association task, randomly select words for mask prediction and context association prediction, construct a pre-training task by replacing mask tags, random words and keeping them unchanged, and extract fragments from the text to determine context relevance, so as to generate a context semantic vector of the medical text; The context semantic vector is added to a pre-built multi-level entity recognition network, and the character-level representation is obtained by performing feature extraction and maximum pooling on the characters by setting convolution kernels of different sizes, and the word-level features are extracted by inputting the bidirectional recurrent neural network, and the character-level representation is adaptively fused with the word-level features by using the attention fusion layer to identify entities in the medical text and obtain the medical entity recognition result; The medical entity recognition result is input into an entity representation enhancement module, and the entity representation enhancement module constructs a similarity measurement matrix through a character similarity subnetwork, a semantic similarity subnetwork, and a context similarity subnetwork, wherein the character similarity subnetwork calculates character similarity based on an edit distance matrix, the semantic similarity subnetwork calculates semantic similarity based on a synonym dictionary, and the context similarity subnetwork calculates context similarity based on a context window, and the character similarity, the semantic similarity, and the context similarity are input into a multi-layer neural network to calculate the semantic association between entities; An entity relationship graph is constructed for entities with semantic association, and the connection relationship between entities is determined by setting a similarity threshold. A graph attention network is used for feature transfer and enhancement to generate an enhanced entity feature vector. The enhanced entity feature vector is aligned with the standard terminology in the medical knowledge base, and the medical entities are normalized by calculating the similarity between the entity features and the knowledge base nodes to obtain standardized entity labeling results.

[0020] Obtain medical text data and preprocess it: Obtain medical text data from hospital information systems, electronic medical records, medical literature and other sources. Classify and sort according to the time of consultation, department (for example: internal medicine, surgery, pediatrics), and disease type (for example: respiratory diseases, cardiovascular diseases). Use string matching rules to identify and remove special characters (for example: punctuation, emoticons), markup symbols (for example: HTML tags), and repeated spaces. Perform standardized format conversion on numbers, units, and time, for example, convert "January 1, 1998" to "1998-01-01" and convert "one hundred milliliters" to "100ml". Use the jieba word segmentation tool to segment medical text data, for example, segment "patient's chief complaint of headache" into "patient / chief complaint / headache".

[0021] Input the segmented results into the pre-trained BERT model. The BERT model is pre-trained based on the mask prediction task and the context association task. Mask prediction task: randomly select 15% of the words for masking, replace them with the "[MASK]" tag, and then let the model predict these masked words. For example, "the patient complains of [MASK] pain", the model needs to predict the word "head". Context association task: randomly extract two fragments from the text and determine whether they are continuous. Through these two pre-training tasks, the BERT model can learn the contextual semantic information of words. Input the medical text into the BERT model to obtain the contextual semantic vector representation of each word. For example, the vector representation of "patient" is [0.1, 0.2, 0.3], and the vector representation of "headache" is [0.4, 0.5, 0.6].

[0022] Construct a multi-level entity recognition network. The network uses convolution kernels of different sizes (for example, the convolution kernel sizes are 2, 3, and 4, respectively) to extract features from characters, and obtains character-level representations through maximum pooling operations. The character-level representation is input into a bidirectional recurrent neural network (Bi-LSTM) to extract word-level features, and the character-level representation is adaptively fused with the word-level features using an attention fusion layer to obtain a more comprehensive word representation. The contextual semantic vector generated by the BERT model is added to the word representation to further enrich the semantic information. The fused word representation is sequence-labeled using a conditional random field (CRF) to identify entities in medical texts, such as "disease", "symptom", "examination", and "treatment". For example, "headache" is identified as a "symptom" entity.

[0023] The entity recognition results are input into the entity representation enhancement module. This module constructs a similarity measurement matrix through the character similarity subnetwork, the semantic similarity subnetwork and the context similarity subnetwork. The character similarity subnetwork calculates the character similarity based on the edit distance matrix. For example, the edit distance of "headache" and "headache" is 1, and the character similarity is high. The semantic similarity subnetwork calculates the semantic similarity based on the synonym word forest. For example, "headache" and "headache" belong to the same concept in the synonym word forest, and the semantic similarity is high. The context similarity subnetwork calculates the context similarity based on the context window. For example, if "headache" and "fever" often appear in the same context window, their context similarity is high. The character similarity, semantic similarity and context similarity are input into the multi-layer neural network to calculate the semantic association between entities.

[0024] Entities with semantic associations are constructed into an entity relationship graph. The connection relationship between entities is determined by setting a similarity threshold (e.g. 0.8). A graph attention network is used for feature transfer and enhancement to generate an enhanced entity feature vector. The enhanced entity feature vector is aligned with the standard terms in the medical knowledge base (e.g. SNOMEDCT). Medical entities are normalized by calculating the similarity between entity features and knowledge base nodes to obtain standardized entity labeling results. For example, "headache" is normalized to "migraine".

[0025] In this embodiment, by combining contextual semantic vectors and multi-level entity recognition networks, entities in medical texts can be more accurately identified, especially when dealing with complex medical terms and ambiguous expressions. The entity representation enhancement module constructs a more comprehensive entity representation by considering character, semantic and contextual information, thereby improving the robustness of entity recognition. By aligning with the medical knowledge base, the identified entities can be normalized into standard terms, facilitating subsequent medical information processing and application.

[0026] In an optional embodiment, The context semantic vector is added to the pre-built multi-level entity recognition network, and the character-level representation is obtained by setting convolution kernels of different sizes to extract features and perform maximum pooling on the characters. The bidirectional recurrent neural network is input to extract word-level features, and the character-level representation is adaptively fused with the word-level features using the attention fusion layer to identify entities in the medical text. The medical entity recognition results include: Adding the context semantic vector to a multi-level entity recognition network, wherein the multi-level entity recognition network includes a character-level feature extraction branch, a word-level feature extraction branch, and an attention fusion layer; The character-level feature extraction branch includes a plurality of convolution units connected in series, each of the convolution units is provided with convolution kernels of different sizes, the convolution kernel of the first convolution unit extracts the combination features between adjacent characters, the convolution kernel of the second convolution unit extracts the character combination features at the word level, and the convolution kernel of the third convolution unit extracts the character association features across words, residual connection paths are provided between the convolution units to transfer the character features, and the features output by the convolution units are subjected to maximum pooling processing to obtain the character-level representation; The word-level feature extraction branch adopts a bidirectional recurrent neural network, including an input layer, a hidden layer and an output layer, wherein the hidden layer is provided with a word internal attention calculation unit, and the output layer is provided with a word-inter-word relationship attention calculation unit, wherein the word internal attention calculation unit generates a character weight vector according to a word internal character combination, and the word-inter-word relationship attention calculation unit generates a word weight vector according to a context word association degree, and the character weight vector is combined with the word weight vector to obtain a word-level feature; The attention fusion layer includes a feature selection unit, a feature combination unit and a global association unit. The feature selection unit uses a gating mechanism to dynamically calculate the weight coefficients of the character-level representation and the word-level feature. The feature combination unit combines the features after adding the weight coefficients. The global association unit uses a multi-head attention mechanism to calculate the long-range dependency between features. Performing entity recognition on the combined features, including an entity boundary recognition subtask and an entity category recognition subtask. The entity boundary recognition subtask uses a pointer network to locate the start position and the end position of the entity. The entity category recognition subtask uses a multi-layer perceptron to classify the entity category. During the training process, sampling weights are set for different types of entities according to their frequency of occurrence, and the sampling weights are inversely proportional to the frequency of occurrence of the entity type. Adversarial perturbations are applied to the training samples, wherein the adversarial perturbations construct adversarial samples through the gradient ascent method. The medical text is input into the trained multi-level entity recognition network, and the medical entity recognition results containing category labels, location coordinates and corresponding texts are output.

[0027] Preprocess the input medical text, such as word segmentation, stop word removal, etc. Take "the patient complained of headache, accompanied by nausea and vomiting" as an example. After word segmentation, the word sequence ["patient", "complaint", "headache", "," "accompanied by", "nausea", "vomiting", "symptoms"] is obtained.

[0028] Perform character-level feature extraction. Convert each word into a character sequence, for example, "headache" is converted into ["head", "pain"]. For each character sequence, use three convolution kernels of different sizes to perform convolution operations. The size of the first convolution kernel is 2, which extracts the combination features of adjacent characters, for example, "headache" is extracted into ["headache"]. The size of the second convolution kernel is 3, which extracts the character combination features at the word level. For "headache", since the length is less than 3, a padding operation is performed. The size of the third convolution kernel is 4, which extracts cross-word character association features. Here, contextual words need to be considered, for example, "main complaint of headache" is extracted into ["complaint of headache,"]. Residual connections are set between each convolution unit, and the output of the previous convolution unit is directly added to the output of the current convolution unit to avoid gradient disappearance. Perform a maximum pooling operation on the output of each convolution unit to obtain a character-level representation. For example, the character-level representation of "headache" can be [0.8, 0.2, 0.5].

[0029] Perform word-level feature extraction. Use a bidirectional recurrent neural network (BiRNN) to process word sequences. In the hidden layer of BiRNN, an internal attention mechanism is introduced to generate a character weight vector based on the internal character combination of the word. For example, for "headache", a weight vector [0.7, 0.3] can be generated based on the importance of the characters "head" and "pain". In the output layer of BiRNN, an inter-word attention mechanism is introduced to generate a word weight vector based on the context word association. For example, for "headache", a weight vector [0.2, 0.8] can be generated based on its association with the previous and next words "main complaint" and "," . The character weight vector and the word weight vector are combined to obtain word-level features. For example, the word-level features of "headache" can be [0.5, 0.6, 0.9].

[0030] The character-level representation and word-level features are input to the attention fusion layer. The attention fusion layer contains three units: feature selection unit, feature combination unit, and global association unit. The feature selection unit uses a gating mechanism to dynamically calculate the weight coefficients of the character-level representation and word-level features. For example, a higher weight can be given to the character-level representation according to the needs of the current task. The feature combination unit combines the features after adding the weight coefficients. The global association unit uses a multi-head attention mechanism to calculate the long-range dependencies between features.

[0031] Entity recognition is performed on the combined features. Entity recognition includes two subtasks: entity boundary recognition and entity category recognition. Entity boundary recognition uses a pointer network to locate the start and end positions of an entity. For example, it can be identified that the start position of "headache" is 2 and the end position is 3. Entity category recognition uses a multi-layer perceptron to classify entity categories. For example, "headache" can be classified as a "symptom" entity.

[0032] During the training process, sampling weights are set according to the frequency of occurrence of different types of entities, and entities with low frequency of occurrence are given higher weights. At the same time, adversarial perturbations are applied to the training samples, and adversarial samples are constructed through the gradient ascent method to improve the robustness of the model. Medical text is input into the trained multi-level entity recognition network, and the output is the medical entity recognition result containing category labels, location coordinates and corresponding text.

[0033] In this embodiment, by combining character-level and word-level features and introducing contextual semantic vectors and attention mechanisms, the information in the medical text can be captured more comprehensively, thereby improving the accuracy of entity recognition. Through adversarial training, the model's resistance to noise and interference can be enhanced, and the robustness of the model can be improved. By setting sampling weights, the number of training samples of different types of entities can be balanced to avoid the model being biased towards entities with high frequency of occurrence, thereby improving the recognition effect of low-frequency entities.

[0034] In the existing medical entity recognition technology, traditional methods such as BERT or BiLSTM-CRF only extract features at the word level, ignoring the intrinsic semantic information of Chinese characters. At the same time, a single feature extraction method is usually used, which cannot fully utilize the multi-level semantic information of the text. The existing methods have poor recognition effects on long-tail entities unique to the medical field and have poor robustness when facing noisy data; This embodiment adopts multi-scale convolution kernels and residual connection mechanism in the character-level feature extraction link. Through convolution kernels of different sizes, it can simultaneously capture feature information at the character level, word level and cross-word level, significantly improving the comprehensiveness of feature extraction. A double-layer attention mechanism is introduced in word-level feature extraction. Through the internal attention mechanism of words, the importance differences of characters within words can be accurately grasped. Through the attention mechanism of inter-word relations, the contextual semantic associations can be effectively captured. The multi-level fusion mechanism can dynamically adjust the feature weights according to different task requirements, and capture the long-range dependency relationship between features through the multi-head attention mechanism, greatly enhancing the adaptability and expression ability of the model. In summary, this embodiment has obvious improvements in recognition accuracy, recall rate and other indicators, especially when processing low-frequency entities and noisy data. It shows stronger performance advantages, has better interpretability, and can clearly track the process of feature extraction and decision-making.

[0035] S2. Map the entity nodes in the standardized entity annotation results into high-dimensional feature vectors, calculate the attention scores between the entity nodes and perform weighted aggregation to obtain fused features, perform nonlinear transformation on the fused features through a multi-layer perceptron to obtain context representation, input the context representation into a relationship classifier to calculate the probability distribution of the relationship type to obtain a preliminary relationship extraction result, verify the preliminary relationship extraction result based on the semantic similarity of the entity pairs and medical knowledge rules, and optimize it according to the verification result in combination with a re-labeling algorithm based on contrastive learning to obtain an optimized relationship labeling result; In an optional embodiment, Mapping the entity nodes in the standardized entity annotation result into high-dimensional feature vectors, calculating the attention scores between the entity nodes and performing weighted aggregation to obtain fused features, and performing nonlinear transformation on the fused features through a multi-layer perceptron to obtain context representation includes: The entity nodes in the standardized entity annotation results are mapped into high-dimensional feature vectors. Through the context-aware layer, a multi-scale sliding window whose size is adaptively adjusted according to the length of the text is used to capture the contextual information around the entity. Through the enhanced sequence modeling layer, the location information of the entity in the text and the syntactic dependency information based on the shortest path of the grammatical analysis tree are encoded into the high-dimensional feature vector. The semantic embedding vector of the entity node is extracted from the pre-trained medical knowledge graph and weightedly fused with the original feature vector to obtain an enhanced representation. Based on the enhanced representation, multiple parallel attention calculation units are set. Each attention calculation unit projects the input enhanced representation into multiple feature subspaces. In each subspace, the dot product of the query vector and the key vector is calculated to obtain the attention weight. The product of the attention weight and the value vector is weighted and summed to obtain the attention output. The dimension effect is eliminated through the feature normalization layer and the residual connection is introduced to retain the original information. The learnable temperature parameter is set to soften the attention distribution to obtain the attention score. The entity features are weightedly aggregated according to the attention scores to obtain the fused features. A multi-level skip connection path is set in the feature transmission process to directly transfer the shallow features to the deep network. A gating mechanism including a reset gate and an update gate is adopted to dynamically adjust the feature combination weights according to the input features at the current moment and the hidden state at the previous moment. The fused features are input into the multi-layer perceptron, dense connections are added between each layer, and nonlinear transformation is performed through mini-batch normalization and random dropout regularization to obtain context representation.

[0036] Map the entity nodes in the standardized entity annotation results into high-dimensional feature vectors. For example, map the disease entity "diabetes" into a 512-dimensional vector. This mapping process can use a pre-trained word vector model, such as Word2Vec or BERT.

[0037] The contextual information around the entity is captured through the context-aware layer. This layer uses a multi-scale sliding window whose size is adaptively adjusted according to the length of the text. For example, for a text of 100 words in length, the sliding window size can be set to 10, 20, and 30. For a text of 50 words in length, the sliding window size can be set to 5, 10, and 15. For the text in each window, a recurrent neural network (such as LSTM) or a convolutional neural network (such as CNN) is used to extract features and these features are concatenated as the contextual features of the entity.

[0038] The enhanced sequence modeling layer encodes the position information of the entity in the text and the syntactic dependency information based on the shortest path of the parse tree into a high-dimensional feature vector. For example, position encoding can be used to represent the position of the entity in the text. For syntactic dependency information, the shortest dependency path between the entity and other words can be calculated, and the relationship type on the path can be encoded into a vector. The position encoding and syntactic dependency encoding are concatenated with the previous context features to form a new feature vector.

[0039] Extract the semantic embedding vector of the entity node from the pre-trained medical knowledge graph. For example, extract the semantic embedding vector of "diabetes" from the knowledge graph. Perform weighted fusion on the vector and the feature vector obtained previously to obtain an enhanced representation. The fusion weight can be obtained through learning.

[0040] Based on the enhanced representation, multiple parallel attention calculation units are set. Each attention calculation unit projects the input enhanced representation into multiple feature subspaces. In each subspace, the dot product of the query vector and the key vector is calculated to obtain the attention weight. The product of the attention weight and the value vector is weighted and summed to obtain the attention output. The dimension effect is eliminated through the feature normalization layer, and the residual connection is introduced to retain the original information. A learnable temperature parameter is set to soften the attention distribution to obtain the attention score. For example, 8 attention calculation units are set, and each unit projects the enhanced representation into 4 feature subspaces.

[0041] The entity features are weighted and aggregated according to the attention score to obtain the fused features. In the process of feature transfer, a multi-level skip connection path is set to directly transfer the shallow features to the deep network. A gating mechanism including a reset gate and an update gate is used to dynamically adjust the feature combination weight according to the input features at the current moment and the hidden state at the previous moment. For example, GRU or LSTM is used to implement the gating mechanism.

[0042] The fused features are input into a multilayer perceptron. Dense connections are added between each layer, and nonlinear transformations are performed through mini-batch normalization and random dropout regularization to obtain context representation. For example, a multilayer perceptron with two hidden layers is used, and each hidden layer contains 256 neurons.

[0043] In this embodiment, by fusing multi-source information, including context information, location information, syntactic dependency information and semantic embedding vectors, the semantics of the entity can be more comprehensively characterized, thereby improving the accuracy of entity representation. By using pre-trained word vector models and knowledge graphs, existing knowledge can be effectively utilized to enhance the generalization ability of the model so that it can perform well even when faced with new medical texts. The attention mechanism can highlight important contextual information, thereby improving the interpretability of the model and helping to understand the decision-making process of the model.

[0044] In an optional embodiment, The context representation is input into the relationship classifier to calculate the probability distribution of the relationship type to obtain a preliminary relationship extraction result, and the preliminary relationship extraction result is verified based on the semantic similarity of the entity pair and the medical knowledge rules. According to the verification result, the optimization is performed in combination with the re-labeling algorithm based on contrastive learning, and the optimized relationship labeling result includes: The context representation is input into the relationship classifier to calculate the probability distribution of the relationship type, a selective random inactivation unit based on the attention score is set in each layer of the classifier, the feature channel is adaptively recalibrated, and the relationship prediction task is decomposed into multiple subtasks using a tree classification structure. A dynamic weight adjustment mechanism is introduced in each subtask to solve the problem of imbalanced category samples, and a preliminary relationship extraction result is obtained; The preliminary relationship extraction results are verified based on the semantic similarity of entity pairs and medical knowledge rules. The angle cosine value and normalized Euclidean distance of the feature vector are calculated to obtain the semantic similarity score. A hierarchical constraint graph of entity types is constructed in combination with the pre-set medical ontology knowledge base. Knowledge verification is performed based on the logical constraint rules of the relationship type. The verification results are obtained by calculating the consistency of the mutual information evaluation between the relationship prediction results and the contextual semantic representation. According to the verification results, the re-labeling algorithm based on contrastive learning is combined for optimization. Based on the prediction error and sample density estimation, representative positive sample pairs are selected from the prediction results that have passed the verification, and negative sample pairs with a moderate distance from the positive sample pairs are selected from the results that have not passed the verification. The mutual information between the positive sample pairs is maximized in the feature space, while the mutual information with the negative sample pairs is minimized. The complexity of the training samples is gradually increased from easy to difficult. The comprehensive score of the prediction result is calculated by combining the confidence score of the model prediction, the consistency score of the multi-dimensional verification results, and the prior probability of the relationship type based on the historical annotation data statistics. The classification threshold is adaptively determined according to the data distribution to divide the prediction results into high-confidence prediction results, medium-confidence prediction results, and low-confidence prediction results. The high-confidence prediction result is confirmed as the final annotation result, the medium-confidence prediction result is submitted to experts for review, and the low-confidence prediction result is filtered. The optimized relationship annotation result is obtained through multiple rounds of alternating optimization.

[0045] Medical texts are preprocessed, including word segmentation, part-of-speech tagging, named entity recognition, etc. For example, the input text "The patient was admitted to the hospital due to persistent hypertension, and his blood pressure was well controlled after taking captopril" is preprocessed to identify the entities "hypertension" and "captopril", as well as their respective types, such as "disease" and "drug".

[0046] Convert the preprocessed text into a contextual representation. This can be achieved with a pre-trained language model (e.g. BERT, BioBERT). The model converts each word in the text into a vector that captures the semantic information of the word as well as the contextual information. For example, the vector representation of "hypertension" will contain its meaning in the medical field and its relationship with surrounding words (e.g. "persistent", "admitted").

[0047] The context representation is input into the relation classifier, the probability distribution of the relation type is calculated, and the preliminary relation extraction result is obtained. In order to improve the performance of the classifier, a selective random inactivation unit based on the attention score is set in each layer of the classifier to adaptively recalibrate the feature channel. In addition, a tree classification structure is used to decompose the relation prediction task into multiple subtasks, and a dynamic weight adjustment mechanism is introduced in each subtask to solve the problem of imbalanced class samples. For example, the "treatment" relation is further subdivided into sub-relationships such as "drug treatment" and "surgical treatment", and their weights are dynamically adjusted according to the number of samples of different sub-relationships in the training data. Assuming that there are more "drug treatment" samples and fewer "surgical treatment" samples, the model will automatically reduce the weight of "drug treatment" and increase the weight of "surgical treatment" to avoid the model being biased towards the category with more samples.

[0048] After obtaining the preliminary relationship extraction results, the entity pairs are verified based on their semantic similarity and medical knowledge rules, and the angle cosine value and normalized Euclidean distance of the feature vectors are calculated to obtain the semantic similarity score. For example, the similarity of the vector representations of "hypertension" and "captopril" is calculated, and a hierarchical constraint graph of entity types is constructed in combination with the pre-set medical ontology knowledge base (such as UMLS, SNOMEDCT), and knowledge verification is performed based on the logical constraint rules of the relationship type. For example, if the knowledge base stipulates that "drugs" can "treat" "diseases", then the relationship of "captopril (drug) treats hypertension (disease)" is reasonable, and the verification result is obtained by calculating the consistency of the mutual information evaluation between the relationship prediction results and the contextual semantic representation.

[0049] Combined with the re-labeling algorithm based on contrastive learning for optimization. Select representative positive sample pairs from the prediction results that have passed the verification, such as "captopril treats hypertension". Select negative sample pairs with a moderate distance from the positive sample pairs from the results that have not passed the verification, such as "hypertension causes headaches". Maximize the mutual information between positive sample pairs in the feature space, while minimizing the mutual information with negative sample pairs, and gradually increase the complexity of the training samples from easy to difficult.

[0050] The comprehensive score of the prediction result is calculated by combining the confidence score of the model prediction, the consistency score of the multi-dimensional verification results, and the prior probability of the relationship type based on the historical annotation data statistics. The classification threshold is adaptively determined according to the data distribution, and the prediction results are divided into high-confidence prediction results, medium-confidence prediction results, and low-confidence prediction results. The high-confidence prediction results are confirmed as the final annotation results, such as "Captopril treats hypertension". The medium-confidence prediction results are submitted to experts for review, such as "Smoking causes hypertension". Low-confidence prediction results are filtered out, such as "Hypertension is related to age". Through multiple rounds of alternating optimization, the optimized relationship annotation results are obtained.

[0051] In this embodiment, through multi-dimensional verification and optimization strategies, the error rate of relationship extraction is effectively reduced, the accuracy of the model is improved, the situation of sample imbalance and complex relationships can be effectively handled, the robustness of the model is enhanced, and the computational efficiency of the model is optimized through technologies such as adaptive recalibration and tree classification structure, and the speed of relationship extraction is accelerated.

[0052] S3. Perform multi-granularity encoding on the entities in the optimized relationship annotation results to obtain a hierarchical entity representation, calculate the relationship vectors between entities based on the hierarchical entity representation and fuse them with a gating mechanism to obtain a comprehensive relationship representation, input the comprehensive relationship representation into an inference rule network constructed based on a medical rule base, determine the entity relationship through reasoning verification and construct an initial knowledge graph, determine supplementary medical knowledge based on the centrality of the initial knowledge graph and integrate them to obtain a medical knowledge graph.

[0053] In an optional embodiment, The entities in the optimized relationship annotation results are encoded at multiple granularities to obtain hierarchical entity representations, the relationship vectors between entities are calculated based on the hierarchical entity representations and are integrated with the gating mechanism to obtain comprehensive relationship representations, the comprehensive relationship representations are input into the inference rule network constructed based on the medical rule base, the entity relationship is determined through reasoning verification and an initial knowledge graph is constructed, and supplementary medical knowledge is determined based on the centrality of the initial knowledge graph and integrated to obtain a medical knowledge graph, including: The entities in the optimized relationship annotation results are input into a character-level convolutional network, local character combination features are captured through sliding windows of different sizes, the entity text is input into a word-level bidirectional gated recurrent network to extract word-level contextual semantic features, the entity phrase is input into an attention-enhanced converter network to obtain global semantic features, the character combination features, word-level contextual semantic features and global semantic features are adaptively normalized, and the character combination features, word-level contextual semantic features and global semantic features are combined through a residual connection and feature recalibration mechanism to obtain a hierarchical entity representation; A multi-channel interactive network is set up to process the hierarchical entity representation, a bidirectional attention module is constructed in each channel to calculate the relationship vector between entities, the product of the attention weight and the hierarchical entity representation is weightedly aggregated, candidate features are generated through a candidate content generation module, and the fusion weights of relationship vectors of different granularities are adaptively adjusted according to current input features and historical state information by combining an update gating module and a reset gating module in the gating mechanism, and a comprehensive relationship representation is obtained through multi-layer nonlinear transformation; Construct a medical rule library containing entity type constraint rules, relationship type constraint rules, entity attribute constraint rules and relationship combination constraint rules, use graph neural network to encode the rules into network nodes, encode the logical relationship between the rules into network edges, and construct an inference rule network by transmitting and aggregating information between rule nodes through message passing mechanism. Input the comprehensive relationship representation into the inference rule network, judge whether the relationship meets the medical knowledge constraint through the activation state of the rule node, and use the attention mechanism to dynamically assign importance weights to different rules. Determine entity relationships through reasoning and verification, establish connections and construct an initial knowledge graph, set attribute fields of entity nodes in the initial knowledge graph to store the hierarchical entity representation, set attribute fields of relationship edges to store the comprehensive relationship representation and rule verification scores, use graph embedding technology to map nodes and edges to continuous vector space, calculate node importance scores based on the centrality of the initial knowledge graph, combine local connection features of nodes and global network structure features, extract relevant knowledge of important nodes from a medical literature library through remote supervision, encode the extracted knowledge into entity nodes and relationship edges to be supplemented, and use existing knowledge to guide representation learning of new knowledge in combination with knowledge distillation mechanism; A progressive graph fusion strategy is adopted to add the medical knowledge to be supplemented into the initial knowledge graph and inherit the connection relationship of similar nodes. The nodes are transmitted and updated through the graph attention network, and the relationship projector is used to adjust the semantic representation of the supplementary relationship. A gated verification mechanism is set to evaluate the reliability of the newly added knowledge and dynamically adjust its weight. The integrated knowledge graph is globally optimized for consistency to obtain the medical knowledge graph.

[0054] The entities in the optimized relation annotation results are multi-granularly encoded to obtain hierarchical entity representations. Specifically, the entity text is input into the character-level convolutional network, and sliding windows of different sizes are used to extract local character combination features. For example, for the entity "diabetes", features such as "sugar", "urine", "disease", and "diabetes" can be extracted. At the same time, the entity text is input into the word-level bidirectional gated recurrent network to extract word-level contextual semantic features. For example, considering the sentence "the patient has suffered from diabetes for many years", contextual information such as "patient", "suffering from", and "many years" can be extracted. In addition, the entity phrase is input into the attention-enhanced transformer network to obtain global semantic features. For example, the semantic role and importance of the entity in the entire text can be captured. Then, the extracted character combination features, word-level contextual semantic features, and global semantic features are adaptively normalized, and the three are combined through residual connection and feature recalibration mechanism to obtain the final hierarchical entity representation.

[0055] Based on the hierarchical entity representation, the relationship vectors between entities are calculated and fused with the gating mechanism to obtain a comprehensive relationship representation. The hierarchical entity representation is processed using a multi-channel interaction network, and a bidirectional attention module is constructed in each channel to calculate the relationship vector between entities. For example, the relationship vector between the entities "diabetes" and "hyperglycemia" is calculated. The product of the attention weight and the hierarchical entity representation is weighted and aggregated. The candidate features are generated by the candidate content generation module, and the fusion weights of relationship vectors of different granularities are adaptively adjusted according to the current input features and historical state information in combination with the update gating module and the reset gating module in the gating mechanism. For example, the weights of the character-level, word-level, and global-level relationship vectors are dynamically adjusted according to the context information. A comprehensive relationship representation is obtained through multi-layer nonlinear transformation.

[0056] The comprehensive relationship representation is input into the inference rule network built based on the medical rule base, and the entity relationship is determined through reasoning verification. A medical rule base is constructed that contains entity type constraint rules (for example, "diabetes" is a disease), relationship type constraint rules (for example, "concurrency" is a relationship), entity attribute constraint rules (for example, "diabetes" can have "symptom" attributes), and relationship combination constraint rules (for example, "diabetes" can be "concurrent" with "hypertension"). A graph neural network is used to encode the rules into network nodes, and the logical relationships between the rules are encoded into network edges. The message passing mechanism is used to transmit and aggregate information between the rule nodes to construct an inference rule network. The comprehensive relationship representation is input into the inference rule network, and the activation state of the rule node is used to determine whether the relationship meets the medical knowledge constraint. The attention mechanism is used to dynamically assign importance weights to different rules. For example, if the relationship between "diabetes" and "hypertension" is activated, the relationship is considered valid.

[0057] After determining the entity relationship through reasoning and verification, the initial knowledge graph is constructed. In the initial knowledge graph, the attribute fields of the entity nodes are set to store the hierarchical entity representation, and the attribute fields of the relationship edges are set to store the comprehensive relationship representation and rule verification score. For example, the entity node "diabetes" stores its multi-granularity encoded feature vector, and the relationship edge "diabetes-complication-hypertension" stores the corresponding comprehensive relationship representation and rule verification score.

[0058] Based on the centrality of the initial knowledge graph, the supplementary medical knowledge is determined and integrated to obtain the final medical knowledge graph. The graph embedding technology is used to map nodes and edges to a continuous vector space. Based on the centrality of the initial knowledge graph, the node importance score is calculated by combining the local connection characteristics of the nodes and the global network structure characteristics. For example, the importance score of the entity "diabetes" in the graph is calculated. The relevant knowledge of important nodes is extracted from the medical literature library through remote supervision, for example, knowledge related to "diabetes", such as "treatment methods for diabetes". The extracted knowledge is encoded into entity nodes and relationship edges to be supplemented. The knowledge distillation mechanism is combined to use existing knowledge to guide the representation learning of new knowledge. The progressive graph fusion strategy is used to add the medical knowledge to be supplemented to the initial knowledge graph and inherit the connection relationship of similar nodes. The nodes are transmitted and updated through the graph attention network. The relationship projector is used to adjust the semantic representation of the supplementary relationship. A gated verification mechanism is set to evaluate the reliability of the newly added knowledge and dynamically adjust its weight. The integrated knowledge graph is globally optimized for consistency to obtain the medical knowledge graph.

[0059] In this embodiment, by automatically extracting entities and relationships from medical texts and using the medical rule base for reasoning verification, the efficiency of knowledge graph construction can be significantly improved, and the workload of manual intervention can be reduced. Multi-granular entity encoding and medical rule-based reasoning verification mechanisms can effectively reduce noise and erroneous information, ensuring the accuracy and reliability of knowledge graphs. The knowledge supplement mechanism can continuously enrich and improve the knowledge graph, improve its coverage and completeness, and high-quality medical knowledge graphs can provide support for various medical applications, such as disease diagnosis, drug development, personalized medicine, etc., which helps to improve the level and efficiency of medical services.

[0060] In an optional embodiment, Determine the entity relationship through reasoning and verification and establish connections to build an initial knowledge graph. Set the attribute field of the entity node in the initial knowledge graph to store the hierarchical entity representation, set the attribute field of the relationship edge to store the comprehensive relationship representation and rule verification score, use graph embedding technology to map the nodes and edges to a continuous vector space, calculate the node importance score based on the centrality of the initial knowledge graph, combine the local connection characteristics of the nodes and the global network structure characteristics, extract the relevant knowledge of important nodes from the medical literature library through remote supervision, encode the extracted knowledge into entity nodes and relationship edges to be supplemented, and use the knowledge distillation mechanism to use existing knowledge to guide the representation learning of new knowledge, including: Construct a double-layer hash table storage structure, wherein the outer hash table of the double-layer hash table storage structure uses the entity as the key, and the inner hash table stores the relationship information related to the current entity, stores the relationship information of the entity relationship pair verified by reasoning into the inner hash table, establishes a reverse index, sets the attribute field of the entity node in the initial knowledge graph to store the hierarchical entity representation, and sets the attribute field of the relationship edge to store the comprehensive relationship representation and the rule verification score; The initial knowledge graph is used to construct training samples through a stratified sampling strategy, local structural information of nodes is obtained through breadth-first traversal, a fixed number of first-order neighbor nodes and second-order neighbor nodes are selected for each node to form a subgraph, a node sequence is generated in the subgraph through truncated random walks, co-occurring node pairs in the node sequence are constructed as positive samples, negative samples are generated by randomly replacing nodes, samples of multiple subgraphs are processed by batch iterative optimization, and nodes and edges are mapped to a continuous vector space using adversarial training; A multi-level parallel computing framework is constructed based on the continuous vector space, and the in-degree centrality, out-degree centrality, and betweenness centrality of the nodes are respectively calculated as local connection features. The in-degree centrality and out-degree centrality are accelerated by forward adjacency lists and backward adjacency lists. The betweenness centrality is obtained by dividing the graph into multiple subgraphs and processing them in parallel and then merging the results. The global network structure features are obtained by a random walk algorithm with restart and sparse matrix operations. The local connection features and the global network structure features are input into a multi-layer perceptron network, the feature combination relationship is learned through the nonlinear transformation of the intermediate layer, the node importance score is generated in the output layer, some features are randomly shielded through the feature denoising module during the training process, and the feature importance weights are dynamically adjusted through the adaptive feature weight mechanism according to the characteristics of different types of nodes; An attention-based text scanner is constructed for the nodes with higher importance scores, the medical literature is segmented and candidate knowledge is extracted at the paragraph level using a sliding window, entities are annotated using a pre-trained medical named entity recognition model, the relationship between entities is identified through a relation extractor based on dependency syntax, the extracted knowledge is filtered using entity type consistency check, relation logic constraint check, and knowledge duplication check, and the extracted knowledge is encoded into entity nodes and relationship edges to be supplemented; For the entity nodes and relationship edges to be supplemented, the teacher network guides the student network to learn the feature distribution of the node representation vector and the relationship pattern between the nodes, the dynamic temperature parameter is used to adjust the smoothness of the soft label, the contrastive learning loss is introduced to promote the semantic alignment of new and old knowledge, and the distillation intensity is dynamically adjusted through the performance indicators on the verification set.

[0061] Determine the entity relationship through reasoning verification and construct the initial knowledge graph. For example, through the existing medical rule base, determine that there is a "complication" relationship between "diabetes" and "hyperglycemia". Add "diabetes" and "hyperglycemia" as entity nodes to the knowledge graph, and connect the two nodes with "complications". Store hierarchical entity representations in the attribute fields of entity nodes. For example, the hierarchical representation of "diabetes" can be "chronic diseases-endocrine diseases-diabetes". Store comprehensive relationship representations and rule verification scores in the attribute fields of relationship edges. For example, the score of the "complication" relationship can be determined based on the confidence of rule matching. Use graph embedding technology to map nodes and edges to continuous vector space. For example, "diabetes" and "complications" can be converted into vector representations using technologies such as Word2Vec.

[0062] Based on the centrality of the initial knowledge graph, the node importance score is calculated by combining the local connection features of the node and the global network structure features. For example, the in-degree, out-degree and betweenness centrality of the "diabetes" node are calculated as local connection features. The global network structure features are obtained by the random walk algorithm with restart. These features are input into the multi-layer perceptron network, and finally the importance score of the "diabetes" node is obtained. During the training process, some features are randomly shielded for feature denoising, and the feature importance weights are dynamically adjusted according to the node type. For example, for disease nodes, more emphasis is placed on their association with other diseases, while for drug nodes, more emphasis is placed on their therapeutic effects.

[0063] For nodes with high importance scores, such as "diabetes", an attention-based text scanner is built to extract relevant knowledge from medical literature. The literature is segmented and candidate knowledge is extracted at the paragraph level using a sliding window. Entities are annotated using a pre-trained medical named entity recognition model, for example, "insulin resistance" is identified as a pathological mechanism of "diabetes". Relationships between entities are identified using a dependency syntax-based relation extractor. The extracted knowledge is filtered, for example, checking whether the entity types are consistent, "insulin resistance" should be a biological process or pathological mechanism, not a drug. The filtered knowledge is encoded into entity nodes and relationship edges to be supplemented, for example, "insulin resistance" is used as a new entity node, and a "pathological mechanism" relationship is added to connect "diabetes" and "insulin resistance".

[0064] For the supplemented entity nodes and relationship edges, representation learning is performed through the knowledge distillation mechanism. Use existing knowledge to guide the learning of new knowledge. For example, use the learned vector representation of "diabetes" to guide the learning of the vector representation of "insulin resistance". Use dynamic temperature parameters to adjust the smoothness of soft labels, and introduce contrastive learning loss to promote the semantic alignment of new and old knowledge. Dynamically adjust the distillation intensity based on the performance indicators on the validation set. For example, if the addition of new knowledge improves the performance of the knowledge graph on downstream tasks, increase the distillation intensity.

[0065] In this embodiment, knowledge is automatically extracted from medical literature by combining reasoning verification and remote supervision, reducing the cost and time of manually constructing knowledge graphs. Through the knowledge distillation mechanism, existing high-quality knowledge is transferred to new knowledge, ensuring the accuracy and consistency of new knowledge. By supplementing and improving the knowledge graph, it can better support applications such as knowledge discovery, disease diagnosis, and treatment plan recommendation in the medical field. In the existing technology, the traditional TransE algorithm only uses a single entity representation method. Although BERT-GCN introduces deep learning, it lacks consideration of specific knowledge in the medical field. When processing complex medical knowledge, problems such as inaccurate entity relationships and unclear knowledge structure levels often occur; This embodiment proposes a hierarchical entity representation mechanism. By representing entities hierarchically in the manner of "major category-middle category-specific entity", for example, organizing disease entities according to the levels of department, cause, specific symptoms, etc., it is possible to better retain the inherent hierarchical structure of medical knowledge and improve the accuracy and interpretability of entity representation. The relationship construction method based on the combination of rule verification and graph embedding is preliminarily verified through the medical rule base, and the entities and relationships are mapped to the vector space in combination with technologies such as Word2Vec, so that the relationship construction is consistent with medical expertise and can fully utilize the advantages of data-driven feature learning. In summary, this embodiment achieves the effective integration of new and old knowledge through dynamic temperature parameter adjustment and contrastive learning loss, overcomes the problem that the new knowledge in the prior art is difficult to coordinate and unify with the existing knowledge, and significantly improves the construction quality and expansion efficiency of the medical knowledge graph.

[0066] Figure 2 Schematic diagram of the structure of the medical text big data intelligent annotation and knowledge graph construction system according to an embodiment of the present invention. Figure 2 As shown, the system comprises: The first unit is used to obtain medical text data and perform word segmentation processing on the medical text data to obtain a word segmentation result, input the word segmentation result into a deep bidirectional encoding model pre-trained according to a mask prediction task and a context association task to generate a context semantic vector of the medical text, add the context semantic vector to a pre-built multi-level entity recognition network to identify entities in the medical text, obtain a medical entity recognition result, input the medical entity recognition result into an entity representation enhancement module, calculate the semantic association between entities by constructing a similarity measurement matrix, generate an enhanced entity feature vector, and normalize the medical entities in combination with standard terms in a medical knowledge base to obtain a standardized entity labeling result; The second unit is used to map the entity nodes in the standardized entity annotation result into high-dimensional feature vectors, calculate the attention scores between the entity nodes and perform weighted aggregation to obtain fused features, perform nonlinear transformation on the fused features through a multi-layer perceptron to obtain context representation, input the context representation into a relationship classifier to calculate the probability distribution of the relationship type to obtain a preliminary relationship extraction result, verify the preliminary relationship extraction result based on the semantic similarity of the entity pair and the medical knowledge rules, and optimize it according to the verification result in combination with the re-labeling algorithm based on contrastive learning to obtain an optimized relationship labeling result; The third unit is used to perform multi-granularity encoding on the entities in the optimized relationship annotation results to obtain a hierarchical entity representation, calculate the relationship vectors between entities based on the hierarchical entity representation and fuse them in combination with a gating mechanism to obtain a comprehensive relationship representation, input the comprehensive relationship representation into an inference rule network constructed based on a medical rule base, determine the entity relationship through reasoning verification and construct an initial knowledge graph, and determine supplementary medical knowledge based on the centrality of the initial knowledge graph and integrate them to obtain a medical knowledge graph.

[0067] Figure 3 This is a comparison chart of entity recognition accuracy of the method for intelligent annotation and knowledge graph construction of medical text big data in the embodiment of the present invention, showing the comparison of entity recognition accuracy of the present technical solution (circular icon) and the existing technologies, including BiLSTM-CRF (rectangular icon) and BERT-CRF (triangular icon) at different text lengths. When the text length is 100-500 words, the accuracy of the present technical solution is always maintained between 93.5% and 96.8%, which is significantly higher than 85.2%-89.7% of BiLSTM-CRF and 88.4%-92.3% of BERT-CRF. Especially when processing long texts (more than 400 words), the performance advantage of the present technical solution is more obvious, with an accuracy of 96.8%, while BiLSTM-CRF and BERT-CRF can only reach 89.7% and 92.3% respectively, mainly due to the multi-scale convolution kernel and attention fusion mechanism adopted by the present solution, which can better capture long-distance dependencies.

[0068] Figure 4 This is a comparison chart of the accuracy of entity relationships in the knowledge graph of the medical text big data intelligent annotation and knowledge graph construction method according to an embodiment of the present invention, which shows the comparison of the accuracy of entity relationship recognition under knowledge graphs of different scales. The technical solution adopts multi-level entity representation and knowledge distillation mechanism, and achieves an accuracy of 94.2% when processing a scale of 10,000 nodes, which is significantly better than the traditional TransE algorithm (85.6%) and RotatE algorithm (88.9%). In the case of large-scale graphs (50,000 nodes), the technical solution still maintains a high accuracy of 92.8%, while the accuracy of TransE and RotatE drops to 81.3% and 84.5% respectively. Thanks to the hierarchical entity representation and dynamic temperature parameter adjustment mechanism, when the node scale is 30,000, the accuracy of the technical solution is 93.5%, which is 10.9 percentage points higher than TransE and 7.8 percentage points higher than RotatE, which fully proves the superiority of the solution in the construction of large-scale medical knowledge graphs.

[0069] According to a third aspect of the embodiments of the present invention, An electronic device is provided, comprising: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the aforementioned method.

[0070] A fourth aspect of the embodiments of the present invention is: A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.

[0071] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.

[0072] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention 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 replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for intelligent annotation and knowledge graph construction of medical text big data, characterized in that: include: Acquire medical text data and perform word segmentation processing on the medical text data to obtain a word segmentation result, input the word segmentation result into a deep bidirectional encoding model pre-trained according to a mask prediction task and a context association task to generate a context semantic vector of the medical text, add the context semantic vector to a pre-built multi-level entity recognition network to identify entities in the medical text, and obtain a medical entity recognition result, input the medical entity recognition result into an entity representation enhancement module, calculate the semantic association between entities by constructing a similarity measurement matrix, generate an enhanced entity feature vector, and normalize the medical entities in combination with standard terms in a medical knowledge base to obtain a standardized entity labeling result; The entity nodes in the standardized entity annotation result are mapped into high-dimensional feature vectors, the attention scores between the entity nodes are calculated and weighted aggregation is performed to obtain fused features, the fused features are nonlinearly transformed by a multi-layer perceptron to obtain context representation, the context representation is input into a relationship classifier to calculate the probability distribution of the relationship type to obtain a preliminary relationship extraction result, the preliminary relationship extraction result is verified based on the semantic similarity of the entity pairs and medical knowledge rules, and according to the verification result, it is optimized in combination with a re-labeling algorithm based on contrastive learning to obtain an optimized relationship labeling result; The entities in the optimized relationship annotation results are multi-granularly encoded to obtain a hierarchical entity representation, the relationship vectors between entities are calculated based on the hierarchical entity representation and fused with a gating mechanism to obtain a comprehensive relationship representation, the comprehensive relationship representation is input into an inference rule network constructed based on a medical rule base, the entity relationship is determined through reasoning verification and an initial knowledge graph is constructed, and supplementary medical knowledge is determined based on the centrality of the initial knowledge graph and integrated to obtain a medical knowledge graph.

2. The method according to claim 1, characterized in that Obtain medical text data and perform word segmentation processing on the medical text data to obtain a word segmentation result, input the word segmentation result into a deep bidirectional encoding model pre-trained according to a mask prediction task and a context association task to generate a context semantic vector of the medical text, add the context semantic vector to a pre-built multi-level entity recognition network to identify entities in the medical text, obtain a medical entity recognition result, input the medical entity recognition result into an entity representation enhancement module, calculate the semantic association between entities by constructing a similarity measurement matrix, generate an enhanced entity feature vector, and normalize the medical entities in combination with standard terms in a medical knowledge base, and obtain standardized entity annotation results including: Obtain medical text data and classify and organize it according to the time of consultation, department, and disease type, use string matching rules to identify and remove special characters, marking symbols, and repeated spaces, perform standardized format conversion processing on numbers, units, and time, and perform word segmentation processing on the medical text data to obtain word segmentation results; Input the word segmentation result into a deep bidirectional encoding model pre-trained according to a mask prediction task and a context association task, randomly select words for mask prediction and context association prediction, construct a pre-training task by replacing mask tags, random words and keeping them unchanged, and extract fragments from the text to determine context relevance, so as to generate a context semantic vector of the medical text; The context semantic vector is added to a pre-built multi-level entity recognition network, and the character-level representation is obtained by performing feature extraction and maximum pooling on the characters by setting convolution kernels of different sizes, and the word-level features are extracted by inputting the bidirectional recurrent neural network, and the character-level representation is adaptively fused with the word-level features by using the attention fusion layer to identify entities in the medical text and obtain the medical entity recognition result; The medical entity recognition result is input into an entity representation enhancement module, and the entity representation enhancement module constructs a similarity measurement matrix through a character similarity subnetwork, a semantic similarity subnetwork, and a context similarity subnetwork, wherein the character similarity subnetwork calculates character similarity based on an edit distance matrix, the semantic similarity subnetwork calculates semantic similarity based on a synonym dictionary, and the context similarity subnetwork calculates context similarity based on a context window, and the character similarity, the semantic similarity, and the context similarity are input into a multi-layer neural network to calculate the semantic association between entities; An entity relationship graph is constructed for entities with semantic association, and the connection relationship between entities is determined by setting a similarity threshold. A graph attention network is used for feature transfer and enhancement to generate an enhanced entity feature vector. The enhanced entity feature vector is aligned with the standard terminology in the medical knowledge base, and the medical entities are normalized by calculating the similarity between the entity features and the knowledge base nodes to obtain standardized entity labeling results.

3. The method according to claim 2, characterized in that The context semantic vector is added to the pre-built multi-level entity recognition network, and the character-level representation is obtained by setting convolution kernels of different sizes to extract features and perform maximum pooling on the characters. The bidirectional recurrent neural network is input to extract word-level features, and the character-level representation is adaptively fused with the word-level features using the attention fusion layer to identify entities in the medical text. The medical entity recognition results include: Adding the context semantic vector to a multi-level entity recognition network, wherein the multi-level entity recognition network includes a character-level feature extraction branch, a word-level feature extraction branch, and an attention fusion layer; The character-level feature extraction branch includes a plurality of convolution units connected in series, each of the convolution units is provided with convolution kernels of different sizes, the convolution kernel of the first convolution unit extracts the combination features between adjacent characters, the convolution kernel of the second convolution unit extracts the character combination features at the word level, and the convolution kernel of the third convolution unit extracts the character association features across words, residual connection paths are provided between the convolution units to transfer the character features, and the features output by the convolution units are subjected to maximum pooling processing to obtain the character-level representation; The word-level feature extraction branch adopts a bidirectional recurrent neural network, including an input layer, a hidden layer and an output layer, wherein the hidden layer is provided with a word internal attention calculation unit, and the output layer is provided with a word-inter-word relationship attention calculation unit, wherein the word internal attention calculation unit generates a character weight vector according to a word internal character combination, and the word-inter-word relationship attention calculation unit generates a word weight vector according to a context word association degree, and the character weight vector is combined with the word weight vector to obtain a word-level feature; The attention fusion layer includes a feature selection unit, a feature combination unit and a global association unit. The feature selection unit uses a gating mechanism to dynamically calculate the weight coefficients of the character-level representation and the word-level feature. The feature combination unit combines the features after adding the weight coefficients. The global association unit uses a multi-head attention mechanism to calculate the long-range dependency between features. Performing entity recognition on the combined features, including an entity boundary recognition subtask and an entity category recognition subtask. The entity boundary recognition subtask uses a pointer network to locate the start position and the end position of the entity. The entity category recognition subtask uses a multi-layer perceptron to classify the entity category. During the training process, sampling weights are set for different types of entities according to their frequency of occurrence, and the sampling weights are inversely proportional to the frequency of occurrence of the entity type. Adversarial perturbations are applied to the training samples, wherein the adversarial perturbations construct adversarial samples through the gradient ascent method. The medical text is input into the trained multi-level entity recognition network, and the medical entity recognition results containing category labels, location coordinates and corresponding texts are output.

4. The method according to claim 1, characterized in that: Mapping the entity nodes in the standardized entity annotation result into high-dimensional feature vectors, calculating the attention scores between the entity nodes and performing weighted aggregation to obtain fused features, and performing nonlinear transformation on the fused features through a multi-layer perceptron to obtain context representation includes: The entity nodes in the standardized entity annotation results are mapped into high-dimensional feature vectors. Through the context-aware layer, a multi-scale sliding window whose size is adaptively adjusted according to the length of the text is used to capture the contextual information around the entity. Through the enhanced sequence modeling layer, the location information of the entity in the text and the syntactic dependency information based on the shortest path of the grammatical analysis tree are encoded into the high-dimensional feature vector. The semantic embedding vector of the entity node is extracted from the pre-trained medical knowledge graph and weightedly fused with the original feature vector to obtain an enhanced representation. Based on the enhanced representation, multiple parallel attention calculation units are set. Each attention calculation unit projects the input enhanced representation into multiple feature subspaces. In each subspace, the dot product of the query vector and the key vector is calculated to obtain the attention weight. The product of the attention weight and the value vector is weighted and summed to obtain the attention output. The dimension effect is eliminated through the feature normalization layer and the residual connection is introduced to retain the original information. The learnable temperature parameter is set to soften the attention distribution to obtain the attention score. The entity features are weightedly aggregated according to the attention scores to obtain the fused features. A multi-level skip connection path is set in the feature transmission process to directly transfer the shallow features to the deep network. A gating mechanism including a reset gate and an update gate is adopted to dynamically adjust the feature combination weights according to the input features at the current moment and the hidden state at the previous moment. The fused features are input into the multi-layer perceptron, dense connections are added between each layer, and nonlinear transformation is performed through mini-batch normalization and random dropout regularization to obtain context representation.

5. The method according to claim 1, characterized in that The context representation is input into the relationship classifier to calculate the probability distribution of the relationship type to obtain a preliminary relationship extraction result, and the preliminary relationship extraction result is verified based on the semantic similarity of the entity pair and the medical knowledge rules. According to the verification result, the optimization is performed in combination with the re-labeling algorithm based on contrastive learning, and the optimized relationship labeling result includes: The context representation is input into the relationship classifier to calculate the probability distribution of the relationship type, a selective random inactivation unit based on the attention score is set in each layer of the classifier, the feature channel is adaptively recalibrated, and the relationship prediction task is decomposed into multiple subtasks using a tree classification structure. A dynamic weight adjustment mechanism is introduced in each subtask to solve the problem of imbalanced category samples, and a preliminary relationship extraction result is obtained; The preliminary relationship extraction results are verified based on the semantic similarity of entity pairs and medical knowledge rules. The angle cosine value and normalized Euclidean distance of the feature vector are calculated to obtain the semantic similarity score. A hierarchical constraint graph of entity types is constructed in combination with the pre-set medical ontology knowledge base. Knowledge verification is performed based on the logical constraint rules of the relationship type. The verification results are obtained by calculating the consistency of the mutual information evaluation between the relationship prediction results and the contextual semantic representation. According to the verification results, the re-labeling algorithm based on contrastive learning is combined for optimization. Based on the prediction error and sample density estimation, representative positive sample pairs are selected from the prediction results that have passed the verification, and negative sample pairs with a moderate distance from the positive sample pairs are selected from the results that have not passed the verification. The mutual information between the positive sample pairs is maximized in the feature space, while the mutual information with the negative sample pairs is minimized. The complexity of the training samples is gradually increased from easy to difficult. The comprehensive score of the prediction result is calculated by combining the confidence score of the model prediction, the consistency score of the multi-dimensional verification results, and the prior probability of the relationship type based on the historical annotation data statistics. The classification threshold is adaptively determined according to the data distribution to divide the prediction results into high-confidence prediction results, medium-confidence prediction results, and low-confidence prediction results. The high-confidence prediction result is confirmed as the final annotation result, the medium-confidence prediction result is submitted to experts for review, and the low-confidence prediction result is filtered. The optimized relationship annotation result is obtained through multiple rounds of alternating optimization.

6. The method according to claim 1, characterized in that The entities in the optimized relationship annotation results are encoded at multiple granularities to obtain hierarchical entity representations, the relationship vectors between entities are calculated based on the hierarchical entity representations and are integrated with the gating mechanism to obtain comprehensive relationship representations, the comprehensive relationship representations are input into the inference rule network constructed based on the medical rule base, the entity relationship is determined through reasoning verification and an initial knowledge graph is constructed, and supplementary medical knowledge is determined based on the centrality of the initial knowledge graph and integrated to obtain a medical knowledge graph, including: The entities in the optimized relationship annotation results are input into a character-level convolutional network, local character combination features are captured through sliding windows of different sizes, the entity text is input into a word-level bidirectional gated recurrent network to extract word-level contextual semantic features, the entity phrase is input into an attention-enhanced converter network to obtain global semantic features, the character combination features, word-level contextual semantic features and global semantic features are adaptively normalized, and the character combination features, word-level contextual semantic features and global semantic features are combined through a residual connection and feature recalibration mechanism to obtain a hierarchical entity representation; A multi-channel interactive network is set up to process the hierarchical entity representation, a bidirectional attention module is constructed in each channel to calculate the relationship vector between entities, the product of the attention weight and the hierarchical entity representation is weightedly aggregated, candidate features are generated through a candidate content generation module, and the fusion weights of relationship vectors of different granularities are adaptively adjusted according to current input features and historical state information by combining an update gating module and a reset gating module in the gating mechanism, and a comprehensive relationship representation is obtained through multi-layer nonlinear transformation; Construct a medical rule library containing entity type constraint rules, relationship type constraint rules, entity attribute constraint rules and relationship combination constraint rules, use graph neural network to encode the rules into network nodes, encode the logical relationship between the rules into network edges, and construct an inference rule network by transmitting and aggregating information between rule nodes through message passing mechanism. Input the comprehensive relationship representation into the inference rule network, judge whether the relationship meets the medical knowledge constraint through the activation state of the rule node, and use the attention mechanism to dynamically assign importance weights to different rules. Determine entity relationships through reasoning and verification, establish connections and construct an initial knowledge graph, set attribute fields of entity nodes in the initial knowledge graph to store the hierarchical entity representation, set attribute fields of relationship edges to store the comprehensive relationship representation and rule verification scores, use graph embedding technology to map nodes and edges to continuous vector space, calculate node importance scores based on the centrality of the initial knowledge graph, combine local connection features of nodes and global network structure features, extract relevant knowledge of important nodes from a medical literature library through remote supervision, encode the extracted knowledge into entity nodes and relationship edges to be supplemented, and use existing knowledge to guide representation learning of new knowledge in combination with knowledge distillation mechanism; A progressive graph fusion strategy is adopted to add the medical knowledge to be supplemented into the initial knowledge graph and inherit the connection relationship of similar nodes. The nodes are transmitted and updated through the graph attention network, and the relationship projector is used to adjust the semantic representation of the supplementary relationship. A gated verification mechanism is set to evaluate the reliability of the newly added knowledge and dynamically adjust its weight. The integrated knowledge graph is globally optimized for consistency to obtain the medical knowledge graph.

7. The method according to claim 6, characterized in that Determine the entity relationship through reasoning and verification and establish connections to build an initial knowledge graph. Set the attribute field of the entity node in the initial knowledge graph to store the hierarchical entity representation, set the attribute field of the relationship edge to store the comprehensive relationship representation and rule verification score, use graph embedding technology to map the nodes and edges to a continuous vector space, calculate the node importance score based on the centrality of the initial knowledge graph, combine the local connection characteristics of the nodes and the global network structure characteristics, extract the relevant knowledge of important nodes from the medical literature library through remote supervision, encode the extracted knowledge into entity nodes and relationship edges to be supplemented, and use the knowledge distillation mechanism to use existing knowledge to guide the representation learning of new knowledge, including: Construct a double-layer hash table storage structure, wherein the outer hash table of the double-layer hash table storage structure uses the entity as the key, and the inner hash table stores the relationship information related to the current entity, stores the relationship information of the entity relationship pair verified by reasoning into the inner hash table, establishes a reverse index, sets the attribute field of the entity node in the initial knowledge graph to store the hierarchical entity representation, and sets the attribute field of the relationship edge to store the comprehensive relationship representation and the rule verification score; The initial knowledge graph is used to construct training samples through a stratified sampling strategy, local structural information of nodes is obtained through breadth-first traversal, a fixed number of first-order neighbor nodes and second-order neighbor nodes are selected for each node to form a subgraph, a node sequence is generated in the subgraph through truncated random walks, co-occurring node pairs in the node sequence are constructed as positive samples, negative samples are generated by randomly replacing nodes, samples of multiple subgraphs are processed by batch iterative optimization, and nodes and edges are mapped to a continuous vector space using adversarial training; A multi-level parallel computing framework is constructed based on the continuous vector space, and the in-degree centrality, out-degree centrality, and betweenness centrality of the nodes are respectively calculated as local connection features. The in-degree centrality and out-degree centrality are accelerated by forward adjacency lists and backward adjacency lists. The betweenness centrality is obtained by dividing the graph into multiple subgraphs and processing them in parallel and then merging the results. The global network structure features are obtained by a random walk algorithm with restart and sparse matrix operations. The local connection features and the global network structure features are input into a multi-layer perceptron network, the feature combination relationship is learned through the nonlinear transformation of the intermediate layer, the node importance score is generated in the output layer, some features are randomly shielded through the feature denoising module during the training process, and the feature importance weights are dynamically adjusted through the adaptive feature weight mechanism according to the characteristics of different types of nodes; An attention-based text scanner is constructed for the nodes with higher importance scores, the medical literature is segmented and candidate knowledge is extracted at the paragraph level using a sliding window, entities are annotated using a pre-trained medical named entity recognition model, the relationship between entities is identified through a relation extractor based on dependency syntax, the extracted knowledge is filtered using entity type consistency check, relation logic constraint check, and knowledge duplication check, and the extracted knowledge is encoded into entity nodes and relationship edges to be supplemented; For the entity nodes and relationship edges to be supplemented, the teacher network guides the student network to learn the feature distribution of the node representation vector and the relationship pattern between the nodes, the dynamic temperature parameter is used to adjust the smoothness of the soft label, the contrastive learning loss is introduced to promote the semantic alignment of new and old knowledge, and the distillation intensity is dynamically adjusted through the performance indicators on the verification set.

8. A medical text big data intelligent annotation and knowledge graph construction system, used to implement the method described in any one of claims 1 to 7, characterized in that: include: The first unit is used to obtain medical text data and perform word segmentation processing on the medical text data to obtain a word segmentation result, input the word segmentation result into a deep bidirectional encoding model pre-trained according to a mask prediction task and a context association task to generate a context semantic vector of the medical text, add the context semantic vector to a pre-built multi-level entity recognition network to identify entities in the medical text, obtain a medical entity recognition result, input the medical entity recognition result into an entity representation enhancement module, calculate the semantic association between entities by constructing a similarity measurement matrix, generate an enhanced entity feature vector, and normalize the medical entities in combination with standard terms in a medical knowledge base to obtain a standardized entity labeling result; The second unit is used to map the entity nodes in the standardized entity annotation result into high-dimensional feature vectors, calculate the attention scores between the entity nodes and perform weighted aggregation to obtain fused features, perform nonlinear transformation on the fused features through a multi-layer perceptron to obtain context representation, input the context representation into a relationship classifier to calculate the probability distribution of the relationship type to obtain a preliminary relationship extraction result, verify the preliminary relationship extraction result based on the semantic similarity of the entity pair and the medical knowledge rules, and optimize it according to the verification result in combination with the re-labeling algorithm based on contrastive learning to obtain an optimized relationship labeling result; The third unit is used to perform multi-granularity encoding on the entities in the optimized relationship annotation results to obtain a hierarchical entity representation, calculate the relationship vectors between entities based on the hierarchical entity representation and fuse them in combination with a gating mechanism to obtain a comprehensive relationship representation, input the comprehensive relationship representation into an inference rule network constructed based on a medical rule base, determine the entity relationship through reasoning verification and construct an initial knowledge graph, and determine supplementary medical knowledge based on the centrality of the initial knowledge graph and integrate them to obtain a medical knowledge graph.

9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method described in any one of claims 1 to 7.

10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Medical intelligent knowledge graph automatic construction system based on end-to-end differential learning

    CN119312904A

  • Medical knowledge graph construction method and apparatus based on model, device, and medium

    WO2022151812A1

  • Aided disease differential diagnosis system based on causality-containing medical knowledge graph

    WO2023098288A1

Cited By

  • Method and system for generating settlement list based on medical data

    CN120068802A

  • Method and system for extracting and visualizing multi-level events from telephone audio data

    CN120087364A

  • Disease science popularization error correction method and system based on artificial intelligence

    CN120108774A

  • Construction method of wound surface grading model and wound surface self-analysis system

    CN120221096A

  • Mechanism name normalization method based on deep learning

    CN120235146A