Text correction method and device based on post-processing discriminator, equipment and medium

Through the text correction method based on post-processing discriminator, combined with sentence-level and character-level error checkers and confidence similarity decoder, the problem of low text correction accuracy is solved and a more efficient text correction effect is achieved.

CN119623459BActive Publication Date: 2025-10-10PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411662108.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-10-10
Estimated Expiration
2044-11-20

AI Technical Summary

Technical Problem

Existing automatic speech recognition technology has problems of speech feature confusion and over-correction during the text correction process, resulting in low accuracy of text correction.

Method used

A text error correction method based on post-processing discriminator is adopted. The sentence-level and character-level error checkers are combined with confidence similarity decoder, and the fusion strategy is used to fuse the inspection results to identify and correct text errors.

Benefits of technology

The accuracy of text error correction is improved, miscorrection is avoided, and computer processing efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119623459B_ABST
    Figure CN119623459B_ABST
Patent Text Reader

Abstract

The present application relates to artificial intelligence technology, disclose a kind of text correction method, device, equipment and medium based on post-processing discriminator, wherein the method comprises: obtaining text to be analyzed, sentence division is carried out to text to be analyzed, and original text sentence is obtained;Original text sentence is checked using sentence level error checker and confidence similarity decoder in Chinese spelling correction model, and first checking result is obtained;Original text sentence is checked using character level error checker and confidence similarity decoder, and second checking result is obtained;Result fusion is carried out to first checking result and second checking result using fusion strategy, and target result is obtained;Original text sentence is corrected according to target result, and corrected text sentence is obtained;Multiple corrected text sentences are integrated, and corrected text is obtained.The present application is suitable for medical health field, and the accuracy of medical and other related text correction can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a text error correction method, device, equipment and medium based on a post-processing discriminator. Background Art

[0002] Automatic speech recognition (ASR) and text correction technology play a crucial role in current insurance and healthcare scenarios. Specifically, when customers input medical information via voice, ASR text correction technology automatically identifies and corrects incorrect words or phrases in that information, enabling smoother input and improving both customer experience and work efficiency. Furthermore, CSC models based on pre-trained language models (PLMs) also demonstrate powerful error correction capabilities, but this also leads to the problem of incorrectly correcting correct characters in many medical and other texts. This overcorrection problem is particularly severe in real-world applications.

[0003] Since errors introduced by automatic speech recognition (ASR) often affect the execution of downstream tasks such as voice search and voice translation, it is necessary to reduce the errors caused by automatic speech recognition. Specifically, existing automatic speech recognition technology has the following two defects and shortcomings: the first is the problem of confusion of speech features. Since there is no space separator between Chinese characters, it leads to confusion between multiple words with similar pronunciation but different semantics; the second is the problem of overcorrection. Since the error rate of sentences is generally low, many correct characters are incorrectly corrected during the sentence correction process, resulting in overcorrection of sentences. In summary, the existing technology has the problem of low accuracy of text error correction. Summary of the Invention

[0004] The present invention provides a text error correction method, device, equipment and medium based on a post-processing discriminator, the main purpose of which is to solve the problem of low accuracy of text error correction.

[0005] To achieve the above-mentioned object, the present invention provides a text error correction method based on a post-processing discriminator, comprising:

[0006] Obtaining a text to be analyzed, dividing the text to be analyzed into sentences, and obtaining original text sentences;

[0007] Performing sentence error checking on the original text sentence using a sentence-level error checker and a confidence similarity decoder in a pre-built Chinese spelling correction model to obtain a first checking result, wherein the Chinese spelling correction model includes a sentence-level error checker, a character-level error checker, a fusion strategy, and a confidence similarity decoder;

[0008] Performing a character error check on the original text sentence using the character-level error checker and the confidence similarity decoder to obtain a second check result;

[0009] fusing the first inspection result and the second inspection result using the fusion strategy to obtain a target result;

[0010] The original text sentence is corrected according to the target result to obtain a corrected text sentence, and a plurality of the corrected text sentences are integrated to obtain a corrected text.

[0011] Optionally, dividing the text to be analyzed into sentences to obtain original text sentences includes:

[0012] Extracting text symbols from the text to be analyzed, and matching the text symbols with a preset symbol library to obtain target symbols;

[0013] The text to be analyzed is segmented according to the target symbol to obtain original text sentences.

[0014] Optionally, the sentence error check is performed on the original text sentence using a sentence-level error checker and a confidence similarity decoder in a pre-built Chinese spelling correction model to obtain a first check result, including:

[0015] Performing an initial error check on the original text sentence using the sentence-level error checker to obtain an initial check result;

[0016] When the initial check result shows that the original text sentence has no spelling errors, decoding the original text sentence according to the confidence similarity decoder to obtain a sentence sequence and sentence confidence;

[0017] Calculating the speech similarity of the sentence sequence, and assigning weights to the sentence confidence and the speech similarity to obtain a first weight and a second weight;

