Text intelligent error correction method and device, electronic equipment and storage medium

Through the intelligent text error correction method based on classification and sequence generation modes, the problem of semantic ambiguity in the text conversion process is solved, the accuracy and controllability of text error correction are achieved, and the quality of information processing is improved.

CN118627495APending Publication Date: 2024-09-10PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410840847.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-09-10

Smart Images

  • Figure CN118627495A
    Figure CN118627495A
Patent Text Reader

Abstract

The invention relates to an artificial intelligence technology in the field of digital medical treatment, and discloses an intelligent text error correction method, which comprises the following steps of: embedding an original medical inquiry text into a preset matrix layer to obtain a converted medical text; performing text compiling on the converted medical text by using an encoder in a trained text error correction model to obtain a model readable text; identifying abnormal characters of the readable text of the model by utilizing a judging device in the text error correction model to obtain an abnormal text; performing text error correction on the abnormal text by using an error corrector in the text error correction model to obtain an error-corrected text; randomly sorting words and sentences in the error correction text to obtain sequence words and sentences, and extracting preferred sequence words and sentences in the sequence words and sentences to obtain a preferred text; and performing text decoding on the preferred text by using a decoder in the trained text error correction model to obtain a target medical text. According to the method, the problem of semantic ambiguity in the text conversion process can be better solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of text semantics and digital medicine, and in particular to a text intelligent error correction method, device, electronic equipment and storage medium. Background Art

[0002] With the development of artificial intelligence, more and more application scenarios of machine learning technology have been successfully implemented in the field of traditional Chinese medicine, such as telemedicine, intelligent diagnosis, robot consultation, etc. In the field of smart traditional Chinese medicine, robot-assisted consultation is a relatively common business scenario. The robot communicates with the patient and collects patient information instead of human experts. The collected semantic information is translated through the intelligent voice system and then compiled into text information for experts to directly obtain, which can save a lot of time. In this process, the amount of error noise contained in the patient's original words directly affects the processing and processing of subsequent module information. For example, there is semantic ambiguity between the patient's "medical hospital" and the patient's "medical intention".

[0003] At present, texts are usually corrected for text anomalies using rule-based methods. However, rule-based methods require the maintenance of a set of common words corresponding to words that may be transcribed or entered incorrectly. Machine learning-based methods use multiple steps to solve the error correction task, that is, first locate the wrong words, and then correct them. In the generated mode, there will be problems of uncontrollable generation or change of the original expression semantics. Therefore, the present invention proposes a text homophonic error discrimination and correction method based on classification and sequence generation mode, which can better solve the problem of semantic ambiguity in the text conversion process.

[0004] Invention Method

[0005] In order to solve the above technical problems, the present invention provides a text intelligent error correction method, which can better solve the problem of semantic ambiguity in the text conversion process.

[0006] In a first aspect, the present invention provides a text intelligent error correction method, comprising:

[0007] Acquire an original medical consultation text, and embed the original medical consultation text into a preset matrix layer to obtain a converted medical text;

[0008] Using the encoder in the trained text error correction model to perform text compilation on the converted medical text to obtain model-readable text;

[0009] Using the judgement device in the trained text error correction model to identify abnormal words in the model-readable text, and obtaining abnormal text;

[0010] Using the corrector in the trained text error correction model to perform text error correction on the abnormal text to obtain a corrected text;

[0011] Randomly sorting the words and sentences in the error correction text to obtain sequence words and sentences, and extracting preferred sequence words and sentences from the sequence words and sentences to obtain a preferred text;

[0012] The preferred text is decoded using a decoder in a trained text error correction model to obtain a target medical text.

[0013] In a possible implementation of the first aspect, embedding the original medical consultation text into a preset matrix layer to obtain a converted medical text includes:

[0014] Querying the spatial capacity of the preset matrix layer;

[0015] According to the spatial capacity, constructing the spatial dimension of the original medical consultation text in the preset matrix layer;

[0016] According to the spatial dimension, the original medical consultation text is input into the preset matrix layer to obtain the converted medical text.

