A method for recognizing nested named entities in electronic medical records

By constructing graph structures and using cascade graph convolution neural networks, combined with bidirectional long and short-term memory networks, the problem of poor nested named entities recognition in Chinese electronic medical records is solved, and more accurate nested entities recognition is achieved.

CN118821778BActive Publication Date: 2024-11-22四川互慧软件有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411300185.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2024-11-22
Estimated Expiration
2044-09-18

AI Technical Summary

Technical Problem

Chinese electronic medical record text contains a large number of professional terms, complex grammatical structure, strong context dependence, and multi-level nesting, resulting in poor recognition of nested named entities.

Method used

The graph structure is used to characterize unstructured information, construct sequence diagrams and syntactic dependency diagrams, capture local feature information and syntactic structure information through cascade graph convolution neural network, and extract context information with two-way long and short-term memory networks. The Prime Minister’s similar picture is used to understand the semantic structure and morphological characteristics of Chinese characters, and to realize nested named entity recognition through feature fusion.

Benefits of technology

Through the multi-feature fusion of graph convolutional neural networks, nested entities in electronic medical records can be more accurately identified, improving the accuracy of nested named entities recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118821778B_ABST
    Figure CN118821778B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for recognizing nested named entities in electronic medical records, and belongs to the technical field of medical natural language processing. The electronic medical record text is used as input to perform nested named entity recognition, including: encoding the electronic medical record text to obtain character vectors and word vectors; extracting features from the word vectors to obtain context feature representation vectors; sequentially constructing and extracting features from the character vectors to obtain sequence graph feature extraction results, sequentially constructing and extracting features from the word vectors to obtain syntactic dependency graph feature extraction results; extracting features from the sequence graph feature extraction results and the syntactic dependency graph feature extraction results to obtain cascade feature graphs and clustering to obtain cluster extraction results; obtaining radical feature extraction results based on the electronic medical record text; and performing span prediction based on the context feature representation vectors, cluster extraction results, and radical feature extraction results to more accurately identify nested entities in the electronic medical record.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical natural language processing, and specifically to a method for recognizing nested named entities in electronic medical records. Background Art

[0002] Smart healthcare is a hot topic in the current field of artificial intelligence research, and among various medical data, Chinese electronic medical records are of great value. Chinese electronic medical records are usually written in natural language, and most of them are semi-structured or unstructured data that cannot be directly used by medical information systems. In order to fully explore the important medical knowledge contained in electronic medical records, researchers use named entity recognition (NER) technology to identify and extract medical entities in them, thereby providing structured information for subsequent data processing and analysis. NER refers to the recognition of some specific types of meaningful names or quantity phrases in free text. By using named entity recognition technology to transform the unstructured information of electronic medical records into structured information, the medical knowledge contained in the free text of electronic medical records can be effectively extracted. Traditional NER mainly recognizes flat entities, while Chinese electronic medical records have many entity nesting problems due to the complexity of the text. Nested named entities refer to the situation where there is a hierarchical nested relationship between named entities in the text, such as "coronary artery bypass grafting" belongs to past history, while "coronary artery" belongs to body parts, and one entity is nested in another entity. By extracting nested entities, the knowledge in the medical field can be captured more comprehensively.

[0003] There are currently four main nested named entity recognition modeling methods for general fields: hierarchical-based methods, sequence generation-based methods, hypergraph neural network-based methods, and span enumeration-based methods. The span enumeration-based method directly enumerates all possible entity spans in the text, predicts the entity labels of each span based on semantic information, and realizes the recognition of nested named entities. In the medical field, Chinese electronic medical record texts contain a large number of professional terms, complex grammatical structures, strong context dependence, and multi-level nesting, which results in poor nested entity recognition. Summary of the invention

[0004] The technical problem to be solved by the present application is to provide a method for identifying nested named entities in electronic medical records, which has the characteristic of being able to more accurately identify nested entities in electronic medical records.

[0005] In a first aspect, an embodiment provides a method for recognizing nested named entities in electronic medical records, comprising:

[0006] Access to electronic medical record texts;

[0007] The electronic medical record text is used as the input of the trained electronic medical record entity recognition neural network to perform nested named entity recognition to obtain an entity recognition result; including:

[0008] Perform character-level encoding and word-level encoding based on the input electronic medical record text to obtain character vectors and word vectors;

[0009] The word vector is used as the input of the BiLSTM feature extraction sub-network to perform feature extraction to obtain a context feature representation vector;

[0010] The character vector is sequentially subjected to sequential graph construction and CGCN feature extraction to obtain a sequential graph feature extraction result, and the word vector is sequentially subjected to syntactic dependency graph construction and CGCN feature extraction to obtain a syntactic dependency graph feature extraction result;

[0011] Performing CGCN feature extraction on the sequence graph feature extraction results and the syntactic dependency graph feature extraction results to obtain a cascade feature graph; clustering the cascade feature graph to obtain a cluster extraction result;

[0012] Based on the input electronic medical record text, a radical feature vector of each radical in the radical set of each character is obtained; based on the radical feature vector of each radical, a radical semantic similarity graph is constructed using a semantic similarity matrix, and CGCN feature extraction is performed on the radical semantic similarity graph to obtain a radical feature extraction result; in the radical semantic similarity graph, each node represents a radical, and an edge represents a semantic similarity relationship between two radicals;

[0013] Based on the context feature representation vector, clustering extraction results and radical feature extraction results, span prediction is performed to achieve entity recognition of electronic medical records.

[0014] The beneficial effects of the present invention are:

[0015] By taking advantage of the powerful representation ability of graph structure for unstructured information, we construct sequence graph and syntactic dependency graph, and use cascaded graph convolutional neural network as graph structure feature extraction module to capture local feature information and linear sequence information, grammatical structure information and global syntactic dependency information of different granularities; secondly, we use bidirectional long short-term memory network to extract context information; in addition, we construct radical similarity graph, and use cascaded graph convolution to extract radical information and its similarity, so as to understand the semantic structure and morphological characteristics of Chinese characters at a deeper level. By predicting the span through fusion features, we can realize the nested named entity recognition of Chinese electronic medical records with multi-feature fusion of cascaded graph convolutional neural network, which can more accurately identify nested entities in electronic medical records. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is a flowchart of a method for identifying nested named entities in electronic medical records according to an embodiment of the present application;