[0018] Calculating character similarity corresponding to the sentence sequence according to the sentence confidence, the speech similarity, the first weight, and the second weight, and reordering the sentence sequence using the character similarity to obtain an updated sentence sequence;

[0019] Correcting the original text sentence according to the updated sentence sequence to obtain a corrected sentence, and performing error checking on the corrected sentence using the sentence-level error checker to obtain a corrected checking result;

[0020] The initial inspection result and the revised inspection result are integrated to obtain a first inspection result.

[0021] Optionally, the character error checking on the original text sentence by using the character-level error checker and the confidence similarity decoder obtains a second checking result, comprising:

[0022] performing initial character error checking on the original text sentence by using the character-level error checker to obtain an initial character checking result;

[0023] when the initial checking result is that the characters of the original text sentence have no spelling errors, performing character feature extraction on the original text sentence by using the character-level error checker to obtain text character features;

[0024] performing character decoding on the text character features by using the confidence similarity decoder to obtain a character sequence and a character confidence;

[0025] calculating a character similarity of the character sequence and setting a first weight ratio and a second weight ratio corresponding to the character similarity and the character confidence;

[0026] calculating a feature similarity corresponding to the text character features according to the character similarity, the character confidence, the first weight ratio, and the second weight ratio;

[0027] performing sequence updating on the character sequence based on the feature similarity to obtain an updated character sequence, and performing sentence updating on the original text sentence according to the updated character sequence to obtain an updated sentence;

[0028] checking character spelling errors of the updated sentence by using the character-level error checker to obtain an updated checking result, and aggregating the initial character checking result and the updated checking result to obtain a second checking result.

[0029] Optionally, the result fusion on the first checking result and the second checking result by using the fusion strategy obtains a target result, comprising:

[0030] judging whether the initial checking result and the corrected checking result in the first checking result have spelling errors based on the fusion strategy;

[0031] when the initial checking result has no spelling errors but the corrected checking result has spelling errors, determining that the target result is overcorrection;

[0032] when the initial checking result has no spelling errors and the corrected checking result has no spelling errors, judging whether the initial character checking result and the updated checking result in the second checking result have character spelling errors;

[0033] When the initial character check result does not have a character spelling error but the updated character check result does have a character spelling error, determining that the target result is over-corrected;

[0034] When the initial character check result does not have any character spelling errors and the updated character check result does not have any spelling errors, determining that the target result is over-corrected;

[0035] When there are spelling errors in the initial check result in the first check result or there are no spelling errors in the initial check result in the first check result and there are no spelling errors in the revised check result but there are character spelling errors in the initial character check result in the second check result, the target result is determined to be correctly modified.

[0036] Optionally, the correcting the original text sentence according to the target result to obtain a corrected text sentence includes:

[0037] When the target result is over-correction, it indicates that the original text sentence does not need to be corrected, and the original text sentence is used as the corrected text sentence;

[0038] When the target result is a correct modification, performing an initial modification on the original text sentence according to the revised inspection result in the first inspection result to obtain an initial corrected sentence;

[0039] The initial corrected sentence is modified a second time according to the updated check result in the second check result to obtain a corrected text sentence.

[0040] Optionally, the step of integrating the plurality of corrected text sentences to obtain a corrected text includes:

[0041] Extracting a text sequence of original text sentences corresponding to a plurality of the corrected text sentences in the text to be analyzed;

[0042] A plurality of the corrected text sentences are spliced ​​together according to the text sequence to obtain a corrected text.

[0043] In order to solve the above problems, the present invention also provides a text error correction device based on a post-processing discriminator, the device comprising:

[0044] A sentence segmentation module is used to obtain a text to be analyzed, and to segment the text to be analyzed into sentences to obtain original text sentences;

[0045] The sentence error checking module is configured to perform sentence error checking on the original text sentence by using a sentence-level error checker and a confidence similarity decoder in a pre-built Chinese spelling correction model, to obtain a first checking result, wherein the Chinese spelling correction model comprises a sentence-level error checker, a character-level error checker, a fusion strategy, and a confidence similarity decoder.

[0046] The character error checking module is configured to perform character error checking on the original text sentence by using the character-level error checker and the confidence similarity decoder, to obtain a second checking result.

[0047] The result fusion module is configured to perform result fusion on the first checking result and the second checking result by using the fusion strategy, to obtain a target result.

[0048] The sentence integration module is configured to correct the original text sentence according to the target result, to obtain a corrected text sentence, and to integrate a plurality of corrected text sentences, to obtain a corrected text.

[0049] To solve the above problems, the present application further provides an electronic device, which comprises:

[0050] at least one processor; and

[0051] a memory connected in communication with the at least one processor; wherein

[0052] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the above-mentioned text correction method based on a post-processing discriminator.

[0053] To solve the above problems, the present application further provides a computer readable storage medium, which stores at least one computer program, and the at least one computer program is executed by a processor in an electronic device to implement the above-mentioned text correction method based on a post-processing discriminator.

