A medical symptom entity information normalization method and system
By defining a standard symptom category list in the medical dialogue system and utilizing embedding encoding and entity information normalization models, the problem of entity information ambiguity caused by multiple patient description methods is solved, achieving efficient symptom entity information normalization and recognition.
Patent Information
- Application Number
- CN202210736314.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-27
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2042-06-27
AI Technical Summary
In medical dialogue systems, the multiple ways patients describe the same symptom can lead to ambiguity in entity information, which existing technologies struggle to process and normalize efficiently.
A standard symptom category list is defined by combining entity recognition methods with disease information. Ambiguity is eliminated and processing complexity is reduced through embedding encoding and entity information normalization models.
It achieves efficient normalization of medical symptom entity information, reduces the complexity of entity information processing, and enhances the model's recognition ability.
Smart Images

Figure CN115148367B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical dialogue systems, and in particular to a medical symptom entity information normalization method and system. Background Art
[0002] In the medical dialogue system, symptom information can be extracted through named entity recognition (NER). However, due to the diversity of oral expressions, patients may describe the same symptom in many different ways. For example, the symptom of "itching" may be described as "itching", "very itchy", "always wanting to scratch", etc. Therefore, in the response process configuration of the dialogue system, if you want to set up the process related to itching, you need to exhaustively list a large number of expressions, which is time-consuming and labor-intensive and cannot solve the problem from the root.
[0003] Therefore, there is an urgent need to develop a method for normalizing medical symptom entity names that can solve the above technical difficulties. Summary of the invention
[0004] The main purpose of the present invention is to overcome the above-mentioned defects in the prior art and to propose a medical symptom entity information normalization method and system, which can normalize the results in combination with the entity recognition method, eliminate entity information ambiguity, and reduce the complexity of entity information processing.
[0005] The present invention adopts the following technical solution:
[0006] A medical symptom entity information normalization method, comprising:
[0007] defining a list of standard symptom categories based on disease information, including but not limited to disease characteristics, disease types, and disease physiological phenomena;
[0008] For each disease data in the original data set, the entity recognition method is used to identify the original symptoms contained therein. The disease data is labeled by combining the original symptoms extracted by the entity recognition method and the text of the disease data itself. Its label category is one of the categories in the standard symptom list. After labeling, it is used as the model training data set;
[0009] Perform embedding encoding on each sentence in the training data set to obtain a sentence matrix X1 with a dimension of [40, 80]. Perform embedding encoding on each symptom in the training data set to obtain an entity matrix X2 with a dimension of [40, 80]. Perform embedding encoding on each standard symptom category in the training data set to obtain a vector Y with a dimension of [N, 1], where N is the number of defined standard symptom categories, and each dimension of the vector represents a category. The dimension value corresponding to this standard symptom category is 1, and the other dimension values are 0.
[0010] The sentence matrix X1 and entity matrix X2 in the training data are used to train the entity information normalization model to obtain the entity information normalization model after training;
[0011] The disease sentences are recognized by the entity recognition method, and the symptom entity information recognized by the entity recognition method is extracted; the sentence information and symptom entity information are embedded and encoded, and the encoded sentence matrix and entity matrix are input into the trained entity information normalization model to obtain a vector of dimension [1, N], and the dimension of the element with the largest value in the N-dimensional vector output by the entity information normalization model is determined to obtain the corresponding category after normalization.
[0012] Specifically, the entity recognition method includes but is not limited to: HMM model, CRF model and RNN model method.
[0013] Specifically, the entity information normalization model includes: a sentence encoding module, an entity symptom encoding module, a sentence batch normalization module, an entity symptom normalization module, a sentence self-attention module, a first splicing module, a first self-attention module, a second splicing module and a fully connected layer.
[0014] Specifically, the sentence matrix X1 and the entity matrix X2 in the training data are used to train the entity information normalization model to obtain the trained entity information normalization model, which specifically includes:
[0015] Input sentence matrix X1, randomly extract at a ratio of 0.5, input sentence batch normalization module to obtain sentence normalization matrix X1a, dimension is [40, 80], input sentence normalization matrix X1a into sentence self-attention module, obtain sentence vector X1b, dimension is [1, 80];
[0016] Input entity matrix X2, randomly extract at a ratio of 0.5, and input it into the entity batch normalization module to obtain entity normalization matrix X2a with a dimension of [8, 80];
[0017] Input the sentence standardization matrix X1a and entity standardization matrix X2a into the first concatenation module for concatenation to obtain a standardized concatenation matrix X3 with a dimension of [48,80];
[0018] Input the normalized concatenation matrix X3 into the first self-attention module to obtain the normalized attention vector X4 with a dimension of [1,80];
[0019] The sentence vector X1b and the normalized attention vector X4 are input into the second concatenation module for concatenation to obtain a combined vector X5 with a dimension of [1,160];
[0020] The combined vector X5 is input into the fully connected layer and normalized by softmax to obtain the output vector Y', with a dimension of [1, N]. After the combined vector X5 is input into the fully connected layer, a vector with a preset dimension of [1, N] is obtained. Each element of the vector with a preset dimension of [1, N] is normalized by softmax to obtain the vector Y'. The dimension of vector Y' is [1, N], and the sum of all element values is 1. The softmax formula is Where z is the element of vector Y', and i takes the value of 1, 2, 3...N;
[0021] The cross entropy of the output vector Y' and Y is calculated, and the optimization is performed step by step until the iteration conditions are met to obtain the entity information normalization model after training.
[0022] Another aspect of the present invention provides a medical symptom entity information normalization system, including:
[0023] Definition unit: defining a standard symptom category list according to disease information, wherein the disease information includes but is not limited to disease characteristics, disease types, and disease physiological phenomena;
[0024] Labeling unit: For each disease data in the original data set, the original symptoms contained in it are identified by using the entity recognition method. The disease data is labeled by combining the original symptoms extracted by the entity recognition method and the text of the disease data itself. Its label category is one of the categories in the standard symptom list. After labeling, it is used as the model training data set;
[0025] Coding unit: embedding encoding is performed on each sentence information in the training data set to obtain a sentence matrix X1 with a dimension of [40, 80]. Embedding encoding is performed on each symptom information in the training data set to obtain an entity matrix X2 with a dimension of [40, 80]. Embedding encoding is performed on each standard symptom category in the training data set to obtain a vector Y with a dimension of [N, 1], where N is the number of defined standard symptom categories, each dimension of the vector represents a category, the dimension value corresponding to this standard symptom category is 1, and the other dimension values are 0;
[0026] Training unit: using the sentence matrix X1 and entity matrix X2 in the training data to train the entity information normalization model, and obtaining the entity information normalization model after training;
[0027] Category determination unit: Use entity recognition method to identify disease sentences and extract symptom entity information identified by the entity recognition method; embedding encode sentence information and symptom entity information, input the encoded sentence matrix and entity matrix into the trained entity information normalization model to obtain a vector of dimension [1, N], determine the dimension of the element with the largest value in the N-dimensional vector output by the entity information normalization model, and obtain the corresponding category after normalization.
[0028] Specifically, the entity recognition method includes but is not limited to: HMM model, CRF model and RNN model method.
[0029] Specifically, the entity information normalization model includes: a sentence encoding module, an entity symptom encoding module, a sentence batch normalization module, an entity symptom normalization module, a sentence self-attention module, a first splicing module, a first self-attention module, a second splicing module and a fully connected layer.
[0030] Specifically, the training unit uses the sentence matrix X1 and the entity matrix X2 in the training data to train the entity information normalization model to obtain the entity information normalization model after training, which specifically includes:
[0031] Input sentence matrix X1, randomly extract at a ratio of 0.5, input sentence batch normalization module to obtain sentence normalization matrix X1a, dimension is [40, 80], input sentence normalization matrix X1a into sentence self-attention module, obtain sentence vector X1b, dimension is [1, 80];
[0032] Input entity matrix X2, randomly extract at a ratio of 0.5, and input it into the entity batch normalization module to obtain entity normalization matrix X2a with a dimension of [8, 80];
[0033] Input the sentence standardization matrix X1a and entity standardization matrix X2a into the first concatenation module for concatenation to obtain a standardized concatenation matrix X3 with a dimension of [48,80];
[0034] Input the normalized concatenation matrix X3 into the first self-attention module to obtain the normalized attention vector X4 with a dimension of [1,80];
[0035] The sentence vector X1b and the normalized attention vector X4 are input into the second concatenation module for concatenation to obtain a combined vector X5 with a dimension of [1,160];
[0036] The combined vector X5 is input into the fully connected layer and normalized by softmax to obtain the output vector Y' with a dimension of [1, N]. After the combined vector X5 is input into the fully connected layer, a vector with a preset dimension of [1, N] is obtained. Each element of the vector with a preset dimension of [1, N] is normalized by softmax to obtain the vector Y'; the dimension of vector Y' is [1, N], and the sum of all element values is 1; the softmax formula is Where z is the element of vector Y', and i takes the value of 1, 2, 3...N;
[0037] The cross entropy of the output vector Y' and Y is calculated, and the optimization is performed step by step until the iteration conditions are met to obtain the entity information normalization model after training.
[0038] On the other hand, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method steps for normalizing medical symptom entity information when executing the computer program.
[0039] Yet another aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements the above-mentioned method steps for normalizing medical symptom entity information.
[0040] It can be seen from the above description of the present invention that, compared with the prior art, the present invention has the following beneficial effects:
[0041] (1) The present invention proposes a method for normalizing medical symptom entity information. First, a standard symptom category list is defined based on disease information, and the original symptoms contained therein are identified using an entity recognition method. The disease data is labeled in combination with the text of the actual disease data itself to serve as a model training data set. Embedding encoding is performed on each sentence and each symptom information in the training data set, and an entity information normalization model is trained to obtain a trained entity information normalization model. The medical data to be normalized is input into the trained entity information normalization model to obtain a vector of dimension [1, N]. The dimension of the element with the largest value in the N-dimensional vector output by the entity information normalization model is determined to obtain the corresponding category after normalization. The method provided by the present invention can normalize the results in combination with the entity recognition method, eliminate entity information ambiguity, and reduce the complexity of entity information processing.
[0042] (2) The present invention proposes a method for normalizing medical symptom entity information, which takes into account the text of the actual disease data itself and the medical symptoms. In constructing an entity information normalization model, it includes first encoding modules for the sentence matrix and the entity matrix. In order to comprehensively learn the sentence matrix information, a sentence self-attention module branch is designed. In this model, the sentence information and symptom information are fully integrated through the first splicing module, the first self-attention module, the second splicing module and the fully connected layer, so that the recognition ability of the model is greatly enhanced. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is an application environment diagram of a medical symptom entity information normalization method in an embodiment of the present invention;
[0044] Figure 2 This is a flow chart of a method for normalizing medical symptom entity information in an embodiment of the present invention;
[0045] Figure 3 A schematic diagram of the structure of an entity information normalization model provided by an embodiment of the present invention;
[0046] Figure 4 A diagram of the architecture of a medical symptom entity information normalization system provided by an embodiment of the present invention;
[0047] Figure 5 A schematic diagram of an electronic device provided by an embodiment of the present invention;
[0048] Figure 6 A schematic diagram of an embodiment of a computer-readable storage medium provided in an embodiment of the present invention.
[0049] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. DETAILED DESCRIPTION
[0050] This application provides a method for normalizing medical symptom entity information. Figure 1 An exemplary system architecture 100 of a medical symptom entity information normalization method or a medical symptom entity information normalization system to which an embodiment of the present application can be applied is shown.
[0051] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0052] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various applications, such as data processing applications, file processing applications, etc., can be installed on terminal devices 101, 102, 103.
[0053] Terminal devices 101, 102, 103 can be hardware or software. When terminal devices 101, 102, 103 are hardware, they can be various electronic devices, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, etc. When terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. They can be implemented as multiple software or software modules (for example, software or software modules used to provide distributed services), or they can be implemented as a single software or software module. No specific limitation is made here.
[0054] The server 105 may be a server that provides various services, such as a background data processing server that processes files or data uploaded by the terminal devices 101, 102, and 103. The background data processing server may process the acquired files or data and generate processing results.
[0055] It should be noted that the medical symptom entity information normalization method provided in the embodiment of the present application can be executed by the server 105 or by the terminal devices 101, 102, and 103. Accordingly, a medical symptom entity information normalization system can be set in the server 105 or in the terminal devices 101, 102, and 103.
[0056] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided as required. In the case where the processed data does not need to be obtained remotely, the above device architecture may not include a network, but only a server or a terminal device.
[0057] like Figure 2 , is a flow chart of a medical symptom entity information normalization method provided by an embodiment of the present invention, specifically comprising:
[0058] S201: defining a standard symptom category list according to disease information, wherein the disease information includes but is not limited to disease characteristics, disease types, and disease physiological phenomena;
[0059] The standard symptom category list definition must meet specific task requirements, and there should be no overlapping definitions between symptom categories.
[0060] S202: for each piece of disease data in the original data set, the original symptoms contained therein are identified by using the entity recognition method, and the disease data is labeled by combining the original symptoms extracted by the entity recognition method and the text of the disease data itself. The label category is one of the categories in the standard symptom list, and after labeling, it is used as the model training data set;
[0061] Named Entity Recognition is a common task in natural language processing and is widely used. Named entities usually refer to entities in the text that have special meaning or strong referentiality, usually including names of people, places, institutions, time, proper nouns, etc. The NER system extracts the above entities from unstructured text and can identify more categories of entities according to business needs, such as product names, models, prices, etc.
[0062] The present invention aims to identify entities of interest in text, such as identity, part, symptom, address, and time. The identified entities can be used in various downstream applications, such as de-identification and information extraction systems based on patient records, and can also be used as features of machine learning systems for other natural language processing tasks. For example, the following example: My head hurts. "Head" is a "part" entity, and "hurts" is a "symptom" entity
[0063] The goal of the NER problem is to extract text fragments of specific required entities from text. For this task, rule-based methods and model-based methods are usually used;
[0064] For entities with special contexts, or texts with many features, the rule-based approach is simple and effective.
[0065] For example, to extract the price of an item in a text, if all the prices of goods in the text are in the form of "number + yuan", you can use the regular expression "\d*\.?\d+yuan" to extract it. As the amount of corpus increases, the situation becomes more and more complicated, conflicts may occur between rules, and the entire system may become unmaintainable. The rule-based method is suitable for extraction tasks in semi-structured or relatively standardized texts, and can achieve certain results in combination with business needs. Advantages: simple and fast, Disadvantages: poor applicability, high maintenance cost, and even unmaintainable in the later stage;
[0066] The embodiment of the present invention adopts a model-based entity recognition method, common models include HMM, CRF, RNN and the like.
[0067] The HMM model is a generative model that includes two sequences and three matrices: the observation sequence, the hidden sequence, the initial state probability matrix, the state transition probability matrix, and the emission probability matrix. Usually, we need to get the hidden sequence based on the observation sequence and the three matrices.
[0068] CRF (Conditional random field) is a discriminant model. Conditional random field is the Markov random field of random variable Y given random variable X. Markov random field is a probabilistic undirected graph model that satisfies pairwise, local and global Markov properties. For sequence labeling problems, linear chain conditional random fields are generally used. In theory, the performance of CRF algorithm is better than HMM because CRF can use more features, but at the same time, feature selection has a certain impact on the performance of the model. In addition, compared with HMM, the training of CRF model is more complicated and takes relatively long time.
[0069] RNN generally requires a large amount of training data, and CRF performs better on small-scale data sets. In academia, the current popular approach is to combine BILISTM and CRF, drawing on the advantages of both models to achieve better results.
[0070] Prepare a sufficient set of texts describing symptoms by patients as the original data set. For each piece of data in the original data set, use NER to identify the original symptoms it contains. The labeler combines the original symptoms extracted by NER and the text of the data itself to label the data, and its label category is a category in the standard symptom list. For example, there is a "headache" item in the defined standard symptoms. When a piece of data "My head hurts a little" is extracted, use NER to identify the symptom entity information of "My head hurts a little" and mark it as the standard symptom "headache", as shown in the following table. After labeling enough data, it can be used as a model training data set.
[0071] sentence symptom Standard symptoms My head hurts a bit I have a headache. Headache
[0072] S203: Perform embedding encoding on each sentence information in the training data set to obtain a sentence matrix X1 with a dimension of [40, 80], perform embedding encoding on each symptom information in the training data set to obtain an entity matrix X2 with a dimension of [40, 80], and perform embedding encoding on each standard symptom category in the training data set to obtain a vector Y with a dimension of [N, 1], where N is the number of defined standard symptom categories, each dimension of the vector represents a category, the dimension value corresponding to this standard symptom category is 1, and the other dimension values are 0;
[0073] In the embodiment of the present invention, embedding encoding is performed on each sentence information and each symptom information in the training data set, and the low-dimensional original data information is embedded in the high-dimensional data space. In natural language processing, it specifically refers to encoding the text confidence into a vector in the high-dimensional space for calculation.
[0074] S204: training an entity information normalization model using the sentence matrix X1 and the entity matrix X2 in the training data to obtain a trained entity information normalization model;
[0075] Specifically, Figure 3 The entity information normalization model includes: sentence encoding module, entity symptom encoding module, sentence batch normalization module (BatchNormalization), entity symptom normalization module, sentence self-attention module (slef-attention), first concatenation module (concatenate), first self-attention module, second concatenation module and fully connected layer (dense).
[0076] Specifically, the sentence matrix X1 and the entity matrix X2 in the training data are used to train the entity information normalization model to obtain the trained entity information normalization model, which specifically includes:
[0077] Input sentence matrix X1, randomly extract at a ratio of 0.5, input sentence batch normalization module to obtain sentence normalization matrix X1a, dimension is [40, 80], input sentence normalization matrix X1a into sentence self-attention module, obtain sentence vector X1b, dimension is [1, 80];
[0078] Input entity matrix X2, randomly extract at a ratio of 0.5, and input it into the entity batch normalization module to obtain entity normalization matrix X2a with a dimension of [8, 80];
[0079] Input the sentence standardization matrix X1a and entity standardization matrix X2a into the first concatenation module for concatenation to obtain a standardized concatenation matrix X3 with a dimension of [48,80];
[0080] Input the normalized concatenation matrix X3 into the first self-attention module to obtain the normalized attention vector X4 with a dimension of [1,80];
[0081] The sentence vector X1b and the normalized attention vector X4 are input into the second concatenation module for concatenation to obtain a combined vector X5 with a dimension of [1,160];
[0082] The combined vector X5 is input into the fully connected layer and normalized by softmax to obtain the output vector Y' with a dimension of [1, N]. After the combined vector X5 is input into the fully connected layer, a vector with a preset dimension of [1, N] is obtained. Each element of the vector with a preset dimension of [1, N] is normalized by softmax to obtain the vector Y'; the dimension of vector Y' is [1, N], and the sum of all element values is 1; the softmax formula is Where z is the element of vector Y', and i takes the value of 1, 2, 3...N;
[0083] The cross entropy of the output vector Y' and Y is calculated, and the optimization is performed step by step until the iteration conditions are met to obtain the entity information normalization model after training.
[0084] Then calculate the cross entropy of Y' and Y, which is the loss value. The termination condition is when the loss does not decrease for 20 consecutive iterations or the loss is less than 1e-4.
[0085] The present invention proposes a method for normalizing medical symptom entity information, which takes into account the text of the actual disease data itself and the medical symptoms. In constructing an entity information normalization model, it includes first encoding modules for the sentence matrix and the entity matrix. In order to comprehensively learn the sentence matrix information, a sentence self-attention module branch is designed. In the model, the sentence information and the symptom information are fully integrated through the first splicing module, the first self-attention module, the second splicing module and the fully connected layer, so that the recognition ability of the model is greatly enhanced.
[0086] S205: Identify disease sentences using an entity recognition method, and extract symptom entity information identified by the entity recognition method; perform embedding encoding on the sentence information and symptom entity information, input the encoded sentence matrix and entity matrix into the trained entity information normalization model, and obtain a vector of dimension [1, N], determine the dimension of the element with the largest value in the N-dimensional vector output by the entity information normalization model, and obtain the corresponding category after normalization.
[0087] like Figure 4 , another aspect of the present invention provides a medical symptom entity information normalization system, comprising:
[0088] Definition unit 401: defining a standard symptom category list according to disease information, wherein the disease information includes but is not limited to disease characteristics, disease types, and disease physiological phenomena;
[0089] The standard symptom category list definition must meet specific task requirements, and there should be no overlapping definitions between symptom categories.
[0090] Labeling unit 402: for each piece of disease data in the original data set, the original symptoms contained therein are identified by using the entity recognition method, and the disease data is labeled by combining the original symptoms extracted by the entity recognition method and the text of the disease data itself, and its label category is one of the categories in the standard symptom list, and after labeling, it is used as a model training data set;
[0091] Named Entity Recognition is a common task in natural language processing and is widely used. Named entities usually refer to entities in the text that have special meaning or strong referentiality, usually including names of people, places, institutions, time, proper nouns, etc. The NER system extracts the above entities from unstructured text and can identify more categories of entities according to business needs, such as product names, models, prices, etc.
[0092] The present invention aims to identify entities of interest in text, such as identity, part, symptom, address, and time. The identified entities can be used in various downstream applications, such as de-identification and information extraction systems based on patient records, and can also be used as features of machine learning systems for other natural language processing tasks. For example, the following example: My head hurts. "Head" is a "part" entity, and "hurts" is a "symptom" entity
[0093] The goal of the NER problem is to extract text fragments of specific required entities from text. For this task, rule-based methods and model-based methods are usually used;
[0094] For entities with special contexts, or texts with many features, the rule-based approach is simple and effective.
[0095] For example, to extract the price of an item in a text, if all the prices of goods in the text are in the form of "number + yuan", you can use the regular expression "\d*\.?\d+yuan" to extract it. As the amount of corpus increases, the situation becomes more and more complicated, conflicts may occur between rules, and the entire system may become unmaintainable. The rule-based method is suitable for extraction tasks in semi-structured or relatively standardized texts, and can achieve certain results in combination with business needs. Advantages: simple and fast, Disadvantages: poor applicability, high maintenance cost, and even unmaintainable in the later stage;
[0096] The embodiment of the present invention adopts a model-based entity recognition method, common models include HMM, CRF, RNN and the like.
[0097] The HMM model is a generative model that includes two sequences and three matrices: the observation sequence, the hidden sequence, the initial state probability matrix, the state transition probability matrix, and the emission probability matrix. Usually, we need to get the hidden sequence based on the observation sequence and the three matrices.
[0098] CRF (Conditional random field) is a discriminant model. Conditional random field is the Markov random field of random variable Y given random variable X. Markov random field is a probabilistic undirected graph model that satisfies pairwise, local and global Markov properties. For sequence labeling problems, linear chain conditional random fields are generally used. In theory, the performance of CRF algorithm is better than HMM because CRF can use more features, but at the same time, feature selection has a certain impact on the performance of the model. In addition, compared with HMM, the training of CRF model is more complicated and takes relatively long time.
[0099] RNN generally requires a large amount of training data, and CRF performs better on small-scale data sets. In academia, the current popular approach is to combine BILISTM and CRF, drawing on the advantages of both models to achieve better results.
[0100] Prepare a sufficient set of texts describing symptoms by patients as the original data set. For each piece of data in the original data set, use NER to identify the original symptoms it contains. The labeler combines the original symptoms extracted by NER and the text of the data itself to label the data, and its label category is a category in the standard symptom list. For example, there is a "headache" item in the defined standard symptoms. When a piece of data "My head hurts a little" is extracted, use NER to identify the symptom entity information of "My head hurts a little" and mark it as the standard symptom "headache", as shown in the following table. After labeling enough data, it can be used as a model training data set.
[0101]
[0102]
[0103] Coding unit 403: Perform embedding coding on each sentence information in the training data set to obtain a sentence matrix X1 with a dimension of [40, 80], perform embedding coding on each symptom information in the training data set to obtain an entity matrix X2 with a dimension of [40, 80], perform embedding coding on each standard symptom category in the training data set to obtain a vector Y with a dimension of [N, 1], wherein N is the number of defined standard symptom categories, each dimension of the vector represents a category, the dimension value corresponding to the standard symptom category is 1, and the other dimension values are 0;
[0104] In the embodiment of the present invention, embedding encoding is performed on each sentence information and each symptom information in the training data set, and the low-dimensional original data information is embedded in the high-dimensional data space. In natural language processing, it specifically refers to encoding the text confidence into a vector in the high-dimensional space for calculation.
[0105] Training unit 404: training the entity information normalization model using the sentence matrix X1 and the entity matrix X2 in the training data to obtain the trained entity information normalization model;
[0106] Specifically, Figure 3 ,The entity information normalization model includes: sentence encoding module, entity symptom encoding module, sentence batch normalization module, entity symptom normalization module, sentence self-attention module, first splicing module, first self-attention module, second splicing module and fully connected layer.
[0107] Specifically, the sentence matrix X1 and the entity matrix X2 in the training data are used to train the entity information normalization model to obtain the trained entity information normalization model, which specifically includes:
[0108] Input sentence matrix X1, randomly extract at a ratio of 0.5, input sentence batch normalization module to obtain sentence normalization matrix X1a, dimension is [40, 80], input sentence normalization matrix X1a into sentence self-attention module, obtain sentence vector X1b, dimension is [1, 80];
[0109] Input entity matrix X2, randomly extract at a ratio of 0.5, and input it into the entity batch normalization module to obtain entity normalization matrix X2a with a dimension of [8, 80];
[0110] Input the sentence standardization matrix X1a and entity standardization matrix X2a into the first concatenation module for concatenation to obtain a standardized concatenation matrix X3 with a dimension of [48,80];
[0111] Input the normalized concatenation matrix X3 into the first self-attention module to obtain the normalized attention vector X4 with a dimension of [1,80];
[0112] The sentence vector X1b and the normalized attention vector X4 are input into the second concatenation module for concatenation to obtain a combined vector X5 with a dimension of [1,160];
[0113] The combined vector X5 is input into the fully connected layer and normalized by softmax to obtain the output vector Y' with a dimension of [1, N]. After the combined vector X5 is input into the fully connected layer, a vector with a preset dimension of [1, N] is obtained. Each element of the vector with a preset dimension of [1, N] is normalized by softmax to obtain the vector Y'; the dimension of vector Y' is [1, N], and the sum of all element values is 1; the softmax formula is Where z is the element of vector Y', and i takes the value of 1, 2, 3...N;
[0114] Calculate the cross entropy of the output vector Y' and Y, and gradually iterate and optimize until the iteration conditions are met to obtain the entity information normalization model after training; then calculate the cross entropy of Y' and Y, which is the loss value. The termination condition is when the loss no longer decreases for 20 consecutive iterations or the loss is less than 1e-4.
[0115] The present invention proposes a method for normalizing medical symptom entity information, which takes into account the text of the actual disease data itself and the medical symptoms. In constructing an entity information normalization model, it includes first encoding modules for the sentence matrix and the entity matrix. In order to comprehensively learn the sentence matrix information, a sentence self-attention module branch is designed. In the model, the sentence information and the symptom information are fully integrated through the first splicing module, the first self-attention module, the second splicing module and the fully connected layer, so that the recognition ability of the model is greatly enhanced.
[0116] Category determination unit 405: Use entity recognition method to identify disease sentences and extract symptom entity information identified by the entity recognition method; embedding encode the sentence information and symptom entity information, input the encoded sentence matrix and entity matrix into the trained entity information normalization model to obtain a vector with dimension [1, N], determine the dimension of the element with the largest value in the N-dimensional vector output by the entity information normalization model, and obtain the corresponding category after normalization.
[0117] like Figure 5 As shown, an embodiment of the present invention provides an electronic device 500, including a memory 510, a processor 520, and a computer program 511 stored in the memory 520 and executable on the processor 520. When the processor 520 executes the computer program 511, a method for normalizing medical symptom entity information provided by an embodiment of the present invention is implemented.
[0118] Since the electronic device introduced in this embodiment is the device used to implement the embodiment of the present invention, based on the method introduced in the embodiment of the present invention, the technical personnel in this field can understand the specific implementation mode of the electronic device of this embodiment and its various variations. Therefore, how the electronic device implements the method in the embodiment of the present invention is not introduced in detail here. As long as the equipment used by the technical personnel in this field to implement the method in the embodiment of the present invention falls within the scope of protection of the present invention.
[0119] See also Figure 6 , Figure 6 A schematic diagram of an embodiment of a computer-readable storage medium provided in an embodiment of the present invention.
[0120] like Figure 6 As shown, this embodiment provides a computer-readable storage medium 600, on which a computer program 611 is stored. When the computer program 611 is executed by a processor, a method for normalizing medical symptom entity information provided by an embodiment of the present invention is implemented;
[0121] It should be noted that in the above embodiments, the description of each embodiment has its own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0122] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0123] The present invention proposes a method for normalizing medical symptom entity information. First, a standard symptom category list is defined according to disease information, and the original symptoms contained therein are identified by an entity recognition method. The disease data is labeled in combination with the text of the actual disease data itself to serve as a model training data set. Embedding encoding is performed for each sentence and each symptom information in the training data set, and an entity information normalization model is trained to obtain a trained entity information normalization model. The medical data to be normalized is input into the trained entity information normalization model to obtain a vector with a dimension of [1, N], and the dimension of the element with the largest value in the N-dimensional vector output by the entity information normalization model is determined to obtain the corresponding category after normalization. The method provided by the present invention can normalize the result in combination with the entity recognition method, eliminate entity information ambiguity, and reduce the complexity of entity information processing.
[0124] The present invention proposes a method for normalizing medical symptom entity information, which takes into account the text of the actual disease data itself and the medical symptoms. In constructing an entity information normalization model, it includes first encoding modules for the sentence matrix and the entity matrix. In order to comprehensively learn the sentence matrix information, a sentence self-attention module branch is designed. In the model, the sentence information and the symptom information are fully integrated through the first splicing module, the first self-attention module, the second splicing module and the fully connected layer, so that the recognition ability of the model is greatly enhanced.
[0125] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements. The above is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. The various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features applied for herein.
[0126] The above is only a specific implementation of the present invention, but the design concept of the present invention is not limited thereto. Any non-substantial changes to the present invention using this concept shall be deemed as an infringement of the protection scope of the present invention.
Claims
1. A method for normalizing medical symptom entity information, characterized in that: include: defining a list of standard symptom categories based on disease information, including but not limited to disease characteristics, disease types, and disease physiological phenomena; For each disease data in the original data set, the entity recognition method is used to identify the original symptoms contained therein. The disease data is labeled by combining the original symptoms extracted by the entity recognition method and the text of the disease data itself. Its label category is one of the categories in the standard symptom list. After labeling, it is used as the model training data set; Perform embedding encoding on each sentence in the training data set to obtain a sentence matrix X1 with a dimension of [40, 80]. Perform embedding encoding on each symptom in the training data set to obtain an entity matrix X2 with a dimension of [40, 80]. Perform embedding encoding on each standard symptom category in the training data set to obtain a vector Y with a dimension of [N, 1], where N is the number of defined standard symptom categories, and each dimension of the vector represents a category. The dimension value corresponding to this standard symptom category is 1, and the other dimension values are 0. The entity information normalization model is trained by using the sentence matrix X1 and the entity matrix X2 in the training data to obtain the entity information normalization model after training, wherein the entity information normalization model includes: a sentence encoding module, an entity symptom encoding module, a sentence batch normalization module, an entity batch normalization module, a sentence self-attention module, a first splicing module, a first self-attention module, a second splicing module and a fully connected layer; Input sentence matrix X1, randomly extract at a ratio of 0.5, input sentence batch normalization module to obtain sentence normalization matrix X1a, dimension is [40, 80], input sentence normalization matrix X1a into sentence self-attention module, obtain sentence vector X1b, dimension is [1, 80]; Input entity matrix X2, randomly extract at a ratio of 0.5, and input it into the entity batch normalization module to obtain entity normalization matrix X2a with a dimension of [8, 80]; Input the sentence standardization matrix X1a and entity standardization matrix X2a into the first concatenation module for concatenation to obtain a standardized concatenation matrix X3 with a dimension of [48,80]; Input the normalized concatenation matrix X3 into the first self-attention module to obtain the normalized attention vector X4 with a dimension of [1,80]; The sentence vector X1b and the normalized attention vector X4 are input into the second concatenation module for concatenation to obtain a combined vector X5 with a dimension of [1,160]; The combined vector X5 is input into the fully connected layer and normalized by softmax to obtain the output vector Y', with a dimension of [1, N]. After the combined vector X5 is input into the fully connected layer, a vector with a preset dimension of [1, N] is obtained. Each element of the vector with a preset dimension of [1, N] is normalized by softmax to obtain the vector Y'. The dimension of vector Y' is [1, N], and the sum of all element values is 1. The softmax formula is Where z is the element of vector Y', and i takes the value of 1, 2, 3...N; Calculate the cross entropy of the output vector Y' and Y, and gradually iterate and optimize until the iteration conditions are met to obtain the entity information normalization model after training; The disease sentences are recognized by the entity recognition method, and the symptom entity information recognized by the entity recognition method is extracted; the sentence information and symptom entity information are embedded and encoded, and the encoded sentence matrix and entity matrix are input into the trained entity information normalization model to obtain a vector of dimension [1, N], and the dimension of the element with the largest value in the N-dimensional vector output by the entity information normalization model is determined to obtain the corresponding category after normalization.
2. A medical symptom entity information normalization method according to claim 1, characterized in that: The entity recognition method includes but is not limited to: HMM model, CRF model and RNN model method.
3. A medical symptom entity information normalization system, characterized in that: include: Definition unit: defining a standard symptom category list according to disease information, wherein the disease information includes but is not limited to disease characteristics, disease types, and disease physiological phenomena; Labeling unit: For each disease data in the original data set, the original symptoms contained in it are identified by using the entity recognition method. The disease data is labeled by combining the original symptoms extracted by the entity recognition method and the text of the disease data itself. Its label category is one of the categories in the standard symptom list. After labeling, it is used as the model training data set; Coding unit: embedding encoding is performed on each sentence information in the training data set to obtain a sentence matrix X1 with a dimension of [40, 80]. Embedding encoding is performed on each symptom information in the training data set to obtain an entity matrix X2 with a dimension of [40, 80]. Embedding encoding is performed on each standard symptom category in the training data set to obtain a vector Y with a dimension of [N, 1], where N is the number of defined standard symptom categories, each dimension of the vector represents a category, the dimension value corresponding to this standard symptom category is 1, and the other dimension values are 0; Training unit: using the sentence matrix X1 and the entity matrix X2 in the training data to train the entity information normalization model, and obtaining the entity information normalization model after training, wherein the entity information normalization model includes: a sentence encoding module, an entity symptom encoding module, a sentence batch normalization module, an entity batch normalization module, a sentence self-attention module, a first splicing module, a first self-attention module, a second splicing module and a fully connected layer; Input sentence matrix X1, randomly extract at a ratio of 0.5, input sentence batch normalization module to obtain sentence normalization matrix X1a, dimension is [40, 80], input sentence normalization matrix X1a into sentence self-attention module, obtain sentence vector X1b, dimension is [1, 80]; Input entity matrix X2, randomly extract at a ratio of 0.5, and input it into the entity batch normalization module to obtain entity normalization matrix X2a with a dimension of [8, 80]; Input the sentence standardization matrix X1a and entity standardization matrix X2a into the first concatenation module for concatenation to obtain a standardized concatenation matrix X3 with a dimension of [48,80]; Input the normalized concatenation matrix X3 into the first self-attention module to obtain the normalized attention vector X4 with a dimension of [1,80]; The sentence vector X1b and the normalized attention vector X4 are input into the second concatenation module for concatenation to obtain a combined vector X5 with a dimension of [1,160]; The combined vector X5 is input into the fully connected layer and normalized by softmax to obtain the output vector Y', with a dimension of [1, N]. After the combined vector X5 is input into the fully connected layer, a vector with a preset dimension of [1, N] is obtained. Each element of the vector with a preset dimension of [1, N] is normalized by softmax to obtain the vector Y'. The dimension of vector Y' is [1, N], and the sum of all element values is 1. The softmax formula is Where z is the element of vector Y', and i takes the value of 1, 2, 3...N; Calculate the cross entropy of the output vector Y' and Y, and gradually iterate and optimize until the iteration conditions are met to obtain the entity information normalization model after training; Category determination unit: Use entity recognition method to identify disease sentences and extract symptom entity information identified by the entity recognition method; embedding encode sentence information and symptom entity information, input the encoded sentence matrix and entity matrix into the trained entity information normalization model to obtain a vector of dimension [1, N], determine the dimension of the element with the largest value in the N-dimensional vector output by the entity information normalization model, and obtain the corresponding category after normalization.
4. A medical symptom entity information normalization system according to claim 3, characterized in that: The entity recognition method includes but is not limited to: HMM model, CRF model and RNN model method.
5. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the method steps of claim 1 or 2 are implemented when the processor executes the computer program.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps of claim 1 or 2 are implemented.
Citation Information
Patent Citations
Electronic medical record text named entity recognition method based on pre-trained language model
CN110705293A