[0017] Figure 2 It is a flowchart of a method for performing electronic medical record nested named entity recognition through an electronic medical record entity recognition neural network according to an embodiment of the present application;

[0018] Figure 3 It is a schematic flow chart of a method for sequentially constructing a sequence graph and extracting CGCN features of a character vector in accordance with an embodiment of the present application to obtain a sequence graph feature extraction result;

[0019] Figure 4 It is a schematic diagram of a method flow of sequentially constructing a syntactic dependency graph and extracting CGCN features from a word vector to obtain a syntactic dependency graph feature extraction result according to an embodiment of the present application;

[0020] Figure 5 It is a schematic flow chart of a method for clustering cascade feature graphs to obtain cluster extraction results according to an embodiment of the present application;

[0021] Figure 6 This application Figure 5 A schematic diagram of a method flow chart of an embodiment of any iterative update in step S402;

[0022] Figure 7 This application Figure 2 A method flow diagram of an embodiment of step S500;

[0023] Figure 8 This application Figure 2 A method flow diagram of an embodiment of step S600;

[0024] Fig. 9 This application Figure 8 A method flow chart of an embodiment of step S601 in FIG. DETAILED DESCRIPTION

[0025] The present invention is further described in detail below by specific embodiments in conjunction with the accompanying drawings. Wherein similar elements in different embodiments adopt associated similar element numbers. In the following embodiments, many detailed descriptions are for making the present application better understood. However, those skilled in the art can easily recognize that some features can be omitted in different situations, or can be replaced by other elements, materials, methods. In some cases, some operations related to the present application are not shown or described in the specification, this is to avoid the core part of the present application being overwhelmed by too much description, and for those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations according to the description in the specification and the general technical knowledge in the art.

[0026] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various implementations. At the same time, the steps or actions in the method description can also be interchanged or adjusted in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a required sequence, unless otherwise specified that a certain sequence must be followed.

[0027] The serial numbers assigned to the components in this article, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning.

[0028] In the medical field, Chinese electronic medical record texts contain a large number of professional terms, complex grammatical structures, strong context dependence, and multi-level nesting, which results in poor nested entity recognition.

[0029] In view of this, the present application provides a method for recognizing nested named entities in electronic medical records, which utilizes the powerful representation ability of graph structures for unstructured information, constructs sequence graphs and syntactic dependency graphs, and uses cascaded graph convolutional neural networks as graph structure feature extraction modules to capture local feature information and linear sequence information, grammatical structure information, and global syntactic dependency information of different granularities; secondly, a bidirectional long short-term memory network is used to extract contextual information; in addition, a radical similarity graph is constructed, and cascaded graph convolution is used to extract radical information and its similarity, so as to understand the semantic structure and morphological characteristics of Chinese characters at a deeper level. By predicting the span through fusion features, nested named entity recognition in Chinese electronic medical records with multi-feature fusion of cascaded graph convolutional neural networks can be realized, which can more accurately identify nested entities in electronic medical records.

[0030] A method for identifying nested named entities in electronic medical records provided in one embodiment of the present application is provided in Figure 1 ,include:

[0031] Step S10, obtaining the electronic medical record text.

[0032] In an embodiment of the present application, the acquired electronic medical record text is a Chinese electronic medical record text.

[0033] Step S20, using the electronic medical record text as the input of the trained electronic medical record entity recognition neural network to perform nested named entity recognition to obtain an entity recognition result.

[0034] It should be noted that the electronic medical record entity recognition neural network is a trained neural network. For the convenience of explanation, the training process of the electronic medical record entity recognition neural network is briefly introduced below.

[0035] First, prepare an electronic medical record text data set for neural network training. In one embodiment, after analyzing the characteristics of the acquired Chinese electronic medical record text, a medical expert team annotates the electronic medical record text data based on the text characteristics. The annotation can adopt the annotation method of the prior art, and a new annotation method is provided in this application.

[0036] In the new annotation method, firstly, the flat entity category and the nested entity category are defined, wherein the flat entity refers to an independent named entity existing in the text and does not contain other entities. This entity has no hierarchical structure and does not nest other entities. It is the simplest and most basic entity category and can usually be directly identified and extracted from the text. For example, myocardial infarction is marked as a disease entity; the right chest is marked as a body part entity, etc. In one embodiment, 15 types of flat entities can be defined, including: disease, signs, symptoms, past history, body part, physical examination, laboratory examination, auxiliary examination, examination results, drug name, medication, drug efficacy, treatment, nursing, and duration. A nested entity refers to a multi-level structure existing in a text fragment, in which one entity (called an inner entity or a nested entity) is completely or partially contained in another entity (called an outer entity). By analyzing the text, in some embodiments, there is a nested relationship between the 10 types of entities. For example: the nested relationship between disease entities and body part entities, such as coronary artery atherosclerosis is marked as a disease entity, and its nested body part entity is coronary artery; the nested relationship between symptom entities and body part entities, such as chest tightness is marked as a symptom, and its nested body part entity is chest, and so on.

[0037] Secondly, nested entities are labeled hierarchically, using different levels of labels to distinguish nested entities. For example, there is an entity: "Chronic Pneumonia" is labeled as a disease. If it is labeled hierarchically, the first level is the nested entity it contains: "Pneumonia" is labeled as a disease, and the second level is the nested entity "Lung" in "Pneumonia" is labeled as a body part.

[0038] During the annotation process, entities should not contain punctuation marks and should not contain conjunctions such as "or, and, and" as much as possible. Entities mentioned in a medical text can only belong to a certain entity type. After the annotation work is completed, 20% are randomly selected for quality inspection. After the quality inspection, the annotation consistency is used to test the data annotation quality. The consistency of the two annotators is greater than 90%, indicating that the Chinese electronic medical record dataset annotated in this study is reliable.