[0017] In a possible implementation of the first aspect, using an encoder in a trained text error correction model to perform text compilation on the converted medical text to obtain a model-readable text includes:

[0018] Using the array function in the encoder to define the initialization array of the converted medical text, to obtain an initial array;

[0019] Inserting a separator into the initial array using a column separation tool in the encoder;

[0020] The assignment software in the encoder is used to assign numerical values ​​to the initial array of each column of the delimiter to obtain the model readable text.

[0021] In a possible implementation of the first aspect, using an encoder in a trained text error correction model to perform text compilation on the converted medical text to obtain a model-readable text includes:

[0022] Using the array function in the encoder to define the initialization array of the converted medical text, to obtain an initial array;

[0023] Inserting a separator into the initial array using a column separation tool in the encoder;

[0024] The assignment software in the encoder is used to assign numerical values ​​to each column of the initial array where the separator is inserted, so as to obtain the model readable text.

[0025] In a possible implementation of the first aspect, the method of using a judger in a trained text error correction model to identify abnormal text in the model-readable text to obtain the abnormal text includes:

[0026] Using the word segmentation tool in the judger to segment the model readable text to obtain a text word segmentation set;

[0027] Combining the text segmentation sets in order to obtain a plurality of combined segmentations;

[0028] Using the matching algorithm in the judger to perform word matching on each of the multiple combined participles with the combined words in a preset word library, to obtain word matching results between the multiple combined participles and the combined words in the preset word library;

[0029] According to the word matching results, abnormal text in the model readable text is located.

[0030] In a possible implementation of the first aspect, the step of performing text correction on the abnormal text using a corrector in a trained text correction model to obtain a corrected text includes:

[0031] Using the context recognition function in the error corrector to identify the current context of the abnormal text;

[0032] Extract error keywords of abnormal text in the current context using the extraction function in the error corrector;

[0033] Using a semantic association function in the error corrector to identify the semantics of the error keyword;

[0034] The error keyword is corrected according to the semantics of the error keyword to obtain the error correction text.

[0035] In a possible implementation manner of the first aspect, extracting a preferred sequence phrase from the sequence phrases to obtain a preferred text includes:

[0036] Constructing a candidate collection of words and sentences of the sequence of words and sentences, and calculating a preferred collection of the candidate collection of words and sentences;

[0037] A new text is generated according to the preferred collection to obtain a preferred text.

[0038] In a possible implementation of the first aspect, using a decoder in a trained text error correction model to perform text decoding on the preferred text to obtain a target medical text includes:

[0039] Using the character query script in the decoder to query all characters in the error correction text to obtain a character set;

[0040] Calculating the loss value of the character set using a cross entropy loss function in the decoder;

[0041] When the loss value of the character set is less than a set threshold, the character set is converted using a beam search algorithm in the decoder to obtain a target medical text.

[0042] In a second aspect, the present invention provides a text intelligent error correction device, the device comprising:

[0043] A text conversion module, used for acquiring an original medical consultation text, and embedding the original medical consultation text into a preset matrix layer to obtain a converted medical text;

[0044] A text compilation module, used to compile the converted medical text using an encoder in a trained text error correction model to obtain a model-readable text;

[0045] A text anomaly module, used to identify abnormal text in the model-readable text using a judger in a trained text error correction model to obtain abnormal text;

[0046] A text error correction module, used to perform text error correction on the abnormal text using an error corrector in a trained text error correction model to obtain an error-corrected text;

[0047] A text optimization module, used for randomly sorting the words and sentences in the error correction text to obtain sequence words and sentences, and extracting the preferred sequence words and sentences in the sequence words and sentences to obtain the preferred text;

[0048] The text decoding module is used to use the decoder in the trained text error correction model to perform text decoding on the preferred text to obtain the target medical text.

[0049] In a third aspect, the present invention provides an electronic device, comprising:

[0050] at least one processor; and a memory communicatively coupled to the at least one processor;