[0054] The embodiment of the present invention can accurately obtain the original text sentences by dividing the text to be analyzed into sentences; the original text sentences can be accurately obtained by using the sentence-level error checker and the confidence similarity decoder in the Chinese spelling correction model to check the sentence errors; the original text sentences can be accurately obtained by using the character-level error checker and the confidence similarity decoder to check the character errors; the second check result can be accurately obtained; the sentence-level error checker and the character-level error checker can combine coarse-grained and fine-grained features to better identify over-correction situations, thereby improving the accuracy of Chinese spelling correction and avoiding miscorrection; the first check result and the second check result can be accurately obtained by fusing the results through a fusion strategy, thereby improving computer processing efficiency; the original text sentences can be corrected by using the target result to accurately obtain the corrected text sentences, thereby accurately obtaining the corrected text. Therefore, the text error correction method, device, equipment and medium based on the post-processing discriminator proposed by the present invention can solve the problem of low accuracy of text error correction. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 A flowchart of a text error correction method based on a post-processing discriminator provided by one embodiment of the present invention;

[0056] Figure 2 A schematic diagram of a process for dividing a text to be analyzed into sentences to obtain original text sentences, provided by an embodiment of the present invention;

[0057] Figure 3 A schematic diagram of a process for correcting an original text sentence according to a target result to obtain a corrected text sentence provided by an embodiment of the present invention;

[0058] Figure 4 A functional module diagram of a text error correction device based on a post-processing discriminator provided by one embodiment of the present invention;

[0059] Figure 5 A schematic structural diagram of an electronic device for implementing the text error correction method based on a post-processing identifier provided in one embodiment of the present invention.

[0060] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

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

[0062] The embodiment of the present application provides a text error correction method based on a post-processing discriminator. The execution subject of the text error correction method based on the post-processing discriminator includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the text error correction method based on the post-processing discriminator 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 (CDNs), and big data and artificial intelligence platforms.

[0063] Reference Figure 1 FIG. 1 is a flow chart of a text error correction method based on a post-processing discriminator according to an embodiment of the present invention. In this embodiment, the text error correction method based on a post-processing discriminator includes:

[0064] S1. Obtain a text to be analyzed, divide the text to be analyzed into sentences, and obtain original text sentences.

[0065] In an embodiment of the present invention, the text to be analyzed includes news report text, notice text, subject classification text, product review text, medical data text, etc.

[0066] See also Figure 2 In the embodiment of the present invention, dividing the text to be analyzed into sentences to obtain original text sentences includes:

[0067] S21, extracting text symbols from the text to be analyzed, matching the text symbols with a preset symbol library to obtain target symbols;

[0068] S22. Segment the text to be analyzed according to the target symbol to obtain original text sentences.

[0069] In an embodiment of the present invention, the text symbols include periods, question marks, brackets, and exclamation marks, etc.; the symbol library contains a variety of symbols representing sentence separations, such as periods, exclamation marks, etc.; the text symbols are compared one by one with the various symbols representing sentence separations in the symbol library, and the symbols that are consistently matched in the text symbols are used as target symbols; the target symbols are used to segment the text to be analyzed to obtain multiple original text sentences.

[0070] In the embodiment of the present invention, the text to be analyzed is divided into sentences, so that the original text sentences can be accurately obtained and the efficiency of subsequent text analysis can be improved.

[0071] S2. Use the sentence-level error checker and confidence similarity decoder in the pre-built Chinese spelling correction model to check the original text sentence for sentence errors to obtain a first check result, wherein the Chinese spelling correction model includes a sentence-level error checker, a character-level error checker, a fusion strategy and a confidence similarity decoder.

[0072] In an embodiment of the present invention, the Chinese spelling correction model consists of an original CSC model and a post-processing model, including at least one sentence-level error checker, at least one character-level error checker, at least one fusion strategy, and at least one confidence similarity decoder.

[0073] Furthermore, the sentence-level error checker (SEC) refers to a binary classification model that can check whether there are spelling errors in a sentence; the character-level error checker (CEC) refers to a binary classifier that can detect whether there are spelling errors for each character in a sentence; the fusion strategy can fuse the results of SEC and CEC and determine whether there are any over-corrections in the sentence; the confidence similarity decoder (CSD) refers to a sentence decoder that can use context confidence and character phonetic similarity to improve the decoding effect of the Chinese spelling correction model.

[0074] In an embodiment of the present invention, the Chinese spelling correction model further includes, before use, performing loss calculation on the Chinese spelling correction model using a cross entropy loss function to obtain a correction loss value, and updating the Chinese spelling correction model according to the correction loss value to obtain an updated Chinese spelling correction model. Furthermore, a training sample (X, Y) is set, where X represents the sentence sequence of the original text sentence and Y represents the corrected sentence sequence, and the correction loss value is calculated using the following formula:

[0075] γ i =-logp(Y i |X i )

[0076] Among them, γi represents the correction loss value corresponding to the i-th sentence sequence, X i represents the i-th sentence sequence, Y i represents the i-th corrected sentence sequence, and p represents the preset output distribution.