[0039] After the labeling is completed, the obtained training data is input into the constructed electronic medical record entity recognition neural network infrastructure, and training and learning are carried out in combination with the loss function to obtain the electronic medical record entity recognition neural network required for electronic medical record nested named entity recognition.

[0040] The following is an explanation of the process of identifying nested named entities in electronic medical records using an electronic medical record entity recognition neural network. Figure 2 ,include:

[0041] Step S100, character-level encoding and word-level encoding are performed based on the input electronic medical record text to obtain character vectors and word vectors.

[0042] For the input electronic medical record text, it can be expressed as ,in, Represents the nth character, 1≤n≤N, where N represents the number of characters.

[0043] In one embodiment, based on one-hot encoding, the feature dimension is set, each character in the electronic medical record text is represented as a character matrix composed of character vectors, and then a conventional convolution operation is performed on the matrix, and the final character vector is obtained by using the maximum pooling method. .

[0044] In one embodiment, the word vector representation can be obtained by searching and matching the pre-loaded Med-BERT pre-trained word vector table. ,include:

[0045] ;

[0046] in, Represents the mth word in the electronic medical record text sequence, 1≤m≤M, and M represents the number of words.

[0047] Step S200, using the word vector as the input of the BiLSTM feature extraction sub-network to perform feature extraction to obtain a context feature representation vector.

[0048] BiLSTM is a variant of the long short-term memory network (LSTM), which is composed of the forward LSTM and the backward LSTM. LSTM is a special recurrent neural network (RNN) model. Compared with the general RNN structure, LSTM introduces three gate structures: input gate, forget gate and output gate, thereby realizing a specific learning mechanism to learn what information needs to be remembered, updated and paid attention to.

[0049] The word vector corresponding to the input electronic medical record text is used as the input of the BiLSTM feature extraction sub-network. After calculating the formula for each neuron in LSTM, the context feature representation vector B is obtained:

[0050] ;

[0051] in, Represents the BiLSTM feature extraction function.

[0052] Step S300, sequential graph construction and CGCN feature extraction are performed on the character vector in sequence to obtain the sequential graph feature extraction result, and syntactic dependency graph construction and CGCN feature extraction are performed on the word vector in sequence to obtain the syntactic dependency graph feature extraction result.

[0053] In one embodiment, please refer to Figure 3 , sequential graph construction and CGCN feature extraction are performed on the character vector in turn to obtain the sequential graph feature extraction results, including:

[0054] Step S3011, construct a sequence graph for the character vector to obtain a feature matrix and an adjacency matrix of the sequence graph. In the sequence graph, each node represents a character, and an edge represents a sequence relationship between adjacent characters.

[0055] We represent the sequential relationship between characters in the electronic medical record text sequence as a graph structure, namely a sequence graph. The order reflects the order and relative position of the characters. Each node in the sequence graph represents a character, and the edge represents the sequential relationship between adjacent characters. Through the sequence graph, the sequential information of the text can be better captured, so that the sequential relationship between each node can be expressed through the graph structure. Specifically, for the input text sequence, each character will be regarded as a node in the graph. According to the sequential relationship, sequential edges are constructed for the previous and next character nodes in the context. The edges are not directional, indicating that information in both the positive and negative directions can be transmitted. Thus, the feature matrix of the sequence graph is obtained. and the adjacency matrix of the sequential graph In the adjacency matrix, if there is an edge, it is 1, and if there is no edge, it is 0. For example, for the input "hypertension", the adjacency matrix of its sequential graph can be expressed as:

[0056] .

[0057] Therefore, the character-level sequential graph can capture fine-grained semantic information by using nodes to represent characters and edges to represent the sequential relationship between characters. For example, the semantics of "liver function" is determined by the order of "liver" and "function". Constructing a character-level sequential graph can help the model capture the local and global features of the character sequence, thereby performing entity recognition more accurately.

[0058] Step S3012, performing CGCN feature extraction on the feature matrix and adjacency matrix of the sequence graph to obtain a sequence graph feature extraction result.

[0059] In one embodiment, please refer to Figure 4 , construct the syntactic dependency graph and extract CGCN features for the word vectors in turn, and obtain the syntactic dependency graph feature extraction results, including:

[0060] Step S3021, construct a syntactic dependency graph for the word vector to obtain a feature matrix and an adjacency matrix of the syntactic dependency graph. In the syntactic dependency graph, each node represents a segmented word, and the edge represents the dependency relationship between words.

[0061] We represent the syntactic dependencies between words in electronic medical record text sequences (including grammatical connections and subordinate relationships between words) as a graph structure, namely, a syntactic dependency graph, to better extract complex semantic relationships in sentences, thereby improving the ability to recognize nested entities.

[0062] In one embodiment, LTP tools are used to perform word segmentation, part-of-speech tagging, and syntactic dependency parsing. Based on the parsing results, a syntactic dependency graph is constructed. Each node of the syntactic dependency graph is a word after word segmentation, and the edges represent the dependency relationship between words. , after LTP is used for word segmentation, a word sequence is obtained. LTP is used to perform part-of-speech tagging on each word to obtain a word set with part-of-speech tagging, and then LTP is used to perform syntactic analysis on the word set with part-of-speech tagging to obtain a dependency relationship set ,in It is a dependency head word. is a dependent term, express and The dependency relationship type between them, h and d represent the indexes of the dependency head word and the dependency sub-word respectively. The dependency head word is the dominant word in the syntactic dependency relationship and the grammatical dominator of other words.

[0063] The dependency head word determines the syntactic function and structure of the dependency sub-words; the dependency sub-words are subordinate words in the syntactic dependency relationship and are words dominated by the dependency head word. The existence and grammatical function of the dependency sub-words depend on the dependency head word. Common types of dependency relationships include: noun subjects, direct objects, noun modifiers, and auxiliary verbs. According to the dependency relationship set D, a syntactic dependency graph is constructed. First, the node set represents the set of words in the sentence, where each node represents a word in the segmentation result, and the feature matrix of the syntactic dependency graph is constructed according to the node combination. ; Secondly, the edge set represents the set of dependency relationships between words. The adjacency matrix of the syntactic dependency graph is constructed based on the edge set . Adjacency Matrix Based on Syntactic Dependency Graph Indicates the dependency relationship between nodes. If there is a dependency relationship ,but ,in Indicates the weight of the dependency relationship, which can be set to 1. If there is specific weight information, different weights can be set according to the dependency type.