[0051] Wherein, the memory stores a computer program that can be executed by the at least one processor, so that the at least one processor can execute the text intelligent error correction method as described in any one of the above-mentioned first aspects.

[0052] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the text intelligent error correction method as described in any one of the above-mentioned first aspects.

[0053] Compared with the prior art, the technical principle and beneficial effects of this solution are:

[0054] This scheme first obtains the original medical consultation text, embeds the original medical consultation text into a preset matrix layer, obtains the converted medical text, which can be used as a prerequisite for the subsequent text error correction model processing, and uses the encoder in the trained text error correction model to compile the converted medical text to obtain a model readable text, which can be recognized by the trained text error correction model, which is convenient for subsequent error discrimination, and uses the judger in the trained text error correction model to identify the abnormal text of the model readable text, obtain the abnormal text, and locate the error in the model readable text for subsequent error correction; secondly, the embodiment of the present invention uses the corrector in the trained text error correction model to perform text error correction on the abnormal text to obtain the corrected text, which can correct the wrong words in the text to obtain the correct text for subsequent correct decoding; further, the embodiment of the present invention uses the decoder in the trained text error correction model to perform text decoding on the preferred text to obtain the decoded text, which can obtain the correct text for system recognition. Therefore, the text intelligent error correction method, device, electronic device and storage medium proposed in the embodiment of the present invention can better solve the problem of semantic ambiguity in the text conversion process. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0057] Figure 1 A flowchart of a text intelligent error correction method provided by an embodiment of the present invention;

[0058] Figure 2 A schematic diagram of a module of a text intelligent error correction device provided by an embodiment of the present invention;

[0059] Figure 3 A schematic diagram of the internal structure of an electronic device for implementing a text intelligent error correction method provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0060] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0061] The embodiment of the present invention provides a text intelligent error correction method, and the execution subject of the text intelligent error correction method includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present invention. In other words, the text intelligent error correction method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

[0062] See also Figure 1 FIG. 1 is a flow chart of a text intelligent error correction method provided by an embodiment of the present invention. Figure 1 The text intelligent error correction method described in the text includes the following steps S1-S6:

[0063] S1. Obtain an original medical consultation text, and embed the original medical consultation text into a preset matrix layer to obtain a converted medical text.

[0064] The embodiment of the present invention obtains the original medical inquiry text, embeds the original medical inquiry text into a preset matrix layer, and obtains the converted medical text, which can be a prerequisite for subsequent text error correction model processing, wherein the original medical inquiry text refers to the original input language text that has not been processed in any way, such as in the field of digital medicine, the patient's voice text obtained by an intelligent voice robot, the chat records between the patient and the doctor, the patient's audio records, etc., as well as the voice text obtained in financial transactions, etc. The preset matrix layer refers to a matrix set in which n matrices are arranged in a hierarchy, which can be constructed through a vector matrix.

[0065] As an embodiment of the present invention, the embedding of the original medical inquiry text into a preset matrix layer to obtain a converted medical text includes: querying the spatial capacity of the preset matrix layer; constructing the spatial dimension of the original medical inquiry text in the preset matrix layer according to the spatial capacity; and inputting the original medical inquiry text into the preset matrix layer according to the spatial dimension to obtain the converted medical text.

[0066] Among them, the spatial capacity refers to the dictionary capacity in the preset matrix layer, such as 5000*732, which means that the dictionary capacity is 5000, and the spatial dimension refers to the dimension of the vector space generated by the row vector (or column vector) in the matrix, such as L*732, which means that the sentence length is L, and each word is represented by a 732-dimensional vector. Optionally, the query of the spatial capacity of the preset matrix layer is performed by accessing the generated file query of the preset matrix layer, and the construction of the spatial dimension of the original medical consultation text in the preset matrix layer is constructed by the spatial dimension setting script in the word2vec tool.

[0067] S2. Use the encoder in the trained text error correction model to compile the converted medical text to obtain model-readable text.