[0077] In the embodiment of the present invention, the sentence error checker and the confidence similarity decoder in the pre-built Chinese spelling correction model are used to check the original text sentence for sentence errors, and the first check result is obtained, including:

[0078] Performing an initial error check on the original text sentence using the sentence-level error checker to obtain an initial check result;

[0079] When the initial check result shows that the original text sentence has no spelling errors, decoding the original text sentence according to the confidence similarity decoder to obtain a sentence sequence and sentence confidence;

[0080] Calculating the speech similarity of the sentence sequence, and assigning weights to the sentence confidence and the speech similarity to obtain a first weight and a second weight;

[0081] Calculating character similarity corresponding to the sentence sequence according to the sentence confidence, the speech similarity, the first weight, and the second weight, and reordering the sentence sequence using the character similarity to obtain an updated sentence sequence;

[0082] Correcting the original text sentence according to the updated sentence sequence to obtain a corrected sentence, and performing error checking on the corrected sentence using the sentence-level error checker to obtain a corrected checking result;

[0083] The initial inspection result and the revised inspection result are integrated to obtain a first inspection result.

[0084] In an embodiment of the present invention, the initial inspection result includes whether the original text sentence has no spelling errors and whether the original text sentence has spelling errors. When the original text sentence has no spelling errors, it is necessary to determine whether the corrected sentence is over-corrected when correcting the original text sentence. The phonetic similarity of the sentence sequence can be calculated by calculating the edit distance of the sentence sequence, that is, using the Levenshtein Distance algorithm to calculate the minimum number of editing operations between two adjacent character strings in the sentence sequence, wherein a smaller edit distance indicates a greater similarity.

[0085] Furthermore, the AHP hierarchical method and the priority diagram method, that is, the subjective assignment method, can be used to assign weights to the sentence confidence and the speech similarity. Specifically, the sentence confidence can be assigned to 0.4 and the speech similarity can be assigned to 0.6 to calculate the character similarity corresponding to the sentence sequence.

[0086] In the embodiment of the present invention, the character similarity corresponding to the sentence sequence is calculated using the following formula:

[0087] η=a×A+b×B

[0088] Among them, η represents the character similarity corresponding to the sentence sequence, a represents the first weight, A represents the sentence confidence, b represents the second weight, and B represents the sentence similarity.

[0089] In an embodiment of the present invention, the sentence sequence is reordered using the character similarity to obtain an updated sentence sequence, which refers to setting a character threshold, wherein the character threshold refers to a pre-set standard similarity, and judging whether the character similarity is less than the character threshold. When the character similarity is less than the character threshold, it indicates that the sentence sequence does not need to be reordered, and the sentence sequence is used as an updated sentence sequence; when the character similarity is greater than or equal to the character threshold, it indicates that the sentence sequence needs to be reordered, and the sentence sequence is sorted according to the size of the character similarity to obtain an updated sentence sequence; the original text sentences are reordered according to the order of the updated sentence sequence to obtain corrected sentences.

[0090] In an embodiment of the present invention, the sentence-level error checker performs an error check on the revised sentence to obtain a revised check result, which includes two results: one is that the revised sentence has no spelling errors, and the other is that the revised sentence has spelling errors; the initial check result and the revised check result are summarized to obtain a first check result; further, when the revised sentence is a correct sentence, the revised sentence can be marked as 0; when the revised sentence is an incorrect sentence, the revised sentence can be marked as 1, which can avoid subsequent repeated processing and improve computer operation efficiency.

[0091] In the embodiment of the present invention, sentence error checking is performed on the original text sentences according to the sentence-level error checker and the confidence similarity decoder, and the first checking result can be accurately obtained, thereby accelerating the computer processing efficiency.

[0092] S3. Perform a character error check on the original text sentence using the character-level error checker and the confidence similarity decoder to obtain a second check result.

[0093] In the embodiment of the present invention, the character-level error checker and the confidence similarity decoder are used to perform character error checking on the original text sentence to obtain a second check result, including:

[0094] Performing an initial character error check on the original text sentence using the character-level error checker to obtain an initial character error check result;

[0095] When the initial check result shows that there are no spelling errors in the characters of the original text sentence, extracting character features from the original text sentence using the character-level error checker to obtain text character features;

[0096] Decoding the text character features using the confidence similarity decoder to obtain a character sequence and character confidence;

[0097] Calculating the character similarity of the character sequence, and setting a first weight ratio and a second weight ratio corresponding to the character similarity and the character confidence;

[0098] Calculating feature similarity corresponding to the text character feature according to the character similarity, the character confidence, the first weight ratio, and the second weight ratio;

[0099] performing sequence updating on the character sequence based on the feature similarity to obtain an updated character sequence, and performing sentence updating on the original text sentence according to the updated character sequence to obtain an updated sentence;

[0100] The updated sentence is checked for spelling errors using the character-level error checker to obtain an updated check result, and the initial character check result and the updated check result are aggregated to obtain a second check result.

