Medical text error correction method and device, storage medium, and electronic device
By calculating the context confidence, character similarity and entity similarity of medical text, the existing medical text error correction methods are solved in terms of accuracy, maintenance difficulty and scalability, and more efficient and flexible error correction effects are achieved. .
Patent Information
- Application Number
- CN202210333402.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-30
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2042-03-30
AI Technical Summary
Existing medical text error correction methods have problems such as poor accuracy, difficulty in maintaining and weak scalability in the medical field, especially when dealing with the particularity of complex medical terms and language.
By obtaining target medical text and medical named entities, context confidence, character similarity, and entity similarity are calculated, and these indicators are used to correct medical texts. The specific steps include: inputting medical text into a pre-trained medical language representation model for context confidence calculation, and calculating the context confidence of candidate words; calculating character similarity for target medical text and candidate words, including glyphs and pronunciation similarity. Degree; determine the position coordinates of the candidate words based on context confidence, character similarity and entity similarity, and decide whether to correct errors based on the coordinates.
It improves the accuracy and scalability of medical text error correction, reduces maintenance difficulty, and can be effectively applied in different medical scenarios without the need for maintenance correction dictionary.
Smart Images

Figure CN114881006B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of natural language processing, and in particular to a medical text error correction method and device, a computer-readable storage medium, and an electronic device. Background Art
[0002] Typo detection is one of the most important problems in the field of NLP (Natural Language Processing). While several classic methods exist for typo detection, these methods fail to accurately grasp the true semantics of sentences, resulting in high costs and poor scalability. Consequently, deep learning has been successfully applied to natural language processing, surpassing classic methods in most tasks.
[0003] However, in medical texts, due to the complexity of terminology and the specificity of the language, commonly used deep learning models often fail. Different languages require different error correction methods. For medical records in various languages, error correction methods often rely on established medical rules. However, corrections for medical texts, such as Chinese medical records, are often based on dictionaries and rules, which can lead to poor accuracy, difficulty in maintenance, and limited scalability.
[0004] In view of this, there is an urgent need in this field to develop a new medical text error correction method and device.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the Invention
[0006] The purpose of the present disclosure is to provide a medical text correction method, a medical text correction device, a computer-readable storage medium and an electronic device, thereby overcoming, at least to a certain extent, the technical problems of poor accuracy, difficult maintenance and weak scalability caused by the limitations of related technologies.
[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by practice of the present disclosure.
[0008] According to one aspect of the present disclosure, a medical text error correction method is provided, the method comprising: acquiring a target medical text and a medical named entity, and performing context confidence calculation on the target medical text to obtain candidate characters and the context confidence of the candidate characters;
[0009] Performing character similarity calculation on the target medical text and the candidate characters to obtain character similarity, and performing entity similarity calculation on the candidate characters and the medical named entities to obtain entity similarity;
[0010] Based on the context confidence, the character similarity and the entity similarity, the target medical text is corrected using the candidate characters.
[0011] In an exemplary embodiment of the present disclosure, the performing context confidence calculation on the target medical text to obtain candidate characters and the context confidence of the candidate characters includes:
[0012] The target medical text is input into a pre-trained medical language representation model, so that the pre-trained medical language representation model performs context confidence calculation on the target medical text to obtain candidate words and the context confidence of the candidate words.
[0013] In an exemplary embodiment of the present disclosure, before inputting the target medical text into a pre-trained medical language representation model, the method further includes:
[0014] Obtaining positive samples of medical text for training the medical language representation model to be trained;
[0015] The medical text positive sample is input into the medical language representation model to be trained to train the medical language representation model to be trained until the training is completed to obtain a pre-trained medical language representation model.
[0016] In an exemplary embodiment of the present disclosure, the step of calculating the character similarity between the target medical text and the candidate characters to obtain the character similarity includes:
[0017] Calculating the glyph similarity between the target medical text and the candidate characters to obtain the glyph similarity;
[0018] Calculating the pronunciation similarity between the target medical text and the candidate characters to obtain the pronunciation similarity;
[0019] The character similarity between the target medical text and the candidate characters is determined according to the character shape similarity and the character pronunciation similarity.
[0020] In an exemplary embodiment of the present disclosure, the step of calculating the glyph similarity between the target medical text and the glyphs of the candidate characters to obtain the glyph similarity includes:
[0021] Performing an ideographic description on the target medical text to obtain a target text descriptor, and performing an ideographic description on the candidate characters to obtain candidate text descriptors;
[0022] Performing edit distance calculation on the target text descriptor and the candidate text descriptor to obtain a glyph edit distance between the target medical text and the candidate character;
[0023] A glyph similarity calculation is performed on the glyph edit distance to obtain the glyph similarity between the target medical text and the candidate character.
[0024] In an exemplary embodiment of the present disclosure, the step of calculating the pronunciation similarity between the target medical text and the candidate characters to obtain the pronunciation similarity includes:
[0025] Obtaining a target pronunciation representation of the target medical text and obtaining a candidate pronunciation representation of the candidate character;
[0026] Performing an edit distance calculation on the target pronunciation representation and the candidate pronunciation representation to obtain a pronunciation edit distance between the target medical text and the candidate character;
[0027] The pronunciation similarity of the target medical text and the candidate characters is calculated by performing a pronunciation similarity calculation on the pronunciation edit distance.
[0028] In an exemplary embodiment of the present disclosure, determining the character similarity between the target medical text and the candidate character according to the glyph similarity and the pronunciation similarity includes:
[0029] Determining the glyph similarity as the character similarity between the target medical text and the candidate character; or
[0030] Determine the pronunciation similarity as the character similarity between the target medical text and the candidate character; or
[0031] The character similarity between the target medical text and the candidate characters is obtained by performing a weighted calculation on the character shape similarity and the character pronunciation similarity.
[0032] In an exemplary embodiment of the present disclosure, performing text error correction on the target medical text using the candidate characters based on the context confidence, the character similarity, and the entity similarity includes:
[0033] Acquire a medical text negative sample corresponding to the medical text positive sample, and perform an ablation test on the medical text positive sample and the medical text negative sample to obtain an ablation plane;
[0034] Determining the position coordinates of the candidate character relative to the ablation plane according to the context confidence, the character similarity, and the entity similarity;
[0035] Based on the position coordinates, the candidate characters are used to perform text correction on the target medical text.
[0036] In an exemplary embodiment of the present disclosure, performing text error correction on the target medical text using the candidate characters based on the position coordinates includes:
[0037] If the position coordinates are above the ablation plane, the target medical text is corrected using the candidate characters.
[0038] In an exemplary embodiment of the present disclosure, the step of performing text error correction on the target medical text using the candidate characters includes:
[0039] If the position coordinates corresponding to the plurality of candidate characters are above the ablation plane, determining one of the plurality of candidate characters as the target candidate character according to the character similarity;
[0040] The target candidate characters are used to perform text error correction on the target medical text.
[0041] In an exemplary embodiment of the present disclosure, the method further includes:
[0042] If the position coordinates are below the ablation plane, the target medical text is retained.
[0043] In an exemplary embodiment of the present disclosure, the step of calculating entity similarity between the candidate character and the medical named entity to obtain entity similarity includes:
[0044] Performing edit distance calculation on the candidate character and the medical named entity to obtain an entity edit distance;
[0045] The entity edit distance is normalized to obtain the entity similarity between the candidate character and the medical named entity.
[0046] According to one aspect of the present disclosure, a medical text error correction device is provided, comprising: a first computing module configured to obtain a target medical text and a medical named entity, and perform context confidence calculation on the target medical text to obtain candidate characters and the context confidence of the candidate characters;
[0047] A second calculation module is configured to perform character similarity calculation on the target medical text and the candidate characters to obtain character similarity, and perform entity similarity calculation on the candidate characters and the medical named entities to obtain entity similarity;
[0048] The text error correction module is configured to perform text error correction on the target medical text using the candidate characters based on the context confidence, the character similarity and the entity similarity.
[0049] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor and a memory; wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the medical text error correction method of any of the above exemplary embodiments is implemented.
[0050] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the medical text error correction method in any of the above exemplary embodiments is implemented.
[0051] As can be seen from the above technical solutions, the medical text error correction method, medical text error correction device, computer storage medium, and electronic device in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:
[0052] In the method and apparatus provided by the exemplary embodiments of the present disclosure, the corresponding context confidence, character similarity, and entity similarity are calculated by using the target medical text and medical named entities, providing a data basis and theoretical support for text correction of the target medical text, enriching the data dimensions that can be used for text correction, and ensuring the accuracy of error detection and correction of typos from the perspective of data comprehensiveness. Furthermore, using context confidence, character similarity, and entity similarity as the basis for text correction effectively improves the correction effect of medical texts, improves the scalability of medical text correction through a systematic text correction method, enriches the application scenarios of medical text correction, and eliminates the need to use and maintain correction dictionaries, thus avoiding the generation of maintenance issues.
[0053] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and those skilled in the art can derive other drawings based on these drawings without inventive effort.
[0055] Figure 1 A flowchart schematically illustrates a method for correcting errors in medical texts in an exemplary embodiment of the present disclosure;
[0056] Figure 2 A flowchart schematically illustrates a method for training a medical language representation model in an exemplary embodiment of the present disclosure;
[0057] Figure 3Schematically illustrates a training diagram for training a BERT deep bidirectional language model in an exemplary embodiment of the present disclosure;
[0058] Figure 4 A schematic diagram schematically illustrates a flow chart of a method for calculating character similarity in an exemplary embodiment of the present disclosure;
[0059] Figure 5 A flowchart schematically illustrates a method for calculating glyph similarity in an exemplary embodiment of the present disclosure;
[0060] Figure 6 Schematically illustrates a diagram of glyph decomposition of ideographic descriptions in an exemplary embodiment of the present disclosure;
[0061] Figure 7 A flowchart schematically illustrates a method for calculating word pronunciation similarity in an exemplary embodiment of the present disclosure;
[0062] Figure 8 A flowchart schematically illustrates a method for determining character similarity in an exemplary embodiment of the present disclosure;
[0063] Figure 9 A flowchart schematically illustrates a method for calculating entity similarity in an exemplary embodiment of the present disclosure;
[0064] Figure 10 A flowchart schematically illustrating a method for text error correction in an exemplary embodiment of the present disclosure is provided;
[0065] Figure 11 A flowchart schematically illustrating a method for further text error correction in an exemplary embodiment of the present disclosure is provided;
[0066] Figure 12 A system diagram schematically illustrates a medical text error correction method in an application scenario in an exemplary embodiment of the present disclosure;
[0067] Figure 13 The following schematically shows a structural diagram of a medical text error correction device in an exemplary embodiment of the present disclosure;
[0068] Figure 14 Schematically illustrates an electronic device for implementing a medical text error correction method in an exemplary embodiment of the present disclosure;
[0069] Figure 15 A computer-readable storage medium for implementing a medical text error correction method in an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0070] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the present disclosure will be more comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or that other methods, components, devices, steps, etc. may be employed. In other cases, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0071] The terms "a", "an", "the" and "said" are used in this specification to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first" and "second" etc. are used only as labels and are not intended to limit the quantity of their objects.
[0072] In addition, the accompanying drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. Identical reference numerals in the drawings represent identical or similar parts, and thus repeated descriptions thereof will be omitted. Some of the blocks shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically separate entities.
[0073] Typo detection is one of the most important problems in the field of NLP.
[0074] Early classic methods were mostly based on traditional rules, N-Gram (an algorithm based on statistical language models) or probabilistic graphical models.
[0075] Xin, Yang, and others drew on a method commonly used in Chinese word segmentation to construct a directed acyclic graph. Typos can lead to incorrect segmentation results, resulting in a variety of word segmentation scenarios. This method adds all characters or words with similar pinyin in the segmentation results to a directed acyclic graph, constructing a graph model composed of similar words. The shortest path along the graph is then found as the most reasonable segmentation result.
[0076] Building on this approach, Zhao, Hai, and others added a conditional random field model for prediction and employed a large number of rules to refine the candidate word screening process, improving the effectiveness of correction. However, this approach suffers from a failure to accurately grasp the true semantics of a sentence. When a typo originates from a frequently occurring word, it often fails to recognize it. Furthermore, the addition of rules increases costs and limits the method's scalability.
[0077] Deep learning has been successfully applied to natural language processing, surpassing traditional methods in most tasks. Consequently, Chinese character error detection methods are increasingly turning to end-to-end character-based models. These powerful deep language models, trained on vast corpora, have been applied to Chinese character error detection tasks, significantly improving accuracy.
[0078] However, in medical texts, due to the complexity of terminology and the specificity of the language, commonly used models often fail. Different languages require different error correction methods. Foreign methods for correcting medical records in various languages often employ methods such as developing medical-specific rules, leveraging medical corpora to develop N-Gram language models, word embedding, and deep learning.
[0079] However, the correction of typos in Chinese medical records is mostly based on dictionaries and rules, which have problems such as poor accuracy, difficult maintenance, and weak scalability.
[0080] Specifically, existing Chinese medical record error correction methods, based on traditional language models like rules or N-Gram, are less accurate than deep language models. Furthermore, medical record error correction requires medical knowledge, further exacerbating the accuracy issue.
[0081] In addition, with the changes in medical scenarios or the development of medicine, rule-based models require manual updating of corresponding rules, which makes maintenance difficult. Different scenarios require different rules, and the scalability is weak.
[0082] In response to the problems existing in the related art, the present disclosure proposes a medical text error correction method. Figure 1 A flow chart of a medical text error correction method is shown. Figure 1 As shown, the medical text error correction method includes at least the following steps:
[0083] Step S110: Obtain target medical text and medical named entities, and perform context confidence calculation on the target medical text to obtain candidate words and their context confidences.
[0084] Step S120: Perform character similarity calculation on the target medical text and the candidate characters to obtain character similarity, and perform entity similarity calculation on the candidate characters and the medical named entities to obtain entity similarity.
[0085] Step S130: Based on context confidence, character similarity and entity similarity, the target medical text is corrected using candidate characters.
[0086] In the exemplary embodiment of the present disclosure, the corresponding context confidence, character similarity, and entity similarity are calculated by the target medical text and medical named entities, providing a data basis and theoretical support for text error correction of the target medical text, enriching the data dimensions that text error correction can be based on, and ensuring the accuracy of error detection and correction of typos from the perspective of data comprehensiveness. Furthermore, using context confidence, character similarity, and entity similarity as the basis for text error correction effectively improves the error correction effect of medical texts, and also improves the scalability of medical text error correction through a systematic text error correction method, enriching the application scenarios of medical text error correction, and eliminating the need to use and maintain correction dictionaries, thus avoiding the generation of maintenance problems.
[0087] The following describes in detail the various steps of the medical text error correction method.
[0088] In step S110 , target medical text and medical named entities are acquired, and context confidence calculation is performed on the target medical text to obtain candidate characters and their context confidences.
[0089] In an exemplary embodiment of the present disclosure, the target medical text may be a medical text to be identified for typos and corresponding typos to be corrected, such as a hospital medical record text to be identified, etc. This exemplary embodiment does not specifically limit this.
[0090] After obtaining the target medical text, the context confidence of the target medical text can be further calculated.
[0091] In an optional embodiment, the target medical text is input into a pre-trained medical language representation model, so that the pre-trained medical language representation model performs context confidence calculation on the target medical text to obtain candidate words and the context confidence of the candidate words.
[0092] In some embodiments, for each word in the target medical text, multiple candidate words corresponding to the word and the context confidence of each candidate word are obtained.
[0093] Before inputting the target medical text into a pre-trained medical language representation model, the medical language representation model to be trained may be trained first to obtain a trained medical language representation model.
[0094] In an alternative embodiment, Figure 2 A flow chart of the method for training a medical language representation model is shown, as Figure 2As shown, the method includes at least the following steps: in step S210, obtaining positive samples of medical texts for training the medical language representation model to be trained.
[0095] The difficulty in correcting errors in target medical text, such as medical records, lies in the fact that many errors in medical entities are not identifiable by language models. Therefore, it is useful to collect a large amount of real and correct hospital medical record data. This positive sample of medical text can be collected error-free medical text, such as hospital medical records that have been manually verified to be correct.
[0096] Furthermore, the medical language representation model to be trained may be a BERT (Bidirectional Encoder Representations from Transformers) language model or other language models, which is not particularly limited in this exemplary embodiment.
[0097] BERT is a deep bidirectional language model that consists of multiple structural layers: input layer, word vector construction layer, Bi-LSTM (Bi-directional Long Short-Term Memory) network layer, self-attention mechanism layer, and output layer.
[0098] In the first input layer, the positive samples of medical text to be predicted are input into the BERT language model; in the second word vector construction layer, each word is mapped to a low-dimensional vector; in the third Bi-LSTM network layer, Bi-LSTM is used to extract relevance features from the word vector layer based on each word vector and sentence vector; in the fourth self-attention mechanism layer, a weight vector corresponding to each word is generated, and by multiplying with each weight vector, the word-level features in each iteration are merged into sentence-level features to obtain the feature data of the positive sample of medical text; in the fifth output layer, the feature data of the positive sample of medical text is used to train the complete medical language representation model.
[0099] In step S220, the positive samples of medical texts are input into the medical language representation model to be trained to train the medical language representation model to be trained, until the training is completed to obtain a pre-trained medical language representation model.
[0100] When using BERT as a medical language representation model, the BERT deep bidirectional language model mainly uses a bidirectional Transformer encoding layer, abandons the recurrent network structure of RNN (Recurrent Neural Network), and is completely based on the attention mechanism.
[0101] The BERT deep bidirectional language model uses the Transformer Encoder to extract text features. The Encoder consists of a self-attention mechanism and a feed Fordward Neural Network.
[0102] The core of the Encoder is Self-Attention, which can determine the relationship between each word and other words in the current text sentence without any distance restrictions. Therefore, it can fully mine the left and right context information of each word to obtain a bidirectional representation of the word.
[0103] Figure 3 A training diagram for training the BERT deep bidirectional language model is shown, as Figure 3 As shown in the figure, BERT is a pre-trained language representation model. BERT combines the powerful feature extractor Transformer with a bidirectional language model. It uses the Masked Language Model (MLM) and Next Sentence Prediction pre-training methods to generate deep bidirectional language representations.
[0104] When performing word embedding representation, three dimensions of information are extracted for each positive sample of medical text.
[0105] Among them, Token Embedding is the word vector corresponding to the original concept, where E CLS Identifies the start information of each sentence, E SEP Identifies the segmentation information of the two sentences.
[0106] Segment Embedding is used for sentence pair training, where E A and E B Will be trained along with the model. If it is a downstream task with only one sentence, then there will only be E A .
[0107] Position Embedding is used to identify the position information of word vectors.
[0108] Therefore, the sum of the three constitutes the input part of the model.
[0109] Next, the model is pre-trained through MLM and Next Sentence Prediction.
[0110] The so-called MLM is to randomly replace certain words in a sentence with masks according to a certain probability (for example, 15%), and then the task is to predict these masked words, which is equivalent to the task of filling in the blanks.
[0111] For example, my dog is hairy → my dog is [MASK]. These [MASK] will also correspond to an Embedding and will be trained along with the model.
[0112] In fact, in practice, [MASK] will be used for replacement in about 80% of cases, the remaining 10% of words will be replaced by other randomly selected words, and the other 10% of words will remain unchanged.
[0113] The so-called Next Sentence Prediction is set up to cope with downstream tasks that utilize the correlation between sentence pairs, such as question-answering tasks and reasoning tasks.
[0114] 50% of these sentence pairs are actually two consecutive sentences in the original corpus, and 50% are two randomly selected sentences with no connection. The sentences with a connection are labeled as 1, and the sentences without a connection are labeled as 0.
[0115] It should be noted that if the downstream task is only for a sentence, such as the classification of a single sentence, then there is no need to construct Next Sentence Prediction, and only MLM is needed; if the downstream task needs to utilize the correlation between two sentences, such as reading comprehension, automatic question answering, etc., it is necessary to use MLM and Next Sentence Prediction at the same time.
[0116] When training the BERT medical language representation model to obtain a trained medical language representation model, the BERT classification model algorithm can be iterated 20 times, and a loss function of the BERT classification model algorithm is calculated during each iteration. When the loss function meets a predetermined threshold, the BERT medical language representation model is considered complete.
[0117] Therefore, using the BERT model as a medical language representation model and adopting a bidirectional Transformer network structure with stronger expression capabilities to pre-train a large number of positive medical text samples can obtain a more general deep bidirectional language model, improve the model's language comprehension ability, and improve the model's accuracy.
[0118] After the BERT medical language representation model is trained, the target medical text can be input into the trained BERT medical language representation model. The trained BERT medical language representation model can then calculate the contextual confidence of the target medical text to obtain candidate words corresponding to the target medical text and the contextual confidence of each candidate word. The candidate words can be the top N candidate words for each word in the target medical text, and this exemplary embodiment does not impose any specific restrictions on the number of N.
[0119] In this exemplary embodiment, contextual confidence is calculated for target medical texts using a pre-trained medical language representation model. This allows for more comprehensive and accurate identification of candidate characters corresponding to target medical texts, such as medical records, providing data support for subsequent text error correction. Furthermore, the use of a medical language representation model for contextual confidence calculation ensures the maintainability of contextual confidence during medical text error correction, further ensuring the maintainability of medical text error correction.
[0120] In step S120 , character similarity is calculated between the target medical text and the candidate characters to obtain character similarity, and entity similarity is calculated between the candidate characters and the medical named entities to obtain entity similarity.
[0121] In an exemplary embodiment of the present disclosure, after the target medical text and the candidate characters are acquired, character similarity calculation may be performed on the target medical text and the candidate characters.
[0122] In an alternative embodiment, Figure 4 A flow chart of a method for calculating character similarity is shown in FIG. Figure 4 As shown, the method at least includes the following steps: in step S410, the glyph similarity is calculated between the glyphs of the target medical text characters and the corresponding candidate characters to obtain the glyph similarity.
[0123] In an alternative embodiment, Figure 5 A flow chart of a method for calculating the similarity of glyphs is shown in FIG. Figure 5 As shown, the method at least includes the following steps: in step S510, an ideographic description is performed on the target medical text to obtain a target text descriptor, and an ideographic description is performed on the candidate characters to obtain a candidate text descriptor.
[0124] In order to express the target medical text and candidate characters in ideographic form, the IDS (Ideographic Description Sequences) character representation specified in the Unicode encoding standard may be used for description.
[0125] Among them, Unicode is an industry standard in the field of computer science, including character sets, encoding schemes, etc.
[0126] Figure 6 The schematic diagram of the glyph decomposition of ideographic description is shown, such as Figure 6 shown. For the character "贫" (poor), above the dotted line is the IDS string representation of "贫", and below the dotted line is the IDS tree representation.
[0127] Among them, the three representation methods of ①-③ represent different fine-grained IDS tree representations. It can be found that the IDS string representation is the preorder traversal path of the IDS tree representation. That is, the IDS string can be obtained by traversing each character in the IDS tree representation in the order from top to bottom and from left to right.
[0128] The finest-grained IDS tree representation (③ tree representation) of the character "贫" is, from top to bottom and from left to right in turn: 丿、、 、丿、 丨、 、 丿、, then the IDS string of the character "贫" is: 丿 丿 丨 丿。
[0129] Among them, symbols such as represent the Chinese character structure of the character. Specifically, represents the upper-lower structure, represents the left-right structure, represents the upper-right surrounded structure, represents the upper-three surrounded structure.
[0130] It should be noted that when using IDS to represent characters for ideographic description of the target medical text and candidate characters, any granularity can be obtained. Preferably, the IDS representation characters at the finest granularity can be obtained.
[0131] Since the IDS representation characters at the finest granularity can more detailedly represent the composition order between the characters that make up the text, they can be more accurate when calculating the glyph similarity.
[0132] Therefore, after ideographic description of the target medical text and candidate characters through IDS representation characters, target text descriptors and candidate text descriptors can be obtained.
[0133] In step S520 , an edit distance calculation is performed on the target text descriptor and the candidate text descriptors to obtain a glyph edit distance between the target medical text and the candidate characters.
[0134] After obtaining the target text description and the candidate text descriptors, the glyph edit distance between the target medical text and the candidate text can be calculated using the target text descriptors and the candidate text descriptors. The glyph edit distance can represent the number of characters required to replace the candidate text to the target medical text.
[0135] The edit distance calculation may be implemented by Levenshtein edit distance or by tree edit distance represented by an IDS tree type, which is not particularly limited in this exemplary embodiment.
[0136] In step S530 , the glyph similarity is calculated based on the glyph edit distance to obtain the glyph similarity between the target medical text and the candidate characters.
[0137] After calculating the glyph edit distance, the glyph similarity between the target medical text character and the corresponding candidate character can be calculated.
[0138] Generally, the glyph similarity can be calculated using formula (1):
[0139]
[0140] Among them, glyph edit distance (target text descriptor, candidate text descriptor) represents the glyph edit distance between the target medical text and the candidate character, length (target text descriptor) represents the length of the IDS representation characters of the target text descriptor, length (candidate text descriptor) represents the length of the IDS representation characters of the candidate text descriptor, and max (length (target text descriptor), length (candidate text descriptor)) represents the maximum value of the glyph edit distance between the target medical text and the candidate character.
[0141] For the same word, the length of the IDS character representation at different granularities is different. The longer the length, the finer the granularity.
[0142] In this exemplary embodiment, the glyph similarity calculation is performed on the target medical text and candidate characters after the ideographic description, which fully utilizes the characteristics of Chinese characters as ideographic characters, effectively calculates the glyph similarity between the target medical text and candidate characters, and can further improve the accuracy of text correction.
[0143] In step S420, the pronunciation similarity of the characters in the target medical text and the pronunciation of the corresponding candidate characters is calculated to obtain the pronunciation similarity.
[0144] In an alternative embodiment, Figure 7A flow chart of a method for calculating phonetic similarity is shown in FIG. Figure 7 As shown, the method includes at least the following steps: in step S710, a target pronunciation representation of a target medical text is obtained, and candidate pronunciation representations of candidate characters are obtained.
[0145] Taking into account the influence of Chinese homophones, for the target medical text and candidate characters, the pronunciation representations of Chinese characters in the corresponding different preset language types can be obtained respectively. For example, Mandarin Chinese (MC) Pinyin, Cantonese Chinese (CC) Pinyin, Korean (K) Hanzi Latin Pinyin, Japanese Kanji (JO) Romaji, and Vietnamese (V) Hanzi Pinyin can be obtained to represent the pronunciation of each Chinese character. These language types contain a large amount of pronunciation representation information of Chinese characters, so the pronunciation representation information can be used to obtain the target pronunciation representation and candidate pronunciation representation.
[0146] In step S720, an edit distance calculation is performed on the target pronunciation representation and the candidate pronunciation representation to obtain a pronunciation edit distance between the target medical text and the candidate character.
[0147] After obtaining the target pronunciation representation and the candidate pronunciation representation, the pronunciation edit distance between the target medical text and the candidate character can be further calculated. The pronunciation edit distance is recorded as the number of characters required to replace the candidate pronunciation representation of the candidate character to modify it to the target pronunciation representation of the target medical text.
[0148] The edit distance calculation may be implemented by using the Levenshtein edit distance, which is not particularly limited in this exemplary embodiment.
[0149] In step S730, the pronunciation similarity is calculated based on the pronunciation edit distance to obtain the pronunciation similarity between the target medical text and the candidate characters.
[0150] After the pronunciation edit distance is calculated, the pronunciation similarity can be calculated for the pronunciation edit distance.
[0151] For example, formula (2) can be used for calculation:
[0152]
[0153] Among them, the phonetic edit distance (target pronunciation representation, candidate pronunciation representation) represents the phonetic edit distance between the target medical text and the candidate character, length (target pronunciation representation) represents the length of the target pronunciation representation of the target medical text, length (candidate pronunciation representation) represents the length of the candidate pronunciation representation of the candidate character, and max (length (target pronunciation representation), length (candidate pronunciation representation)) represents the maximum value of the phonetic edit distance between the target medical text and the candidate character.
[0154] In this exemplary embodiment, the pronunciation similarity is calculated by using the corresponding pronunciation representations of the target medical text and the candidate characters. The calculation method is simple and accurate, and can take into account the influence of Chinese homophones, further ensuring the accuracy of text correction.
[0155] In step S430 , the character similarity between the target medical text and the candidate characters is determined based on the glyph similarity and the pronunciation similarity.
[0156] In an alternative embodiment, Figure 8 A flow chart of a method for determining character similarity is shown in FIG. Figure 8 As shown, the method at least includes the following steps: in step S810, the glyph similarity is determined as the character similarity between the target medical text and the candidate word.
[0157] When determining the character similarity between the target medical text and the candidate word based on the glyph similarity and the phonetic similarity, either the glyph similarity or the phonetic similarity can be selected for representation.
[0158] In step S820 , the pronunciation similarity is determined as the character similarity between the target medical text and the candidate characters.
[0159] When determining the character similarity between the target medical text and the candidate word based on the glyph similarity and the phonetic similarity, either the glyph similarity or the phonetic similarity can be selected for representation.
[0160] In step S830, the character similarity between the target medical text and the candidate characters is obtained by performing a weighted calculation on the character shape similarity and the character pronunciation similarity.
[0161] When determining the character similarity between the target medical text and the candidate characters based on the glyph similarity and the pronunciation similarity, the character similarity can also be calculated based on the glyph similarity and the pronunciation similarity at the same time.
[0162] Specifically, the character similarity between the target medical text and the candidate characters may be obtained by performing a weighted calculation on the character shape similarity and the character pronunciation similarity.
[0163] The weights corresponding to the glyph similarity and the pronunciation similarity can be determined based on whether glyph or pronunciation is given more weight in different application scenarios.
[0164] For example, the weights corresponding to the glyph similarity and the pronunciation similarity may be set to 0.5, or the weight corresponding to the pronunciation similarity may be set to a larger value, etc. This exemplary embodiment does not impose any special limitation on this.
[0165] It is worth noting that among the three methods of determining character similarity provided in steps S810 to S830, any one of them can be selected according to actual circumstances and needs, and this exemplary embodiment does not impose any special limitation on this.
[0166] In this exemplary embodiment, three methods for determining character similarity between a target medical text and a candidate word based on glyph similarity and / or pronunciation similarity are provided, further enriching the application scenarios of text error correction.
[0167] In addition, after obtaining the candidate words of the target medical text, entity similarity calculation can be performed on the candidate words and medical named entities.
[0168] In an alternative embodiment, Figure 9 A flow chart of a method for calculating entity similarity is shown in FIG. Figure 9 As shown, the method at least includes the following steps: in step S910, the edit distance between the candidate character and the medical named entity is calculated to obtain the entity edit distance.
[0169] The medical named entities may be data in a constructed biomedical named entity database, and the medical named entities may include drug entities, disease entities, etc., which are not particularly limited in this exemplary embodiment.
[0170] In order to determine the medical named entity corresponding to the candidate character, the target medical text corresponding to the candidate character can be put back to the corresponding position, and the target medical text can be segmented to obtain the vocabulary of the target medical text corresponding to the candidate character, so as to determine the medical named entity corresponding to the vocabulary as the medical named entity of the candidate character.
[0171] After calculating the edit distance between the candidate word and the medical named entity, the entity edit distance is obtained, and the entity edit distance represents the number of characters that need to be replaced to modify the candidate word into the medical named entity.
[0172] The edit distance calculation may be implemented by using the Levenshtein edit distance, which is not particularly limited in this exemplary embodiment.
[0173] When there are multiple medical named entities corresponding to the candidate character, the edit distances between the candidate character and the multiple medical named entities may be calculated respectively, and the closest edit distance may be determined as the entity edit distance.
[0174] In step S920 , the entity edit distance is normalized to obtain the entity similarity between the candidate character and the medical named entity.
[0175] Since the number of characters between candidate words and corresponding medical named entities may affect the entity edit distance, the entity edit distance can be normalized.
[0176] Among them, normalization is a way to simplify calculations, that is, to transform a dimensioned expression into a dimensionless expression, which becomes a scalar.
[0177] Therefore, after normalizing the entity edit distance, the entity similarity between the candidate word and the medical named entity can be obtained.
[0178] In this exemplary embodiment, entity similarity is obtained by performing edit distance calculation and normalization processing on candidate characters and medical named entities. The calculation method is simple and convenient, and the influence of the length of different words is taken into account, thereby ensuring the calculation accuracy of entity similarity.
[0179] In step S130 , the target medical text is corrected using the candidate characters based on context confidence, character similarity, and entity similarity.
[0180] In an exemplary embodiment of the present disclosure, after calculating the context confidence, character similarity and entity similarity, the context confidence, character similarity and entity similarity can be used as a basis for text correction of the target medical text using candidate characters.
[0181] In an alternative embodiment, Figure 10 A flowchart of a text error correction method is shown in FIG. Figure 10 As shown, the method includes at least the following steps: in step S1010, a medical text negative sample corresponding to the medical text positive sample is obtained, and an ablation test is performed on the medical text positive sample and the medical text negative sample to obtain an ablation plane.
[0182] The medical text negative sample may be a collected medical text with errors, such as an erroneous hospital medical record text, etc., which is not particularly limited in this exemplary embodiment.
[0183] The original meaning of "ablation" was the surgical removal of body tissue. The term "ablation research" has its roots in the field of experimental psychology in the 1960s and 1970s, in which parts of an animal's brain were removed to study its effects on its behavior.
[0184] In the context of machine learning, and particularly complex deep neural networks, “ablation studies” have been employed to describe the process of removing parts of a network in order to better understand its behavior.
[0185] Understanding the causal relationships in a system is the most direct way to generate reliable knowledge (the goal of any research). Ablation is a very low-effort way to study causal relationships.
[0186] With any complex deep learning experimental setup, it is possible to remove some modules (or replace some trained features with random modules) without any loss in performance.
[0187] When performing ablation experiments using positive medical text samples and negative medical text samples, the context confidence, character similarity, and entity similarity of the positive medical text samples and the negative medical text samples may be calculated respectively.
[0188] Furthermore, an ablation plane is formed in three-dimensional space using the context confidence, character similarity, and entity similarity of the positive and negative medical text samples as coordinates. The ablation plane can be a plane that separates the correct positive medical text samples from the incorrect negative medical text samples as much as possible.
[0189] Then, the coordinates determined by the context confidence, character similarity and entity similarity of the positive sample of the medical text can be located above the ablation plane, or the coordinates formed by the context confidence, character similarity and entity similarity of the negative sample of the medical text can be located below the ablation plane.
[0190] In step S1020, the position coordinates of the candidate characters relative to the ablation plane are determined based on the context confidence, character similarity, and entity similarity.
[0191] Similar to the method used to determine corresponding coordinates based on contextual confidence, character similarity, and entity similarity for positive and negative medical text samples, corresponding coordinates can also be determined in three-dimensional space based on the contextual confidence, character similarity, and entity similarity of the target medical text. Furthermore, since the ablation plane has been determined, the coordinates relative to the ablation plane can also be obtained.
[0192] In step S1030, based on the position coordinates, the candidate characters are used to perform text correction on the target medical text.
[0193] In an optional embodiment, if the position coordinates are above the ablation plane, the target medical text is corrected using the candidate characters.
[0194] When the position coordinates determined by context confidence, character similarity, and entity similarity are above the ablation plane, it indicates that the target medical text is incorrectly recognized. Therefore, text correction can be performed on the target medical text based on the candidate characters corresponding to the position coordinates.
[0195] Correspondingly, when the position coordinates determined by context confidence, character similarity, and entity similarity are below the ablation plane, there is no need to use candidate characters to perform text correction on the target medical text.
[0196] In an optional embodiment, if the location coordinates are below the ablation plane, the target medical text is retained.
[0197] When the position coordinates determined by the context confidence, character similarity, and entity similarity are below the ablation plane, it indicates that the target medical text is correctly identified. Therefore, there is no need to perform text correction on the target medical text, and the corresponding target medical text can be retained unchanged.
[0198] In an alternative embodiment, Figure 11 A flow chart of a further text error correction method is shown, as Figure 11 As shown, the method includes at least the following steps: in step S1110, if the position coordinates corresponding to multiple candidate characters are above the ablation plane, one of the multiple candidate characters is determined as the target candidate character based on character similarity.
[0199] When the target medical text corresponds to multiple candidate characters, the position coordinates corresponding to the multiple candidate characters will be located above the ablation plane.
[0200] In this case, the character similarities of multiple candidate characters may be compared, and the one with the greatest character similarity may be determined as the target candidate character.
[0201] The character similarity at this time may be the pronunciation similarity, which is not particularly limited in this exemplary embodiment.
[0202] In step S1120, the target medical text is corrected using the target candidate characters.
[0203] After the target candidate characters are determined, the target candidate characters can be used to perform text correction on the target medical text.
[0204] Specifically, the target candidate characters may be used to replace the corresponding target medical text to achieve text error correction.
[0205] In this exemplary embodiment, a method for implementing text correction in the presence of multiple candidate characters is proposed. This ensures both accuracy and precision of text correction. Furthermore, the design of the ablation plane allows text correction to consider a wider range of data dimensions, thereby improving the accuracy of text correction from the perspective of data comprehensiveness.
[0206] The following describes in detail the medical text error correction method in the embodiment of the present disclosure in conjunction with an application scenario.
[0207] Figure 12 A system diagram of the medical text error correction method in an application scenario is shown. Figure 12 As shown in Figure 1, the medical text error correction system can be composed of a denoising autoencoder and a decoder. The denoising autoencoder is a pre-trained medical language representation model.
[0208] When training a medical language representation model, positive samples of medical texts for training the medical language representation model to be trained may be obtained.
[0209] The difficulty in correcting errors in target medical text, such as medical records, lies in the fact that many errors in medical entities are not identifiable by language models. Therefore, it is useful to collect a large amount of real and correct hospital medical record data. Therefore, the positive examples of medical text can be collected error-free medical text, such as correct hospital medical records.
[0210] Furthermore, the medical language representation model to be trained may be a BERT language model or other language models, and this exemplary embodiment does not impose any special limitation on this.
[0211] Furthermore, the positive samples of medical texts are input into the medical language representation model to be trained to train the medical language representation model to be trained, until the training is completed to obtain a pre-trained medical language representation model.
[0212] When performing word embedding representation, three dimensions of information are extracted from each positive sample of medical text.
[0213] Among them, Token Embedding is the word vector corresponding to the original concept, where E CLS Identifies the start information of each sentence, E SEP Identifies the segmentation information of the two sentences.
[0214] Segment Embedding is used for training sentence pair tasks, where E A and E B Will be trained along with the model. If it is a downstream task with only one sentence, then there will only be E A .
[0215] Position Embedding is used to identify the position information of word vectors.
[0216] Therefore, the sum of the three constitutes the input part of the model.
[0217] Next, the model is pre-trained through MLM and Next Sentence Prediction.
[0218] The so-called MLM is to randomly replace certain words in a sentence with masks according to a certain probability (for example, 15%), and then the task is to predict these masked words, which is equivalent to the task of filling in the blanks.
[0219] For example, my dog is hairy → my dog is [MASK]. These [MASK] will also correspond to an Embedding and will be trained along with the model.
[0220] In fact, in practice, [MASK] will be used for replacement in about 80% of cases, the remaining 10% of words will be replaced by other randomly selected words, and the other 10% of words will remain unchanged.
[0221] Next Sentence Prediction is designed to support downstream tasks that leverage the relationships between sentence pairs, such as question-answering and reasoning tasks. 50% of these sentence pairs are actually consecutive sentences in the original corpus, and 50% are randomly selected, unrelated sentences. Related sentences are labeled as class 1, while unrelated sentences are labeled as class 0.
[0222] It should be noted that if the sentece level representation is used, then the last layer of the model is used for E CLS After the parameters used in these language models are trained, they can be easily transferred to downstream tasks.
[0223] It is worth noting that if the downstream task is only for a sentence, such as the classification of a single sentence, then there is no need to construct Next Sentence Prediction, and only MLM is needed; if the downstream task needs to utilize the correlation between two sentences, such as reading comprehension, automatic question answering, etc., it is necessary to use MLM and Next Sentence Prediction at the same time.
[0224] When training the BERT medical language representation model to obtain a trained medical language representation model, the BERT classification model algorithm can be iterated 20 times, and a loss function of the BERT classification model algorithm is calculated during each iteration. When the loss function meets a predetermined threshold, the BERT medical language representation model is considered complete.
[0225] Therefore, for each word in the target medical text, the trained medical language representation model can generate several candidate words and corresponding contextual confidence scores. The contextual confidence scores can be calculated by the BERT medical language representation model and can reflect the credibility of the candidate words in the context.
[0226] For example, when the target medical text is "The patient occasionally has stabbing pain in the abdomen", the candidate characters corresponding to "患" calculated by the pre-trained BERT medical language representation model can be "患", "病", and "术". And the context confidence corresponding to "患" is 1.0000, while the context confidences corresponding to "病" and "术" are 0.0000; the candidate characters corresponding to "者" can be "者", "儿", and "侧", and the context confidence corresponding to "者" is 0.9999, while the context confidences corresponding to "儿" and "侧" are 0.0000; the candidate characters corresponding to "素" can include "诉", "上", and "下", and the context confidence corresponding to "诉" is 0.6463, while the context confidences corresponding to "上" and "下" are 0.0000;...
[0227] The decoder can be a candidate character filter for calculating the character similarity between the candidate character and the target medical text. This character similarity includes two parts: glyph similarity and phonetic similarity. In addition, other decoders can also be used to filter candidate characters. Specifically, the decoder can be formed based on simple rules, such as the rule of taking the first candidate as the error correction result, etc.
[0228] When calculating the glyph similarity, the target medical text is described by ideographic characters to obtain a target character descriptor, and the candidate character is described by ideographic characters to obtain a candidate character descriptor.
[0229] Among them, the target medical text can be a medical text to be identified for whether there are misspelled characters and the corresponding misspelled characters to be corrected, such as the hospital medical record text to be identified, etc. This exemplary embodiment does not make special limitations on this.
[0230] To perform ideographic character representation on the target medical text and the candidate character, the IDS representation characters specified in the Unicode encoding standard can be used for description.
[0231] After performing ideographic character description on the target medical text and the candidate character through the IDS representation characters, a target character descriptor and a candidate character descriptor can be obtained.
[0232] The edit distance between the target character descriptor and the candidate character descriptor is calculated to obtain the glyph edit distance between the target medical text and the candidate character.
[0233] After obtaining the target character description and the candidate character descriptor, the glyph edit distance between the target medical text and the candidate character can be calculated through the target character descriptor and the candidate character descriptor. This glyph edit distance can represent the number of characters that need to be replaced to modify the candidate character into the target medical text.
[0234] The edit distance calculation may be implemented by using the Levenshtein edit distance or the tree edit distance represented by the IDS tree type, which is not particularly limited in this exemplary embodiment.
[0235] The glyph similarity is calculated based on the glyph edit distance to obtain the glyph similarity between the target medical text and the candidate characters.
[0236] After calculating the glyph edit distance, the glyph similarity between the target medical text and the candidate characters can be calculated.
[0237] Generally, the glyph similarity can be calculated using formula (1), or by other methods, which is not particularly limited in this exemplary embodiment.
[0238] When calculating the word-phonetic similarity, a target pronunciation representation of the target medical text is obtained, and a candidate pronunciation representation of the candidate word is obtained.
[0239] Considering the influence of Chinese homophones, pronunciation representations of Chinese characters in different preset language types can be obtained for the target medical text and candidate characters. For example, Mandarin Chinese Pinyin, Cantonese Pinyin, Korean Hanzi Latinization, Japanese Hanzi romanization, and Vietnamese Hanzi Pinyin can be obtained to represent the pronunciation of each Chinese character. These language types contain a large amount of pronunciation representation information for Chinese characters, so this pronunciation representation information can be used to obtain the target pronunciation representation and candidate pronunciation representations.
[0240] The edit distance between the target pronunciation representation and the candidate pronunciation representation is calculated to obtain the pronunciation edit distance between the target medical text and the candidate word.
[0241] After obtaining the target pronunciation representation and the candidate pronunciation representation, the pronunciation edit distance between the target medical text and the candidate character can be further calculated. The pronunciation edit distance is recorded as the number of characters required to replace the candidate pronunciation representation of the candidate character to modify it to the target pronunciation representation of the target medical text.
[0242] The edit distance calculation may be implemented by using the Levenshtein edit distance, which is not particularly limited in this exemplary embodiment.
[0243] The phonetic similarity between the target medical text and the candidate characters is calculated by performing phonetic similarity calculation on the phonetic edit distance.
[0244] After the pronunciation edit distance is calculated, the pronunciation similarity can be calculated for the pronunciation edit distance.
[0245] For example, the calculation may be performed using formula (2), or other methods, which are not particularly limited in this exemplary embodiment.
[0246] Furthermore, the character similarity between the target medical text and the candidate characters is determined based on the character shape similarity and the character pronunciation similarity.
[0247] The glyph similarity is determined as the character similarity between the target medical text and the candidate word.
[0248] When determining the character similarity between the target medical text and the candidate word based on the glyph similarity and the phonetic similarity, either the glyph similarity or the phonetic similarity can be selected for representation.
[0249] The phonetic similarity is determined as the character similarity between the target medical text and the candidate word.
[0250] When determining the character similarity between the target medical text and the candidate word based on the glyph similarity and the phonetic similarity, either the glyph similarity or the phonetic similarity can be selected for representation.
[0251] The character similarity between the target medical text and the candidate characters is obtained by weighted calculation of the character shape similarity and the character pronunciation similarity.
[0252] When determining the character similarity between the target medical text and the candidate characters based on the glyph similarity and the pronunciation similarity, the character similarity can also be calculated based on the glyph similarity and the pronunciation similarity at the same time.
[0253] Specifically, the character similarity between the target medical text and the candidate characters may be obtained by performing a weighted calculation on the character shape similarity and the character pronunciation similarity.
[0254] The weights corresponding to the glyph similarity and the pronunciation similarity can be determined based on whether glyph or pronunciation is given more weight in different application scenarios.
[0255] For example, the weights corresponding to the glyph similarity and the pronunciation similarity may be set to 0.5, or the weight corresponding to the pronunciation similarity may be set to a larger value, etc. This exemplary embodiment does not impose any special limitation on this.
[0256] In addition to the trade-off between context confidence and character similarity, candidate words can also be filtered by combining medical named entities in the biomedical named entity database.
[0257] The edit distance between the candidate characters and the medical named entities is calculated to obtain the entity edit distance.
[0258] The medical named entities may be data in a constructed biomedical named entity database, and the medical named entities may include drug entities, disease entities, etc., which are not particularly limited in this exemplary embodiment.
[0259] In order to determine the medical named entity corresponding to the candidate character, the target medical text corresponding to the candidate character can be put back to the corresponding position, and the target medical text can be segmented to obtain the vocabulary of the target medical text corresponding to the candidate character, so as to determine the medical named entity corresponding to the vocabulary as the medical named entity of the candidate character.
[0260] After calculating the edit distance between the candidate word and the medical named entity, the entity edit distance is obtained, and the entity edit distance represents the number of characters that need to be replaced to modify the candidate word into the medical named entity.
[0261] The edit distance calculation may be implemented by using the Levenshtein edit distance, which is not particularly limited in this exemplary embodiment.
[0262] When there are multiple medical named entities corresponding to the candidate character, the edit distances between the candidate character and the multiple medical named entities may be calculated respectively, and the closest edit distance may be determined as the entity edit distance.
[0263] The entity edit distance is normalized to obtain the entity similarity between the candidate word and the medical named entity.
[0264] Since the number of characters between candidate words and corresponding medical named entities may affect the entity edit distance, the entity edit distance can be normalized.
[0265] Therefore, after normalizing the entity edit distance, the entity similarity between the candidate word and the medical named entity can be obtained.
[0266] Furthermore, after calculating the context confidence, character similarity and entity similarity, the context confidence, character similarity and entity similarity can be used as the basis for text correction of the target medical text using candidate words.
[0267] Obtain medical text negative samples corresponding to the medical text positive samples, and perform ablation tests on the medical text positive samples and the medical text negative samples to obtain ablation planes.
[0268] The medical text negative sample may be a collected medical text with errors, such as an erroneous hospital medical record text, etc., which is not particularly limited in this exemplary embodiment.
[0269] When performing ablation experiments using positive medical text samples and negative medical text samples, the context confidence, character similarity, and entity similarity of the positive medical text samples and the negative medical text samples may be calculated respectively.
[0270] Furthermore, an ablation plane is formed in three-dimensional space using the context confidence, character similarity, and entity similarity of the positive and negative medical text samples as coordinates. The ablation plane can be a plane that separates the correct positive medical text samples from the incorrect negative medical text samples as much as possible.
[0271] Then, the coordinates determined by the context confidence, character similarity and entity similarity of the positive sample of the medical text can be located above the ablation plane, or the coordinates formed by the context confidence, character similarity and entity similarity of the negative sample of the medical text can be located below the ablation plane.
[0272] The position coordinates of the candidate words on the ablation plane are determined based on context confidence, character similarity, and entity similarity.
[0273] Similar to the method used to determine corresponding coordinates based on contextual confidence, character similarity, and entity similarity for positive and negative medical text samples, corresponding coordinates can also be determined in three-dimensional space based on the contextual confidence, character similarity, and entity similarity of the target medical text. Furthermore, since the ablation plane has been determined, the coordinates relative to the ablation plane can also be obtained.
[0274] If the position coordinates are above the ablation plane, the candidate characters are used to perform text correction on the target medical text.
[0275] When the position coordinates determined by context confidence, character similarity, and entity similarity are above the ablation plane, it indicates that the target medical text is incorrectly recognized. Therefore, text correction can be performed on the target medical text based on the candidate characters corresponding to the position coordinates.
[0276] For example, when the target medical text is "The patient Su occasionally has stabbing pain in the abdomen", the position coordinates of "Su" can be determined to be above the ablation plane based on the context confidence, character similarity and entity similarity of the target medical text. Therefore, the corresponding candidate characters can be used to perform text correction on the character.
[0277] If the position coordinates corresponding to multiple candidate characters are above the ablation plane, one of the multiple candidate characters is determined as the target candidate character based on character similarity.
[0278] When the target medical text corresponds to multiple candidate characters, the position coordinates corresponding to the multiple candidate characters will be located above the ablation plane.
[0279] In this case, the character similarities of multiple candidate characters may be compared, and the one with the greatest character similarity may be determined as the target candidate character.
[0280] The character similarity at this time may be the pronunciation similarity, which is not particularly limited in this exemplary embodiment.
[0281] The target candidate characters are used to perform text correction on the target medical text.
[0282] After the target candidate characters are determined, the target candidate characters can be used to perform text correction on the target medical text.
[0283] Specifically, the target candidate characters may be used to replace the corresponding target medical text to achieve text error correction.
[0284] Correspondingly, when the position coordinates determined by context confidence, character similarity, and entity similarity are below the ablation plane, there is no need to use candidate characters to perform text correction on the target medical text.
[0285] If the position coordinates are below the ablation plane, the target medical text is retained.
[0286] When the position coordinates determined by the context confidence, character similarity, and entity similarity are below the ablation plane, it indicates that the target medical text is correctly identified. Therefore, there is no need to perform text correction on the target medical text, and the corresponding target medical text can be retained unchanged.
[0287] For example, when the target medical text is "The patient suffers from occasional stabbing pain in the abdomen", it can be determined that the position coordinates of "patient", "patient", "abdomen", "part", "occasionally", "have", "stabbing" and "pain" are all located below the ablation plane, and therefore the corresponding target medical text is retained unchanged.
[0288] In the medical text error correction method in the exemplary embodiment of the present disclosure, the corresponding context confidence, character similarity and entity similarity are calculated by the target medical text and medical named entities, which provides a data basis and theoretical support for text error correction of the target medical text, enriches the data dimensions that text error correction can be based on, and ensures the accuracy of typo detection and correction from the perspective of data comprehensiveness.
[0289] In terms of datasets, both accuracy and recall rates for error detection exceeded 95%, and for error correction, they exceeded 80%. Based on the medical text error correction method, the system automatically corrects typos in Chinese medical records. This system can detect over 95% of typos in real time during medical record input and provide correction suggestions with over 80% accuracy.
[0290] Moreover, this method does not require maintenance of a correction dictionary, so there is no maintenance problem.
[0291] Using context confidence, character similarity and entity similarity as the basis for text correction effectively improves the correction effect of medical texts. It also improves the scalability of medical text correction through systematic text correction methods and enriches the application scenarios of medical text correction.
[0292] Therefore, the medical text error correction method is highly scalable across diverse medical record scenarios. For example, a system based on this method can perform basic error correction across different hospitals and departments. To improve accuracy, different BERT medical language representation models can be trained using historical medical record data, making the corresponding system more suitable for the current scenario.
[0293] In addition, in an exemplary embodiment of the present disclosure, a medical text error correction device is also provided. Figure 13 The schematic diagram of the medical text error correction device is shown in FIG. Figure 13 As shown, the medical text error correction device 1300 may include: a first calculation module 1310, a second calculation module 1320 and a text error correction module 1330. Among them:
[0294] A first calculation module 1310 is configured to obtain a target medical text and a medical named entity, and perform context confidence calculation on the target medical text to obtain candidate characters and the context confidence of the candidate characters;
[0295] A second calculation module 1320 is configured to perform character similarity calculation on the target medical text and the candidate character to obtain character similarity, and perform entity similarity calculation on the candidate character and the medical named entity to obtain entity similarity;
[0296] The text correction module 1330 is configured to perform text correction on the target medical text using the candidate characters based on the context confidence, the character similarity and the entity similarity.
[0297] In an exemplary embodiment of the present disclosure, the performing context confidence calculation on the target medical text to obtain candidate characters and the context confidence of the candidate characters includes:
[0298] The target medical text is input into a pre-trained medical language representation model, so that the pre-trained medical language representation model performs context confidence calculation on the target medical text to obtain candidate words and the context confidence of the candidate words.
[0299] In an exemplary embodiment of the present disclosure, before inputting the target medical text into a pre-trained medical language representation model, the method further includes:
[0300] Obtaining positive samples of medical text for training the medical language representation model to be trained;
[0301] The medical text positive sample is input into the medical language representation model to be trained to train the medical language representation model to be trained until the training is completed to obtain a pre-trained medical language representation model.
[0302] In an exemplary embodiment of the present disclosure, the step of calculating the character similarity between the target medical text and the candidate characters to obtain the character similarity includes:
[0303] Calculating the glyph similarity between the target medical text and the candidate characters to obtain the glyph similarity;
[0304] Calculating the pronunciation similarity between the target medical text and the candidate characters to obtain the pronunciation similarity;
[0305] The character similarity between the target medical text and the candidate characters is determined according to the character shape similarity and the character pronunciation similarity.
[0306] In an exemplary embodiment of the present disclosure, the step of calculating the glyph similarity between the target medical text and the glyphs of the candidate characters to obtain the glyph similarity includes:
[0307] Performing an ideographic description on the target medical text to obtain a target text descriptor, and performing an ideographic description on the candidate characters to obtain candidate text descriptors;
[0308] Performing edit distance calculation on the target text descriptor and the candidate text descriptor to obtain a glyph edit distance between the target medical text and the candidate character;
[0309] A glyph similarity calculation is performed on the glyph edit distance to obtain the glyph similarity between the target medical text and the candidate character.
[0310] In an exemplary embodiment of the present disclosure, the step of calculating the pronunciation similarity between the target medical text and the candidate characters to obtain the pronunciation similarity includes:
[0311] Obtaining a target pronunciation representation of the target medical text and obtaining a candidate pronunciation representation of the candidate character;
[0312] Performing an edit distance calculation on the target pronunciation representation and the candidate pronunciation representation to obtain a pronunciation edit distance between the target medical text and the candidate character;
[0313] The pronunciation similarity of the target medical text and the candidate characters is calculated by performing a pronunciation similarity calculation on the pronunciation edit distance.
[0314] In an exemplary embodiment of the present disclosure, determining the character similarity between the target medical text and the candidate character according to the glyph similarity and the pronunciation similarity includes:
[0315] Determining the glyph similarity as the character similarity between the target medical text and the candidate character; or
[0316] Determine the pronunciation similarity as the character similarity between the target medical text and the candidate character; or
[0317] The character similarity between the target medical text and the candidate characters is obtained by performing a weighted calculation on the character shape similarity and the character pronunciation similarity.
[0318] In an exemplary embodiment of the present disclosure, performing text error correction on the target medical text using the candidate characters based on the context confidence, the character similarity, and the entity similarity includes:
[0319] Acquire a medical text negative sample corresponding to the medical text positive sample, and perform an ablation test on the medical text positive sample and the medical text negative sample to obtain an ablation plane;
[0320] Determining the position coordinates of the candidate character relative to the ablation plane according to the context confidence, the character similarity, and the entity similarity;
[0321] Based on the position coordinates, the candidate characters are used to perform text correction on the target medical text.
[0322] In an exemplary embodiment of the present disclosure, performing text error correction on the target medical text using the candidate characters based on the position coordinates includes:
[0323] If the position coordinates are above the ablation plane, the target medical text is corrected using the candidate characters.
[0324] In an exemplary embodiment of the present disclosure, the step of performing text error correction on the target medical text using the candidate characters includes:
[0325] If the position coordinates corresponding to the plurality of candidate characters are above the ablation plane, determining one of the plurality of candidate characters as the target candidate character according to the character similarity;
[0326] The target candidate characters are used to perform text error correction on the target medical text.
[0327] In an exemplary embodiment of the present disclosure, the method further includes:
[0328] If the position coordinates are below the ablation plane, the target medical text is retained.
[0329] In an exemplary embodiment of the present disclosure, the step of calculating entity similarity between the candidate character and the medical named entity to obtain entity similarity includes:
[0330] Performing edit distance calculation on the candidate character and the medical named entity to obtain an entity edit distance;
[0331] The entity edit distance is normalized to obtain the entity similarity between the candidate character and the medical named entity.
[0332] The specific details of the above-mentioned medical text correction device 1300 have been described in detail in the corresponding medical text correction method, so they will not be repeated here.
[0333] It should be noted that although the above detailed description mentions several modules or units of the medical text error correction device 1300, this division is not mandatory. In fact, according to embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in a single module or unit. Conversely, the features and functions of a single module or unit described above can be further divided and embodied by multiple modules or units.
[0334] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0335] Refer to the following Figure 14 The electronic device 1400 according to this embodiment of the present invention is described below. The electronic device 1400 shown in FIG14 is merely an example and should not limit the functions and scope of use of the embodiments of the present invention.
[0336] like Figure 14 As shown, electronic device 1400 is implemented as a general-purpose computing device. Components of electronic device 1400 may include, but are not limited to, the aforementioned at least one processing unit 1410, the aforementioned at least one storage unit 1420, a bus 1430 connecting various system components (including storage unit 1420 and processing unit 1410), and a display unit 1440.
[0337] The storage unit stores program codes, which can be executed by the processing unit 1410, so that the processing unit 1410 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification.
[0338] The storage unit 1420 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 1421 and / or a cache memory unit 1422 , and may further include a read-only memory unit (ROM) 1423 .
[0339] The storage unit 1420 may also include a program / utility 1424 having a set (at least one) of program modules 1425, such program modules 1425 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0340] The bus 1430 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0341] Electronic device 1400 can also communicate with one or more external devices 1600 (e.g., a keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 1400, and / or any device that enables electronic device 1400 to communicate with one or more other computing devices (e.g., a router, modem, etc.). Such communication can occur via input / output (I / O) interface 1450. Furthermore, electronic device 1400 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via network adapter 1460. As shown, network adapter 1440 communicates with other modules of electronic device 1400 via bus 1430. It should be understood that, although not shown, other hardware and / or software modules can be used in conjunction with electronic device 1400, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0342] Through the description of the above embodiments, it will be readily understood by those skilled in the art that the example embodiments described herein may be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (such as a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network and include several instructions for enabling a computing device (such as a personal computer, a server, a terminal device, or a network device, etc.) to execute the methods according to the embodiments of the present disclosure.
[0343] In exemplary embodiments of the present disclosure, a computer-readable storage medium is also provided, storing a program product capable of implementing the aforementioned methods of this specification. In some possible embodiments, various aspects of the present invention may also be implemented in the form of a program product comprising program code. When the program product is executed on a terminal device, the program code is configured to cause the terminal device to perform the steps according to various exemplary embodiments of the present invention described in the "Exemplary Methods" section of this specification.
[0344] refer to Figure 15 As shown, a program product 1500 for implementing the above method according to an embodiment of the present invention is described. The program product 1500 may be a portable compact disc read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0345] The program product may be implemented in any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0346] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0347] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0348] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0349] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow from the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.
Claims
1. A medical text error correction method, characterized in that: The method comprises: Acquire target medical text and medical named entities, and perform context confidence calculation on the target medical text to obtain candidate words and context confidence of the candidate words; Performing character similarity calculation on the target medical text and the candidate word to obtain character similarity, and performing entity similarity calculation on the candidate word and the medical named entity to obtain entity similarity; Based on the context confidence, the character similarity and the entity similarity, using the candidate characters to perform text error correction on the target medical text; The step of calculating the context confidence of the target medical text to obtain candidate words and the context confidence of the candidate words includes: Inputting the target medical text into a pre-trained medical language representation model, so that the pre-trained medical language representation model performs context confidence calculation on the target medical text to obtain candidate words and context confidence of the candidate words; The method of performing text error correction on the target medical text using the candidate characters based on the context confidence, the character similarity and the entity similarity includes: Acquire a negative sample of medical text corresponding to the positive sample of medical text, and perform an ablation test on the positive sample of medical text and the negative sample of medical text to obtain an ablation plane; Determining the position coordinates of the candidate character relative to the ablation plane according to the context confidence, the character similarity and the entity similarity; Based on the position coordinates, the candidate characters are used to perform text correction on the target medical text.
2. The medical text error correction method according to claim 1, characterized in that: Before inputting the target medical text into the pre-trained medical language representation model, the method further includes: Obtaining positive samples of medical texts for training a medical language representation model to be trained; The medical text positive sample is input into the medical language representation model to be trained to train the medical language representation model to be trained until the training is completed to obtain a pre-trained medical language representation model.
3. The medical text error correction method according to claim 2, characterized in that: The step of calculating the character similarity between the target medical text and the candidate characters to obtain the character similarity includes: Calculating the glyph similarity between the target medical text and the glyphs of the candidate characters to obtain the glyph similarity; Calculating the pronunciation similarity of the target medical text and the candidate characters to obtain the pronunciation similarity; The character similarity between the target medical text and the candidate character is determined according to the character shape similarity and the character pronunciation similarity.
4. The medical text error correction method according to claim 3, characterized in that: The step of calculating the glyph similarity between the target medical text and the glyphs of the candidate characters to obtain the glyph similarity includes: Performing an ideographic description on the target medical text to obtain a target text descriptor, and performing an ideographic description on the candidate characters to obtain candidate text descriptors; Performing edit distance calculation on the target text descriptor and the candidate text descriptor to obtain a glyph edit distance between the target medical text and the candidate character; The glyph similarity is calculated for the glyph edit distance to obtain the glyph similarity between the target medical text and the candidate character.
5. The medical text error correction method according to claim 3, characterized in that: The calculating the pronunciation similarity of the target medical text and the candidate characters to obtain the pronunciation similarity includes: Obtaining a target pronunciation representation of the target medical text, and obtaining a candidate pronunciation representation of the candidate character; Performing edit distance calculation on the target pronunciation representation and the candidate pronunciation representation to obtain a pronunciation edit distance between the target medical text and the candidate character; The pronunciation similarity is calculated for the pronunciation edit distance to obtain the pronunciation similarity between the target medical text and the candidate character.
6. The medical text error correction method according to claim 3, characterized in that: The step of determining the character similarity between the target medical text and the candidate character according to the character shape similarity and the character pronunciation similarity comprises: Determine the glyph similarity as the character similarity between the target medical text and the candidate character; or Determine the pronunciation similarity as the character similarity between the target medical text and the candidate character; or The character shape similarity and the character pronunciation similarity are weightedly calculated to obtain the character similarity between the target medical text and the candidate character.
7. The medical text error correction method according to claim 1, characterized in that: The step of performing text error correction on the target medical text using the candidate characters based on the position coordinates includes: If the position coordinates are above the ablation plane, the candidate characters are used to perform text correction on the target medical text.
8. The medical text error correction method according to claim 1, characterized in that: The step of using the candidate characters to perform text error correction on the target medical text includes: If the position coordinates corresponding to the plurality of candidate characters are above the ablation plane, determining one of the plurality of candidate characters as a target candidate character according to the character similarity; The target candidate characters are used to perform text error correction on the target medical text.
9. The medical text error correction method according to claim 7, characterized in that: The method further comprises: If the location coordinates are below the ablation plane, the target medical text is retained.
10. The medical text error correction method according to claim 1, characterized in that: The calculating entity similarity between the candidate word and the medical named entity to obtain entity similarity includes: Performing edit distance calculation on the candidate word and the medical named entity to obtain an entity edit distance; The entity edit distance is normalized to obtain the entity similarity between the candidate character and the medical named entity.
11. A medical text error correction device, characterized in that: include: A first calculation module is configured to obtain a target medical text and a medical named entity, and perform context confidence calculation on the target medical text to obtain candidate characters and context confidences of the candidate characters; A second calculation module is configured to perform character similarity calculation on the target medical text and the candidate word to obtain character similarity, and perform entity similarity calculation on the candidate word and the medical named entity to obtain entity similarity; A text error correction module is configured to perform text error correction on the target medical text using the candidate characters based on the context confidence, the character similarity and the entity similarity; The step of calculating the context confidence of the target medical text to obtain candidate words and the context confidence of the candidate words includes: Inputting the target medical text into a pre-trained medical language representation model, so that the pre-trained medical language representation model performs context confidence calculation on the target medical text to obtain candidate words and context confidence of the candidate words; The method of performing text error correction on the target medical text using the candidate characters based on the context confidence, the character similarity and the entity similarity includes: Acquire a negative sample of medical text corresponding to the positive sample of medical text, and perform an ablation test on the positive sample of medical text and the negative sample of medical text to obtain an ablation plane; Determining the position coordinates of the candidate character relative to the ablation plane according to the context confidence, the character similarity and the entity similarity; Based on the position coordinates, the candidate characters are used to perform text correction on the target medical text.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a transmitter, the medical text error correction method described in any one of claims 1-10 is implemented.
13. An electronic device, characterized in that: include: Transmitter; A memory, used to store executable instructions of the transmitter; Wherein, the transmitter is configured to execute the medical text error correction method described in any one of claims 1-10 by executing the executable instructions.
Citation Information
Patent Citations
Text error correction method, system and device and readable storage medium
CN112016310A
Medical information relation prediction method and system based on open world hypothesis
CN114003684A