[0068] The embodiment of the present invention uses the encoder in the trained text error correction model to compile the converted medical text to obtain a model-readable text. The text compilation can make the converted medical text into a language recognizable by the text error correction model, which is convenient for subsequent error discrimination. The trained text error correction model refers to the use of existing data, through mathematical modeling and parameter adjustment, and repeated calculation and verification of the data, and finally obtains a better calculation method, which can complete a certain task, such as language translation in intelligent medical consultation.

[0069] As an embodiment of the present invention, the encoder in the trained text error correction model is used to compile the converted medical text to obtain a model-readable text, including: using the array function in the encoder to define the initialization array of the converted medical text to obtain an initial array, using the column separation tool in the encoder to insert a separator in the initial array, using the separator to split the initial array to obtain a multi-column array, and using the assignment software in the encoder to assign values ​​to the multi-column array to obtain a model-readable text.

[0070] Among them, the initialization array refers to the initial data grouping of the original medical consultation text in the encoder, the delimiter refers to the character that divides the initial array into multiple columns, optionally, the array function includes a javascript array function, the column separation tool includes a keynote tool, and the initial array assignment for each column of the inserted delimiter is performed through the assignment function in the matlab program software.

[0071] S3. Using the judger in the trained text error correction model to identify abnormal characters in the model readable text, to obtain abnormal text.

[0072] In the embodiment of the present invention, the judger in the trained text error correction model is used to perform text judgment on the model readable text, and the abnormal text can be obtained to locate the erroneous text in the model readable text, which is convenient for the subsequent abnormal text error correction premise. The abnormal text is commonly seen as garbled characters that appear in the code conversion process, or typos that appear in machine translation.

[0073] As an embodiment of the present invention, the method of using a judger in a trained text error correction model to identify abnormal text in the model readable text to obtain abnormal text includes: using a segmentation tool in the judger to segment the model readable text to obtain a text segmentation set; combining the text segmentation set in sequence to obtain a plurality of combined segmentations; using a matching algorithm in the judger to match each of the plurality of combined segmentations with a combined word in a preset vocabulary to obtain a word matching result between the plurality of combined segmentations and the combined words in the preset vocabulary; and locating the abnormal text in the model readable text according to the word matching result.

[0074] Among them, the text segmentation set refers to a set of multiple phrases that the text is divided into, the segmentation combination refers to a regular combination of each segmentation to form a new phrase, and the preset word library refers to a database formed by collecting historical combination words. Optionally, the segmentation tool can be obtained by a segmenter generated by a programming language such as java, js, and v++, and the text segmentation set is combined in order by a segmentation string matching method. The segmentation string matching method mainly relies on the information of the dictionary, without using rule knowledge and statistical information. According to a certain strategy, the Chinese character string to be segmented is matched one by one with the entries in the dictionary. If the entry is found in the dictionary, the match is successful. The matching algorithm includes a bidirectional maximum matching algorithm. It should be noted that the bidirectional maximum matching algorithm compares the segmentation results obtained by the forward maximum matching method with the results obtained by the reverse maximum matching method, thereby determining the correct segmentation method, which is more accurate than the conventional matching algorithm.

[0075] S4. Use the corrector in the trained text correction model to perform text correction on the abnormal text to obtain a corrected text.

[0076] The embodiment of the present invention uses the corrector in the trained text correction model to perform text correction on the abnormal text, and the obtained error-corrected text can correct the wrong words in the text to obtain the correct text, which is convenient for subsequent correct decoding.

[0077] As an embodiment of the present invention, the method of using a corrector in a trained text correction model to perform text correction on the abnormal text to obtain a corrected text includes: using a context recognition function in the corrector to calculate a current context score of the abnormal text, and using the current context score to identify the current context of the abnormal text; using an extraction function in the corrector to extract error keywords of the abnormal text in the current context; using a semantic association function in the corrector to calculate the semantic association degree of the error keywords, and using the semantic association degree to identify the semantics of the error keywords; correcting the error keywords according to the semantics of the error keywords to obtain the corrected text.