[0101] In an embodiment of the present invention, the initial character check result includes two results: there are no spelling errors in the characters of the original text sentence and there are spelling errors in the characters of the original text sentence; when there are no spelling errors in the characters of the original text sentence, character features are extracted from the original text sentence according to the feature extractor included in the character-level error checker to obtain text character features; calculating the character similarity of the character sequence is consistent with the step of calculating the voice similarity of the sentence sequence in S2 above; the entropy method can be used to set the first weight ratio and the second weight ratio, wherein the first weight ratio is lower than the value assigned to the sentence confidence above, and the second weight ratio is higher than the value assigned to the voice similarity above. For example, the first weight ratio can be set to 0.2 and the second weight ratio can be set to 0.8.

[0102] In an embodiment of the present invention, calculating the feature similarity corresponding to the text character feature is consistent with the step of calculating the character similarity corresponding to the sentence sequence in the above S2, and will not be elaborated on here; updating the character sequence based on the feature similarity to obtain an updated character sequence means setting a feature similarity threshold and judging whether the feature similarity is less than the feature similarity threshold. When the feature similarity is less than the feature similarity threshold, it indicates that the character sequence does not need to be updated, and the character sequence is used as an updated character sequence; when the feature similarity is greater than or equal to the feature similarity threshold, it indicates that the character sequence needs to be updated, and the character sequence is reordered according to the size of the feature similarity to obtain an updated character sequence; the updated character sequence replaces the character sequence corresponding to the original text sentence to obtain an updated sentence.

[0103] In an embodiment of the present invention, the update check result includes the problem that the characters of the updated sentence have no spelling errors and the problem that the characters of the updated sentence have spelling errors, wherein if the updated sentence has no spelling errors, the updated sentence is marked as 0; if the updated sentence has spelling errors, the updated sentence is marked as 1; the second check result includes the problem that the original text sentence has spelling errors, the original text sentence has no spelling errors but the updated sentence has spelling errors, and the original text sentence has no spelling errors and the updated sentence has no spelling errors.

[0104] In an embodiment of the present invention, the original text sentence is checked for character errors through a character-level error checker and a confidence similarity decoder, and the second check result can be accurately obtained; by combining the sentence-level and character-level aspects, that is, combining coarse-grained and fine-grained features at two different levels to determine whether the original text sentence needs to be corrected, over-correction can be avoided, thereby improving the efficiency of text correction.

[0105] S4. Use the fusion strategy to fuse the first inspection result and the second inspection result to obtain a target result.

[0106] In the embodiment of the present invention, the step of fusing the first inspection result and the second inspection result using the fusion strategy to obtain a target result includes:

[0107] determining whether the initial inspection result and the revised inspection result in the first inspection result have spelling errors based on the fusion strategy;

[0108] When the initial check result does not have spelling errors but the revised check result does have spelling errors, determining that the target result is over-corrected;

[0109] When there is no spelling error in the initial check result and no spelling error in the revised check result, determining whether there are spelling errors in the initial character check result and the updated check result in the second check result;

[0110] When the initial character check result does not have a character spelling error but the updated character check result does have a character spelling error, determining that the target result is over-corrected;

[0111] When the initial character check result does not have any character spelling errors and the updated character check result does not have any spelling errors, determining that the target result is over-corrected;

[0112] When there are spelling errors in the initial check result in the first check result or there are no spelling errors in the initial check result in the first check result and there are no spelling errors in the revised check result but there are character spelling errors in the initial character check result in the second check result, the target result is determined to be correctly modified.

[0113] In an embodiment of the present invention, the situations predicted by the fusion strategy can be divided into four situations: First, if SEC correctly predicts the original text sentence M, but SEC incorrectly predicts the revised sentence N, this situation is considered to be over-correction; second, when both the original text sentence M and the revised sentence N are correctly predicted by SEC, further analysis of the CEC results, when the characters of the original text sentence are predicted to be correct, and the characters of the modified updated sentence are predicted to be incorrect, this situation is also considered to be over-correction; third, when all results are predicted to be correct, it means that the sentence can be expressed in multiple ways. In this case, it is best not to modify the original text sentence, otherwise it indicates over-correction; fourth, in other cases, it indicates correct modification.

[0114] In the embodiment of the present invention, the fusion strategy is expressed as:

[0115]

[0116] Among them, output represents the target result, y s1 represents the initial inspection result in the first inspection result, y s2 represents the revised inspection result in the first inspection result, y c1 Indicates the initial character check result in the second check result, y c2 Indicates the updated check result in the second check result, 1 indicates an error, and 0 indicates a correct result.

[0117] In the embodiment of the present invention, the first inspection result and the second inspection result are fused using a fusion strategy, so that the target result can be accurately obtained, thereby avoiding excessive correction of the original text sentence and improving the accuracy of text error correction.

[0118] S5. Correct the original text sentence according to the target result to obtain a corrected text sentence, and integrate multiple corrected text sentences to obtain a corrected text.