[0064] Thus, the syntactic dependency graph is obtained through syntactic analysis and can represent the dependency relationship between words in a sentence. For example, in "chronic hepatitis patients", "hepatitis" depends on "chronic" and "patient" depends on "hepatitis". The word-level syntactic dependency graph can help the model understand the structure of the sentence and the dependency relationship between words, which helps to better identify complex named entities.

[0065] Step S3022, perform CGCN feature extraction on the feature matrix and adjacency matrix of the syntactic dependency graph to obtain the syntactic dependency graph feature extraction result.

[0066] In the embodiment of the present application, CGCN is used to perform multi-level feature extraction and fusion of character-level sequence graphs and word-level syntactic dependency graphs, thereby achieving nested feature extraction.

[0067] Suppose we have a Chinese electronic medical record text:

[0068] "The patient was diagnosed with coronary atherosclerotic heart disease." In this text, "coronary atherosclerotic heart disease" is an overall disease entity, while "coronary artery" and "heart disease" are nested entities. A sequential graph is constructed with characters as nodes (coronary, shape, ...) and edges as the order relationship between characters (there is an edge between crown and shape, indicating that they are adjacent characters); words are used as nodes (such as "coronary artery", "atherosclerosis", "heart disease"), and edges represent the syntactic dependency relationship between words. For example, "coronary artery" depends on "atherosclerosis", and "heart disease" depends on "coronary atherosclerosis" to construct a syntactic dependency graph. Then, CGCN is used to perform graph convolution on the character-level sequential graph to extract fine-grained semantic information by aggregating the features of each character node and its neighboring nodes; graph convolution is performed on the word-level syntactic dependency graph to extract global syntactic information by aggregating the features of each word node and its dependent neighboring nodes. On the character-level sequential graph, multiple graph convolution layers gradually extract the features of each character node. For example, "coronary", "shape", "movement", and "pulse" are extracted to their own features. On the word-level syntactic dependency graph, multiple graph convolution layers gradually extract the features of each word node. For example, "coronary artery", "atherosclerosis", and "heart disease" are extracted to their own features. Character-level and word-level features are concatenated or weighted summed. For example, the features of "coronary artery" include not only the fine-grained features of "coronary", "shape", "movement", and "pulse", but also the dependency features of the word as a whole in the sentence. After each layer of graph convolution, the character-level features and word-level features are fused to form a new node feature representation. For example, after the first convolution layer, the feature of the "coronary artery" node may be a combination of the features of "coronary", "shape", "movement", and "pulse" and their syntactic dependency features. Through multi-layer graph convolution and cascade operations, feature information is aggregated and transmitted layer by layer, and finally a comprehensive feature representation is formed, thereby realizing nested feature extraction.

[0069] The applicant found in the research that if traditional sequence models such as LSTM and BiLSTM-CRF are used to process nested entities, they perform poorly because they can only process sequential information linearly. In the embodiment of the present application, CGCN is combined for processing, which can simultaneously process character-level and word-level information, extract and fuse features layer by layer through cascade operations, so as to better identify nested entities, and extract and fuse features at different levels to form a comprehensive feature representation. For example, by cascading character-level and word-level graph convolution features, fine-grained and global semantic information can be comprehensively utilized.

[0070] GCN updates the features of nodes by performing convolution operations on the graph. Each node is determined by the features of its neighboring nodes and itself. The feature extraction layer uses multiple simple GCN models in cascade to propagate and aggregate information layer by layer, so that each node can obtain features from more distant nodes. Each layer of GCN learns the information of adjacent nodes with different receptive field sizes through the setting of different convolution kernels.

[0071] For the graph structure, the adjacent nodes of the graph are not fixed, so the operation of graph convolution is based on the adjacency matrix, superimposing the neighboring nodes around a node according to different weights. The 0 and 1 in the graph represent the connection status of the nodes. The calculation formula for each layer of graph convolution can be expressed as:

[0072] ;

[0073] in, Indicates GCN The node feature matrix of the layer contains the node features after the Node features after layer convolution and activation function processing; represents the ReLU activation function, Represents the adjacency matrix of the graph. For a sentence, the rows and columns of the adjacency matrix represent the connection status of the word nodes at the corresponding positions. A value of 1 indicates that there is a connected edge, and a value of 0 indicates that there is no association. It represents the node degree matrix, which is a diagonal matrix whose diagonal elements represent the number of edges connected to the node. Represents the negative quadratic root operation of the node degree matrix, which is used to normalize the adjacency matrix. This process can balance the influence of features between nodes, making the co-occurrence of each node's features on its adjacent nodes more balanced; Indicates GCN Node characteristics of the layer; Indicates The weight matrix of the layer is a trainable parameter of the GCN model. The model adjusts the input features by learning this weight matrix.

[0074] The above formula uses the method of multiplying the adjacency matrix and the node to finally realize the information transmission between neighbor nodes. In order to avoid feature loss and reduce the distinguishability of features, the initial stage of feature extraction will use CGCN to extract features from the sequence graph and the syntactic dependency graph, that is, one or more rounds of GCN operations are performed on the sequence graph and the syntactic dependency graph respectively, and the first-order or multi-order neighbor information is transmitted and updated.

[0075] Step S400, performing CGCN feature extraction on the sequence graph feature extraction result and the syntactic dependency graph feature extraction result to obtain a cascade feature graph; clustering the cascade feature graph to obtain a cluster extraction result.

[0076] During the research, the applicant found that in the electronic medical record text, there is a problem that synonymous entities cannot be effectively identified. For example, "coronary atherosclerotic heart disease" and "coronary heart disease" are two synonymous entities, but in the current recognition technology, they will be identified as two independent entities, and it is impossible to understand that they are synonymous entities.

[0077] In view of this, in an embodiment of the present application, the cascade feature graphs are clustered to obtain a cluster extraction result. In one embodiment, an Affinity Propagation clustering algorithm is used to obtain a cluster extraction result.