[0078] Among them, the current context refers to the environment in which the speaker is speaking at that time and place, that is, in what kind of environment, the content of the speech at a certain moment always revolves around a specific topic, the error keywords refer to specific words and phrases that make the meaning of the sentence ambiguous, and the semantics refers to the meaning that specific words and phrases in a specific sentence want to express.

[0079] Furthermore, in an optional embodiment of the present invention, the context recognition function includes:

[0080]

[0081] Wherein, C represents the current context score, n c represents the total number of words and sentences in the word set c in the abnormal text, d represents the current context of the abnormal text, Tc j Represents abnormal text word set c j The jth element in c i Represents the i-th abnormal difference value of abnormal text word set c.

[0082] Furthermore, in an optional embodiment of the present invention, the extraction function includes:

[0083]

[0084] Wherein, TK represents the error keyword, M C represents the total number of word pairs in the keyword library corresponding to the abnormal text, c i Indicates the i-th core word in the keyword library corresponding to the abnormal text, w j Represents the jth word in the corpus.

[0085] Furthermore, in an optional embodiment of the present invention, the semantic association function includes:

[0086]

[0087] Where S(x1, x2) represents the degree of semantic association, S(X1, X2)≤1, and the closer S(X1, X2) is to 1, the higher the association is. When it is equal to 1, it means that the semantics are exactly the same. X1 is the word vector of the error keyword set, X2 is all the word vectors in the keyword library corresponding to the abnormal text, and x 1i , x 2i They represent the components of the word vectors in X1 and X2 under the i-th semantics, and m represents the total number of keywords in the keyword library corresponding to the abnormal text.

[0088] S5. Randomly sort the words and sentences in the error correction text to obtain sequence words and sentences, and extract preferred sequence words and sentences from the sequence words and sentences to obtain a preferred text.

[0089] The embodiment of the present invention randomly sorts the words and sentences in the error correction text to obtain sequence words and sentences, which can make the words and sentences in the text appear more likely, thereby achieving the appearance of sentences that are completely consistent with the original medical consultation text.

[0090] Among them, the sequence phrase such as ihu means I-love-you, and the ihu has multiple arrangements such as iuh, hui, uih, etc.

[0091] Optionally, an embodiment of the present invention randomly sorts words and sentences in the error correction text through a word order sorting script, wherein the word order sorting script is generated by Java.

[0092] Furthermore, the embodiment of the present invention can select sentences that conform to the real semantics in the sentence arrangement by extracting the preferred sequence of sentences in the sequence of sentences, so as to improve the quality of the translated text.

[0093] As an embodiment of the present invention, the extracting of the preferred sequence words and sentences in the sequence words and sentences to obtain the preferred text includes: constructing a candidate word and sentence collection of the sequence words and sentences, and calculating the preferred collection in the candidate word and sentence collection; generating a new text according to the preferred collection to obtain the preferred text. The candidate collection refers to a plurality of selected word and sentence sorted sets.

[0094] Optionally, the candidate word and sentence collection for constructing the sequence of words and sentences is generated by a candidate word and sentence collection construction script, the preferred collection among the candidate word and sentence collection is calculated by generating a bunch search algorithm using Java language, the bunch search algorithm refers to an algorithm function that performs conditional search according to a given parameter, and the generation of a new text based on the preferred collection to obtain the preferred text is achieved through the text generation function of SQL syntax.

[0095] S6. Use the decoder in the trained text error correction model to decode the preferred text to obtain the target medical text.

[0096] The embodiment of the present invention uses the decoder in the trained text error correction model to perform text decoding on the preferred text, and the decoded text can obtain the correct text, so as to realize intelligent error correction of the original medical consultation text.

[0097] As an embodiment of the present invention, the use of a decoder in a trained text correction model to perform text decoding on the preferred text to obtain a target medical text includes: using a character query script in the decoder to query all characters in the correction text to obtain a character set; using a cross entropy loss function in the decoder to calculate a loss value of the character set; when the loss value of the character set is less than a set threshold, using a beam search algorithm in the decoder to convert the character set to obtain a decoded text.