[0119] See also Figure 3 As shown, in the embodiment of the present invention, the correcting the original text sentence according to the target result to obtain the corrected text sentence includes:

[0120] S31, determining whether the target result is an overcorrection or a correct modification;

[0121] When the target result is over-correction, executing S32, indicating that the original text sentence does not need to be corrected, and the original text sentence is used as the corrected text sentence;

[0122] When the target result is a correct modification, executing S33, performing an initial modification on the original text sentence according to the revised inspection result in the first inspection result to obtain an initial corrected sentence;

[0123] S34. Modify the initial corrected sentence a second time according to the updated check result in the second check result to obtain a corrected text sentence.

[0124] In an embodiment of the present invention, when the target result is over-correction, it means that there is no problem with the original text sentence and no correction is required; when the target result is correct modification, it means that there is a spelling error in the original text sentence. At this time, the original text sentence needs to be doubly modified according to the modification content of S2 and S3 above to obtain a corrected text sentence.

[0125] In the embodiment of the present invention, the step of integrating the plurality of corrected text sentences to obtain the corrected text includes:

[0126] Extracting a text sequence of original text sentences corresponding to a plurality of the corrected text sentences in the text to be analyzed;

[0127] A plurality of the corrected text sentences are spliced ​​together according to the text sequence to obtain a corrected text.

[0128] In an embodiment of the present invention, the original text sentences may be sorted according to the segmentation order of the original text sentences to obtain a text sequence; and the corrected text sentences corresponding to the original text sentences may be connected according to the order of the text sequence to obtain a corrected text.

[0129] In the embodiment of the present invention, correcting the original text sentence according to the target result can improve the accuracy of the corrected text sentence; integrating multiple corrected text sentences can accurately obtain the corrected text.

[0130] The embodiment of the present invention can accurately obtain the original text sentences by dividing the text to be analyzed into sentences; the original text sentences can be accurately obtained by using the sentence-level error checker and the confidence similarity decoder in the Chinese spelling correction model to check the sentence errors; the original text sentences can be accurately obtained by using the character-level error checker and the confidence similarity decoder to check the character errors; the second check result can be accurately obtained; the sentence-level error checker and the character-level error checker can combine coarse-grained and fine-grained features to better identify over-correction situations, thereby improving the accuracy of Chinese spelling correction and avoiding miscorrection; the first check result and the second check result can be accurately obtained by fusing the results through a fusion strategy, thereby improving computer processing efficiency; the original text sentences can be corrected by using the target result to accurately obtain the corrected text sentences, thereby accurately obtaining the corrected text. Therefore, the text error correction method based on the post-processing discriminator proposed by the present invention can solve the problem of low accuracy of text error correction.

[0131] like Figure 4 , which is a functional module diagram of a text error correction device based on a post-processing identifier provided by an embodiment of the present invention.

[0132] The text error correction device 400 based on a post-processing identifier described in the present invention can be installed in an electronic device. Depending on the functionality implemented, the text error correction device 400 based on a post-processing identifier can include a sentence segmentation module 401, a sentence error checking module 402, a character error checking module 403, a result fusion module 404, and a sentence integration module 405. A module, also referred to as a unit, is a series of computer program segments that can be executed by an electronic device processor and perform a fixed function, and is stored in the electronic device's memory.

[0133] In this embodiment, the functions of each module / unit are as follows:

[0134] The sentence segmentation module 401 is used to obtain a text to be analyzed, and perform sentence segmentation on the text to be analyzed to obtain original text sentences;

[0135] The sentence error checking module 402 is configured to perform sentence error checking on the original text sentence using a sentence-level error checker and a confidence similarity decoder in a pre-built Chinese spelling correction model to obtain a first checking result, wherein the Chinese spelling correction model includes a sentence-level error checker, a character-level error checker, a fusion strategy, and a confidence similarity decoder;

[0136] The character error checking module 403 is configured to perform a character error check on the original text sentence using the character-level error checker and the confidence similarity decoder to obtain a second check result;

[0137] The result fusion module 404 is configured to fuse the first inspection result and the second inspection result using the fusion strategy to obtain a target result;

[0138] The sentence integration module 405 is configured to correct the original text sentences according to the target result to obtain corrected text sentences, and integrate multiple corrected text sentences to obtain corrected text.

[0139] In detail, the modules described in the text correction device 400 based on the post-processing discriminator in the embodiment of the present invention adopt the same technical means as the text correction method based on the post-processing discriminator described in the accompanying drawings when used, and can produce the same technical effects, which will not be repeated here.

[0140] like Figure 5 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing a text error correction method based on a post-processing identifier provided by an embodiment of the present invention.

[0141] The electronic device 500 may include a processor 501 , a memory 502 , a communication bus 503 , and a communication interface 504 . It may also include a computer program stored in the memory 502 and executable on the processor 501 , such as a text error correction program based on a post-processing identifier.

