A method to improve the efficiency of automatic disease coding
The trained disease coding model predicts the first n codes of disease names and constructs a coding subset, which solves the problem of low efficiency of existing disease coding, realizes automatic coding and efficient matching of diseases, and significantly improves coding efficiency.
Patent Information
- Application Number
- CN202311143544.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-06
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2043-09-06
AI Technical Summary
Existing disease coding methods are inefficient, especially when coding a large number of disease names, it is time-consuming, resulting in low coding efficiency.
Using the trained disease coding model, through the input layer, word embedding layer, bidirectional long short-term memory layer, attention mechanism layer and output layer, predict the first n-digit codes of the disease name to be encoded, and construct a coding based on the first n-digit codes Subset, quickly match the disease standard names with the highest similarity.
It realizes automatic coding of diseases, significantly improves the coding efficiency, saves the time of matching coding, and can accurately obtain the coding of the standard name of the disease in a short time.
Smart Images

Figure CN116884630B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical information technology, and in particular to a method for improving the efficiency of automatic disease coding. Background Art
[0002] With the widespread application of Diagnosis Related Groups (DRGs) across the country, the importance of disease coding and homepage data quality has become increasingly prominent. Among them, disease coding is the basis and core of grouping. The quality of disease coding will directly affect the case inclusion rate and the correctness of inclusion, and then affect the evaluation results of the hospital.
[0003] Hospital coding is usually done by professional coders, but most hospitals have few professional coders and they have to do other work such as medical record collection and homepage entry. The current common disease coding is the ICD-10 version, which contains more than 30,000 diseases. If the coders match the name of the disease to be coded with each disease name in the standard library, it will take a lot of time when the data volume is large. Moreover, the existing semantic relevance algorithm for disease coding uses full coding to search, calculate and match the relevance in the coding, which is relatively time-consuming, especially for the coding of massive disease names. Summary of the invention
[0004] The purpose of the present invention is to provide a method for improving the efficiency of automatic disease coding to solve the technical problem of low efficiency of disease coding in the prior art. The preferred technical solutions among the many technical solutions provided by the present invention can produce many technical effects as described below.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] The present invention provides a method for improving the efficiency of automatic disease coding, comprising the following steps:
[0007] Predict the label value corresponding to the first n codes of the disease name to be coded according to the trained disease coding model, and obtain h optimal predicted label values; the disease coding model includes an input layer, a word embedding layer, a bidirectional long short-term memory layer, an attention mechanism layer and an output layer connected in sequence; a random inactivation layer is added to the output result of the attention mechanism layer, and the bidirectional long short-term memory layer is a two-layer structure; the word embedding layer is used to convert the input of the input layer into a standard text vector; according to all the codes in the code library, the coding subset of the code library is constructed with the first n codes as the subset label, and a subset label value is set for each of the coding subsets; the coding subsets corresponding to the subset label values consistent with the h predicted label values are screened out, and all the standard disease names and the codes associated with each of the standard disease names are extracted from the screened coding subsets; the subset label The value is an integer value; the similarity between the disease name to be coded and each extracted disease standard name is calculated, and the code associated with the disease standard name corresponding to the maximum similarity value is used as the code of the disease name to be coded; wherein the disease name to be coded and each extracted disease standard name are converted into characters, and each character corresponds to an M-dimensional character vector; the vector sum of each character of the disease name to be coded in the same dimension is a text vector with M dimensions for the disease name to be coded; the vector sum of each character of each extracted disease standard name in the same dimension is a text vector with M dimensions for each disease standard name; the text vector is limited to a set fixed text length range to obtain an M-dimensional standard text vector corresponding to the disease name to be coded and each extracted disease standard name, and the M-dimensional standard text vector is used to calculate the similarity.
[0008] Furthermore, the step of constructing the encoding subsets of the encoding library using the first n-bit encodings as subset labels, and setting a subset label value for each encoding subset, comprises the following steps:
[0009] Obtain all codes in the code library and the disease standard name associated with each code, and extract the first n digits of the code from each code; according to the extracted first n digits of the code, classify the codes corresponding to the same first n digits of the code and the disease standard name associated with the code into a code subset, and use the first n digits of the code as the subset label of the corresponding code subset; according to the subset label corresponding to each code subset, set the corresponding subset label value for each code subset.
[0010] Furthermore, the disease coding model includes an input layer, a word embedding layer, a bidirectional long short-term memory layer, an attention mechanism layer and an output layer connected in sequence; a random inactivation layer is added to the output result of the attention mechanism layer, and the bidirectional long short-term memory layer is a two-layer structure.
[0011] Furthermore, the prediction step of the disease coding model includes: converting the name of the disease to be coded into characters through a character conversion model, and bringing the characters converted from the name of the disease to be coded into the trained disease coding model for coding prediction.
[0012] Furthermore, the disease coding model is trained, and the training steps include:
[0013] All the disease standard names and the subset label values corresponding to each of the disease standard names are divided into a training sample set and a test sample set; each disease standard name of all the coding subsets is converted into a character through a character conversion model to obtain the character corresponding to each disease standard name; the disease coding model is trained through the training sample set and tested through the test sample set until the training end condition is met; the character corresponding to the disease standard name is used as an input variable, and the subset label value corresponding to the disease standard name is used as the corresponding output variable.
[0014] Furthermore, the disease coding model is trained by a training sample set and tested by a test sample set until a training end condition is met, comprising the following steps:
[0015] Setting the parameters of each layer, loss function and optimizer of the disease coding model;
[0016] Inputting the characters corresponding to each of the standard disease names in the training sample set into the input layer, and converting the characters corresponding to each of the standard disease names into standard text vectors in the word embedding layer;
[0017] Passing each of the standard text vectors into the bidirectional long short-term memory layer for processing to obtain an output result of the bidirectional long short-term memory layer;
[0018] The output result of the bidirectional long short-term memory layer is passed to the attention mechanism layer to obtain the output result of the attention mechanism layer;
[0019] The output result of the attention mechanism layer is passed to the random dropout layer to obtain the output result of the random dropout layer;
[0020] The prediction result is outputted in a fully connected manner to obtain the disease coding model that has been preliminarily trained; the prediction result includes a prediction probability and a prediction label value corresponding to the prediction probability;
[0021] Input the characters corresponding to each of the standard disease names in the test sample set into the preliminarily trained disease coding model, calculate the loss value between the predicted label value corresponding to the maximum predicted probability and the actual subset label value through the loss function, optimize the transfer parameters of each layer of the preliminarily trained disease coding model through the optimizer, and repeat the above steps in sequence from the step of "inputting the characters corresponding to each of the standard disease names in the training sample set into the input layer, and converting each of the characters corresponding to the standard disease name into a standard text vector in the word embedding layer" until the training is stopped when the loss value calculated twice in a row no longer changes; the actual subset label value is the subset label value corresponding to the input in the test sample set corresponding to the maximum predicted probability.
[0022] Furthermore, converting the characters corresponding to each of the standard disease names into standard text vectors at the word embedding layer includes the following steps:
[0023] The characters corresponding to each of the standard disease names are imported into the trained character vector model to obtain the character vector corresponding to each of the standard disease names; the character vectors corresponding to each of the standard disease names are combined into a text vector to obtain the text vector corresponding to each of the standard disease names; according to the set fixed length of the text, the part of the text corresponding to each of the text vectors that exceeds the fixed length of the text is deleted, or the part of the text corresponding to each of the text vectors that is less than the fixed length of the text is filled with 0 to obtain the standard text vector corresponding to each of the standard disease names.
[0024] Furthermore, the method further includes training the word vector model, wherein the training step includes:
[0025] A medical text training set is obtained, and each medical text in the obtained medical text training set is converted into a word through a word conversion model; the word vector model is trained using the converted words corresponding to all the medical texts to obtain a trained word vector model; the word vector model is a GloVe model.
[0026] Furthermore, obtaining the output result of the bidirectional long short-term memory layer comprises the following steps:
[0027] A dynamic RNN model is used to process each of the standard text vectors to obtain the forward output result and the reverse output result of the first layer of the bidirectional long short-term memory layer; the forward output result and the reverse output result of the first layer are spliced, and the spliced results are sequentially passed to the second layer of the bidirectional long short-term memory layer; the spliced results are processed by a dynamic RNN model to obtain the forward output result and the reverse output result of the second layer of the bidirectional long short-term memory layer; the forward output result and the reverse output result of the second layer are spliced to obtain the output result of the bidirectional long short-term memory layer.
[0028] Furthermore, obtaining the output result of the attention mechanism layer comprises the following steps:
[0029] Initialize a weight vector; use an activation function to perform nonlinear transformation on the output result of the bidirectional long short-term memory layer to obtain a transformation vector matrix; multiply the weight vector and the transformation vector matrix by matrix multiplication, and normalize the multiplication result to obtain a normalized vector matrix; use the normalized vector matrix to perform weighted summation on the output result of the bidirectional long short-term memory layer to obtain the output result of the attention mechanism layer.
[0030] Furthermore, the word conversion model converts the medical text into words, and the steps include:
[0031] The medical text is segmented using the Jieba word segmentation to obtain a word segmentation list corresponding to the medical text; the word segmentation list corresponding to the medical text is traversed, and if the word segmentation in the word segmentation list is not in the stop word list, the word segmentation is retained, otherwise, the word segmentation is removed; the word segmentation list corresponding to the medical text after filtering the stop words is traversed, and if the word segmentation in the word segmentation list is in Chinese, the word segmentation is further divided into characters, and the split characters are stored in the word segmentation results corresponding to the medical text; if the word segmentation in the word segmentation list does not contain Chinese, the word segmentation is saved in the word segmentation results corresponding to the medical text; the word segmentation results are the converted characters corresponding to the medical text; the medical text includes the name of the disease to be encoded and the standard name of the disease.
[0032] Furthermore, the calculation formula of the similarity S is:
[0033]
[0034] Wherein, M is the dimension of the text vector, A=[A1,A2,A3,...,A M ] is the standard text vector of the disease name to be encoded, B = [B1, B2, B3, ..., B M ] is the standard text vector of the standard name of the disease.
[0035] Implementing one of the above technical solutions of the present invention has the following advantages or beneficial effects:
[0036] The present invention indirectly predicts part of the coding of the disease name to be coded through the disease coding model, obtains multiple optimal prediction results, and thereby locks the coding of the disease name to be coded into a small range; then, within this small range, the disease standard name with the highest similarity is matched according to the similarity, and the coding associated with the disease standard name with the highest similarity is used as the coding of the disease name to be coded. Therefore, the present method can realize the automatic coding of the disease and improve the coding efficiency.
[0037] On the other hand, in order to save time for subsequent coding matching, this method constructs a coding subset based on the first n bits of the coding as labels according to the prediction results and the coding library, which facilitates rapid matching of the disease standard name with the highest similarity and its corresponding coding, thereby improving the overall coding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. It is obvious that the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0039] Figure 1 is a flow chart of a method for improving the efficiency of automatic disease coding according to an embodiment of the present invention;
[0040] Figure 2 is a network structure diagram of a disease coding model in an embodiment of the present invention;
[0041] Figure 3 It is a flowchart of training a disease coding model under a training end condition in an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solutions and advantages of the present invention clearer, the various exemplary embodiments to be described below will refer to the corresponding drawings, which constitute a part of the exemplary embodiments, wherein various exemplary embodiments that may be used to implement the present invention are described. Unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation methods described in the following exemplary embodiments do not represent all implementation methods consistent with the present disclosure. It should be understood that they are only examples of processes, methods, devices, etc. that are consistent with some aspects of the present disclosure as detailed in the attached claims, and other embodiments may also be used, or the embodiments listed herein may be modified in structure and function without departing from the scope and essence of the present invention.
[0043] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", etc. indicate the orientation or positional relationship based on the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the elements referred to must have a specific orientation, be constructed and operated in a specific orientation. The terms "first", "second", etc. are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. The term "multiple" means two or more. The terms "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, an integral connection, a mechanical connection, an electrical connection, a communication connection, a direct connection, an indirect connection through an intermediate medium, and can be the internal connection of two elements or the interaction relationship between two elements. The term "and / or" includes any and all combinations of one or more related listed items. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances.
[0044] In order to illustrate the technical solution of the present invention, a specific embodiment is used below for description, and only the parts related to the embodiment of the present invention are shown.
[0045] Embodiment 1:
[0046] like Figure 1 As shown, the present invention provides a method for improving the efficiency of automatic disease coding, which is characterized by comprising the following steps:
[0047] S100, predicting the label values corresponding to the first n digits of the disease name to be coded according to the trained disease coding model, and obtaining h optimal predicted label values;
[0048] S200, constructing a code subset of the code library based on all codes in the code library, using the first n bits of the code as a subset label, and setting a subset label value for each code subset;
[0049] S300, screening out the coding subsets corresponding to the subset label values consistent with the h predicted label values, and extracting all disease standard names and the codes associated with each disease standard name from the screened coding subsets;
[0050] S400, calculating the similarity between the disease name to be coded and each extracted disease standard name, and taking the code associated with the disease standard name corresponding to the maximum similarity value as the code of the disease name to be coded.
[0051] The present invention indirectly predicts part of the coding of the disease name to be coded through the disease coding model, obtains multiple optimal prediction results, and thereby locks the coding of the disease name to be coded into a small range; then, within this small range, the disease standard name with the highest similarity is matched according to the similarity, and the coding associated with the disease standard name with the highest similarity is used as the coding of the disease name to be coded. Therefore, the present method can realize the automatic coding of the disease and improve the coding efficiency.
[0052] On the other hand, in order to save time for subsequent coding matching, this method constructs a coding subset based on the first n bits of the coding as the subset label according to the prediction results and the existing coding library, which facilitates rapid matching of the disease standard name with the highest similarity and its corresponding coding, thereby improving the overall coding efficiency.
[0053] It should be noted that the coding library of this embodiment is the currently common disease coding ICD-10 version, which contains more than 30,000 diseases. In addition, in the specific implementation, n can be taken as 2, and h can be taken as 3. The optimal predicted label value can be obtained by predicting the probability from high to low, and taking the predicted label value corresponding to the first h probabilities as the optimal predicted label value. It should also be noted that step S100 and step S200 can be performed in any order.
[0054] As an optional implementation, in step S200, the coding subsets of the coding library are constructed with the first n-bit codes as subset labels, and a subset label value is set for each coding subset, including the following steps:
[0055] Get all the codes in the code library and the disease standard name associated with each code, and extract the first n digits of each code. It should be noted that each code in the code library is associated with a unique disease standard name;
[0056] According to the extracted first n-digit codes, the codes corresponding to the same first n-digit codes and the disease standard names associated with the codes are grouped into a code subset, and the first n-digit codes are used as subset labels of the corresponding code subset;
[0057] According to the subset label corresponding to each coding subset, a corresponding subset label value is set for each coding subset. Specifically, the subset label value can be an integer value, such as 0-262 in the following example.
[0058] A specific example is: using the universal disease code ICD-10 version as the code library, taking the first two digits of the code as the subset label, there are a total of 263 subset labels, corresponding to 263 subset label values, recorded as 0-262. In order to save subsequent matching time, this example divides the disease standard name and its uniquely associated code into 263 code subsets according to the first two digits of the code, and each subset name corresponds to the above 263 subset label values, such as 0, 1, 2, ..., 262. For example, the first two digits of the code are A0, and its corresponding codes and disease standard names include: Cholera: A00.900, Typhoid: A01.000, Bacillary Dysentery: A03.900, Escherichia coli Enteritis: A04.401, .... Then, the coding subset A0 = {cholera: A00.900, typhoid: A01.000, bacillary dysentery: A03.900, Escherichia coli enteritis: A04.401, ...}, A0 is the subset label of the coding subset, and an integer from 0-262 is assigned in sequence as the subset label value corresponding to the A0 subset label, such as 0 (A0 is at the front of all subset labels, so the matching subset label value is 0), that is, 0 is the subset label value corresponding to the coding subset.
[0059] like Figure 2 As shown in the figure, as an optional implementation, the disease coding model includes a bidirectional long short-term memory (Bi-directional Long Short-Term Memory, Bi-LSTM) layer, an attention mechanism layer (AttentionLayer) and an output layer connected in sequence. Among them, a random dropout layer (Dropout Layer) is added to the output result of the attention mechanism layer, and the bidirectional long short-term memory layer is a two-layer structure.
[0060] It should be noted that the attention mechanism layer will have a fitting transition. To prevent overfitting, a random inactivation layer is added before the output of the attention mechanism layer, and the output result of the random inactivation layer is used as the output result of the bidirectional long short-term memory network to make the fitting more accurate. It should also be noted that by increasing the depth of the bidirectional long short-term memory layer, the training efficiency is improved and higher accuracy is obtained, and then the bidirectional long short-term memory layer is set to a two-layer structure.
[0061] As an optional implementation, the prediction step of the disease coding model includes:
[0062] The name of the disease to be coded is converted into characters through a character conversion model, and the characters converted from the name of the disease to be coded are brought into the trained disease coding model for coding prediction.
[0063] As an optional implementation, the disease coding model is further trained, and the training steps include:
[0064] Divide all disease standard names and the subset label values corresponding to each disease standard name into a training sample set and a test sample set;
[0065] As an example, the above division can be: all disease standard names and part of the subset label values corresponding to each disease standard name (such as 80% of all disease standard names, selected by random selection) are used as training sample sets, and the rest are used as test sample sets. It should be noted that each randomly selected disease standard name corresponds to a corresponding subset label value, that is, each randomly selected disease standard name corresponds to a corresponding subset label value;
[0066] Each disease standard name in all coded subsets is converted into a character through a character conversion model to obtain the character corresponding to each disease standard name. It should be noted that each subset label value in the above sample set corresponds to multiple disease standard names, and each disease standard name corresponds to a converted character;
[0067] The disease coding model is trained through the training sample set and tested through the test sample set until the training end condition is met. The characters corresponding to the disease standard names are used as input variables, and the subset label values corresponding to the disease standard names are used as corresponding output variables.
[0068] like Figure 3 As shown, as an optional implementation, the disease coding model is trained by a training sample set and tested by a test sample set until the training end condition is met, including the following steps:
[0069] S101, setting the parameters of each layer, loss function and optimizer of the disease coding model. For the loss function and optimizer, see the following step S107; the setting of the parameters of each layer includes setting the number of neural units in the input layer, word embedding layer, bidirectional long short-term memory layer, attention mechanism layer, random inactivation layer and output layer;
[0070] As an example, the input layer and the word embedding layer are both set to 64 neural units, the bidirectional long short-term memory layer is set to two layers, each layer includes a forward long short-term memory structure and a reverse long short-term memory structure, and the number of hidden layer neural units (hidden_units) of each forward long short-term memory structure and each reverse long short-term memory structure is set to 64; the number of neural units of the attention mechanism layer and the random inactivation layer is set to 64; the output of the output layer is the subset label value y and the classification probability (prediction probability) corresponding to y, and the subset label categories in this embodiment are 263, so the corresponding number of neural units is 263;
[0071] It should be noted that the predicted label value output by the output layer is the predicted value of the subset label value. The corresponding subset label is found through the predicted subset label value. The subset label is the first 2 digits of the ICD-10 code. In this way, the subset label corresponding to the subset label value can be quickly obtained. The corresponding coded subset can be obtained through the subset label. The standard name of the disease in the subset can be obtained through the coded subset, and then the similarity is used to realize the rapid numbering of the disease to be coded. In the training stage, 263 subset label values and their corresponding classification probabilities are output. After training, only the top 3 probability values corresponding to the 263 subset label values are selected from high to low as the prediction results. It should be further noted that in Figure 2 In the example, T in xT represents time. For example, xT is the input at time T. In this embodiment, it can be simply understood that the input at time T is the Tth word.
[0072] S102. Input the characters corresponding to each standard disease name in the training sample set into the input layer, and convert the characters corresponding to each standard disease name into standard text vectors in the word embedding layer. It should be noted that the input layer input text x is the character corresponding to each standard disease name. Of course, the input layer input can be a sentence, a word, or a character. In this embodiment, it is a character. For example, "bronchial dilatation combined with infection", the input text is: x1 = 'branch', x2 = 'air', x3 = 'tube', x4 = 'expansion', x5 = 'expand', x6 = 'combination', x7 = 'and', x8 = 'infection', x9 = 'infection';
[0073] S103, passing each standard text vector into the bidirectional long short-term memory layer for processing, and obtaining an output result of the bidirectional long short-term memory layer;
[0074] S104, passing the output result of the bidirectional long short-term memory layer to the attention mechanism layer to obtain the output result of the attention mechanism layer;
[0075] S105, passing the output result of the attention mechanism layer to the random dropout layer to obtain the output result of the random dropout layer. In which, the neuron retention probability of the random dropout layer is set to keep_prob = 0.5;
[0076] S106. Use a fully connected method to output the prediction results to obtain a preliminarily trained disease coding model. The prediction results include the predicted probability and the predicted label value corresponding to the predicted probability. Among them, set the number of categories and the activation function of the output layer. Specifically, the number of categories is 263 (when predicting after training, only the first h probability values corresponding to the 263 labels are selected from high to low as the prediction results), and softmax is used as the activation function to obtain the final classification output. It should be noted that the fully connected method here refers to the use of the softmax activation function to calculate the probability value of each classification result, and the function of the fully connected layer is classification;
[0077] S107. Input the characters corresponding to each disease standard name in the test sample set into the preliminarily trained disease coding model. Calculate the loss value between the predicted label value corresponding to the maximum predicted probability and the actual subset label value through the loss function, where the actual subset label value is the subset label value corresponding to the input with the maximum predicted probability in the test sample set. Optimize the transfer parameters of each layer of the preliminarily trained disease coding model (the transfer parameters of the bidirectional long short-term memory layer, the attention mechanism layer, and the dropout layer) through the optimizer. Repeat steps S102 to S107 until the loss values calculated continuously twice no longer change (that is, the loss value calculated in a certain time is equal to the loss value calculated last time, or the error between the loss value calculated in a certain time and the loss value calculated last time is less than the set threshold), and then stop training. Specifically, the learning rate learning_rate = 0.01, the batch size bach_size = 512, select the categorical cross-entropy as the model loss function, and use the AdamOptimizer optimizer to continuously update the disease coding model.
[0078] As an example, a sample result output by the model is y = {'0': 0.05, '1': 0.01,..., '262': '0.009'}, where the 0 - 262 in single quotes are the predicted label values corresponding to all 263 subset labels, and behind the predicted label value is the predicted probability corresponding to this label value. For example, the predicted subset label corresponding to the predicted label value '0' is 'A0', and the predicted probability corresponding to the subset label 'A0' is 0.05.
[0079] As an alternative implementation, in the above step S102, the step of converting the characters corresponding to each disease standard name into a standard text vector in the word embedding layer includes:
[0080] Import the characters corresponding to each disease standard name into the trained character vector model to obtain the character vector corresponding to each disease standard name;
[0081] Form the text vectors of the characters corresponding to each disease standard name into a text vector to obtain the text vector corresponding to each disease standard name. For example, if the dimension (VECTOR_SIZE) of each character vector set by the character vector model (see the GloVe model described below) is 300, then the character vector corresponding to '支' in '支气管' is c = [c1, c2, c3,..., c 300 , the character vector corresponding to '气' is d = [d1, d2, d3,..., d 300 , and the character vector corresponding to '管' is e = [e1, e2, e3,..., e 300 , then the text vector (sentence vector) of '支气管' is:
[0082] [c1+d1+e1,c2+d2+e2,c3+d3+e3,…,c 300 +d 300 +e 300 ];
[0083] As an example, the 300-dimensional "branch" vector is: [0.02602266, 0.35493448, 0.15897253, ..., -0.27806452];
[0084] According to the set fixed length of the text, the part of the text corresponding to the text vector that exceeds the fixed length of the text is deleted, or the part of the text corresponding to the text vector that is less than the fixed length of the text is filled with 0, so as to obtain the standard text vector corresponding to each standard disease name. It should be noted that after the above steps, the subset label value corresponding to each standard disease name is consistent with the subset label value corresponding to each standard text vector.
[0085] As an example, the fixed length of the text is 100. For example, the text corresponding to the text vector is "bronchial dilatation and infection", and its text length is 9. The text (text representation) corresponding to the obtained standard text vector (data representation) is: x1 = 'branch', x2 = 'air', x3 = 'tube', x4 = 'expansion', x5 = 'expansion', x6 = 'combination', x7 = 'combination', x8 = 'infection', x9 = 'infection', x10 = '0', ..., x100 = '0'. It should be noted that the words corresponding to x1, x2, ..., x100 all contain 300-dimensional vector values.
[0086] It should be noted that since there may be discrepancies between the input disease name to be coded and the disease standard name, the text length of the text vector may not be consistent after they are converted into text vectors. In order to ensure that the input text of the disease coding model is consistent, this example sets a fixed length for the text corresponding to the disease name to be coded and limits it to the set fixed text length range.
[0087] As an optional implementation, the word vector model is further trained, and the steps include:
[0088] Obtain a medical text training set, and convert each medical text in the obtained medical text training set into a word through a word conversion model. The medical text training set is obtained during data collection, including but not limited to the text content of electronic medical records;
[0089] The GloVe model is trained using the corresponding converted words of all medical texts to obtain the trained word vector model. Furthermore, the GloVe model parameter configuration is as follows:
[0090] VECTOR_SIZE (word vector dimension): 300, WINDOW_SIZE (learning window): 8, VOCAB_MIN_COUNT (minimum number of word occurrences): 3, MAX_ITER (maximum number of iterations): 1000.
[0091] It should be noted that the GloVe (Global Vectors for Word Representation, GloVe) model is a new global logarithmic bilinear regression model for unsupervised learning of word / character vectors, which combines the advantages of global matrix decomposition and local context window methods. Since the glove model not only considers global information, but also can make good use of global statistical information, and the training speed is fast, therefore, this embodiment uses the GloVe model to obtain the word vector of medical text.
[0092] As an optional implementation, in the above step S103, the step of obtaining the output result of the bidirectional long short-term memory layer includes:
[0093] The dynamic RNN model is used to process each standard text vector to obtain the forward output result and reverse output result of the first layer of the bidirectional long short-term memory layer;
[0094] The forward output result and the reverse output result of the first layer are concatenated, and the concatenated results are sequentially passed to the second layer of the bidirectional long short-term memory layer;
[0095] The splicing results are processed using a dynamic RNN model to obtain the forward output result and reverse output result of the second layer of the bidirectional long short-term memory layer;
[0096] The forward output result and the reverse output result of the second layer are concatenated to obtain the output result of the bidirectional long short-term memory layer.
[0097] It should be noted that the splicing in this example can be understood as splicing multiple outputs in a certain order. One splicing method is to splice the forward output results first and the reverse output results last to form a whole. Of course, this embodiment is not limited to the above splicing method.
[0098] As an optional implementation, in the above step S105, obtaining the output result of the attention mechanism layer includes the following steps:
[0099] Initialize a weight vector. It should be noted that the dimension of the weight vector is (hidden_units, 1), that is, (64, 1);
[0100] The output of the bidirectional long short-term memory layer is transformed nonlinearly using an activation function to obtain a transformation vector matrix. It should be noted that the activation function is tanh (hyperbolic tangent function);
[0101] The weight vector and the transformation vector matrix are multiplied by matrix multiplication, and the result of the multiplication is normalized to obtain a normalized vector matrix. It should be noted that the normalization function is softmax;
[0102] The normalized vector matrix is used to perform weighted summation on the output results of the bidirectional long short-term memory layer to obtain the output result of the attention mechanism layer.
[0103] As an optional implementation, a word conversion model is also included to convert medical text into words, and the steps include:
[0104] Use Jieba word segmentation to segment the medical text and obtain the word segmentation list corresponding to the medical text;
[0105] As an example of stuttering word segmentation, for example, a medical text is: "Blood alcohol level is less than 20mg / 100ml", after stuttering word segmentation, the word segmentation list is: ['blood', 'alcohol', 'level', 'less than', '20mg', ' / ', '100ml'];
[0106] Traverse the word list corresponding to the medical text. If the word in the word list is not in the stop word list, keep the word, otherwise, remove the word. It should be noted that the stop word list is compiled by combining the existing online resources and the characteristics of medical texts. For example, the ' / ' in the above text is a stop word and needs to be deleted from the above word list. The word list corresponding to the traversed medical text is: ['blood', 'alcohol', 'level', 'lower than', '20mg', '100ml']. The stop words of this implementation include but are not limited to: 'when', 'of', 'at the moment', ',', '. ', ''《', etc.;
[0107] Traverse the word list corresponding to the medical text after filtering the stop words. If the word list contains Chinese, further split the word and store the split word in the word result corresponding to the medical text; if the word list does not contain Chinese, save the word to the word result corresponding to the medical text. For example, traverse the word list ['blood', 'alcohol', 'level', 'lower than', '20mg', '100ml'], where 'blood', 'alcohol', 'level', 'lower than' all contain Chinese, so they need to be further split, that is, 'blood', 'medium', 'wine', 'essence', 'water', 'level', 'low', 'at'; and '20mg' and '100ml' do not contain Chinese, so directly store '20mg' and '100ml' in the word result; the word result is the corresponding converted word of the medical text.
[0108] It should be noted that medical text includes the name of the disease to be coded, the standard name of the disease and the text content of the electronic medical record.
[0109] As an optional implementation, the calculation formula of the similarity S is:
[0110]
[0111] Where M is the dimension of the text vector, A = [A1, A2, A3, ..., A M ] is the standard text vector of the disease name to be encoded, B = [B1, B2, B3, ..., B M ] is the standard text vector of the standard disease name, and in this embodiment M=300.
[0112] In summary, this embodiment indirectly predicts part of the coding of the disease name to be coded through the disease coding model, and obtains multiple optimal prediction results, thereby locking the coding of the disease name to be coded within a small range; then, within this small range, the disease standard name with the highest similarity is matched according to the similarity, and the coding associated with the disease standard name with the highest similarity is used as the coding of the disease name to be coded. Therefore, this method can realize the automatic coding of the disease and improve the efficiency of coding. In addition, a coding subset based on the first n bits of coding as a label is constructed, which facilitates the rapid matching of the disease standard name with the highest similarity and its corresponding coding, thereby improving the overall efficiency of coding.
[0113] Embodiment 2:
[0114] This embodiment provides a method for improving the efficiency of automatic disease coding based on implementation one and its related parameters, and performs coding matching on the names of diseases to be matched (names of diseases to be coded) such as pharyngeal tuberculosis, salmonella infection combined with bronchopneumonia, pelvic tumors, vulvar malignant tumors, unstable angina, acute myocardial infarction and hypertension, and records the matching time; at the same time, as a comparison, this embodiment adopts the method of traversing the entire standard library based on the semantic similarity of implementation one (traditional method) to perform coding matching on the above-mentioned names of diseases to be matched, and records the matching time. As shown in Table 1 below.
[0115] Table 1 Comparison of matching results and time of this method and semantic similarity traversal of all standard library methods
[0116]
[0117] From the data in the table, it can be seen that the method (traditional method) based on the semantic similarity of the present invention (i.e., the similarity S described in Example 1) to traverse the entire standard library takes an average of about 1.383 seconds per item, while the method of the present invention (first predicting the three prediction results with the highest probability of the first two digits of the disease name to be coded based on the Bi-LSTM+Attention model; then finding the three coding subsets corresponding to the first two digits of each predicted code in the grouped 263 coding subsets; calculating the semantic similarity between the disease name to be coded and each disease standard name based on all the disease standard names found in the three coding subsets; and finally obtaining the code of the disease name to be coded based on the maximum semantic similarity) takes an average of 0.029 seconds per item, which greatly reduces the time. When the disease name to be coded is in the standard library, the method based on the semantic similarity of the present invention to traverse the entire standard library takes an average of about 0.009 seconds less per item than the method of the present invention; and when the disease name to be coded is not in the standard library, the method based on the semantic similarity of the present invention to traverse the entire standard library takes an average of about 2 seconds more per item than the method of the present invention. Therefore, the present invention can improve the efficiency of disease coding.
[0118] To summarize, this embodiment has divided the code set into 263 code subsets according to the first two digits of the code before model training. The code subsets are named after the first two digits of the code. After the three prediction results with the highest probability of the first two digits of the code are obtained according to the disease coding model of Embodiment 1, the corresponding three subsets are directly obtained from the 263 code subsets through the prediction results, and all the names extracted from these three subsets do not need to be searched in all code libraries, which effectively saves time.
[0119] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flow involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0120] The above description is only the preferred embodiment of the present invention. It is known to those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application belong to the protection scope of the present invention.
Claims
1. A method for improving the efficiency of automatic disease coding, characterized in that: The steps include: Predict the label values corresponding to the first n digits of the disease name to be coded according to the trained disease coding model, and obtain h optimal predicted label values; the disease coding model includes an input layer, a word embedding layer, a bidirectional long short-term memory layer, an attention mechanism layer and an output layer connected in sequence; a random inactivation layer is added to the output result of the attention mechanism layer, and the bidirectional long short-term memory layer is a two-layer structure; the word embedding layer is used to convert the input of the input layer into a standard text vector; According to all codes in the code library, a code subset of the code library is constructed with the first n bits of code as a subset label, and a subset label value is set for each of the code subsets; The coding subset corresponding to the subset label value consistent with the h predicted label values is screened out, and all disease standard names and the codes associated with each disease standard name are extracted from the screened coding subset; the subset label value is an integer value; Calculate the similarity between the disease name to be coded and each of the extracted disease standard names, and use the code associated with the disease standard name corresponding to the maximum similarity as the code of the disease name to be coded; wherein the disease name to be coded and each of the extracted disease standard names are converted into characters, and each character corresponds to an M-dimensional character vector; the vector sum of each character of the disease name to be coded in the same dimension is a text vector with M dimensions for the disease name to be coded; the vector sum of each character of each extracted disease standard name in the same dimension is a text vector with M dimensions for each disease standard name; limit the text vector to a set fixed text length range, and obtain the M-dimensional standard text vector corresponding to the disease name to be coded and each of the extracted disease standard names, and the M-dimensional standard text vector is used to calculate the similarity; The calculation formula of the similarity S is: Wherein, M is the dimension of the text vector, A=[A1,A2,A3,...,A M ] is the standard text vector of the disease name to be encoded, B = [B1, B2, B3, ..., B M ] is the standard text vector of the standard name of the disease; It also includes a word conversion model to convert medical text into words, and its steps include: The medical text is segmented using the Jieba word segmentation to obtain a word segmentation list corresponding to the medical text; the word segmentation list corresponding to the medical text is traversed, and if the word segmentation in the word segmentation list is not in the stop word list, the word segmentation is retained, otherwise, the word segmentation is removed; the word segmentation list corresponding to the medical text after filtering the stop words is traversed, and if the word segmentation in the word segmentation list is in Chinese, the word segmentation is further divided into characters, and the split characters are stored in the word segmentation results corresponding to the medical text; if the word segmentation in the word segmentation list does not contain Chinese, the word segmentation is saved in the word segmentation results corresponding to the medical text; the word segmentation results are the converted characters corresponding to the medical text; the medical text includes the name of the disease to be encoded and the standard name of the disease.
2. A method for improving the efficiency of automatic disease coding according to claim 1, characterized in that: The step of constructing the encoding subsets of the encoding library using the first n-bit encodings as subset labels, and setting a subset label value for each encoding subset, comprises the following steps: Obtain all codes in the code library and the standard name of the disease associated with each code, and extract the first n digits of each code; According to the extracted first n-digit codes, the codes corresponding to the same first n-digit codes and the disease standard names associated with the codes are grouped into a code subset, and the first n-digit codes are used as subset labels of the corresponding code subset; According to the subset label corresponding to each of the coding subsets, a corresponding subset label value is set for each of the coding subsets.
3. A method for improving the efficiency of automatic disease coding according to claim 1, characterized in that: The prediction steps of the disease coding model include: The name of the disease to be encoded is converted into characters through a character conversion model, and the characters converted from the name of the disease to be encoded are brought into the trained disease encoding model for encoding prediction.
4. A method for improving the efficiency of automatic disease coding according to claim 1, characterized in that: The disease coding model is also trained, and the training steps include: Dividing all the disease standard names and the subset label values corresponding to each disease standard name into a training sample set and a test sample set; Convert each disease standard name of all the coding subsets into a character through a character conversion model to obtain a character corresponding to each disease standard name; The disease coding model is trained through a training sample set and tested through a test sample set until a training end condition is met; the characters corresponding to the standard disease names are used as input variables, and the subset label values corresponding to the standard disease names are used as corresponding output variables.
5. A method for improving the efficiency of automatic disease coding according to claim 4, characterized in that: The disease coding model is trained by a training sample set and tested by a test sample set until a training end condition is met, comprising the following steps: Setting the parameters of each layer, loss function and optimizer of the disease coding model; Inputting the characters corresponding to each of the standard disease names in the training sample set into the input layer, and converting the characters corresponding to each of the standard disease names into standard text vectors in the word embedding layer; Passing each of the standard text vectors into the bidirectional long short-term memory layer for processing to obtain an output result of the bidirectional long short-term memory layer; The output result of the bidirectional long short-term memory layer is passed to the attention mechanism layer to obtain the output result of the attention mechanism layer; The output result of the attention mechanism layer is passed to the random dropout layer to obtain the output result of the random dropout layer; The prediction result is outputted in a fully connected manner to obtain the disease coding model that has been preliminarily trained; the prediction result includes a prediction probability and a prediction label value corresponding to the prediction probability; Input the characters corresponding to each of the standard disease names in the test sample set into the preliminarily trained disease coding model, calculate the loss value between the predicted label value corresponding to the maximum predicted probability and the actual subset label value through the loss function, optimize the transfer parameters of each layer of the preliminarily trained disease coding model through the optimizer, and repeat the above steps in sequence from the step "inputting the characters corresponding to each of the standard disease names in the training sample set into the input layer, and converting the characters corresponding to each of the standard disease names into standard text vectors in the word embedding layer" until the training is stopped when the loss value calculated twice in a row no longer changes; the actual subset label value is the subset label value corresponding to the input in the test sample set corresponding to the maximum predicted probability.
6. A method for improving the efficiency of automatic disease coding according to claim 5, characterized in that: The converting of each word corresponding to the standard disease name into a standard text vector in the word embedding layer comprises the following steps: Importing the word corresponding to each of the standard disease names into the trained word vector model to obtain the word vector corresponding to each of the standard disease names; Combining the word vectors corresponding to each of the disease standard names into a text vector, to obtain a text vector corresponding to each of the disease standard names; According to the set fixed length of the text, the part of the text corresponding to each text vector that exceeds the fixed length of the text is deleted, or the part of the text corresponding to each text vector that is less than the fixed length of the text is filled with 0, so as to obtain a standard text vector corresponding to each standard disease name.
7. A method for improving the efficiency of automatic disease coding according to claim 6, characterized in that: The method further includes training the word vector model, wherein the training steps include: A medical text training set is obtained, and each medical text in the obtained medical text training set is converted into a word through a word conversion model; The word vector model is trained using the converted words corresponding to all the medical texts to obtain a trained word vector model; the word vector model is a GloVe model.
8. A method for improving the efficiency of automatic disease coding according to claim 5, characterized in that: The step of obtaining the output result of the bidirectional long short-term memory layer comprises the following steps: Using a dynamic RNN model to process each of the standard text vectors, obtaining a forward output result and a reverse output result of the first layer of the bidirectional long short-term memory layer; Concatenate the forward output result and the reverse output result of the first layer, and sequentially pass the concatenated results to the second layer of the bidirectional long short-term memory layer; The splicing result is processed by using a dynamic RNN model to obtain a forward output result and a reverse output result of the second layer of the bidirectional long short-term memory layer; The forward output result and the reverse output result of the second layer are concatenated to obtain the output result of the bidirectional long short-term memory layer.
9. A method for improving the efficiency of automatic disease coding according to claim 5, characterized in that: The step of obtaining the output result of the attention mechanism layer comprises the following steps: Initialize a weight vector; The output result of the bidirectional long short-term memory layer is nonlinearly transformed by using an activation function to obtain a transformation vector matrix; The weight vector and the conversion vector matrix are multiplied by matrix multiplication, and the result of the multiplication is normalized to obtain a normalized vector matrix; The normalized vector matrix is used to perform weighted summation on the output results of the bidirectional long short-term memory layer to obtain the output result of the attention mechanism layer.