[0098] Among them, the character refers to the address corresponding to the encoded text in the text, the loss value refers to the data missing in the text during the conversion process, the size of the missing value directly affects the integrity and referenceability of the data, and the beam search algorithm refers to a decoding function generated by the Java language, which can convert a character set into a language that can be recognized by a computer.

[0099] Optionally, the querying of all characters in the error correction text is implemented by a preset character query script, and the error value of the character set is calculated by a cross entropy loss function.

[0100] Furthermore, in an optional embodiment of the present invention, the cross entropy loss function includes:

[0101]

[0102] In the formula, LOSS represents the error value, x′ i represents the label value of the character set, and m represents the number of loss confrontations.

[0103] Furthermore, after obtaining the target medical text, the embodiment of the present invention further includes: transferring the decoded text to a data repository of a text error correction system for storage, as a subsequent text comparison, so that subsequent texts with similar errors can quickly obtain correct texts by text comparison, thereby improving the efficiency of subsequent text error correction. Optionally, the transferring of the decoded text to a data repository of a text error correction system for storage includes: creating a data repository of the decoded text, generating a data storage list of the decoded text in the data repository of the decoded text, and entering the decoded text into the data storage list of the decoded text.

[0104] Among them, the data repository refers to a repository that persistently stores and manages a collection of data, the data storage list refers to a collection used to store a certain type of data with similar categories or the same functions, optionally, the data repository for creating the decoded text is created by a database generation tool of the programming language MYSQL, the data storage list for generating the decoded text is generated by a sub-script of the MYSQL database generation tool, and the decoding text is entered into the data storage list of the decoded text by entering it into a data storage medium.

[0105] It can be seen that the scheme first obtains the original medical consultation text, embeds the original medical consultation text into a preset matrix layer, obtains the converted medical text, which can be used as a prerequisite for the subsequent text error correction model processing, and uses the encoder in the trained text error correction model to compile the converted medical text to obtain a model readable text, which can be recognized by the trained text error correction model, which is convenient for subsequent error discrimination, and uses the judger in the trained text error correction model to identify the abnormal text of the model readable text, obtain the abnormal text, and locate the error in the model readable text for subsequent error correction; secondly, the embodiment of the present invention uses the corrector in the trained text error correction model to perform text error correction on the abnormal text to obtain the corrected text, which can correct the wrong words in the text to obtain the correct text for subsequent correct decoding; further, the embodiment of the present invention uses the decoder in the trained text error correction model to perform text decoding on the preferred text to obtain the decoded text, which can obtain the correct text for system recognition. Therefore, the text intelligent error correction method, device, electronic device and storage medium proposed in the embodiment of the present invention can better solve the problem of semantic ambiguity in the text conversion process.

[0106] like Figure 2 The figure shows a functional module diagram of the text intelligent error correction device of the present invention.

[0107] The text intelligent error correction device 200 of the present invention can be installed in an electronic device. According to the functions to be implemented, the text intelligent error correction device can include a text conversion module 201, a text compilation module 202, a text anomaly module 203, a text error correction module 204, a text optimization module 205 and a text decoding module 206. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0108] In the embodiment of the present invention, the functions of each module / unit are as follows:

[0109] The text conversion module 201 is used to obtain the original medical consultation text, embed the original medical consultation text into a preset matrix layer, and obtain a converted medical text;

[0110] The text compilation module 202 is used to compile the converted medical text using the encoder in the trained text error correction model to obtain a model-readable text;

[0111] The text anomaly module 203 is used to identify abnormal text in the model readable text using the judgement in the trained text error correction model to obtain abnormal text;

[0112] The text error correction module 204 is used to perform text error correction on the abnormal text using the error corrector in the trained text error correction model to obtain an error-corrected text;

[0113] The text optimization module 205 is used to sort the words and sentences in the error correction text to obtain sequence words and sentences, and extract the preferred sequence words and sentences in the sequence words and sentences to obtain the preferred text;