[0142] In some embodiments, the processor 501 may be composed of an integrated circuit, such as a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including a combination of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 501 is the control core (Control Unit) of the electronic device, connecting the various components of the entire electronic device using various interfaces and lines, and executing the programs or modules stored in the memory 502 (such as executing a text error correction program based on a post-processing identifier, etc.), as well as calling the data stored in the memory 502, to perform various functions of the electronic device and process data.

[0143] The memory 502 includes at least one type of readable storage medium, including a flash memory, a mobile hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 502 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 502 may also be an external storage device of the electronic device, such as a plug-in mobile hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. Furthermore, the memory 502 may also include both an internal storage unit of the electronic device and an external storage device. The memory 502 can 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 error correction program based on a post-processing identifier, but can also be used to temporarily store data that has been output or is about to be output.

[0144] The communication bus 503 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable communication between the memory 502 and at least one processor 501.

[0145] The communication interface 504 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)), 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, for displaying information processed in the electronic device and for displaying a visual user interface.

[0146] Figure 5 Only the electronic device with components is shown, and it can be understood by those skilled in the art that Figure 5 The structure shown does not constitute a limitation on the electronic device 500 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0147] For example, although not shown, the electronic device may further include a power source (such as a battery) for powering various components. Preferably, the power source may be logically connected to the at least one processor 501 via a power management device, thereby implementing functions such as charging management, discharging management, and power consumption management via the power management device. The power source may further include any components such as one or more DC or AC power sources, a recharging device, a power failure detection circuit, a power converter or inverter, and a power status indicator. The electronic device may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.

[0148] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0149] The text error correction program based on the post-processing identifier stored in the memory 502 of the electronic device 500 is a combination of multiple instructions. When executed in the processor 501, it can achieve the following:

[0150] Obtaining a text to be analyzed, dividing the text to be analyzed into sentences, and obtaining original text sentences;

[0151] Performing sentence error checking on the original text sentence using a sentence-level error checker and a confidence similarity decoder in a pre-built Chinese spelling correction model to obtain a first checking result, wherein the Chinese spelling correction model includes a sentence-level error checker, a character-level error checker, a fusion strategy, and a confidence similarity decoder;

[0152] Performing a character error check on the original text sentence using the character-level error checker and the confidence similarity decoder to obtain a second check result;

[0153] fusing the first inspection result and the second inspection result using the fusion strategy to obtain a target result;

[0154] The original text sentence is corrected according to the target result to obtain a corrected text sentence, and a plurality of the corrected text sentences are integrated to obtain a corrected text.

[0155] Specifically, the specific implementation method of the processor 501 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the drawings, which will not be repeated here.

[0156] Furthermore, if the modules / units integrated into the electronic device 500 are implemented as software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. The computer-readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).

[0157] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor of an electronic device, the computer program can implement:

[0158] Obtaining a text to be analyzed, dividing the text to be analyzed into sentences, and obtaining original text sentences;

[0159] Performing sentence error checking on the original text sentence using a sentence-level error checker and a confidence similarity decoder in a pre-built Chinese spelling correction model to obtain a first checking result, wherein the Chinese spelling correction model includes a sentence-level error checker, a character-level error checker, a fusion strategy, and a confidence similarity decoder;

[0160] Performing a character error check on the original text sentence using the character-level error checker and the confidence similarity decoder to obtain a second check result;

[0161] Fusing the first inspection result and the second inspection result by using the fusion strategy to obtain a target result;

[0162] Correcting the original text sentence according to the target result to obtain a corrected text sentence, and integrating a plurality of the corrected text sentences to obtain a corrected text.

[0163] In several embodiments provided in the present application, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and the division of the modules is merely a logical function division, and there can be another division manner in actual implementation.

[0164] The modules illustrated as separated components can or can not be physically separated, and the components illustrated as modules can or can not be physical units, that is, can be located in one place, or can be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purposes of the embodiments.

[0165] In addition, each function module in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware, or in the form of hardware plus software function modules.

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

[0167] Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting, and the scope of the present application is defined by the appended claims rather than the above description, and therefore all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present application. Any reference signs in the claims should not be regarded as limiting the claims involved.

[0168] The embodiments of the present application can acquire and process related data based on artificial intelligence technology. Among them, artificial intelligence (Artificial Intelligence, AI) is to use digital computers or digital computer controlled machines to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0169] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. Terms such as "first" and "second" are used to indicate names and do not imply any particular order.

