Medical record text error correction method and device based on artificial intelligence, equipment and medium
By introducing artificial intelligence-based feature fusion and generator technology into the medical record text error correction method, the problem of low accuracy of medical record text error correction in the existing technology is solved, and a more efficient and accurate medical record text error correction effect is achieved.
Patent Information
- Application Number
- CN202411731847.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-11-27
AI Technical Summary
The accuracy of existing medical record text correction methods is low, especially when facing medical record text with more complex semantics, character-based error correction models are difficult to effectively use the text context information for error correction.
Using the medical record text error correction method based on artificial intelligence, the characteristics of the original characters are extracted through the character encoder, combined with the relevant term characteristics in the preset dictionary, the correlation between term characteristics and character characteristics is calculated, the fusion characteristics are generated, and the character generation is generated using the reconstruction generator, and the character sequence is finally spliced and generated as the error correction result.
By integrating character and term-level feature information, the accuracy of medical record text error correction is improved, and the semantic complex medical record text can be processed more effectively, providing more accurate error correction results.
Smart Images

Figure CN119647462A_ABST
Abstract
Description
Technical Field
[0001] The present invention is applicable to the field of medical data technology, and in particular relates to an artificial intelligence-based medical record text error correction method, device, equipment and medium. Background Art
[0002] Medical records can provide valuable basic data for medical treatment, scientific research, and teaching, and also provide indispensable medical information for hospital management. Based on the importance and rigor of medical records, correcting typos in medical record texts to obtain correct medical records is of great significance to hospitals, doctors and patients, as well as to medical treatment, scientific research, teaching, management and other work.
[0003] Since the medical record text correction model based on terms will be affected by incorrect word segmentation, resulting in a low accuracy rate of medical record text correction, the existing medical record text correction task usually adopts a character-based medical record text correction model. However, medical terms are obscure and difficult to understand. When faced with medical record texts with more complex semantics, the character-based medical record text correction model will make incorrect corrections due to the limitations of the character's ability to represent semantics. For example, when the term to which the character belongs has a reference relationship error or a parallel relationship error with other terms, the character-based medical record text correction model is difficult to effectively correct errors based on the contextual information of the text, resulting in a low accuracy rate of medical record text correction.
[0004] Therefore, in the field of medical data technology, how to improve the accuracy of medical record text error correction has become an urgent problem to be solved. Summary of the invention
[0005] In view of this, the embodiments of the present invention provide a medical record text correction method, device, equipment and medium based on artificial intelligence to solve the problem of low accuracy of medical record text correction in existing medical record text correction methods.
[0006] In a first aspect, an embodiment of the present invention provides a medical record text error correction method based on artificial intelligence, the medical record text error correction method comprising: Obtain a medical record to be corrected, extract text content in the medical record to be corrected, arrange all characters in the text content in the order in which the characters appear, and obtain an original character sequence, wherein the original character sequence includes N original characters, where N is a positive integer; For any original character, use a character encoder to extract features of the original character to obtain a character feature corresponding to the original character; Searching for a term containing the original character from a preset dictionary to obtain at least one related term, and using a term encoder to extract features of each related term to obtain term features corresponding to the related term; Calculate the correlation between each term feature and the character feature to obtain a correlation matrix of the corresponding term feature, calculate the term embedding feature based on all term features and their corresponding correlation matrix, and fuse the term embedding feature and the character feature to obtain a fusion feature corresponding to the original character; Use the reconstruction generator to generate characters for the fused features to obtain generated characters corresponding to the fused features, traverse all fused features, and obtain generated characters corresponding to each fused feature respectively; According to the order of the original characters corresponding to each generated character in the original character sequence, all generated characters are spliced into a generated character sequence, and the generated character sequence is determined to be the error correction result of the medical record to be corrected.
[0007] In a second aspect, an embodiment of the present invention provides a medical record text error correction device based on artificial intelligence, the medical record text error correction device comprising: A character sequence determination module is used to obtain a medical record to be corrected, extract text content in the medical record to be corrected, arrange all characters in the text content in the order of character appearance, and obtain an original character sequence, wherein the original character sequence includes N original characters, where N is a positive integer; A character feature extraction module, for extracting features of any original character using a character encoder to obtain a character feature of the original character; A term feature extraction module, used to search for terms containing the original characters from a preset dictionary to obtain at least one related term, and to use a term encoder to extract features of each related term to obtain term features corresponding to the related term; A fusion feature determination module is used to calculate the correlation between each term feature and the character feature to obtain a correlation matrix of the corresponding term feature, calculate the term embedding feature based on all term features and their corresponding correlation matrix, and perform feature fusion on the term embedding feature and the character feature to obtain a fusion feature corresponding to the original character; A character generation module, used to generate characters for the fused features using a reconstruction generator, obtain generated characters corresponding to the fused features, traverse all fused features, and obtain generated characters corresponding to each fused feature; The error correction result determination module is used to splice all generated characters into a generated character sequence according to the order of the original characters corresponding to each generated character in the original character sequence, and determine that the generated character sequence is the error correction result of the medical record to be corrected.
[0008] In a third aspect, an embodiment of the present invention provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the medical record text error correction method as described in the first aspect when executing the computer program.
[0009] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the medical record text error correction method as described in the first aspect is implemented.
[0010] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: by extracting the text content and the original character sequence in the medical record to be corrected, using a character encoder to extract features of the original characters to obtain character features, searching for terms containing the original characters from a preset dictionary to obtain at least one related term, using a term encoder to extract features of each related term respectively to obtain term features, calculating the correlation between each term feature and the character feature to obtain a correlation matrix, calculating the term embedding feature based on all term features and their corresponding correlation matrices, fusing the term embedding feature and the character feature to obtain the fused feature corresponding to the original character, A reconstruction generator is used to generate characters for the fused features to obtain generated characters corresponding to the fused features, all generated characters are concatenated into a generated character sequence, and the generated character sequence is determined to be the correction result of the medical record to be corrected. According to the correlation between the original characters and their associated terms, the term features are fused with the character features in the form of term embedding features, so that the fused features can effectively represent the syntactic and semantic information at the term level, providing richer feature information for the generator to generate characters to realize medical record text correction, thereby improving the accuracy of medical record text correction, which is of great significance to scientific research, teaching, management and other work in the medical field. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0012] Figure 1 This is a schematic diagram of an application environment of a medical record text error correction method based on artificial intelligence provided in Embodiment 1 of the present invention; Figure 2 It is a flowchart of a medical record text error correction method based on artificial intelligence provided in Embodiment 1 of the present invention; Figure 3It is a structural schematic diagram of a medical record text error correction device based on artificial intelligence provided in Embodiment 2 of the present invention; Figure 4 It is a structural diagram of a computer device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0013] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0014] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0015] It should also be understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0016] As used in the present specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]", depending on the context.
[0017] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0018] References to "one embodiment" or "some embodiments" etc. described in the present specification mean that one or more embodiments of the present invention include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0019] The embodiments of the present invention can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0020] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0021] It should be understood that the order of execution of the steps in the following embodiments does not imply a precedence of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0022] In order to illustrate the technical solution of the present invention, specific embodiments are provided below for illustration.
[0023] The first embodiment of the present invention provides an artificial intelligence-based medical record text error correction method, which can be applied to Figure 1 In the application environment, the client communicates with the server. The client includes but is not limited to PDAs, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud computing devices, personal digital assistants (PDAs), and other computer devices. The server can be implemented with an independent server or a server cluster consisting of multiple servers.
[0024] See also Figure 2, is a flowchart of a medical record text error correction method based on artificial intelligence provided by the first embodiment of the present invention. The medical record text error correction method can be applied to Figure 1 In the client, the medical record text error correction method may include the following steps: Step S201, obtain the medical record to be corrected, extract the text content in the medical record to be corrected, arrange all characters in the text content according to the order of character appearance, and obtain an original character sequence, which includes N original characters.
[0025] Among them, medical records are systematic records of the occurrence, development, diagnosis, and treatment of patients' diseases. They are the data obtained by clinical physicians through interviews, physical examinations, examinations, and detailed observations of the condition. After being summarized, analyzed, organized, and written, they can truly reflect the patient's condition and directly reflect the hospital's medical quality, academic level, and management level. They not only provide valuable basic data for medical treatment, scientific research, and teaching, but also provide indispensable medical information for hospital management. Therefore, correcting medical records and ensuring their accuracy are of great significance to medical treatment, scientific research, teaching, management, and other work.
[0026] The error correction target in this embodiment is the text content in the medical record to be corrected. Therefore, the medical record to be corrected that needs to be corrected is obtained. First, the text content in the medical record to be corrected is extracted. The text content includes several characters in the medical record to be corrected. Then, all the characters in the text content are arranged in the order of character appearance to obtain the original character sequence as the basis for error correction of the medical record text. Correspondingly, the original character sequence includes N original characters, where N is a positive integer.
[0027] Among them, the order of character appearance can be determined according to the position of all characters in the text content in the medical record. For example, all characters in the medical record are sorted from top to bottom and from left to right in the medical record, and the sorting result is determined as the character appearance order corresponding to all characters.
[0028] The above steps include obtaining the medical record to be corrected, extracting the text content in the medical record to be corrected, arranging all the characters in the text content in the order of character appearance, obtaining the original character sequence, and the original character sequence includes N original characters. The text content of the medical record to be corrected is extracted and the original characters are sorted, which provides a data basis for correcting the medical record text.
[0029] Step S202: for any original character, use a character encoder to extract features of the original character to obtain character features corresponding to the original character.
[0030] Among them, in the task of correcting medical record text, the semantic information of the original characters is the basis for effectively representing the information of the original characters themselves and the correlation information between different original characters. It is also the basis for correcting medical record text. The character encoder is an unsupervised learning feature extraction method that can extract relevant features such as the semantic information of characters.
[0031] Therefore, this embodiment uses a character encoder to extract features from the original characters to obtain character features corresponding to the original characters as a basis for error correction of the medical record text.
[0032] The above-mentioned step of using a character encoder to extract features of any original character to obtain the character features corresponding to the original character, extracting the character features of the original character as the basis for representing the information of the original character itself and the correlation information between different original characters, provides a data basis for error correction of medical record text.
[0033] Step S203, searching for terms containing the original characters from a preset dictionary to obtain at least one related term, and using a term encoder to extract features of each related term to obtain term features corresponding to the related term.
[0034] Among them, in the error correction task of medical record text, it is necessary to determine whether each original character needs to be corrected, and correct the original characters that need to be corrected. Since there is a correlation between different characters, several characters can form a word, and the same character may correspond to different semantics in different words. Therefore, when correcting a character, the relevant word associated with the character can be obtained, and the medical record text can be corrected based on the relevant word to improve the accuracy of the correction result.
[0035] Specifically, this embodiment obtains a preset dictionary corresponding to the medical record text correction task. The preset dictionary includes several terms related to the medical record content. The preset dictionary is searched for terms containing the original characters to obtain at least one related term corresponding to the original characters.
[0036] The term encoder is a feature extraction method for unsupervised learning, which can extract relevant features such as semantic information of terms. Therefore, this embodiment uses the term encoder to extract the features of each related term respectively, and obtains the term features of the corresponding related terms, which are used together with the character features as the basis for error correction of medical record text.
[0037] Optionally, searching for a word containing the original character from a preset dictionary to obtain at least one related word includes: searching a dictionary for a term containing the original character to obtain at least one search term, the dictionary including terms formed solely from the original character; For any search term, determine whether all characters contained in the search term exist in the original character sequence to obtain a determination result; If the judgment result is that all characters included in the search term exist in the original character sequence, then the search term is determined to be a related term; Traverse all search terms and get at least one related term.
[0038] A single original character can also be used as a word item, so the dictionary in this embodiment includes words formed by the original characters alone. In order to ensure a strong correlation between the original characters and the corresponding related words, this embodiment first searches for words containing the original characters from the dictionary to obtain at least one search word item, and for any search word item, determines whether all characters contained in the search word item exist in the original character sequence to obtain a determination result.
[0039] Correspondingly, if all characters included in the search term exist in the original character sequence, the search term has a strong correlation with the corresponding original characters and the original character sequence, and can be used as a basis for character error correction to improve the accuracy of the error correction result; if all characters included in the search term do not exist in the original character sequence, the search term is also interfered by the correlation of characters in non-original character sequences, and the search term has a weak correlation with the corresponding original characters and the original character sequence. Therefore, if the judgment result is that all characters included in the search term exist in the original character sequence, the search term is determined to be a related term, and all search terms are traversed to obtain at least one related term corresponding to the original character as a basis for character error correction.
[0040] This embodiment ensures a strong correlation between the original characters and the corresponding related terms by determining the search terms whose all characters exist in the original character sequence as related terms of the original characters, eliminates the interference of characters not in the original character sequence, and makes the related terms serve as the basis for correcting characters, thereby improving the accuracy of the correction results.
[0041] The above steps of searching for terms containing the original characters from a preset dictionary to obtain at least one related term, using a term encoder to extract features of each related term respectively, and obtaining term features of the corresponding related terms, improve the semantic representation ability of the original characters by obtaining related terms associated with the original characters, and perform error correction processing on the original characters based on the related terms, thereby improving the accuracy of the error correction results.
[0042] Step S204, calculate the correlation between each term feature and the character feature, obtain the correlation matrix of the corresponding term feature, calculate the term embedding feature based on all term features and their corresponding correlation matrix, fuse the term embedding feature and the character feature, and obtain the fused feature corresponding to the original character.
[0043] Among them, character features can be used to represent the semantic information of the corresponding original characters, and term features can be used to represent the semantic information of the corresponding related terms. The correlation between each term feature and the character feature is calculated to obtain the correlation matrix of the corresponding term features. Correspondingly, the higher the correlation between the term feature and the character feature, the larger the correlation matrix of the corresponding term feature.
[0044] Then the correlation matrix is regarded as the weight of the corresponding word feature. The product of each word feature and its corresponding correlation matrix can be calculated, and the product is determined as the word embedding feature corresponding to the word feature. The word embedding feature and the character feature are fused to obtain the fused feature corresponding to the original character, so as to improve the representation ability of the original character.
[0045] Optionally, the correlation between each word feature and the character feature is calculated to obtain a correlation matrix of the corresponding word feature, including: Multiplying the character feature and the preset attention matrix to obtain a first multiplication result, and normalizing the first multiplication result to obtain a normalized result; For any term feature, multiply the normalized result and the transpose of the term feature to obtain a second multiplication result, and determine the second multiplication result as the correlation matrix of the term feature; Traverse all the term features and obtain the correlation matrix of the corresponding term features.
[0046] Among them, in order to measure the correlation between the word feature and the corresponding original character, this embodiment obtains a preset attention matrix, multiplies the character feature and the preset attention matrix to obtain a first multiplication result, and normalizes the second multiplication result to obtain a normalized result as the basis for characterizing the correlation between the corresponding word feature and the character feature.
[0047] Then, for any term feature, the first multiplication result is multiplied by the transpose of the term feature to obtain a second multiplication result, and the second multiplication result is determined as the correlation matrix of the term feature to characterize the correlation between the term feature and the original character. By traversing all term features, the correlation matrix corresponding to each term feature can be obtained respectively.
[0048] The dimension of the attention matrix can be determined according to the dimension of the character feature and the word feature. For example, the dimension of the character feature is , the dimension of the term feature is , then the dimension of the attention matrix is , correspondingly, multiply the character feature and the preset attention matrix, and the dimension of the first multiplication result is , and then normalize the first multiplication result to get the dimension of the normalized result: , the normalized result elements, which are used to represent the correlation strength between the corresponding column elements in the term feature and the character feature. Then the first multiplication result is multiplied by the transpose of the term feature, and the dimension of the second multiplication result is , the second multiplication result is determined as a correlation matrix that characterizes the correlation between the term feature and the original character.
[0049] This embodiment obtains a preset attention matrix to measure the correlation between corresponding word features and character features, and obtains a corresponding correlation matrix, which effectively measures the importance of related words in representing the semantic information of the original characters, and can improve the accuracy of the representation of the semantic information of the original characters, thereby improving the accuracy of the error correction results.
[0050] Optionally, each relevance matrix includes M element values, where M is a positive integer. According to all term features and their corresponding relevance matrices, term embedding features are calculated, including: For any element value in any correlation matrix, perform exponential mapping on the element value to obtain the mapping value of the corresponding element value, traverse all element values in all correlation matrices, and obtain the mapping value corresponding to each element value; Calculate the sum of the i-th mapping values corresponding to the i-th element values in all correlation matrices to obtain the i-th mapping total value, i=1, 2, …, M; For the i-th element value in any correlation matrix, calculate the ratio of the corresponding i-th mapping value to the corresponding i-th mapping total value, use the ratio as the weight corresponding to the i-th element value in the correlation matrix, traverse all element values in all correlation matrices, and obtain the weight corresponding to each element value; For any term feature, according to the arrangement order of all element values in the relevance matrix corresponding to the term feature, the weights corresponding to all element values are concatenated to obtain the weight matrix corresponding to the term feature, and all term features are traversed to obtain the weight matrix corresponding to each term feature; According to the weight matrix corresponding to all the term features, all the term features are weighted summed to obtain the sum result, and the sum result is determined to be the term embedding feature.
[0051] Among them, in order to improve the standardization of numerical values in different correlation matrices, this embodiment performs exponential mapping on all element values in all correlation matrices respectively to obtain the mapping value corresponding to each element value, and calculates the sum of the i-th mapping values corresponding to the i-th element value in all correlation matrices to obtain the i-th mapping total value. The larger the ratio of the i-th mapping value to the corresponding i-th mapping total value, the larger the weight of the element value corresponding to the i-th mapping value. Therefore, the ratio of the i-th mapping value corresponding to the i-th element value in any correlation matrix to the corresponding i-th mapping total value is determined as the weight corresponding to the i-th element value in the correlation matrix. By traversing all element values in all correlation matrices, the weights corresponding to all element values can be obtained, which are used to characterize the importance and contribution of the corresponding element values in character error correction.
[0052] Furthermore, for any term feature, the weights corresponding to all element values are concatenated according to the arrangement order of all element values in the correlation matrix corresponding to the term feature, so as to obtain the weight matrix corresponding to the term feature, which is used to characterize the importance and contribution of the corresponding term feature in character error correction.
[0053] By traversing all the word features, we can get the weight matrix corresponding to all the word features, and perform weighted summation on all the word features according to the weight matrix corresponding to all the word features to get the sum result, and determine the sum result as the word embedding feature. The word embedding feature fully measures the importance and contribution of each word feature in character error correction, serves as the basis of character error correction, and improves the accuracy of the error correction result.
[0054] This embodiment determines the weight of the element value corresponding to the mapping value according to the ratio of the mapping value to the corresponding total mapping value, and further determines the weight matrix of each term feature to perform weighted summation on the term features to obtain the term embedding feature. Based on the correlation matrix between the term features and the character features, the importance and contribution of each term feature in character correction are fully measured, which serves as the basis for character correction and improves the accuracy of the correction result.
[0055] The above steps calculate the correlation between each word feature and the character feature to obtain the correlation matrix of the corresponding word feature, calculate the word embedding feature based on all the word features and their corresponding correlation matrix, fuse the word embedding feature and the character feature to obtain the fused feature corresponding to the original character, and measure the correlation between the word feature and the character feature to obtain the correlation matrix to further measure the importance and contribution of the corresponding word feature in character error correction, thereby improving the accuracy of the error correction result.
[0056] Step S205, using the reconstruction generator to generate characters for the fused features, obtaining generated characters corresponding to the fused features, traversing all fused features, and obtaining generated characters corresponding to each fused feature.
[0057] The reconstruction generator is used to reconstruct the input content, generate and output the corresponding character content. In this embodiment, the reconstruction generator is used to generate characters for the fused features to obtain generated characters corresponding to the fused features.
[0058] Since the fusion feature is obtained by fusing the character feature of the original character and the term embedding feature of the relevant term corresponding to the original character, the generated character may be consistent with the original character or inconsistent with the original character to correct the original character. Correspondingly, when there is no error in the original character, the generated character is consistent with the original character and there is no need to correct the original character; when the original character is an erroneous character, the generated character can be used to correct the original character to improve the accuracy of the medical record text.
[0059] Optionally, a reconstruction generator is used to generate characters from the fused features to obtain generated characters corresponding to the fused features, including: For any fused feature, use the reconstruction generator to generate characters for the fused feature, and obtain the generation probability of each reference character in the preset reference dictionary corresponding to the fused feature; The reference character corresponding to the maximum generation probability is used as the generated character corresponding to the fusion feature.
[0060] Among them, the preset reference dictionary consists of all the characters that can be generated by the reconstruction generator. For any fusion feature, the reconstruction generator is used to generate characters for the fusion feature, and the fusion feature obtains the generation probability of each reference character in the preset reference dictionary corresponding to the fusion feature. The generation probability represents the probability of the corresponding reference character being determined as the generated character corresponding to the fusion feature. Therefore, the reference character corresponding to the maximum generation probability is used as the generated character corresponding to the fusion feature.
[0061] This embodiment uses a reconstruction generator to generate characters for fused features based on all reference characters in a preset reference dictionary, and obtains the generation probability of the fused features corresponding to each reference character, to characterize the probability that the corresponding reference character is determined to be the generated character corresponding to the fused feature, thereby improving the generation accuracy of the generated characters.
[0062] Optionally, after obtaining the generation probability of the fused features corresponding to each reference character in the preset reference dictionary, the method further includes: The reference character identical to the original character corresponding to the fused feature is determined as the target character, and the probability of the fused feature using the target character as the generated character is predicted by the replicator to obtain the replication probability, and a replication probability sequence of the fused feature is formed according to the replication probability and the preset value; According to the order of the reference characters corresponding to each generation probability in the preset reference dictionary, all generation probabilities are concatenated into a generation probability sequence of fused features; Adding the generated probability sequence and the copied probability sequence, and determining that the added result is a joint probability sequence, the joint probability sequence including each reference character in the reference dictionary and its corresponding joint probability; Accordingly, the reference character corresponding to the maximum generation probability is used as the generated character corresponding to the fusion feature, including: The reference character corresponding to the maximum joint probability is used as the generated character corresponding to the fused feature.
[0063] Among them, in order to further improve the generation accuracy of generated characters, this embodiment obtains a replicator to predict the probability of using the fused feature as the reference character that is the same as the original character corresponding to the fused feature as the generated character, that is, the replicator is used to predict the probability of the original character itself as the corresponding generated character.
[0064] The reference character that is the same as the original character corresponding to the fused feature is determined as the target character, and the probability of the fused feature using the target character as the generated character is predicted by the copier to obtain the replication probability, and then the replication probability sequence of the fused feature is formed according to the replication probability and the preset value, combined with the order of the target character in the preset reference dictionary. The preset value can be set according to the time situation. Generally, the preset value is 0, and the replication probability sequence of length F consists of a replication probability and F-1 0 values, where F is an integer greater than 1.
[0065] Then, by combining the generation probability sequence obtained from the generation probability, a joint probability sequence can be obtained to characterize the probability of each reference character being a generated character, so that the reference character corresponding to the maximum value of the joint probability is used as the generated character corresponding to the fusion feature.
[0066] This embodiment uses a replicator to predict the probability of the original character itself as the corresponding generated character, and combines it with the generation probabilities of all reference characters to obtain a joint probability sequence to characterize the probability of each reference character as a generated character, thereby improving the generation accuracy of the generated characters. The above uses the reconstruction generator to generate characters for the fused features, obtains the generated characters corresponding to the fused features, traverses all the fused features, and obtains the steps of generating characters corresponding to each fused feature. Step S206, according to the order of the original characters corresponding to each generated character in the original character sequence, all generated characters are concatenated into a generated character sequence, and the generated character sequence is determined as the error correction result of the medical record to be corrected.
[0067] Among them, the generated characters are the correct characters corresponding to the original characters after error correction processing. According to the order of the original characters corresponding to each generated character in the original character sequence, all the generated characters are spliced into a generated character sequence, and it can be determined that the generated character sequence is the error correction result of the medical record to be corrected.
[0068] The embodiment of the present invention extracts text content and original character sequences in the medical record to be corrected, uses a character encoder to perform feature extraction on the original characters to obtain character features, searches for terms containing the original characters from a preset dictionary to obtain at least one related term, uses a term encoder to extract features of each related term respectively to obtain term features, calculates the correlation between each term feature and the character feature to obtain a correlation matrix, calculates term embedding features according to all term features and their corresponding correlation matrices, fuses the term embedding features and the character features to obtain fused features corresponding to the original characters, uses a reconstruction generator to perform character generation on the fused features to obtain generated characters corresponding to the fused features, splices all generated characters into a generated character sequence, determines that the generated character sequence is the correction result of the medical record to be corrected, and fuses the term features with the character features in the form of term embedding features according to the correlation between the original characters and their associated terms, so that the fused features can effectively represent the syntactic and semantic information at the term level, and provide more abundant feature information for the generator to perform character generation to realize medical record text correction, thereby improving the accuracy of medical record text correction, which is of great significance to scientific research, teaching, management and other work in the medical field.
[0069] Corresponding to the medical record text error correction method of the above embodiment, Figure 3 A structural block diagram of an artificial intelligence-based medical record text error correction device provided in Embodiment 2 of the present invention is given. For ease of explanation, only the parts related to the embodiment of the present invention are shown.
[0070] See also Figure 3 , the medical record text error correction device comprises: The character sequence determination module 31 is used to obtain the medical record to be corrected, extract the text content in the medical record to be corrected, arrange all the characters in the text content according to the order of character appearance, and obtain the original character sequence, where the original character sequence includes N original characters, where N is a positive integer; The character feature extraction module 32 is used to extract features of any original character using a character encoder to obtain the character features of the original character; The term feature extraction module 33 is used to search for terms containing original characters from a preset dictionary to obtain at least one related term, and to use a term encoder to extract features of each related term to obtain term features corresponding to the related term; The fusion feature determination module 34 is used to calculate the correlation between each term feature and the character feature, obtain the correlation matrix of the corresponding term feature, calculate the term embedding feature based on all the term features and their corresponding correlation matrix, and fuse the term embedding feature and the character feature to obtain the fusion feature corresponding to the original character; The character generation module 35 is used to generate characters from the fused features using the reconstruction generator to obtain generated characters corresponding to the fused features, and to traverse all fused features to obtain generated characters corresponding to each fused feature; The error correction result determination module 36 is used to splice all generated characters into a generated character sequence according to the order of the original characters corresponding to each generated character in the original character sequence, and determine the generated character sequence as the error correction result of the medical record to be corrected.
[0071] Optionally, the term feature extraction module 33 includes: a term search submodule, for searching a term containing the original character from a dictionary to obtain at least one search term, the dictionary including terms formed solely by the original character; The term discrimination submodule is used to determine, for any search term, whether all characters contained in the search term exist in the original character sequence, and obtain a discrimination result; A related term determination submodule, for determining the search term as a related term if the judgment result is that all characters included in the search term exist in the original character sequence; The first traversal submodule is used to traverse all search terms and obtain at least one related term.
[0072] Optionally, the fusion feature determination module 34 includes: A multiplication result calculation submodule, used for multiplying the character feature and the preset attention matrix to obtain a first multiplication result, and normalizing the first multiplication result to obtain a normalized result; A relevance matrix calculation submodule, for multiplying the normalized result and the transposition of the term feature for any term feature to obtain a second multiplication result, and determining the second multiplication result as the relevance matrix of the term feature; The second traversal submodule is used to traverse all the term features and obtain the correlation matrix of the corresponding term features.
[0073] Optionally, each correlation matrix includes M element values, where M is a positive integer. The fusion feature determination module 34 includes: The element value mapping submodule is used to perform exponential mapping on any element value in any correlation matrix to obtain the mapping value of the corresponding element value, and traverse all element values in all correlation matrices to obtain the mapping value corresponding to each element value; The mapping total value calculation submodule is used to calculate the sum of the i-th mapping values corresponding to the i-th element values in all correlation matrices to obtain the i-th mapping total value, i=1, 2, ..., M; The weight calculation submodule is used to calculate the ratio of the corresponding i-th mapping value to the corresponding i-th mapping total value for the i-th element value in any correlation matrix, and use the ratio as the weight corresponding to the i-th element value in the correlation matrix, and traverse all element values in all correlation matrices to obtain the weight corresponding to each element value; The weight matrix calculation submodule is used to concatenate the weights corresponding to all element values in the relevance matrix corresponding to any term feature according to the arrangement order of all element values in the relevance matrix corresponding to the term feature, obtain the weight matrix corresponding to the term feature, traverse all term features, and obtain the weight matrix corresponding to each term feature; The term embedding feature determination submodule is used to perform weighted summation on all term features according to the weight matrices corresponding to all term features, obtain the summation result, and determine the summation result as the term embedding feature.
[0074] Optionally, the character generation module 35 includes: A generation probability determination submodule is used to generate characters for any fused feature using a reconstruction generator to obtain the generation probability of each reference character in a preset reference dictionary corresponding to the fused feature; The generated character determination submodule is used to use the reference character corresponding to the maximum generation probability as the generated character corresponding to the fused feature.
[0075] Optionally, after the generation probability determination submodule, the character generation module 35 further includes: A copy probability determination submodule is used to determine the reference character that is the same as the original character corresponding to the fused feature as the target character, use the copier to predict the probability of the fused feature using the target character as the generated character, obtain the copy probability, and form a copy probability sequence of the fused feature based on the copy probability and a preset value; A generation probability splicing submodule is used to splice all generation probabilities into a generation probability sequence of fusion features according to the order of reference characters corresponding to each generation probability in a preset reference dictionary; A joint probability sequence calculation submodule, used for adding the generated probability sequence and the copied probability sequence, and determining the addition result as a joint probability sequence, wherein the joint probability sequence includes each reference character in the reference dictionary and its corresponding joint probability; Accordingly, the above-mentioned generated character determination submodule includes: The generated character determination unit is used to use the reference character corresponding to the maximum joint probability as the generated character corresponding to the fused feature.
[0076] It should be noted that the information interaction, execution process and other contents between the above modules are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0077] Figure 4 This is a schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. Figure 4 As shown, the computer device of this embodiment includes: at least one processor ( Figure 4 Only one is shown), a memory, and a computer program stored in the memory and executable on at least one processor, wherein when the processor executes the computer program, the steps in any of the above-mentioned medical record text error correction method embodiments are implemented.
[0078] The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that Figure 4 This is merely an example of a computer device and does not constitute a limitation on the computer device. The computer device may include more or fewer components than those shown in the figure, or a combination of certain components, or different components. For example, it may also include a network interface, a display screen, and an input device.
[0079] The processor may be a CPU, or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0080] The memory includes a readable storage medium, an internal memory, etc., wherein the internal memory may be the memory of a computer device, and the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The readable storage medium may be a hard disk of a computer device, and in other embodiments, it may also be an external storage device of the computer device, for example, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Further, the memory may also include both an internal storage unit of the computer device and an external storage device. The memory is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of a computer program, etc. The memory may also be used to temporarily store data that has been output or is to be output.
[0081] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the above-mentioned method embodiment, which will not be repeated here. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiment can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying computer program code, recording medium, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0082] The present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by a computer program product. When the computer program product runs on a computer device, the computer device can implement the steps in the above-mentioned method embodiment when executing.
[0083] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0084] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0085] In the embodiments provided by the present invention, it should be understood that the disclosed devices / computer equipment and methods can be implemented in other ways. For example, the device / computer equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0086] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0087] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. A medical record text error correction method based on artificial intelligence, characterized in that: The medical record text error correction method comprises: Obtain a medical record to be corrected, extract text content in the medical record to be corrected, arrange all characters in the text content in the order in which the characters appear, and obtain an original character sequence, wherein the original character sequence includes N original characters, where N is a positive integer; For any original character, use a character encoder to extract features of the original character to obtain a character feature corresponding to the original character; Searching for a term containing the original character from a preset dictionary to obtain at least one related term, and using a term encoder to extract features of each related term to obtain term features corresponding to the related term; Calculate the correlation between each term feature and the character feature to obtain a correlation matrix of the corresponding term feature, calculate the term embedding feature based on all term features and their corresponding correlation matrix, and fuse the term embedding feature and the character feature to obtain a fusion feature corresponding to the original character; Use the reconstruction generator to generate characters for the fused features to obtain generated characters corresponding to the fused features, traverse all fused features, and obtain generated characters corresponding to each fused feature respectively; According to the order of the original characters corresponding to each generated character in the original character sequence, all generated characters are spliced into a generated character sequence, and the generated character sequence is determined to be the error correction result of the medical record to be corrected.
2. The medical record text error correction method according to claim 1, characterized in that: The step of searching a preset dictionary for a word containing the original character to obtain at least one related word includes: searching the dictionary for terms containing the original characters to obtain at least one search term, the dictionary including terms formed solely by the original characters; For any search term, determine whether all characters included in the search term exist in the original character sequence to obtain a determination result; If the judgment result is that all characters included in the search term exist in the original character sequence, then determining that the search term is the related term; Traverse all search terms and get at least one related term.
3. The medical record text error correction method according to claim 1, characterized in that: The calculating the correlation between each term feature and the character feature to obtain a correlation matrix of the corresponding term feature includes: Multiplying the character feature and a preset attention matrix to obtain a first multiplication result, and normalizing the first multiplication result to obtain a normalized result; For any term feature, multiply the normalized result and the transpose of the term feature to obtain a second multiplication result, and determine the second multiplication result as a correlation matrix of the term feature; Traverse all the term features and obtain the correlation matrix of the corresponding term features.
4. The medical record text error correction method according to claim 1, characterized in that: Each correlation matrix includes M element values, where M is a positive integer; The term embedding features are calculated based on all term features and their corresponding correlation matrices, including: For any element value in any correlation matrix, perform exponential mapping on the element value to obtain a mapping value of the corresponding element value, traverse all element values in all correlation matrices to obtain a mapping value corresponding to each element value; Calculate the sum of the i-th mapping values corresponding to the i-th element values in all correlation matrices to obtain the i-th mapping total value, i=1, 2, …, M; For the i-th element value in any correlation matrix, calculate the ratio of the corresponding i-th mapping value to the corresponding i-th mapping total value, use the ratio as the weight corresponding to the i-th element value in the correlation matrix, traverse all element values in all correlation matrices, and obtain the weight corresponding to each element value respectively; For any term feature, according to the arrangement order of all element values in the relevance matrix corresponding to the term feature, the weights corresponding to all element values are concatenated to obtain the weight matrix corresponding to the term feature, and all term features are traversed to obtain the weight matrix corresponding to each term feature; According to the weight matrices corresponding to all term features, weighted summation is performed on all term features to obtain a summation result, and the summation result is determined to be the term embedding feature.
5. The medical record text error correction method according to any one of claims 1 to 4, characterized in that: The using a reconstruction generator to generate characters from the fused features to obtain generated characters corresponding to the fused features includes: For any fused feature, use the reconstruction generator to generate characters for the fused feature, and obtain the generation probability of the fused feature corresponding to each reference character in the preset reference dictionary; The reference character corresponding to the maximum generation probability is used as the generated character corresponding to the fused feature.
6. The medical record text error correction method according to claim 5, characterized in that: After obtaining the generation probability that the fusion feature corresponds to each reference character in the preset reference dictionary, the method further includes: Determine a reference character that is the same as the original character corresponding to the fused feature as a target character, use a copier to predict the probability of the fused feature using the target character as a generated character, obtain a copy probability, and form a copy probability sequence of the fused feature based on the copy probability and a preset value; According to the order of the reference characters corresponding to each generation probability in the preset reference dictionary, all generation probabilities are spliced into a generation probability sequence of the fusion feature; Adding the generated probability sequence and the replicated probability sequence, and determining that the added result is a joint probability sequence, wherein the joint probability sequence includes each reference character in the reference dictionary and its corresponding joint probability; Accordingly, the step of using the reference character corresponding to the maximum generation probability as the generated character corresponding to the fused feature includes: The reference character corresponding to the maximum value of the joint probability is used as the generated character corresponding to the fused feature.
7. A medical record text error correction device based on artificial intelligence, characterized in that: The medical record text error correction device comprises: A character sequence determination module is used to obtain a medical record to be corrected, extract text content in the medical record to be corrected, arrange all characters in the text content in the order of character appearance, and obtain an original character sequence, wherein the original character sequence includes N original characters, where N is a positive integer; A character feature extraction module, for extracting features of any original character using a character encoder to obtain a character feature of the original character; A term feature extraction module, used to search for terms containing the original characters from a preset dictionary to obtain at least one related term, and to use a term encoder to extract features of each related term to obtain term features corresponding to the related term; A fusion feature determination module is used to calculate the correlation between each term feature and the character feature to obtain a correlation matrix of the corresponding term feature, calculate the term embedding feature based on all term features and their corresponding correlation matrix, and perform feature fusion on the term embedding feature and the character feature to obtain a fusion feature corresponding to the original character; A character generation module, used to generate characters for the fused features using a reconstruction generator, obtain generated characters corresponding to the fused features, traverse all fused features, and obtain generated characters corresponding to each fused feature; The error correction result determination module is used to splice all generated characters into a generated character sequence according to the order of the original characters corresponding to each generated character in the original character sequence, and determine that the generated character sequence is the error correction result of the medical record to be corrected.
8. The medical record text error correction device according to claim 7, characterized in that: The term feature extraction module comprises: a term search submodule, for searching a term containing the original character from the dictionary to obtain at least one search term, the dictionary including terms formed solely by the original character; A term identification submodule, for determining, for any search term, whether all characters contained in the search term exist in the original character sequence, and obtaining a determination result; a related term determination submodule, configured to determine that the search term is the related term if the judgment result is that all characters included in the search term exist in the original character sequence; The first traversal submodule is used to traverse all search terms and obtain at least one related term.
9. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the medical record text error correction method according to any one of claims 1 to 6 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the medical record text error correction method as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Multi-granularity Chinese text error correction method and device
CN116127952A
Text error correction method and device, electronic equipment and storage medium
CN116402043A
Error character recognition method and device, equipment, storage medium and program product
CN117034908A
Method and device for correcting japanese character recognition error and recording medium with error correcting program recorded
JP1999328317A