[0114] The text decoding module 206 is used to use the decoder in the trained text error correction model to perform text decoding on the preferred text to obtain the target medical text.

[0115] In detail, each module in the text intelligent error correction device 200 in the embodiment of the present invention adopts the same method as above when used. Figure 1 The same technical means are used as the text intelligent error correction method described in , and can produce the same technical effects, so I will not go into details here.

[0116] like Figure 3 The figure is a schematic diagram of the structure of an electronic device for implementing the text intelligent error correction method of the present invention.

[0117] The electronic device may include a processor 30 , a memory 31 , a communication bus 32 , and a communication interface 33 , and may also include a computer program stored in the memory 31 and executable on the processor 30 , such as a text intelligent error correction program.

[0118] In some embodiments, the processor 30 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 30 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 31 (for example, executing text intelligent error correction programs, etc.), and calls data stored in the memory 31 to execute various functions of the electronic device and process data.

[0119] The memory 31 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. The memory 31 may be an internal storage unit of an electronic device in some embodiments, such as a mobile hard disk of the electronic device. The memory 31 may also be an external storage device of an electronic device in other embodiments, such as a plug-in mobile 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 electronic device. Further, the memory 31 may also include both an internal storage unit of the electronic device and an external storage device. The memory 31 may not only be used to store application software and various types of data installed in the electronic device, such as the code of a text intelligent error correction program, but also be used to temporarily store data that has been output or is to be output.

[0120] The communication bus 32 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 31 and at least one processor 30, etc.

[0121] The communication interface 33 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.

[0122] Figure 3 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 3 The structure shown does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0123] For example, although not shown in the figure, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 30 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0124] It should be understood that the embodiment is for illustrative purposes only and the scope of the patent invention is not limited to this structure.

[0125] The text intelligent error correction program stored in the memory 31 in the electronic device is a combination of multiple computer programs. When running in the processor 30, the following method can be implemented:

[0126] Acquire an original medical consultation text, and embed the original medical consultation text into a preset matrix layer to obtain a converted medical text;

[0127] Using the encoder in the trained text error correction model to perform text compilation on the converted medical text to obtain model-readable text;

[0128] Using the judgement device in the trained text error correction model to identify abnormal words in the model-readable text, and obtaining abnormal text;

[0129] Using the corrector in the trained text error correction model to perform text error correction on the abnormal text to obtain a corrected text;

[0130] Sorting the words and sentences in the error correction text to obtain sequence words and sentences, and extracting preferred sequence words and sentences from the sequence words and sentences to obtain a preferred text;

[0131] The preferred text is decoded using a decoder in a trained text error correction model to obtain a target medical text.

[0132] Specifically, the specific implementation method of the processor 30 for the above computer program can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0133] Furthermore, if the module / unit integrated in the electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0134] The present invention also 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 of an electronic device, the following method can be implemented:

[0135] Acquire an original medical consultation text, and embed the original medical consultation text into a preset matrix layer to obtain a converted medical text;

[0136] Using the encoder in the trained text error correction model to perform text compilation on the converted medical text to obtain model-readable text;

[0137] Using the judgement device in the trained text error correction model to identify abnormal words in the model-readable text, and obtaining abnormal text;

[0138] Using the corrector in the trained text error correction model to perform text error correction on the abnormal text to obtain a corrected text;

[0139] Sorting the words and sentences in the error correction text to obtain sequence words and sentences, and extracting preferred sequence words and sentences from the sequence words and sentences to obtain a preferred text;

[0140] The preferred text is decoded using a decoder in a trained text error correction model to obtain a target medical text.

[0141] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0142] The modules described as separate components may or may not be physically separated, and the components shown as modules 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0143] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0144] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0145] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0146] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0147] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.

Claims

