A text error correction method, device, computer equipment and storage medium
By splicing the text to be detected and the error-corrected text into verification text and inputting it into the error correction detection model, combined with contextual information, the problem of error correction in traditional text error correction methods is solved, and the accuracy and rationality of text error correction are improved.
Patent Information
- Application Number
- CN202410998763.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-24
AI Technical Summary
Traditional text error correction methods often have the problem of text miscorrection, which affects the accuracy of text correction and cannot effectively avoid the occurrence of miscorrection problems.
By using the text error correction model to perform error correction on the text to be detected, the text to be detected and the corrected text are spliced into verification text, and input into the error correction detection model for verification. Combined with rich contextual information, it can accurately predict whether the corrected text is There is a problem of error correction, which determines the final text error correction result.
It effectively avoids the situation of error correction, improves the accuracy and rationality of text error correction, and ensures the accuracy of error correction results.
Smart Images

Figure CN118520870B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a text error correction method, apparatus, computer equipment and storage medium. Background Art
[0002] Text error correction refers to the use of various computer programs to automatically or semi-automatically detect and locate grammatical errors, spelling errors, word misuse, punctuation errors, and other problems in the input text, and to correct the detected errors, thereby improving the readability and quality of the text. However, traditional error correction methods often have the problem of text miscorrection, which affects the accuracy of text correction. Summary of the invention
[0003] The embodiments of the present disclosure at least provide a text error correction method, apparatus, computer device and storage medium.
[0004] In a first aspect, an embodiment of the present disclosure provides a text error correction method, comprising:
[0005] Perform text error correction processing on the text to be detected using a text error correction model to obtain an error correction text corresponding to the text to be detected;
[0006] In the case where the error correction text is different from the text to be detected, the text to be detected and the error correction text are used to perform text splicing to obtain a verification text;
[0007] The verification text is verified using an error correction detection model to obtain a detection result; the detection result is used to indicate whether the error correction text has a miscorrection problem;
[0008] According to the detection result, a text error correction result of the text to be detected is determined.
[0009] In a possible implementation, determining the text error correction result of the text to be detected according to the detection result includes:
[0010] In the case where the detection result indicates that there is a miscorrection problem, determining that the text correction result includes the text to be detected;
[0011] In a case where the detection result indicates that there is no miscorrection problem, it is determined that the text correction result includes the corrected text.
[0012] In a possible implementation manner, the text to be detected includes a plurality of characters before correction;
[0013] The step of performing text splicing using the text to be detected and the error correction text to obtain a verification text includes:
[0014] In the case where there are at least two target corrected characters in the error correction text that are inconsistent with the corresponding pre-corrected characters, multiple target error correction texts are generated using the target corrected characters and the text to be detected; wherein each of the target error correction texts includes only one target corrected character, and the target corrected characters in different target error correction texts are different;
[0015] Performing text splicing on each of the target error correction texts and the text to be detected to obtain verification texts corresponding to each of the target error correction texts;
[0016] The verification text is verified by using the error correction detection model to obtain a detection result, including:
[0017] The error correction detection model is used to perform verification processing on the verification texts corresponding to each target error correction text, so as to obtain the detection result corresponding to each target error correction text.
[0018] In a possible implementation, determining the text error correction result of the text to be detected according to the detection result includes:
[0019] Determine, based on the detection results corresponding to each of the target error correction texts, target corrected characters that do not have a miscorrection problem;
[0020] The text error correction result is determined by using the target corrected characters without the miscorrection problem and the text to be detected.
[0021] In a possible implementation, the method further includes:
[0022] In the case that the error correction text is the same as the text to be detected, the text to be detected is used as the text error correction result.
[0023] In a possible implementation manner, the using the error correction detection model to perform verification processing on the verification text to obtain a detection result includes:
[0024] Utilizing the feature extraction layer of the error correction detection model, extracting character features corresponding to each target character in the verification text;
[0025] Using multiple fully connected layers, the character features corresponding to each of the target characters are subjected to multiple continuous fully connected processes to obtain the fully connected features corresponding to each of the target characters;
[0026] According to the fully connected features corresponding to the classified characters, a first probability indicating that there is a miscorrection problem and a second probability indicating that there is no miscorrection problem are obtained; the classified characters are the first target characters in the verification text;
[0027] The detection result is determined according to the first probability, the second probability and a preset probability threshold.
[0028] In a possible implementation, the step of performing text splicing using the text to be detected and the error correction text to obtain a verification text includes:
[0029] Adding a separator character between the text to be detected and the error correction text to obtain a concatenated text;
[0030] Adding classification characters at the starting position of the concatenated text to obtain verification text.
[0031] In a possible implementation, the method further includes the step of training the error correction detection model:
[0032] Acquire a sample text, and use a trained text correction model to perform text correction processing on the sample text to obtain a predicted correction text corresponding to the sample text;
[0033] The predicted error correction text and the sample text are spliced into a sample verification text, and the sample verification text is verified using the error correction detection model to be trained to obtain a predicted detection result;
[0034] According to the predicted detection result and the sample label corresponding to the predicted error correction text, the prediction loss of the error correction detection model is determined, and the error correction detection model is iteratively trained using the prediction loss until a preset cutoff condition is met to obtain a trained error correction detection model; the sample label is used to indicate whether the predicted error correction text has a miscorrection problem.
[0035] In a second aspect, the present disclosure also provides a text error correction device, including:
[0036] An error correction module is used to perform text error correction processing on the text to be detected using a text error correction model to obtain an error correction text corresponding to the text to be detected;
[0037] A splicing module, used for, when the error correction text is different from the text to be detected, performing text splicing using the text to be detected and the error correction text to obtain a verification text;
[0038] A detection module, used to perform verification processing on the verification text using an error correction detection model to obtain a detection result; the detection result is used to indicate whether the error correction text has a miscorrection problem;
[0039] A determination module is used to determine the text error correction result of the text to be detected according to the detection result.
[0040] In a third aspect, an optional implementation of the present disclosure further provides a computer device, a processor, and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the machine-readable instructions stored in the memory, and when the machine-readable instructions are executed by the processor, the machine-readable instructions perform the steps of the above-mentioned first aspect, or any possible implementation of the first aspect.
[0041] In a fourth aspect, an optional implementation of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, the steps of the above-mentioned first aspect, or any possible implementation of the first aspect are executed.
[0042] For a description of the effects of the above-mentioned text correction device, computer equipment, and computer-readable storage medium, please refer to the description of the above-mentioned text correction method, which will not be repeated here.
[0043] The text error correction method, device, computer equipment and storage medium provided by the embodiments of the present disclosure, after using the text error correction model to predict the error correction text corresponding to the text to be detected, by splicing the text to be detected and the error correction text into a verification text and inputting it into the error correction detection model, the error correction detection model can accurately predict whether there is a problem of miscorrection in the error correction text in combination with the rich contextual information in the verification text, that is, obtain an accurate detection result. Furthermore, using the detection result, the occurrence of miscorrection situations can be reduced and the accuracy of text error correction can be improved. In general, the embodiments of the present application can effectively avoid the occurrence of miscorrection of the text to be detected by setting the error correction detection model to perform secondary detection on the error correction text output by the error correction model, thereby improving the rationality and accuracy of text error correction.
[0044] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0046] Figure 1A flowchart of a text error correction method provided by an embodiment of the present disclosure is shown;
[0047] Figure 2 A network structure and prediction schematic diagram of a text error correction model provided by an embodiment of the present disclosure are shown;
[0048] Figure 3 A network structure and prediction schematic diagram of an error correction detection model provided by an embodiment of the present disclosure are shown;
[0049] Figure 4 A specific implementation flow chart of a text error correction method provided by an embodiment of the present disclosure is shown;
[0050] Figure 5 A schematic diagram of a text error correction device provided by an embodiment of the present disclosure is shown;
[0051] Figure 6 A schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the present disclosure claimed for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0053] In addition, the terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. The "plurality or several" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0054] It has been found that in the prior art, text correction systems usually use a variety of algorithmic solutions, including rule-based methods, statistical-based methods, and deep learning methods. Among them, for rule-based methods, it uses predefined language rules to detect and correct errors in the text. For example, check grammatical errors, spelling errors, word collocation, etc. These rules can be written manually or extracted from linguistic knowledge. The disadvantage of this method is that it requires a lot of labor costs and it is difficult to cover all possible errors, resulting in poor accuracy of text correction, and there is a disadvantage that it cannot effectively avoid the problem of miscorrection.
[0055] For the statistical-based method, the error correction process is as follows: when a piece of text is input, the N-gram language model will traverse each word or character in the text and calculate its probability under a given context. If the probability of a word or character is lower than a threshold, it will be marked as an error. For words or characters marked as errors, the N-gram language model will generate a set of candidate words as possible error correction options through spelling edit distance, homophones, synonyms and other technologies to cover possible errors. For each candidate word, the N-gram model will calculate its probability under the given context again. These probability values can be calculated by the conditional probability formula of the model, which can take into account the degree of match between the candidate word and the context. Finally, for each word or character marked as a possible error, the one with the highest probability is selected from the generated candidate words as the error correction result. However, this method still cannot effectively avoid the occurrence of the problem of miscorrection, which affects the accuracy of text error correction.
[0056] For the deep learning-based method, the main focus is to train convolutional neural networks to detect errors in text and give correction results. However, this method also has the disadvantage of being unable to effectively avoid the problem of miscorrection, which affects the accuracy of text correction.
[0057] In addition, the above methods can also be combined to further improve the error correction effect. For example, combine rules with statistics, use rules to preprocess text and reduce the number of candidate corrections, and then use statistical methods to select the best correction results. Combine deep learning with statistics, combine deep learning models with statistical-based methods, use deep learning models to extract features and understand contextual information for error detection, and then use statistical methods to generate correction suggestions. Although the combined approach can improve the accuracy of error correction, it is still difficult to solve the problem of miscorrection.
[0058] In summary, although there are various text error correction methods in the prior art, they all have the disadvantage of being unable to effectively avoid the occurrence of miscorrection problems, which affects the accuracy of text error correction.
[0059] Based on the above research, the present disclosure provides a text error correction method, device, computer equipment and storage medium. After using a text error correction model to predict the error correction text corresponding to the text to be detected, by splicing the text to be detected and the error correction text into a verification text and inputting it into the error correction detection model, the error correction detection model can accurately predict whether there is a miscorrection problem in the error correction text in combination with the rich contextual information in the verification text, that is, to obtain an accurate detection result. Furthermore, using the detection results, the occurrence of miscorrections can be reduced and the accuracy of text error correction can be improved. In general, the embodiments of the present application can effectively avoid the occurrence of miscorrections on the text to be detected by setting an error correction detection model to perform secondary detection on the error correction text output by the error correction model, thereby improving the rationality and accuracy of text error correction.
[0060] The defects existing in the above solutions are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure for the above problems below should be the contributions made by the inventor to the present disclosure during the disclosure process.
[0061] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0062] To facilitate understanding of this embodiment, a text error correction method disclosed in an embodiment of the present disclosure is first introduced in detail. The executor of the text error correction method provided in the embodiment of the present disclosure is generally a terminal device or other processing device with certain computing capabilities, wherein the terminal device may be a user equipment (UE), a mobile device, a user terminal, a terminal, a personal digital assistant (PDA), a handheld device, a computer device, etc.; in some possible implementations, the text error correction method may be implemented by a processor calling computer-readable instructions stored in a memory.
[0063] The text error correction method provided by the embodiment of the present disclosure is described below by taking a computer device as an example of an execution subject.
[0064] like Figure 1 As shown, it is a flowchart of a text error correction method provided by an embodiment of the present disclosure, which may include the following steps:
[0065] S101: Perform text error correction processing on the text to be detected using a text error correction model to obtain an error correction text corresponding to the text to be detected.
[0066] Here, the text to be detected is the text for which text error correction is to be performed, and the corrected text is the predicted text output by the text error correction model for the text to be detected.
[0067] The text to be detected may include at least one character to be detected, which can be defined as the character before correction. The character to be detected can be any character, such as Chinese characters, letters, pinyin, words, punctuation marks, etc. The text error correction model is a pre-trained neural network model that can perform text error correction on the input text and output the corrected text corresponding to the input text. Among them, the corrected text may include the correction results corresponding to each character in the input text, and the correction result can specifically be the corrected character corresponding to the character in the input text.
[0068] For the text error correction model, when it detects each character in the text, if it determines that the character is a correct character, then the corrected character corresponding to the character is the character itself; if it determines that the character is an incorrect character, then the corrected character corresponding to the character is the character obtained after correcting the character. Exemplarily, taking the text "天器晴朗。" as an example, after inputting the text into the text error correction model, the corrected text output by the text error correction model can be "天气晴朗。".
[0069] For the text error correction model, the following steps can be used for training:
[0070] Collect the training data set. Among them, the training data set can include the open-source first text error correction data set collected on the network and the second text error correction data set manually annotated. The first text error correction data set can include multiple first sample error correction data, and each first sample error correction data can include a first sample input text and a first sample label text. The second text error correction data set can include multiple second sample error correction data, and the second sample error correction data can include a second sample input text and the second sample label text manually annotated.
[0071] Input each sample input text in the training data set into the text error correction model to be trained to obtain the predicted text. Use the sample label text corresponding to the sample input text and the predicted text to calculate the model loss of the text error correction model to be trained, and use the model loss to perform iterative training on the model until the training termination condition is met, and a trained text error correction model is obtained. Among them, the training termination condition can be that the number of rounds of iterative training reaches the preset number of rounds, and / or the prediction accuracy of the trained text error correction model reaches the preset accuracy.
[0072] Such as Figure 2As shown, a network structure and prediction diagram of a text error correction model provided by an embodiment of the present application is shown, wherein the text error correction model may include a backbone network for extracting feature vectors corresponding to characters and a prediction head for performing feature processing on the feature vectors. Figure 2 The BERT language representation model shown (where BERT stands for Bidirectional Encoder Representations from Transformers) can also be a network built based on architectures such as statistical models, long short-term memory networks (LSTM), and convolutional neural networks (CNN). The prediction head can specifically be at least one fully connected layer, and the prediction head can perform at least one fully connected process on each character vector extracted by the backbone network, and then normalize the result obtained by the fully connected process to obtain the normalized probability of each character corresponding to multiple preset characters. Among them, multiple preset characters can be determined based on the training set used when training the model. For example, in an embodiment of the present application, the number of preset characters can be 5,000 common characters. The prediction head can output the normalized probability of each character corresponding to 5,000 characters.
[0073] After the normalized probability is obtained using the prediction head, for each character, the preset character with the highest normalized probability can be used as the error correction result corresponding to the character. Figure 2 In FIG. 1 , each circle between the prediction head and the error correction result is a feature vector representation of a preset character with the highest normalized probability corresponding to the input character. According to the feature vector representation, the corresponding preset character can be converted as the error correction result.
[0074] Exemplarily, for any text to be detected, the text to be detected can be input into a trained text error correction model to obtain an error correction text corresponding to the text to be detected.
[0075] S102: When the error correction text is different from the text to be detected, the text to be detected and the error correction text are used to perform text splicing to obtain a verification text.
[0076] The verification text is a text used to verify whether the correction text output by the text correction model contains erroneously corrected characters.
[0077] In specific implementation, after obtaining the corrected text, the corrected text and the text to be detected can be compared to determine whether they are the same. If they are not the same, the text to be detected and the corrected text can be concatenated to obtain a verification text. For example, the verification text can be obtained by concatenating the text to be detected first and the corrected text second.
[0078] In another embodiment, after comparing the corrected text and the text to be detected, when the corrected text is the same as the text to be detected, the text to be detected can be used as the text correction result.
[0079] Among them, the text correction result is the corrected text output for the text to be detected. Among them, the text correction result can be the same as the text to be detected, or it can be the text obtained after correcting some incorrect characters in the text to be detected.
[0080] When the corrected text is the same as the text to be detected, it can be determined that the text to be detected does not include any incorrect characters, and the text to be detected or the corrected text can be directly used as the text correction result. For example, when the text to be detected is "Give up your seat on the bus", the text correction result can be "Offer your seat on the bus"; when the text to be detected is "Study hard and make progress every day", the text correction result can be "Study hard and make progress every day".
[0081] S103: Use the error correction detection model to perform verification processing on the verification text to obtain a detection result; the detection result is used to indicate whether there is an incorrect error correction problem in the corrected text.
[0082] Here, the error correction detection model is a pre-trained neural network model, which can be used to detect whether there is an incorrect error correction problem in the corrected text output by the text error correction model. The detection result is used to indicate whether there are incorrect corrected characters in the corrected text output by the text error correction model. For example, when the text to be detected is "This is a very good question" and the corrected text is "This is a very luxurious question", the "luxurious" in the corrected text is an incorrectly corrected character.
[0083] In specific implementation, after obtaining the verification text, the verification text can be input into the trained error correction detection model, and the error correction detection model can be used to verify the verification text according to the context information and semantic information in the verification text, so as to obtain a detection result. Among them, the detection result can be "yes" or "no". Among them, "yes" means that there is an incorrect error correction problem, and "no" means that there is no incorrect error correction problem.
[0084] S104: Determine the text correction result of the text to be detected according to the detection result.
[0085] Here, the text correction result is the corrected text determined for the text to be detected. The text correction result may be the same as the text to be detected, or may have different characters from the text to be detected, wherein the different characters are the corrected characters.
[0086] Exemplarily, after the detection result is obtained, the text correction result can be determined from the text to be detected and the correction text according to whether there is a miscorrection problem indicated by the detection result.
[0087] Specifically, after obtaining the detection result, if the detection result indicates that there is a miscorrection problem, it is determined that the text error correction result includes the text to be detected. Here, if the detection result indicates that there is a miscorrection problem, it can be explained that the corrected characters in the error correction text are obtained after the error correction, so the text to be detected can be directly used as the text error correction result. Among them, the corrected characters are the characters in the error correction text.
[0088] When the detection result indicates that there is no miscorrection problem, it is determined that the text error correction result includes the error correction text. Here, when the detection result indicates that there is no miscorrection problem, it can be explained that the corrected characters in the error correction text are all obtained after correct correction, so the error correction text can be directly used as the text error correction result.
[0089] For example, when the text to be detected is "This is a good question" and the correction text is "This is a very generous question", the detection result may be "Yes", and "This is a good question" may be used as the text correction result. When the text to be detected is "Give up your seat on the bus" and the text correction result may be "Give up your seat on the bus", the detection result may be "No", and "Give up your seat on the bus" may be used as the text correction result.
[0090] In this way, after using the text error correction model to predict the error correction text corresponding to the text to be detected, by splicing the text to be detected and the error correction text into a verification text and inputting it into the error correction detection model, the error correction detection model can accurately predict whether the error correction text has a miscorrection problem in combination with the rich contextual information in the verification text, that is, obtain an accurate detection result. Furthermore, using the detection result, the occurrence of miscorrection situations can be reduced and the accuracy of text error correction can be improved. In general, the embodiment of the present application realizes the confrontation between text error correction and error correction detection by setting an error correction detection model to perform secondary detection on the error correction text output by the error correction model, thereby effectively avoiding the occurrence of miscorrection of the text to be detected and improving the rationality and accuracy of text error correction.
[0091] In one embodiment, the step of "joining the text to be detected and the error correction text to obtain the verification text" in S102 can be implemented according to the following steps:
[0092] S102-1: Add a separator character between the text to be detected and the error correction text to obtain a concatenated text.
[0093] S102-2: Add classification characters at the starting position of the concatenated text to obtain a verification text.
[0094] Here, the separator character may be a pre-set character, for example, the separator character may be [SEP], where SEP is the abbreviation of SEPARATE. The classification character may also be a pre-set character, for example, the classification character may be [CLS], where CLS is the abbreviation of CLASSIFY.
[0095] For example, the text to be detected and the error correction text may be concatenated together, and a separator character [SEP] may be added between the two texts to obtain a concatenated text "text to be detected [SEP] error correction text". Then, a classification character [CLS] may be added at the start position of the concatenated text (i.e., the beginning of the text) to obtain a verification text "[CLS] text to be detected [SEP] error correction text".
[0096] For example, when the text to be detected is "This is a good question" and the error correction text is "This is a very generous question", the verification text can be "[CLS]This is a good question[SEP]This is a very generous question". When the text to be detected is "Give up your seat on the bus" and the text error correction result can be "Give up your seat on the bus", the verification text can be "[CLS]Give up your seat on the bus[SEP]Give up your seat on the bus".
[0097] Understandably, for any text to be detected, each corrected character included in the error correction text output by the text error correction model can be the same as the pre-corrected character at the corresponding position of the text to be detected. Of course, there may also be one or more corrected characters, which are different from the pre-corrected characters at the corresponding position. In one embodiment, no matter there are several corrected characters different from the pre-corrected characters at the corresponding position in the error correction text, the text to be detected and the error correction text can be spliced together to obtain the verification text according to the steps of S102-1 and S102-2 above. In this case, after obtaining the test result using the verification text, the test result can directly indicate whether there is a wrong error correction problem in the overall error correction text. If the error correction text includes a plurality of corrected characters different from the pre-corrected characters at the corresponding position, and there are characters with wrong correction and characters without wrong correction in these multiple characters, the test result cannot point out which of these multiple corrected characters is the character with wrong correction and which is the character without wrong correction.
[0098] Optionally, in order to specifically determine which of the multiple corrected characters is a mis-corrected character and which is a character without mis-correction, the following steps can be specifically processed as described below. Specifically, when the text to be detected includes multiple pre-correction characters, the above S102 can be implemented according to the following steps:
[0099] S1: When there are at least two target corrected characters in the error-corrected text that are inconsistent with the corresponding pre-correction characters, multiple target error-corrected texts are generated using each target corrected character and the text to be detected; wherein, each target error-corrected text includes only one target corrected character, and the target corrected characters in different target error-corrected texts are different.
[0100] Here, the pre-correction character is the character included in the text to be detected. Each character in the error-corrected text can be defined as a corrected character. The target corrected character is the corrected character that is different from the pre-correction character at the corresponding position. For example, when the text to be detected is "This is a very good question" and the error-corrected text is "This is a very hao question", the target corrected character can be "hao".
[0101] The target error-corrected text is different from the text to be detected by only one character, and this character can be any of the determined target corrected characters. The number of target error-corrected texts is related to the number of target corrected characters, and the target corrected characters in different target error-corrected texts are different. When generating the error-corrected text using the target corrected character, the error-corrected text can include each target error-corrected text.
[0102] Specifically in implementation, when it is determined that the text to be detected is different from the error-corrected text, the number of target corrected characters included in the error-corrected text can be determined according to the text to be detected and the error-corrected text. If the number is less than 2, the text to be detected and the error-corrected text can be directly concatenated according to the steps of the above S102-1 and S102-2 to obtain the verification text, and the text error-correction result of the text to be detected can be determined using the steps of the above S103 and S104.
[0103] When the number of target corrected characters is greater than or equal to 2, that is, when there are at least two target corrected characters in the error-corrected text, one target corrected character can be used each time to replace the pre-correction character at the corresponding position in the text to be detected to obtain the target error-corrected text corresponding to the target corrected character.
[0104] For example, when the text to be detected is "This seems like a good question" and the error correction text is "This is a very proud question", the target corrected characters may include "yes" and "proud". Then, the target corrected characters "yes" and the text to be detected can be used to obtain the target error correction text "This is a good question"; similarly, the target corrected characters "proud" and the text to be detected can be used to obtain the target error correction text "This seems like a very proud question".
[0105] Optionally, the target error correction text can also be generated based on the interval between the target corrected characters and the text to be detected. For example, when two target corrected characters are connected, the two connected target corrected characters can be used to replace the two pre-corrected characters at the corresponding positions in the text to be detected, and the target error correction text including the two target corrected characters can be obtained. When the two target corrected characters are not connected, the two target corrected characters can be used respectively to obtain the target error correction texts corresponding to the two target corrected characters.
[0106] It is understandable that when the text to be detected includes a pre-correction character, the pre-correction character and a post-correction character corresponding to the pre-correction character output by the text error correction model can be concatenated using separation characters and classification characters to obtain a verification text.
[0107] S2: Perform text splicing on each target error correction text and the text to be detected respectively to obtain the verification text corresponding to each target error correction text.
[0108] In specific implementation, for each target error correction text, the target error correction text and the text to be detected can be spliced into a verification text by using separation characters and classification characters. In this way, verification texts corresponding to each target error correction text can be obtained.
[0109] Further, after obtaining the verification texts corresponding to the target error correction texts, the above S103 can be implemented according to the following steps:
[0110] The error correction detection model is used to verify the verification texts corresponding to each target error correction text, and the detection result corresponding to each target error correction text is obtained.
[0111] In specific implementation, the verification texts corresponding to the target error correction texts can be respectively input into the error correction detection model to obtain the detection results corresponding to each target error correction text. The detection results here can be used to indicate whether there is a miscorrection problem in the target corrected characters in the target error correction text.
[0112] Furthermore, after obtaining the detection result corresponding to each target error correction text, the above S104 can be implemented according to the following steps:
[0113] T1: Determine the target corrected characters without mis-correction problems according to the detection results corresponding to each target corrected text.
[0114] During specific implementation, for each target corrected text, if the detection result corresponding to the target corrected text indicates that there is no mis-correction problem, then it can be determined that the target corrected characters in the target corrected text are the target corrected characters without correction problems. On the contrary, if the detection result corresponding to the target corrected text indicates that there is a mis-correction problem, then it can be determined that the target corrected characters in the target corrected text are the target corrected characters with correction problems.
[0115] T2: Use the target corrected characters without mis-correction problems and the text to be detected to determine the text correction result.
[0116] During specific implementation, the target corrected characters without mis-correction problems can be used to replace the characters before correction at the corresponding positions in the text to be detected to obtain the text correction result.
[0117] For example, the text to be detected is "This seems to be a very good question", the corrected text is "This is a very generous question", the target corrected characters may include "is" and "generous", among which, the target corrected character "is" has no mis-correction problem, and the target corrected character "generous" has a mis-correction problem, then "is" can be used to replace "seems" in the text to be detected to obtain the text correction result "This is a very good question".
[0118] In this way, first use the target corrected characters to generate the target corrected text, and then use the target corrected text for error correction detection, which can achieve the granularity of error correction detection to be divided into specific characters, thereby improving the accuracy of the obtained text correction result.
[0119] In one embodiment, the above S103 can be implemented according to the following steps:
[0120] S103-1: Use the feature extraction layer of the error correction detection model to extract the character features corresponding to each target character in the verification text.
[0121] S103-2: Use multiple fully connected layers to perform consecutive fully connected processing on the character features corresponding to each target character to obtain the fully connected features corresponding to each target character.
[0122] Here, the target characters are the characters included in the verification text. For example, when the verification text is "[CLS] Give up your seat on the bus [SEP] Give up your seat on the bus", the target characters may include classification characters "[CLS]", "public", "transport", "car", "get on", "let", "sit", and separation characters "[SEP]", "public", "transport", "car", "get on", "let", "seat".
[0123] The error correction detection model may include a feature layer and a prediction layer, wherein the feature layer includes a feature extraction layer and a multi-layer fully connected layer. The feature extraction layer is used to extract the character features corresponding to each target character in the verification text, and the character features may specifically be feature vectors used to characterize the characters. The fully connected layer is used to perform fully connected processing on the character features extracted by the feature extraction layer to obtain fully connected features. Exemplarily, the feature layer may be, for example, a BERT layer, a network layer built based on a statistical model, an LSTM layer, a CNN layer, and the like.
[0124] The prediction layer is used to perform vector conversion on the feature vector using the fully connected matrix, and then normalize the conversion result to obtain the false alarm probability and non-false alarm probability corresponding to the verification text. The feature prediction layer can be, for example, a normalization layer.
[0125] In specific implementation, the verification text can be input into the error correction detection model, and the feature extraction layer in the error correction detection model is used to extract features for each target character to obtain the character features corresponding to each target character. Then, multiple layers of fully connected layers can be used to perform multiple full connection processing on each character feature output by the feature extraction layer, so as to obtain the fully connected features corresponding to each target character. Among them, when performing the full connection processing, the first layer of fully connected layer can perform the first full connection processing on each character feature output by the feature extraction layer to obtain the fully connected features corresponding to each target character output by the first layer, and then use the second layer of fully connected layer to perform the second full connection processing on the fully connected features of each target character output by the first layer to obtain the fully connected features corresponding to each target character output by the second layer, ..., and so on, to obtain the fully connected features corresponding to each target character output by the last layer of fully connected layer. Among them, for each layer of fully connected layers, when the next layer of fully connected layers performs the full connection processing on the fully connected features of each target character output by the previous layer, it will combine the fully connected features of each target character output by the previous layer. Therefore, the fully connected features corresponding to each target character output by the last fully connected layer have been combined with the character features corresponding to other target characters in the verification text.
[0126] Exemplarily, the character features and fully connected features corresponding to each target character extracted in the feature layer may be N-dimensional feature vectors, where N can be set based on experience and is not specifically limited in the present embodiment. For example, N may be 768-dimensional.
[0127] S103-3: Obtain a first probability indicating that a miscorrection problem exists and a second probability indicating that a miscorrection problem does not exist based on the fully connected features corresponding to the classified character; the classified character is the first target character in the verification text.
[0128] Here, the first probability is used to indicate the probability that the verification text has a miscorrection problem, that is, the false alarm probability. The second probability is used to indicate the probability that the verification text does not have a miscorrection problem, that is, the non-false alarm probability.
[0129] The reason why the fully connected features corresponding to the classified characters are directly used for probability prediction here is that the classified characters are located at the starting position of the verification text. The fully connected features corresponding to the characters output by the last fully connected layer have integrated the character features, contextual information, semantics and other information of other characters in the verification text, which can well characterize whether there is an error correction problem in the entire verification text.
[0130] In specific implementation, the prediction layer in the error correction and detection model can be used to convert the fully connected features corresponding to the classified characters using a preset fully connected matrix to obtain a conversion result, and then the conversion result is normalized to obtain a first probability and a second probability. The sum of the first probability and the second probability is 1.
[0131] S103-4: Determine a detection result according to the first probability, the second probability and a preset probability threshold.
[0132] Here, the preset probability threshold can be set based on experience, and the present application embodiment does not specifically limit it. For example, the preset probability can be 0.8, 0.9, etc.
[0133] During specific implementation, it can be determined whether there is a target probability greater than a preset probability threshold value in the first probability and the second probability. If not, the detection result is determined to be "no", that is, it is determined that there is no problem of miscorrection. If so, the detection result indicated by the target probability can be used as the final detection result. For example, in the case where the first probability is a target probability greater than the preset probability threshold value, the detection result can be determined to be "yes", that is, it is determined that there is a problem of miscorrection; conversely, in the case where the second probability is a target probability greater than the preset probability threshold value, the detection result can be determined to be "no", that is, it is determined that there is a problem of no miscorrection.
[0134] like Figure 3 , which is a network structure and prediction diagram of an error correction detection model provided by an embodiment of the present application. Figure 3 In the example, the verification text is “[CLS] This is a good question [SEP] This is a very proud question”, and the feature layer is the BERT layer. Figure 3Only the fully connected features corresponding to each target character output by the last fully connected layer in the BERT layer are shown. Figure 3 Each rectangle containing a circle in represents the fully connected feature corresponding to a target character ( Figure 3 Only some of the target characters are shown in the figure. A circle in a rectangle represents a 1-dimensional vector. Each rectangle should include N circles, which represent an N-dimensional vector ( Figure 3 Only part of the circle is shown). Figure 3 The fully connected feature on the far left is the fully connected feature corresponding to the classified character. Then, the prediction layer in the error correction detection model can use the fully connected features corresponding to the classified character to determine the false alarm probability and the non-false alarm probability. Figure 3 The false positive probability is 0.9 and the non-false positive probability is 0.1. Figure 3 The false alarm probability and non-false alarm probability in can determine that the detection result is "yes".
[0135] In one embodiment, the present application also provides a method for training an error correction detection model. Specifically, the error correction detection model can be trained according to the following steps:
[0136] Step 1: Obtain sample text and use the trained text correction model to perform text correction on the sample text to obtain the predicted correction text corresponding to the sample text.
[0137] Here, the sample text may include text with erroneous characters and text without erroneous characters. The predicted error correction text is the error correction text output by the trained text error correction model for the sample text.
[0138] Exemplarily, after the text error correction model is trained, a sample text may be obtained, and the sample text may be input into the trained text error correction model to obtain a predicted error correction text corresponding to the sample text.
[0139] Step 2: Concatenate the predicted error correction text and the sample text into a sample verification text, and use the error correction detection model to be trained to verify the sample verification text to obtain the predicted detection result.
[0140] Here, the predicted detection result can be "yes" or "no".
[0141] In specific implementation, the predicted error correction text and the sample text can be spliced using classification characters and separation characters to obtain the sample verification text. Then, the sample verification text is input into the error correction detection model to be trained to obtain the predicted detection result corresponding to the sample verification text.
[0142] Step three: determine the prediction loss of the error correction detection model based on the prediction detection results and the sample labels corresponding to the predicted error correction text, and use the prediction loss to iteratively train the error correction detection model until the preset cutoff condition is met to obtain a trained error correction detection model; the sample label is used to indicate whether the predicted error correction text has a miscorrection problem.
[0143] Here, the sample label may be a manually annotated label, and the sample label may specifically be "yes" or "no", which may be used to indicate whether the predicted error correction text has a miscorrection problem.
[0144] As shown in the following Table 1, it is a schematic table of a sample text, a predicted error correction text and a sample label provided in an embodiment of the present application:
[0145]
[0146] Table 1
[0147] The prediction loss is used to characterize the gap between the predicted detection result and the sample label. The preset cutoff condition can be that the number of iterative training rounds reaches a preset number of rounds, and / or the prediction accuracy of the error correction detection model obtained by training reaches a preset accuracy.
[0148] In specific implementation, the prediction loss can be constructed using the predicted detection results corresponding to the sample verification text and the sample labels corresponding to the predicted error correction text in the sample verification text. The prediction loss is then used to iteratively train the error correction detection model to be trained until the preset cutoff condition is met to obtain a trained error correction detection model.
[0149] Here, by using the predicted error correction text output by the trained text error correction model to construct training samples, and training the error correction detection model to be trained, the text error correction model and the error correction detection model can be deployed into a two-stage adversarial error correction system, and the trained error correction detection model can well learn the error correction characteristics of the text error correction model when performing text error correction, thereby improving the accuracy of false alarm prediction for the text error correction model. In addition, the error correction detection model is a network for the text error correction model, so using less predicted detection text can obtain an error correction detection model that is compatible with the error correction detection model, which not only reduces the difficulty of collecting training samples, but also improves the efficiency of model training.
[0150] To facilitate understanding of the text error correction provided in the embodiments of the present application, Figure 4 As shown, a specific implementation flow chart of a text error correction method provided in an embodiment of the present application may include the following steps:
[0151] S401: Obtain the text to be detected.
[0152] S402: Perform text error correction processing using a text error correction model to obtain an error-corrected text.
[0153] S403: Determine whether the error correction text is consistent with the text to be detected.
[0154] If yes, execute the following S408; if no, execute the following S404.
[0155] S404: Perform text splicing using the text to be detected and the error correction text to obtain a verification text.
[0156] S405: Perform verification processing using the error correction detection model to obtain a detection result.
[0157] S406: Determine whether there is a miscorrection problem based on the detection result.
[0158] If not, execute the following S407; if so, execute the following S408.
[0159] S407: Determine that the text error correction result includes the error correction text.
[0160] S408: Determine whether the text error correction result includes the text to be detected.
[0161] Regarding the specific implementation steps of the above S401 to S408, reference may be made to the above embodiments and will not be repeated here.
[0162] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0163] Based on the same inventive concept, a text correction device corresponding to the text correction method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned text correction method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0164] like Figure 5 FIG. 1 is a schematic diagram of a text error correction device provided by an embodiment of the present disclosure, comprising:
[0165] The error correction module 501 is used to perform text error correction processing on the text to be detected using a text error correction model to obtain an error correction text corresponding to the text to be detected;
[0166] A splicing module 502 is used to perform text splicing using the text to be detected and the error correction text to obtain a verification text when the error correction text is different from the text to be detected;
[0167] A detection module 503 is used to perform verification processing on the verification text using an error correction detection model to obtain a detection result; the detection result is used to indicate whether the error correction text has a miscorrection problem;
[0168] The determination module 504 is used to determine the text error correction result of the text to be detected according to the detection result.
[0169] In a possible implementation, the determination module 504, when determining the text error correction result of the to-be-detected text according to the detection result, is configured to:
[0170] In the case where the detection result indicates that there is a miscorrection problem, determining that the text correction result includes the text to be detected;
[0171] In a case where the detection result indicates that there is no miscorrection problem, it is determined that the text correction result includes the corrected text.
[0172] In a possible implementation manner, the text to be detected includes a plurality of characters before correction;
[0173] The splicing module 502, when splicing the text to be detected and the error correction text to obtain the verification text, is used to:
[0174] In the case where there are at least two target corrected characters in the error correction text that are inconsistent with the corresponding pre-corrected characters, multiple target error correction texts are generated using the target corrected characters and the text to be detected; wherein each of the target error correction texts includes only one target corrected character, and the target corrected characters in different target error correction texts are different;
[0175] Performing text splicing on each of the target error correction texts and the text to be detected to obtain verification texts corresponding to each of the target error correction texts;
[0176] The detection module 503, when the error correction detection model is used to perform verification processing on the verification text to obtain a detection result, is used to:
[0177] The error correction detection model is used to perform verification processing on the verification texts corresponding to each target error correction text, so as to obtain the detection result corresponding to each target error correction text.
[0178] In a possible implementation, the determination module 504, when determining the text error correction result of the to-be-detected text according to the detection result, is configured to:
[0179] Determine, based on the detection results corresponding to each of the target error correction texts, target corrected characters that do not have a miscorrection problem;
[0180] The text error correction result is determined by using the target corrected characters without the miscorrection problem and the text to be detected.
[0181] In a possible implementation manner, the determining module 504 is further configured to:
[0182] In the case that the error correction text is the same as the text to be detected, the text to be detected is used as the text error correction result.
[0183] In a possible implementation manner, the detection module 503, when the error correction detection model is used to perform verification processing on the verification text to obtain a detection result, is used to:
[0184] Utilizing the feature extraction layer of the error correction detection model, extracting character features corresponding to each target character in the verification text;
[0185] Using multiple fully connected layers, the character features corresponding to each of the target characters are subjected to multiple continuous fully connected processes to obtain the fully connected features corresponding to each of the target characters;
[0186] According to the fully connected features corresponding to the classified characters, a first probability indicating that there is a miscorrection problem and a second probability indicating that there is no miscorrection problem are obtained; the classified characters are the first target characters in the verification text;
[0187] The detection result is determined according to the first probability, the second probability and a preset probability threshold.
[0188] In a possible implementation, the splicing module 502, when performing text splicing using the to-be-detected text and the error-correcting text to obtain the verification text, is used to:
[0189] Adding a separator character between the text to be detected and the error correction text to obtain a concatenated text;
[0190] Adding classification characters at the starting position of the concatenated text to obtain verification text.
[0191] In a possible implementation, the device further includes:
[0192] The training module 505 is used to train the error correction detection model according to the following steps:
[0193] Acquire a sample text, and use a trained text correction model to perform text correction processing on the sample text to obtain a predicted correction text corresponding to the sample text;
[0194] The predicted error correction text and the sample text are spliced into a sample verification text, and the sample verification text is verified using the error correction detection model to be trained to obtain a predicted detection result;
[0195] According to the predicted detection result and the sample label corresponding to the predicted error correction text, the prediction loss of the error correction detection model is determined, and the error correction detection model is iteratively trained using the prediction loss until a preset cutoff condition is met to obtain a trained error correction detection model; the sample label is used to indicate whether the predicted error correction text has a miscorrection problem.
[0196] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0197] Based on the same technical concept, the embodiment of the present application also provides a computer device. Figure 6 FIG. 1 is a schematic diagram of a computer device provided in an embodiment of the present application, including:
[0198] Processor 601, memory 602 and bus 603. The memory 602 stores machine-readable instructions executable by the processor 601, and the processor 601 is used to execute the machine-readable instructions stored in the memory 602. When the machine-readable instructions are executed by the processor 601, the processor 601 performs the following steps: S101: using a text error correction model to perform text error correction processing on the text to be detected, and obtain an error correction text corresponding to the text to be detected; S102: when the error correction text is different from the text to be detected, the text to be detected and the error correction text are used to perform text splicing to obtain a verification text; S103: using an error correction detection model to perform verification processing on the verification text to obtain a detection result; the detection result is used to indicate whether the error correction text has a miscorrection problem; and S104: according to the detection result, determine the text error correction result of the text to be detected.
[0199] The above-mentioned memory 602 includes a memory 6021 and an external memory 6022; the memory 6021 here is also called an internal memory, which is used to temporarily store the calculation data in the processor 601, as well as the data exchanged with the external memory 6022 such as a hard disk. The processor 601 exchanges data with the external memory 6022 through the memory 6021. When the computer device is running, the processor 601 communicates with the memory 602 through the bus 603, so that the processor 601 executes the execution instructions mentioned in the above method embodiment.
[0200] The present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the text error correction method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0201] The computer program product of the text error correction method provided in the embodiments of the present disclosure includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the steps of the text error correction method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.
[0202] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK).
[0203] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, 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 communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0204] 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.
[0205] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0206] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0207] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
[0208] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A text error correction method, characterized in that: include: Perform text error correction processing on the text to be detected using a text error correction model to obtain an error correction text corresponding to the text to be detected; In the case where the error correction text is different from the text to be detected, the text to be detected and the error correction text are used to perform text splicing to obtain a verification text; The verification text is verified using an error correction detection model to obtain a detection result; the detection result is used to indicate whether the error correction text has a miscorrection problem; Determining a text error correction result of the text to be detected according to the detection result; The step of performing text splicing using the text to be detected and the error correction text to obtain a verification text includes: Adding a separator character between the text to be detected and the error correction text to obtain a concatenated text; Adding classification characters at the starting position of the concatenated text to obtain a verification text; The verification text is verified by using the error correction detection model to obtain a detection result, including: Utilizing the feature extraction layer of the error correction detection model, extracting character features corresponding to each target character in the verification text; Using multiple fully connected layers, the character features corresponding to each of the target characters are subjected to multiple continuous fully connected processes to obtain the fully connected features corresponding to each of the target characters; According to the fully connected features corresponding to the classified characters, a first probability indicating that there is a miscorrection problem and a second probability indicating that there is no miscorrection problem are obtained; the classified characters are the first target characters in the verification text; The detection result is determined according to the first probability, the second probability and a preset probability threshold.
2. The method according to claim 1, characterized in that Determining the text error correction result of the text to be detected according to the detection result includes: In the case where the detection result indicates that there is a miscorrection problem, determining that the text correction result includes the text to be detected; In a case where the detection result indicates that there is no miscorrection problem, it is determined that the text correction result includes the corrected text.
3. The method according to claim 1, characterized in that The text to be detected includes a plurality of characters before correction; The step of performing text splicing using the text to be detected and the error correction text to obtain a verification text includes: In the case where there are at least two target corrected characters in the error correction text that are inconsistent with the corresponding pre-corrected characters, multiple target error correction texts are generated using the target corrected characters and the text to be detected; wherein each of the target error correction texts includes only one target corrected character, and the target corrected characters in different target error correction texts are different; Performing text splicing on each of the target error correction texts and the text to be detected to obtain verification texts corresponding to each of the target error correction texts; The verification text is verified by using the error correction detection model to obtain a detection result, including: The error correction detection model is used to perform verification processing on the verification texts corresponding to each target error correction text, so as to obtain the detection result corresponding to each target error correction text.
4. The method according to claim 3, characterized in that Determining the text error correction result of the text to be detected according to the detection result includes: Determine, based on the detection results corresponding to each of the target error correction texts, target corrected characters that do not have a miscorrection problem; The text error correction result is determined by using the target corrected characters without the miscorrection problem and the text to be detected.
5. The method according to claim 1, characterized in that The method further comprises: In the case that the error correction text is the same as the text to be detected, the text to be detected is used as the text error correction result.
6. The method according to claim 1, characterized in that The method further comprises the step of training the error correction detection model: Acquire a sample text, and use a trained text correction model to perform text correction processing on the sample text to obtain a predicted correction text corresponding to the sample text; The predicted error correction text and the sample text are spliced into a sample verification text, and the sample verification text is verified using the error correction detection model to be trained to obtain a predicted detection result; According to the predicted detection result and the sample label corresponding to the predicted error correction text, the prediction loss of the error correction detection model is determined, and the error correction detection model is iteratively trained using the prediction loss until a preset cutoff condition is met to obtain a trained error correction detection model; the sample label is used to indicate whether the predicted error correction text has a miscorrection problem.
7. A text error correction device, characterized in that: include: An error correction module is used to perform text error correction processing on the text to be detected using a text error correction model to obtain an error correction text corresponding to the text to be detected; A splicing module, used for, when the error correction text is different from the text to be detected, performing text splicing using the text to be detected and the error correction text to obtain a verification text; A detection module, used to perform verification processing on the verification text using an error correction detection model to obtain a detection result; the detection result is used to indicate whether the error correction text has a miscorrection problem; A determination module, used to determine the text error correction result of the text to be detected according to the detection result; The splicing module, when performing text splicing using the to-be-detected text and the error-correcting text to obtain a verification text, is used to: Adding a separator character between the text to be detected and the error correction text to obtain a concatenated text; Adding classification characters at the starting position of the concatenated text to obtain a verification text; The detection module, when the verification text is verified by using the error correction detection model to obtain a detection result, is used to: Utilizing the feature extraction layer of the error correction detection model, extracting character features corresponding to each target character in the verification text; Using multiple fully connected layers, the character features corresponding to each of the target characters are subjected to multiple continuous fully connected processes to obtain the fully connected features corresponding to each of the target characters; According to the fully connected features corresponding to the classified characters, a first probability indicating that there is a miscorrection problem and a second probability indicating that there is no miscorrection problem are obtained; the classified characters are the first target characters in the verification text; The detection result is determined according to the first probability, the second probability and a preset probability threshold.
8. A computer device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the processor executes the steps of the text correction method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program. When the computer program is executed by a computer device, the computer device executes the steps of the text error correction method according to any one of claims 1 to 6.