[0078] In one embodiment, please refer to Figure 5 , cluster the cascade feature graphs to obtain cluster extraction results, including:

[0079] Step S401, for each node in the cascade feature graph, calculate the similarity between all any two nodes to obtain a similarity matrix.

[0080] In one embodiment, step S401 may include:

[0081] ;

[0082] in, represents the similarity between any two nodes, the first node i and the second node k, represents the Euclidean distance calculation, represents the feature vector of node i, Represents the feature vector of node k.

[0083] For each node in the cascade feature graph, the similarity between any two nodes among all nodes is calculated. The similarity here is calculated using negative Euclidean distance.

[0084] Step S402, initializing the responsibility value matrix and the availability matrix to zero matrices, and performing iterative updates.

[0085] In one embodiment, please refer to Figure 6 , step S402, any iterative update may include:

[0086] Step S4021, updating the responsibility values ​​in the responsibility value matrix, including: for any two nodes, a first node and a second node, updating the responsibility values ​​of the first node and the second node based on the similarity between the first node and the second node and the maximum value of other nodes selected by the first node as cluster centers except the second node.

[0087] In one embodiment, step S4021 can be expressed as:

[0088] ;

[0089] in, is the responsibility value, represents the degree of responsibility of the first node i in selecting the second node k as the cluster center; Represents the similarity between any two nodes, the first node i and the second node k; Indicates that the first node i selects other nodes except the second node k as the maximum value at the cluster center; is the availability value, Indicates that the first node i selects other nodes The degree of availability as a cluster center.

[0090] By updating the responsibility value, It will reflect the support degree of the first node i in selecting the second node k as the cluster center. If the similarity of the second node k Compared with other nodes The sum of the similarity and availability values ​​is greater, then the first node i is more inclined to select the second node k as the cluster center.

[0091] Step S4022, based on the updated responsibility value matrix, the availability value in the availability matrix is ​​updated, including: for any two nodes, the first node and the second node, based on the second node's responsibility value for itself as the cluster center and the sum of the positive responsibility values ​​of other nodes except the first node for selecting the second node as the cluster center, the availability values ​​of the first node and the second node are updated.

[0092] In one embodiment, step S4022 may include:

[0093] ;

[0094] in, It indicates the degree of responsibility of the second node k in choosing itself as the cluster center; Represents all other nodes The second node k is selected as the sum of the positive responsibility values ​​of the cluster center, excluding the first node i and the second node k itself.

[0095] In one embodiment, when i and k are the same node, that is, i=k, step S4022 may further include:

[0096] ;

[0097] in, It indicates that the suitability of the second node k to choose itself as the cluster center depends on the support of all other nodes for the second node k as the cluster center.

[0098] When i and k are the same node, Depends on all other nodes The sum of the positive responsibility values ​​for the second node k indicates the suitability of the second node k itself as the cluster center, which depends on the support of all other nodes for it as the cluster center.

[0099] Based on step S4021 and step S4022, the responsibility value and the availability value are updated alternately until the algorithm converges or reaches a predetermined number of iterations.

[0100] Step S403, determining the cluster center based on the updated responsibility value matrix and the availability matrix, and dividing each node into each cluster according to the cluster center to form a plurality of co-referencing clusters.

[0101] In one embodiment, the cluster center v is determined by the responsibility value matrix and the availability value matrix, and the judgment criterion can be expressed as:

[0102] ;

[0103] It represents the first node with the maximum value among the sum of the responsibility value and the availability value calculated by the second node k and all other first nodes i. The first node with the maximum value is taken as the cluster center of the second node k.

[0104] Step S404: adding edges to the nodes in each coreference cluster, connecting all nodes belonging to the same cluster, and updating the feature matrix and adjacency matrix of the dynamically generated coreference graph.

[0105] Step S405, performing CGCN feature extraction on the feature matrix and adjacency matrix of the co-reference graph to obtain a cluster extraction result.

[0106] In the embodiment of the present application, the Affinity Propagation clustering method is adopted, and the responsibility value and availability value between each pair of nodes in the cascade feature graph structure are updated and calculated by the responsibility value and availability value to obtain the cluster center, and then the same type of entities are divided into the same cluster, and common edges are added to indicate that they are the same type of entities with different descriptions. For example, coronary atherosclerotic heart disease and coronary heart disease, assuming that coronary heart disease is the cluster center, then coronary atherosclerotic heart disease and coronary heart disease belong to the same cluster through calculation, and common edges are added to the two, indicating that they are both the entity of coronary heart disease, but with different descriptions. This can enhance the performance of nested entity recognition.

[0107] In the embodiments of the present application, by adopting the method of adding edges in the graph structure, edges are added between co-referential words of the same type that make up an entity for feature interaction, so that the word features of the composed entity after interaction are close in the vector space, thereby weakening the sequential relationship between different component words in the same entity, that is, learning more position-robust representations for the words of the composed entity, so that an effective entity structure can be recognized even in the case of disordered order.

[0108] Step S500: Based on the input electronic medical record text, obtain the radical feature vector of each radical in the radical set of each character; based on the radical feature vector of each radical, use the semantic similarity matrix to construct a radical semantic similarity graph, and perform CGCN feature extraction on the radical semantic similarity graph to obtain the radical feature extraction result. Among them, in the radical semantic similarity graph, each node represents a radical, and the edge represents the semantic similarity relationship between two radicals.

[0109] Chinese characters are characters that combine form and meaning, and their radicals are of great significance in terms of glyph structure and meaning. For example, entity words related to diseases take "疒" as the radical, such as "epilepsy" or "hemorrhoids", etc., and entity words related to body parts also often take "月" as the radical, such as "face", "eye" or "chest", etc. In order to capture the morphological and semantic features of Chinese characters, this study extracts and constructs a radical semantic similarity graph and uses CGCN for radical feature extraction. In one embodiment, please refer to Figure 7 , step S500 may include:

[0110] Step S501: Based on the input electronic medical record text, perform recursive decomposition of each character by radicals to obtain a radical set.