[0170] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A text error correction method based on a post-processing discriminator, characterized in that: The method comprises: Obtaining a text to be analyzed, dividing the text to be analyzed into sentences, and obtaining original text sentences; Obtaining a pre-built Chinese spelling correction model, wherein the Chinese spelling correction model includes a sentence-level error checker, a character-level error checker, a fusion strategy, and a confidence similarity decoder; Performing an initial error check on the original text sentence using the sentence-level error checker; when the initial check result indicates that the original text sentence has no spelling errors, decoding the original text sentence using the confidence similarity decoder to obtain a sentence sequence and a sentence confidence; calculating the speech similarity of the sentence sequence; and weighting the sentence confidence and the speech similarity to obtain a first weight and a second weight; Calculating the character similarity corresponding to the sentence sequence according to the sentence confidence, the speech similarity, the first weight, and the second weight, and reordering the sentence sequence according to the character similarity to obtain an updated sentence sequence; Correcting the original text sentence according to the updated sentence sequence to obtain a corrected sentence, performing error checking on the corrected sentence using the sentence-level error checker to obtain a corrected check result, and integrating the initial check result and the corrected check result to obtain a first check result; Performing an initial character error check on the original text sentence using the character-level error checker, and when the initial character check result indicates that there are no spelling errors in the characters of the original text sentence, extracting text character features from the original text sentence, performing character decoding on the text character features using the confidence similarity decoder to obtain a character sequence and character confidence, calculating character similarity of the character sequence, and setting a first weight ratio and a second weight ratio corresponding to the character similarity and the character confidence; Calculating feature similarity corresponding to the text character feature based on the character similarity, the character confidence, the first weight ratio, and the second weight ratio, performing a sequence update on the character sequence based on the feature similarity to obtain an updated character sequence, performing a sentence update on the original text sentence based on the updated character sequence to obtain an updated sentence, checking the updated sentence for spelling errors using the character-level error checker to obtain an updated check result, and summarizing the initial character check result and the updated check result to obtain a second check result; fusing the first inspection result and the second inspection result using the fusion strategy to obtain a target result; The original text sentence is corrected according to the target result to obtain a corrected text sentence, and a plurality of the corrected text sentences are integrated to obtain a corrected text.

2. The text error correction method based on the post-processing discriminator according to claim 1, characterized in that: The step of dividing the text to be analyzed into sentences to obtain original text sentences includes: Extracting text symbols from the text to be analyzed, and matching the text symbols with a preset symbol library to obtain target symbols; The text to be analyzed is segmented according to the target symbol to obtain original text sentences.

3. The text error correction method based on the post-processing discriminator according to claim 1, characterized in that: The using the fusion strategy to fuse the first inspection result and the second inspection result to obtain a target result includes: determining whether the initial inspection result and the revised inspection result in the first inspection result have spelling errors based on the fusion strategy; When the initial check result does not have spelling errors but the revised check result does have spelling errors, determining that the target result is over-corrected; When there is no spelling error in the initial check result and no spelling error in the revised check result, determining whether there are spelling errors in the initial character check result and the updated check result in the second check result; When the initial character check result does not have a character spelling error but the updated character check result does have a character spelling error, determining that the target result is over-corrected; When the initial character check result does not have any character spelling errors and the updated character check result does not have any spelling errors, determining that the target result is over-corrected; When there are spelling errors in the initial check result in the first check result or there are no spelling errors in the initial check result in the first check result and there are no spelling errors in the revised check result but there are character spelling errors in the initial character check result in the second check result, the target result is determined to be correctly modified.

4. The text error correction method based on the post-processing discriminator according to claim 1, characterized in that: Correcting the original text sentence according to the target result to obtain a corrected text sentence includes: When the target result is over-correction, it indicates that the original text sentence does not need to be corrected, and the original text sentence is used as the corrected text sentence; When the target result is a correct modification, performing an initial modification on the original text sentence according to the revised inspection result in the first inspection result to obtain an initial corrected sentence; The initial corrected sentence is modified a second time according to the updated check result in the second check result to obtain a corrected text sentence.

5. The text error correction method based on a post-processing discriminator according to any one of claims 1 to 4, characterized in that: The step of integrating the plurality of corrected text sentences to obtain a corrected text comprises: Extracting a text sequence of original text sentences corresponding to a plurality of the corrected text sentences in the text to be analyzed; A plurality of the corrected text sentences are spliced ​​together according to the text sequence to obtain a corrected text.

6. A text error correction device based on a post-processing discriminator, used to execute the text error correction method based on a post-processing discriminator according to any one of claims 1 to 5, characterized in that: The device comprises: A sentence segmentation module is used to obtain a text to be analyzed, and to segment the text to be analyzed into sentences to obtain original text sentences; a sentence error checking module, configured to perform sentence error checking on the original text sentence using a sentence-level error checker and a confidence similarity decoder in a pre-built Chinese spelling correction model, to obtain a first checking result, wherein the Chinese spelling correction model includes a sentence-level error checker, a character-level error checker, a fusion strategy, and a confidence similarity decoder; a character error checking module, configured to perform a character error check on the original text sentence using the character-level error checker and the confidence similarity decoder to obtain a second check result; A result fusion module, configured to fuse the first inspection result and the second inspection result using the fusion strategy to obtain a target result; The sentence integration module is used to correct the original text sentence according to the target result to obtain a corrected text sentence, and integrate multiple corrected text sentences to obtain a corrected text.

7. 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 executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the text error correction method based on the post-processing identifier according to any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the text error correction method based on the post-processing identifier according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Text error correction method and system

    CN111310443A

  • Text error correction method and device, equipment and storage medium

    CN113657098A