1. A medical consultation text intelligent error correction method, characterized in that: The method comprises: Acquire an original medical consultation text, and embed the original medical consultation text into a preset matrix layer to obtain a converted medical text; Using the encoder in the trained text error correction model to perform text compilation on the converted medical text to obtain model-readable text; Using the judgement device in the trained text error correction model to identify abnormal words in the model-readable text, and obtaining abnormal text; Using the corrector in the trained text error correction model to perform text error correction on the abnormal text to obtain a corrected text; Randomly sorting the words and sentences in the error correction text to obtain sequence words and sentences, and extracting preferred sequence words and sentences from the sequence words and sentences to obtain a preferred text; The preferred text is decoded using a decoder in a trained text error correction model to obtain a target medical text.

2. The method according to claim 1, characterized in that The step of embedding the original medical consultation text into a preset matrix layer to obtain a converted medical text includes: Querying the spatial capacity of the preset matrix layer; According to the spatial capacity, constructing the spatial dimension of the original medical consultation text in the preset matrix layer; According to the spatial dimension, the original medical consultation text is input into the preset matrix layer to obtain the converted medical text.

3. The method according to claim 1, characterized in that The method of using the encoder in the trained text error correction model to compile the converted medical text to obtain a model-readable text includes: Using the array function in the encoder to define the initialization array of the converted medical text, to obtain an initial array; Inserting a separator into the initial array using a column separation tool in the encoder; The assignment software in the encoder is used to assign numerical values ​​to the initial array of each column of the delimiter to obtain the model readable text.

4. The method according to claim 1, characterized in that The method of using the judger in the trained text error correction model to identify abnormal text in the model readable text to obtain the abnormal text includes: Using the word segmentation tool in the judger to segment the model readable text to obtain a text word segmentation set; Combining the text segmentation sets in order to obtain a plurality of combined segmentations; Using the matching algorithm in the judger to perform word matching on each of the multiple combined participles with the combined words in a preset word library, to obtain word matching results between the multiple combined participles and the combined words in the preset word library; According to the word matching results, abnormal text in the model readable text is located.

5. The method according to claim 1, characterized in that The method of using the corrector in the trained text error correction model to perform text error correction on the abnormal text to obtain the corrected text includes: Using the context recognition function in the error corrector to identify the current context of the abnormal text; Extract error keywords of abnormal text in the current context using the extraction function in the error corrector; Using a semantic association function in the error corrector to identify the semantics of the error keyword; The error keyword is corrected according to the semantics of the error keyword to obtain the error correction text.

6. The method according to claim 1, characterized in that The step of extracting a preferred sequence of words from the sequence of words to obtain a preferred text includes: Constructing a candidate collection of words and sentences of the sequence of words and sentences, and calculating a preferred collection of the candidate collection of words and sentences; A new text is generated according to the preferred collection to obtain a preferred text.

7. The method according to any one of claims 1 to 6, characterized in that: The step of using a decoder in a trained text error correction model to decode the preferred text to obtain a target medical text includes: Using the character query script in the decoder to query all characters in the error correction text to obtain a character set; Calculating the loss value of the character set using a cross entropy loss function in the decoder; When the loss value of the character set is less than a set threshold, the character set is converted using a beam search algorithm in the decoder to obtain a target medical text.

8. A text intelligent error correction device, characterized in that: The device comprises: A text conversion module, used for acquiring an original medical consultation text, and embedding the original medical consultation text into a preset matrix layer to obtain a converted medical text; A text compilation module, used to compile the converted medical text using an encoder in a trained text error correction model to obtain a model-readable text; A text anomaly module, used to identify abnormal text in the model-readable text using a judger in a trained text error correction model to obtain abnormal text; A text error correction module, used to perform text error correction on the abnormal text using an error corrector in a trained text error correction model to obtain an error-corrected text; A text optimization module, used for randomly sorting the words and sentences in the error correction text to obtain sequence words and sentences, and extracting the preferred sequence words and sentences in the sequence words and sentences to obtain the preferred text; The text decoding module is used to use the decoder in the trained text error correction model to perform text decoding on the preferred text to obtain the target medical text.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the text intelligent error correction method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements a text intelligent error correction method as described in any one of claims 1 to 7.

Citation Information

Cited By

  • A government affair text error correction method and system

    CN119443088B