[0111] For each character in the input electronic medical record text character sequence , perform recursive decomposition by radicals. Among them, for any character , recursive decomposition by radicals can obtain a radical set , where represents the radical set of the nth character in the electronic medical record text character sequence. For example, in "hypertensive disease" represents all the radical sets of "高". represents the pth radical of the nth character, 1 ≤ p ≤ P, and P represents the total number of radicals in the radical set .

[0112] Step S502: Embed each radical in the radical set to obtain the radical feature vector of each radical.

[0113] Here, radical embedding is a function used to map a radical to a higher-dimensional space vector.

[0114] In one embodiment, Radical Embedding is used for encoding to implement radical embedding, and then:

[0115] ;

[0116] in, Indicates radical set The radical feature vector of represents the radical embedding vector of the pth radical. Then we have ,in, Represents the RadicalEmbedding encoding function.

[0117] Step S503, calculating the semantic similarity between every two radical feature vectors in all radical feature vectors, and constructing a semantic similarity matrix.

[0118] In one embodiment, the semantic similarity between any two radical feature vectors can be expressed as:

[0119] ;

[0120] in, represents an element in the semantic similarity matrix D, represents the norm calculation, represents the radical embedding vector of the qth radical, 1≤q≤P.

[0121] Step S504, constructing a radical semantic similarity graph using the semantic similarity matrix to obtain a feature matrix and an adjacency matrix of the radical semantic similarity graph.

[0122] Each node in the radical semantic similarity graph represents a radical, and an edge represents the semantic similarity relationship between two radicals. The radical features of each character are combined by weighted average to obtain the radical feature vector of each character.

[0123] Step S505, performing CGCN feature extraction on the feature matrix and adjacency matrix of the radical semantic similarity graph to obtain a radical feature extraction result.

[0124] Compared with the traditional method of using convolutional neural networks to extract radical features, on the one hand, this application puts the radicals in a graph structure and uses CGCN to extract features from the graph structure. On the other hand, a semantic similarity graph is constructed for the radicals of each character to help capture the similarities and relationships between Chinese characters. This graph structure can effectively represent complex character relationships, which is very important for identifying nested entities because nested entities usually have complex contexts and hierarchical relationships. Graph convolution performs well when processing graph structured data. By performing feature extraction through CGCN, we can make full use of the information in the radical semantic similarity graph to learn the deep semantic relationship between Chinese characters and their radicals. This helps to improve the model's ability to recognize nested named entities, because nested entities usually require comprehensive analysis of multi-level and multi-granular information.

[0125] Step S600, based on the context feature representation vector, clustering extraction results and radical feature extraction results, span prediction is performed to achieve entity recognition of electronic medical records.

[0126] When the input text is "Metformin: 0.25g, Glibenclamide: 2.5mg, Acarbose: 50mg", multiple entities need to be identified. If there is no relative position information of the entities, the predictor is not sensitive enough to the length and span of the entities, and it is easy to predict the head and tail combination of any two entities as a target entity, for example, predicting an entity like "Metformin: 0.25g, Glibenclamide". In view of this, if there is relative position information of the entities, the predictor can be more sensitive to the length and span of the entities, so as to more accurately identify the real entities.

[0127] In one embodiment, please refer to Figure 8 , step S600 may include:

[0128] Step S601, performing feature fusion on the context feature representation vector and the clustering extraction result to obtain a fused feature graph.

[0129] In one embodiment, please refer to Fig. 9 , step S601 may include:

[0130] Step S6011, stacking the context feature representation vector and the cluster extraction result to obtain an input feature matrix.

[0131] Step S6012, use the multi-head self-attention mechanism to process the input feature matrix to obtain a fused feature map.

[0132] The multi-head self-attention mechanism contains multiple independent attention heads, each with its own projection matrix for calculating queries, keys, and values. For each attention head, the query matrix, key matrix, and value matrix are defined. Then, the attention score of each head is calculated using the scaling point and attention, including:

[0133] ;

[0134] Where Q, K and V represent the query matrix, key matrix and value matrix respectively. represents the dimension of the key vector, represents the attention score, T represents transposition, represents the activation function,

[0135] The outputs of all attention heads are concatenated and a linear transformation is performed to obtain the output of the multi-head attention. Then, the output of the multi-head attention is residually connected to the input feature matrix H and the layer is normalized to obtain the fused feature map. ,include:

[0136] ;

[0137] Where H represents the input feature matrix, represents the fused feature map, represents the residual connection, Represents the output of multi-head attention.

[0138] Step S602: Input the fused feature map to the first feedforward neural network and the second feedforward neural network respectively to obtain the beginning and end of the span of each word.

[0139] In one embodiment, step S602 may include:

[0140] ;

[0141] ;

[0142] in, and Respectively represent the beginning and end of the span of any word vector u, and represent the first feedforward neural network and the second feedforward neural network respectively, and They respectively represent the first character feature vector and the last character feature vector of any word vector u in the fused feature map.

[0143] Step S603, calculating the span score of each word vector.

[0144] In one embodiment, a biaffine attention mechanism Biaffine model is used to create a rating matrix, and step S603 may include:

[0145] ;

[0146] in, represents the span score of any word vector u, represents the weight matrix of the bi-affine attention mechanism, represents the weight matrix of the linear transformation, Represents the deviation, which is learned based on a preset deviation. Represents feature concatenation.

[0147] Step S604: Based on the span score of each word vector, the span score of the fused feature map is obtained.

[0148] Step S605 , obtaining the radical feature vector of each character in the radical feature extraction result, and obtaining the start and end of the span belonging to all entity categories.

[0149] A radical feature vector representing each character in the radical feature extraction result is obtained, and the radical feature vector of each character is input into the third feedforward neural network and the fourth feedforward neural network respectively to obtain the beginning and end of the span belonging to any entity category, thereby obtaining the beginning and end of the span belonging to all entity categories.

[0150] Step S606, based on the start and end of the span of all characters belonging to any entity category, the start and end of the span corresponding to every two characters, calculate the score matrix belonging to each entity category, and add the score matrices of all entity categories to obtain the span score of the radical feature extraction result.

[0151] Based on the start and end of the span corresponding to any two characters in the start and end of the span under any entity category of all characters, a first score of one character to another character belonging to the any entity category is calculated, including:

[0152] ;

[0153] in, Represents entity category The first score, Indicates that any character belongs to the entity category The beginning of the span, Indicates that any character belongs to the entity category The end of the span, Represents the transformation matrix, which is the position To location The relative position relationship.

[0154] The introduction of the transformation matrix enables position-dependent encoding or adjustment of these vectors before calculating the dot product of the eigenvectors, thereby enhancing the ability to capture relative position information.

[0155] A first score matrix including all first scores belonging to any entity category is input into a multi-layer perceptron (MLP) to calculate a score matrix belonging to any entity category, and the score matrices of all entity categories are added together to obtain a span score corresponding to the radical feature extraction result.

[0156] The first score matrix, as a preliminary score matrix, is only the result of a linear combination. MLP further processes these scores through multiple layers of nonlinear activation functions to capture more complex patterns and relationships. Secondly, the first score matrix may only consider some features or simple relationships, while MLP can fuse the interactive information between different features through a multi-layer structure to generate more representative scores.

[0157] Step S607, based on the span score of the fused feature graph and the span score of the radical feature extraction result, the probability of each character belonging to each entity category within a given span is calculated to obtain a prediction result of the predicted entity category.

[0158] For the above-mentioned electronic medical record entity recognition neural network, the training process is based on the following loss functions, including:

[0159] ;

[0160] in, The loss function is a span-based cross entropy loss function to better handle the entity boundary prediction problem in the nested named entity recognition task; It indicates the probability of predicting the cth character as the starting position of the entity and the dth character as the ending position of the entity; log indicates logarithmic calculation.

[0161] The goal of this part is to maximize the model's prediction probability of the true entity span. The goal of this part is to minimize the model's predicted probability for non-entity spans.

[0162] In this way, the training process can be simplified and the performance in complex nested named entity recognition tasks can be improved.

[0163] Based on the above implementation scheme, the powerful representation ability of graph structure for unstructured information is used to construct sequence graph and syntactic dependency graph, and the cascaded graph convolutional neural network is used as the graph structure feature extraction module to capture local feature information and linear sequence information, grammatical structure information and global syntactic dependency information of different granularities; secondly, a bidirectional long short-term memory network is used to extract context information; in addition, a radical similarity graph is constructed, and cascaded graph convolution is used to extract radical information and its similarity, so as to understand the semantic structure and morphological characteristics of Chinese characters at a deeper level. By predicting the span through fusion features, the nested named entity recognition of Chinese electronic medical records with multi-feature fusion of cascaded graph convolutional neural network can be realized, which can more accurately identify nested entities in electronic medical records.

[0164] In one embodiment of the present application, a computer-readable storage medium is provided, on which a program is stored. The stored program includes a method that can be loaded by a processor and process any of the above embodiments.

[0165] Those skilled in the art will appreciate that all or part of the functions of the various methods in the above-mentioned embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, and the storage medium can include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to implement the above-mentioned functions. For example, the program is stored in the memory of the device, and when the program in the memory is executed by the processor, all or part of the above-mentioned functions can be implemented. In addition, when all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can also be stored in a storage medium such as a server, another computer, disk, optical disk, flash disk or mobile hard disk, and can be downloaded or copied and saved in the memory of the local device, or the system of the local device is updated, and when the program in the memory is executed by the processor, all or part of the functions in the above-mentioned embodiments can be implemented.

[0166] The above specific examples are used to illustrate the present invention, which is only used to help understand the present invention and is not intended to limit the present invention. For those skilled in the art, according to the concept of the present invention, some simple deductions, modifications or substitutions can be made.

Claims

1. A method for recognizing nested named entities in electronic medical records, characterized in that: include: Access to electronic medical record texts; The electronic medical record text is used as the input of the trained electronic medical record entity recognition neural network to perform nested named entity recognition to obtain an entity recognition result; including: Perform character-level encoding and word-level encoding based on the input electronic medical record text to obtain character vectors and word vectors; The word vector is used as the input of the BiLSTM feature extraction sub-network to perform feature extraction to obtain a context feature representation vector; The character vector is sequentially subjected to sequential graph construction and CGCN feature extraction to obtain a sequential graph feature extraction result, and the word vector is sequentially subjected to syntactic dependency graph construction and CGCN feature extraction to obtain a syntactic dependency graph feature extraction result; Performing CGCN feature extraction on the sequence graph feature extraction results and the syntactic dependency graph feature extraction results to obtain a cascade feature graph; clustering the cascade feature graph to obtain a cluster extraction result; Based on the input electronic medical record text, a radical feature vector of each radical in the radical set of each character is obtained; based on the radical feature vector of each radical, a radical semantic similarity graph is constructed using a semantic similarity matrix, and CGCN feature extraction is performed on the radical semantic similarity graph to obtain a radical feature extraction result; in the radical semantic similarity graph, each node represents a radical, and an edge represents a semantic similarity relationship between two radicals; Based on the context feature representation vector, clustering extraction results and radical feature extraction results, span prediction is performed to achieve entity recognition of the electronic medical record; The method of performing span prediction based on the context feature representation vector, clustering extraction results and radical feature extraction results to realize entity recognition of electronic medical records includes: Performing feature fusion on the context feature representation vector and the clustering extraction result to obtain a fused feature graph; Inputting the fused feature map into the first feedforward neural network and the second feedforward neural network respectively to obtain the beginning and end of the span of each word; Calculate the span score of each word vector; Based on the span score of each word vector, the span score of the fused feature map is obtained; Obtain the radical feature vector of each character in the radical feature extraction result, and obtain the start and end of the span belonging to all entity categories; Based on the start and end of the span of all characters belonging to any entity category, the start and end of the span corresponding to every two characters are calculated to obtain a score matrix belonging to each entity category, and the score matrices of all entity categories are added together to obtain the span score of the radical feature extraction result; Based on the span score of the fused feature map and the span score of the radical feature extraction result, the probability of each character belonging to each entity category within a given span is calculated, and the prediction result of the predicted entity category is obtained.

2. The method for recognizing nested named entities in electronic medical records according to claim 1, characterized in that: The sequential graph construction and CGCN feature extraction are performed on the character vector in sequence to obtain a sequential graph feature extraction result, including: Constructing a sequence graph for the character vector to obtain a feature matrix and an adjacency matrix of the sequence graph; in the sequence graph, each node represents a character, and an edge represents a sequential relationship between adjacent characters; Perform CGCN feature extraction on the feature matrix and adjacency matrix of the sequence graph to obtain the sequence graph feature extraction result; The step of sequentially constructing a syntactic dependency graph and extracting CGCN features from the word vector to obtain a syntactic dependency graph feature extraction result includes: Constructing a syntactic dependency graph for the word vector to obtain a feature matrix and an adjacency matrix of the syntactic dependency graph; in the syntactic dependency graph, each node represents a segmented word, and the edge represents the dependency relationship between words; Perform CGCN feature extraction on the feature matrix and adjacency matrix of the syntactic dependency graph to obtain the syntactic dependency graph feature extraction result.

3. The method for recognizing nested named entities in electronic medical records according to claim 1, characterized in that: The clustering of the cascade feature graph to obtain a cluster extraction result includes: For each node in the cascade feature graph, calculate the similarity between all two nodes to obtain a similarity matrix; Initialize the responsibility value matrix and the availability matrix to zero matrix and perform iterative updates; for any iterative update, including: Updating the responsibility values ​​in the responsibility value matrix includes: for any two nodes, a first node and a second node, updating the responsibility values ​​of the first node and the second node based on the similarity between the first node and the second node and the maximum value of other nodes selected by the first node as cluster centers except the second node; Based on the updated responsibility value matrix, the availability values ​​in the availability matrix are updated, including: for any two nodes, a first node and a second node, based on the sum of the responsibility value of the second node for itself as a cluster center and the positive responsibility values ​​of other nodes other than the first node for selecting the second node as the cluster center, the availability values ​​of the first node and the second node are updated; Determine the cluster center based on the updated responsibility value matrix and availability matrix, and divide each node into each cluster according to the cluster center to form multiple co-referencing clusters; For each node in the co-reference cluster, add edges to connect all nodes belonging to the same cluster, and update the feature matrix and adjacency matrix of the dynamically generated co-reference graph; CGCN feature extraction is performed on the feature matrix and adjacency matrix of the co-reference graph to obtain the clustering extraction results.

4. The method for recognizing nested named entities in electronic medical records as claimed in claim 3, characterized in that: For each node in the cascade feature graph, the similarity between all two arbitrary nodes is calculated, including: ; in, represents the similarity between any two nodes, the first node i and the second node k, represents the Euclidean distance calculation, represents the feature vector of node i, Represents the feature vector of node k.

5. The method for recognizing nested named entities in electronic medical records as claimed in claim 3, characterized in that: The method of updating the responsibility values ​​of any two nodes, a first node and a second node, based on the similarity between the first node and the second node and the maximum value of other nodes selected by the first node as cluster centers except the second node, comprises: ; in, is the responsibility value, represents the degree of responsibility of the first node i in selecting the second node k as the cluster center; Represents the similarity between any two nodes, the first node i and the second node k; Indicates that the first node i selects other nodes except the second node k as the maximum value at the cluster center; is the availability value, Indicates that the first node i selects other nodes The degree of availability as a cluster center; The method of updating the availability values ​​of the first node and the second node for any two nodes, a first node and a second node, based on the second node's responsibility value for itself as a cluster center and the sum of positive responsibility values ​​of other nodes other than the first node selecting the second node as the cluster center, comprises: ; in, It indicates the degree of responsibility of the second node k in choosing itself as the cluster center; Represents all other nodes The second node k is selected as the sum of the positive responsibility values ​​of the cluster centers, excluding the first node i and the second node k itself.

6. The method for recognizing nested named entities in electronic medical records according to claim 5, characterized in that: The method of updating the availability values ​​of the first node and the second node for any two nodes, a first node and a second node, based on the second node's responsibility value for itself as a cluster center and the sum of the positive responsibility values ​​of other nodes other than the first node for selecting the second node as the cluster center, further includes: When i=k, ; in, It indicates that the suitability of the second node k to choose itself as the cluster center depends on the support of all other nodes for the second node k as the cluster center.

7. The method for recognizing nested named entities in electronic medical records according to claim 1, characterized in that: The method of obtaining a radical feature vector of each radical in the radical set of each character based on the input electronic medical record text; constructing a radical semantic similarity graph based on the radical feature vector of each radical using a semantic similarity matrix, and performing CGCN feature extraction on the radical semantic similarity graph to obtain a radical feature extraction result includes: Based on the input electronic medical record text, each character is recursively decomposed into radicals to obtain a radical set; Embed each radical in the radical set to obtain a radical feature vector of each radical; Calculate the semantic similarity between every two radical feature vectors in all radical feature vectors and construct a semantic similarity matrix; The semantic similarity matrix is ​​used to construct a radical semantic similarity graph to obtain a feature matrix and an adjacency matrix of the radical semantic similarity graph; The feature matrix and adjacency matrix of the radical semantic similarity graph are subjected to CGCN feature extraction to obtain the radical feature extraction result.

8. The method for recognizing nested named entities in electronic medical records according to claim 1, characterized in that: The step of fusing the context feature representation vector and the clustering extraction result to obtain a fused feature graph includes: The context feature representation vector and the cluster extraction result are stacked to obtain an input feature matrix; The multi-head self-attention mechanism is used to process the input feature matrix to obtain a fused feature map.

9. The method for recognizing nested named entities in electronic medical records according to claim 1, characterized in that: The calculation of the span score of each word vector includes: ; in, represents the span score of any word vector u, represents the weight matrix of the bi-affine attention mechanism, represents the weight matrix of the linear transformation, Indicates the deviation, which is learned based on a preset deviation; and Respectively represent the beginning and end of the span of any word vector u, T represents transposition, , , and represent the first feedforward neural network and the second feedforward neural network respectively, and They represent the first character feature vector and the last character feature vector of any word vector u in the fusion feature graph, respectively. Represents feature concatenation.