Text correction method, electronic device, and computer-readable storage medium
By using multiple lightweight error correction models for parallel processing and confidence evaluation, combined with a large discriminative model, the problem of high cost and high error rate of existing text error correction methods is solved. This achieves efficient and accurate error correction under resource-constrained conditions and is suitable for high-concurrency scenarios such as news and publishing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING FOUNDER ELECTRONICS CO LTD
- Filing Date
- 2026-01-08
- Publication Date
- 2026-06-02
Smart Images

Figure CN122133646A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing, and more particularly to a text error correction method, an electronic device, and a computer-readable storage medium. Background Technology
[0002] In the era of explosive growth in digital content, the editing, publishing, and news industries are facing unprecedented challenges in both content productivity and quality control. Especially given the rapid pace of content production and the complex and diverse types of errors, manual proofreading is not only costly but also difficult to maintain consistently. For example, articles produced rapidly under high pressure by journalists are often riddled with errors due to homophones, similar-looking characters, inappropriate semantic collocations, and misuse of punctuation. Similarly, the traditional three-stage review and proofreading system in book publishing is also plagued by frequent habitual errors such as the misuse of "de," "di," and "de," as well as errors in professional terminology, due to its time-consuming, labor-intensive, and costly nature, coupled with the visual and mental fatigue that editors are prone to. These errors severely impact the reading experience and can lead to information bias. Therefore, for internet content platforms that pursue high efficiency and high quality, building an efficient and automated text correction system has become an urgent need.
[0003] Currently, text correction methods primarily rely on dictionary-based rule matching. The core of this method lies in building and maintaining a business-specific lexicon, combined with a series of pre-defined correction rules, to quickly match and replace errors. However, this approach faces the following problems: rule-based matching methods heavily depend on manually maintained lexicons and rules, resulting in high correction costs and a relatively high error rate. Summary of the Invention
[0004] This application provides a text correction method, electronic device, and computer-readable storage medium to achieve a balance between correction cost, correction efficiency, and accuracy under resource-constrained conditions, and to meet the real-time correction needs of high-concurrency scenarios such as news and publishing.
[0005] Firstly, this application provides a text correction method, including:
[0006] The target text is processed in parallel using multiple lightweight error correction models to obtain candidate modification suggestions corresponding to each lightweight error correction model.
[0007] Based on confidence assessment, multiple candidate modification suggestions are split into a first split and a second split. In the first split, the confidence of the candidate modification suggestions is less than or equal to the confidence threshold, and in the second split, the confidence of the candidate modification suggestions is greater than the confidence threshold.
[0008] For the candidate modification suggestions in the first split, the candidate modification suggestions are input into the large discrimination model for discrimination, and the discrimination result of whether to adopt the candidate modification suggestions is obtained;
[0009] Based on the candidate modification suggestions indicated by the discrimination results and the candidate modification suggestions in the second stream, text correction is performed on the target text.
[0010] In one possible implementation, before triaging multiple candidate modification suggestions based on confidence assessment, the method further includes:
[0011] For the same error correction type of the target text, determine whether the candidate modification suggestions corresponding to multiple lightweight error correction models are consistent;
[0012] If there is a discrepancy, a splitting process for multiple candidate modification suggestions will be performed;
[0013] If they match, the candidate modification suggestion will be determined as the candidate modification suggestion in the second subdivision.
[0014] In one possible implementation, multiple lightweight error correction models are trained in the following manner:
[0015] Acquire a text corpus of the target domain;
[0016] The text corpus is preprocessed to obtain an initial corpus set. The preprocessing includes cleaning, noise reduction and sentence segmentation.
[0017] Determine the task type for the error correction task;
[0018] For any task type, the initial corpus is processed based on the dataset processing method to generate a training dataset. The training dataset includes multiple error-correction sentence pairs. The dataset processing methods include obfuscation replacement, rule perturbation, and back translation.
[0019] Multiple lightweight error correction models were trained using the training dataset.
[0020] In one possible implementation, a training dataset is used to train multiple lightweight error correction models, including:
[0021] Determine the training strategy for the lightweight error correction model based on the task type;
[0022] Based on the training strategy, multiple lightweight error correction models are trained using the training dataset.
[0023] In one possible implementation, the large discriminative model is trained in the following manner:
[0024] Acquire false alarm data from multiple lightweight error correction models;
[0025] Correcting errors in the training dataset – correcting sentence pairs to obtain correctly modified data;
[0026] In the error-correction sentence pair, the erroneous sentence and the correctly corrected data are identified as negative examples.
[0027] Obtain the error correction results from user feedback and use the error correction results as incremental training data;
[0028] A training set is generated based on false positive data, negative example data, and incremental training data.
[0029] A large discrimination model is trained based on the training set.
[0030] In one possible implementation, a large discriminative model is trained based on a training set, including:
[0031] Based on the discrimination type of the discrimination task, target training data is determined from the training set;
[0032] Based on the target training data, the large language model is fine-tuned to obtain the discriminative large model.
[0033] In one possible implementation, it also includes:
[0034] Based on a preset cycle, obtain the error correction results from user feedback and the newly added content in the text corpus of the target domain;
[0035] Based on the error correction results and the added content, multiple lightweight error correction models and a large discrimination model are retrained.
[0036] In one possible implementation, for the candidate modification suggestions in the first split, the candidate modification suggestions are input into a large-scale discrimination model for discrimination, and a discrimination result is obtained on whether to adopt the candidate modification suggestions, including:
[0037] The candidate suggestions from the first split are input into the large-scale discrimination model. In the large-scale discrimination model, the correlation between the candidate suggestions and the correct modification suggestions is learned to obtain the discrimination result of whether to adopt the candidate modification suggestions.
[0038] Secondly, this application provides a text correction device, comprising:
[0039] The determination module is used to perform parallel error correction processing on the target text using multiple lightweight error correction models, and obtain candidate modification suggestions corresponding to each lightweight error correction model.
[0040] The routing module is used to route multiple candidate modification suggestions based on confidence level assessment to obtain a first route and a second route. In the first route, the confidence level of the candidate modification suggestions is less than or equal to the confidence level threshold, and in the second route, the confidence level of the candidate modification suggestions is greater than the confidence level threshold.
[0041] The determination module is used to input the candidate modification suggestions in the first split into the large discrimination model for discrimination, and obtain the discrimination result of whether to adopt the candidate modification suggestions;
[0042] The error correction module is used to correct text errors in the target text based on the candidate modification suggestions indicated by the judgment result and the candidate modification suggestions in the second stream.
[0043] In one possible implementation, the text correction device further includes a processing module, which is used to:
[0044] For the same error correction type of the target text, determine whether the candidate modification suggestions corresponding to multiple lightweight error correction models are consistent;
[0045] If there is a discrepancy, a splitting process for multiple candidate modification suggestions will be performed;
[0046] If they match, the candidate modification suggestion will be determined as the candidate modification suggestion in the second subdivision.
[0047] In one possible implementation, multiple lightweight error correction models are trained in the following manner:
[0048] Acquire a text corpus of the target domain;
[0049] The text corpus is preprocessed to obtain an initial corpus set. The preprocessing includes cleaning, noise reduction and sentence segmentation.
[0050] Determine the task type for the error correction task;
[0051] For any task type, the initial corpus is processed based on the dataset processing method to generate a training dataset. The training dataset includes multiple error-correction sentence pairs. The dataset processing methods include obfuscation replacement, rule perturbation, and back translation.
[0052] Multiple lightweight error correction models were trained using the training dataset.
[0053] In one possible implementation, the processing module is used for:
[0054] Determine the training strategy for the lightweight error correction model based on the task type;
[0055] Based on the training strategy, multiple lightweight error correction models are trained using the training dataset.
[0056] In one possible implementation, the large discriminative model is trained in the following manner:
[0057] Acquire false alarm data from multiple lightweight error correction models;
[0058] Correcting errors in the training dataset – correcting sentence pairs to obtain correctly modified data;
[0059] In the error-correction sentence pair, the erroneous sentence and the correctly corrected data are identified as negative examples.
[0060] Obtain the error correction results from user feedback and use the error correction results as incremental training data;
[0061] A training set is generated based on false positive data, negative example data, and incremental training data.
[0062] A large discrimination model is trained based on the training set.
[0063] In one possible implementation, the processing module is used for:
[0064] Based on the discrimination type of the discrimination task, target training data is determined from the training set;
[0065] Based on the target training data, the large language model is fine-tuned to obtain the discriminative large model.
[0066] In one possible implementation, the processing module is further configured to:
[0067] Based on a preset cycle, obtain the error correction results from user feedback and the newly added content in the text corpus of the target domain;
[0068] Based on the error correction results and the added content, multiple lightweight error correction models and a large discrimination model are retrained.
[0069] In one possible implementation, the determining module is used for:
[0070] The candidate suggestions from the first split are input into the large-scale discrimination model. In the large-scale discrimination model, the correlation between the candidate suggestions and the correct modification suggestions is learned to obtain the discrimination result of whether to adopt the candidate modification suggestions.
[0071] Thirdly, this application provides an electronic device, including: a memory and a processor;
[0072] The memory stores the instructions that the computer executes;
[0073] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0074] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed, are used to implement the first aspect and / or various possible embodiments of the first aspect.
[0075] Fifthly, this application provides a computer program product, including a computer program that, when executed, implements the first aspect and / or various possible implementations of the first aspect.
[0076] This application provides a text correction method, electronic device, and computer-readable storage medium, relating to the field of natural language processing. The method includes: performing parallel error correction processing on a target text using multiple lightweight error correction models to obtain candidate modification suggestions corresponding to each lightweight error correction model; splitting the multiple candidate modification suggestions based on confidence level assessment to obtain a first split and a second split, wherein the confidence level of the candidate modification suggestions in the first split is less than or equal to a confidence threshold, and the confidence level of the candidate modification suggestions in the second split is greater than the confidence threshold; inputting the candidate modification suggestions in the first split into a large-scale discrimination model for discrimination to obtain a discrimination result indicating whether to adopt the candidate modification suggestions; and performing text correction on the target text based on the discrimination result indicating the adopted candidate modification suggestions and the candidate modification suggestions in the second split. This application leverages the parallel processing capabilities of multiple lightweight error correction models to achieve rapid initial error correction of target text, ensuring high recall and low latency. Simultaneously, it distributes multiple candidate modification suggestions based on their confidence levels, assigning those with confidence levels less than or equal to a confidence threshold to a larger discriminative model for further processing. This significantly reduces the frequency and resource consumption of the larger discriminative model, ensuring the accuracy of suggestions with confidence levels less than or equal to the threshold and avoiding user interference caused by misjudgments from the lightweight error correction models. Finally, based on the selected candidate modification suggestions indicated by the discriminative results, and those with confidence levels greater than the threshold, text correction is performed on the target text. This achieves a balance between error correction cost, efficiency, and accuracy under resource-constrained conditions, meeting the real-time error correction needs of high-concurrency scenarios such as news and publishing. Attached Figure Description
[0077] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0078] Figure 1 Flowchart of the text correction method provided in the embodiments of this application Figure 1 ;
[0079] Figure 2 Flowchart of the text correction method provided in the embodiments of this application Figure 2 ;
[0080] Figure 3 This is a schematic diagram of the structure of the text correction device provided in the embodiments of this application;
[0081] Figure 4This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0082] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0083] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0084] First, let me explain the terms used in this application:
[0085] Large Language Model (LLM) is a deep learning-based artificial intelligence model that learns the statistical patterns, grammatical structures, factual knowledge, and certain logical reasoning abilities of language by being trained on massive amounts of text data, thereby enabling it to understand, generate, and process human language.
[0086] False alarm: The system's incorrect correction judgment for text that was originally correct.
[0087] Missed report: The system failed to identify and correct an existing error.
[0088] Recall rate: The proportion of errors that can be correctly identified and corrected by the system out of all real errors.
[0089] Confusion set: A collection of homophones, similar-looking words or characters that are commonly confused in the target language, used to generate pseudo-error samples.
[0090] Confidence level: The probability value corresponding to the final modified character selected by the model.
[0091] In the context of the rapid development of digital content, fields such as news editing, book publishing, and Internet content production are facing the dual challenges of content quality control and efficiency improvement. Take the news industry as an example. Journalists need to complete manuscript writing and publishing within a very short time. Due to the high-pressure working environment and fast pace, problems such as homophone errors, shape-similar character errors, semantic collocation errors, and punctuation misuse are likely to occur. For example, in breaking news reports, journalists may, due to time constraints, mistakenly write "的" as "地", or confuse the usage of "制定" and "制订". If such errors are not corrected in time, it may lead to information transmission deviation and even trigger public opinion risks. In addition, the book publishing field has long relied on the manual three-round review and three-round proofreading system. However, manual proofreading has problems such as high cost, long cycle, and easy fatigue. The omission rate of editors for common habitual errors (such as the mixed use of "的", "地", and "得") or professional term errors is relatively high.
[0092] In Internet content platforms, the explosive growth of user-generated content has further exacerbated the diversity and complexity of text errors. Traditional proofreading methods are difficult to meet the error correction requirements of high concurrency and low latency. The application of existing text error correction technologies in industrial scenarios still has significant limitations: Although rule-based proofreading methods have a fast reasoning speed, their coverage ability for long-tail words, new terms, and complex grammar errors is insufficient; Although deep learning models (such as small-parameter models like BERT) can achieve a wider error coverage, their ability to understand long-distance dependencies and complex context semantics is limited, and false positives and false negatives are likely to occur; While large language models have powerful semantic understanding capabilities, their high resource consumption and low reasoning efficiency are difficult to meet the real-time requirements of the production environment.
[0093] Therefore, there is an urgent need for an industrial-grade text error correction system that can balance error correction efficiency and accuracy under resource constraints to meet the rigid requirements of high concurrency, low latency, and high error correction accuracy in content production scenarios.
[0094] In response to the above content, this application provides a text error correction method. Multiple lightweight error correction models are used to perform parallel error correction processing on the target text respectively, and candidate modification suggestions corresponding to each lightweight error correction model are obtained; Based on confidence evaluation, multiple candidate modification suggestions are split into two streams, a first stream and a second stream; For the candidate modification suggestions in the first stream, the candidate modification suggestions are input into a discriminative large model for discrimination, and a discrimination result on whether to adopt the candidate modification suggestions is obtained; Based on the candidate modification suggestions indicated to be adopted by the discrimination result, and the candidate modification suggestions in the second stream, text error correction is performed on the target text.
[0095] This application is applicable to high-concurrency and low-latency text error correction scenarios such as news editing, book publishing, and Internet content platforms.
[0096] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0097] The text correction method provided in this application can be implemented by a computing device such as a server or server cluster. The server can be a mobile phone, computer, tablet, or other similar device. This application does not impose any particular restrictions on the implementation method of the implementing entity.
[0098] Figure 1 Flowchart of the text correction method provided in the embodiments of this application Figure 1 ,like Figure 1 As shown, the method includes:
[0099] S101. Parallel error correction processing is performed on the target text using multiple lightweight error correction models to obtain candidate modification suggestions corresponding to each lightweight error correction model.
[0100] Among them, several lightweight error correction models refer to text error correction models with fewer parameters and faster inference speed, such as error correction models based on BERT or Transformer architecture.
[0101] In this step, it can be understood that multiple lightweight error correction models are first used to perform parallel error correction processing on the target text. Each lightweight error correction model will independently generate candidate error correction suggestions corresponding to the target text. Among them, the candidate modification suggestions include error location, error type, original word, and modification suggestion.
[0102] S102. Based on confidence assessment, multiple candidate modification suggestions are split into a first split and a second split, wherein the confidence of the candidate modification suggestions in the first split is less than or equal to the confidence threshold, and the confidence of the candidate modification suggestions in the second split is greater than the confidence threshold.
[0103] After obtaining the candidate modification suggestions corresponding to each lightweight error correction model, the multiple candidate modification suggestions are split into two streams. Specifically, the multiple candidate modification suggestions determined in S101 are evaluated for confidence to obtain the confidence level of each candidate modification suggestion. Based on the comparison between the confidence level and the confidence threshold, the multiple candidate modification suggestions are split into two streams: candidate modification suggestions with a confidence level less than or equal to the confidence threshold are assigned to the first stream, and candidate modification suggestions with a confidence level greater than the confidence threshold are assigned to the second stream.
[0104] Furthermore, the aforementioned confidence thresholds can be dynamically adjusted based on the type of error correction. For example, different confidence thresholds can be assigned based on the type of error correction: a first confidence threshold for spelling correction, a second confidence threshold for grammar correction, and a third confidence threshold for semantic correction; the first confidence threshold could be 0.6, the second confidence threshold could be 0.7, and the third confidence threshold could be 0.8. Assigning confidence thresholds based on error correction type ensures that the processing strategies for different types of error correction are differentiated.
[0105] S103. For the candidate modification suggestions in the first split, input the candidate modification suggestions into the large discrimination model for discrimination, and obtain the discrimination result of whether to adopt the candidate modification suggestions.
[0106] The candidate modification suggestions in the first split are further judged by inputting them into the large discrimination model to determine whether to adopt them.
[0107] For example, for candidate modification suggestions in the first split, the candidate modification suggestions are input into a large-scale discrimination model for discrimination to obtain a discrimination result on whether to adopt the candidate modification suggestions. This includes: inputting candidate suggestions in the first split into a large-scale discrimination model, in which the large-scale discrimination model learns the correlation between historical candidate suggestions and correct modification suggestions, and based on the correlation, discriminates the candidate modification suggestions to obtain a discrimination result on whether to adopt the candidate modification suggestions.
[0108] In this example, the association between the historical candidate suggestions learned in advance by the large model and the correct modification suggestions is determined. Then, based on the association learned in advance, semantic consistency analysis is performed on the candidate modification suggestions, and the collocation and contextual coherence of the sentences before and after the modification in the candidate modification suggestions are judged, so as to obtain the judgment result of whether to adopt the candidate modification suggestions.
[0109] Semantic consistency analysis involves comparing the original and modified sentences in candidate modification suggestions using a large discriminant model to determine whether the modification conforms to the contextual logic. For example, determining whether changing "adopting new regulations" to "establishing new regulations" conforms to the semantic logic of the context. Collocational rationality refers to whether the modified words collocate with the context in accordance with language habits. For example, determining whether "a doctor diagnoses a patient's diagnosis" conforms to the collocation rules of medical terminology.
[0110] Optionally, semantic consistency analysis can be achieved by calculating the semantic similarity between candidate modification suggestions and correct modification suggestions.
[0111] The above examples further enhance the ability of the discriminative large model to distinguish complex ambiguous samples through semantic consistency analysis, collocation rationality, and contextual coherence. The discriminative large model can accurately judge the rationality of modification suggestions by combining contextual logic, thereby significantly reducing the false positive rate while ensuring high accuracy in correcting complex grammatical errors.
[0112] S104. Based on the candidate modification suggestions indicated by the discrimination result and the candidate modification suggestions in the second stream, perform text correction on the target text.
[0113] In this step, the candidate modification suggestions indicated by the discrimination result in S103 and the candidate modification suggestions in the second stream are used as the target modification suggestions, and the target modification suggestions are used to correct text errors in the target text.
[0114] This application's embodiments leverage the parallel processing capabilities of multiple lightweight error correction models to achieve rapid initial error correction of the target text, ensuring high recall and low latency. Simultaneously, multiple candidate modification suggestions are distributed based on their confidence levels. Suggestions with confidence levels less than or equal to a confidence threshold are passed to a larger discriminative model for further discrimination processing, significantly reducing the frequency and resource consumption of the larger discriminative model. This larger discriminative model ensures the accuracy of candidate modification suggestions with confidence levels less than or equal to the threshold, avoiding user interference caused by misjudgments from the lightweight error correction models. Finally, based on the selected candidate modification suggestions indicated by the discrimination results, and candidate modification suggestions with confidence levels greater than the confidence threshold, text correction is performed on the target text. This achieves a balance between error correction efficiency and accuracy under resource-constrained conditions, meeting the real-time error correction needs of high-concurrency scenarios such as news and publishing.
[0115] Based on the above embodiments, before splitting multiple candidate modification suggestions based on confidence assessment, the method further includes: determining whether the candidate modification suggestions corresponding to multiple lightweight error correction models are consistent for the same error correction type of the target text; if they are inconsistent, then performing the splitting step for multiple candidate modification suggestions; if they are consistent, then determining the candidate modification suggestion as the candidate modification suggestion in the second splitting.
[0116] In this embodiment, it can be understood that before splitting multiple candidate suggestions, it is necessary to determine whether the candidate modification suggestions corresponding to the multiple lightweight error correction models are consistent. This determination is based on the premise that the target text has the same error correction type, that is, under the same error correction type, it is determined whether the candidate modification suggestions of the multiple lightweight error correction models for the target text are consistent. If the determination results are inconsistent, the splitting step of multiple candidate modification suggestions needs to be performed, that is, S102 described in the above embodiment is executed; if the determination results are consistent, the candidate modification suggestion is assigned to the second stream. Assigning it to the second stream means that the candidate modification suggestion can be applied to the text correction operation of the target text. Consistent determination results mean that the candidate modification suggestion output by the lightweight error correction model is a correct modification suggestion and can be directly applied to text correction.
[0117] Before splitting multiple candidate suggestions, this embodiment determines whether the candidate modification suggestions corresponding to multiple lightweight error correction models are consistent. Only when the determination results are inconsistent will the candidate modification suggestions be further judged. When the determination results are consistent, the candidate modification suggestions will not be further judged. Through this hybrid collaboration of large and small models, the error correction accuracy can be significantly improved while ensuring low latency.
[0118] Based on the above embodiments, multiple lightweight error correction models are trained in the following manner: acquiring a text corpus of the target domain; preprocessing the text corpus to obtain an initial corpus set, the preprocessing including cleaning, denoising, and sentence segmentation; determining the task type of the error correction task; for any task type, processing the initial corpus set based on dataset processing methods to generate a training dataset, the training dataset including multiple error-correction sentence pairs, the dataset processing methods including obfuscation replacement, rule perturbation, and back-translation; and using the training dataset to train multiple lightweight error correction models.
[0119] In this embodiment, it can be understood that the multiple lightweight error correction models used in the above embodiments require training. Specifically, firstly, a text corpus of the target domain is acquired, followed by preprocessing of the text corpus including cleaning, denoising, and sentence segmentation to obtain an initial corpus set. Then, the task type of the error correction task is determined, and based on the task type and the initial corpus set, a training dataset is generated. The training dataset includes multiple error-correction sentence pairs. It should be noted that the training datasets corresponding to different task types are different. This ensures that the training data received by the multiple lightweight error correction models best matches their expected functions. By using a training set highly relevant to the error correction task, the multiple lightweight error correction models can more effectively learn the key features, patterns, and rules of the task, thereby avoiding wasting learning resources on irrelevant domains. Ultimately, this refined training can significantly improve the accuracy, robustness, and generalization ability of the multiple lightweight error correction models on this task.
[0120] Optionally, the training dataset can be obtained through a small model training data synthesis module. This module includes: first, cleaning, denoising, and segmenting the collected target domain text corpus to obtain a high-quality initial corpus; then, for different error correction tasks (such as spelling, grammar, terminology, etc.), automatically and on a large scale generating error-correction sentence pairs based on a business lexicon and a pre-built confusion set, combined with grammar rule templates and back-translation techniques. Specifically, by purposefully introducing confusion substitutions or rule perturbations into the original sentences of the initial corpus, pseudo-error samples and hard examples are constructed; the training dataset for each error correction task consists of the constructed error-correction negative example sentence pairs (error sentences and their corresponding correct sentences) and error-free positive example sentences in the text corpus. After manual sampling verification and hierarchical annotation of the generated samples, a hierarchical and diverse training dataset is finally obtained. The collection of the target domain text corpus can be achieved through a multi-source data collection module, which includes: collecting massive amounts of raw text data from multiple channels and domains through business cooperation and automated collection technologies to construct a correct corpus. Simultaneously collecting user input, edited drafts, historical error correction records, and user feedback data forms an error sample library, continuously enriching the corpus to ensure coverage of new words, long-tail keywords, and diverse error types. The correct corpus and the error sample library constitute the text corpus.
[0121] Next, using the established training dataset, multiple lightweight error correction models are trained. For example, training multiple lightweight error correction models using the training dataset includes: determining the training strategy for the lightweight error correction models based on the task type; and training multiple lightweight error correction models using the training dataset based on the training strategy.
[0122] In this example, it can be understood that before training multiple lightweight error correction models, a training strategy for each model needs to be determined based on the specific error correction task. Then, using this training strategy and a training dataset, multiple lightweight error correction models are trained. The training strategy differs for different task types, allowing for the tailoring of an optimal learning path for each error correction task. By matching appropriate loss functions, optimizers, and data processing methods, the learning efficiency, accuracy, and robustness of the lightweight error correction model can be significantly improved, ultimately enabling it to achieve optimal results on the specific error correction task.
[0123] Optionally, lightweight error correction models can be implemented through a small error correction model building module. This module includes: training spelling correction models, grammar correction models, and other specialized error correction models on training data split according to the error correction task using multiple lightweight models with hundreds of megabytes of parameters (such as BERT, Transformer, etc.), thus forming a small error correction model library. Each small model differs in its model architecture and training strategy, focusing on specific error types such as spelling errors and grammar errors. Through complementary error recognition capabilities, multiple candidate error correction suggestions are generated to improve recall and minimize false negatives. Each small error correction model learns from a massive number of error-correction sentence pairs, internalizes common correction patterns, and can quickly return correction results on a given input text. The returned results include: error location, error type, original misspelled word, correction suggestion, and corresponding confidence score. The confidence score of each correction suggestion is used as the decision-making basis for subsequent inference predictions, achieving a balance between efficiency and coverage by leveraging a large discriminative model to improve overall accuracy while ensuring high recall. The above method aims to train multiple small error correction models, i.e. multiple lightweight error correction models, to complete the first round of screening of input text with low latency and high recall, covering as many possible error points as possible, and laying the foundation for subsequent fine discrimination processing.
[0124] Furthermore, in some examples, the large discriminative model is trained as follows: False positive data from multiple lightweight error correction models are acquired; error-correction sentence pairs in the training dataset are corrected to obtain correctly modified data; erroneous sentences and correctly modified data in the error-correction sentence pairs are identified as negative examples; error correction results from user feedback are acquired and used as incremental training data; a training set is generated based on the false positive data, negative examples, and incremental training data; and the large discriminative model is trained based on the training set.
[0125] In the above example, the training set of the discrimination large model is realized through the large model training data synthesis module. The training set is specifically composed of the following data: The first category is the false positive output of the lightweight error correction model for the originally error-free positive example sentences in the training data set. Specifically, the error correction results of the lightweight error correction model for error-free sentences and the corresponding original correct sentences are used as the positive example data of the discrimination large model training set to solve the false positive problem caused by the limited ability of the lightweight error correction model; The second category is the correct modification data obtained by methods such as edit distance for the error-correction negative example sentence pairs in the lightweight error correction training data set, that is, the modification position, the original wrong word and the correct word. The correct modification data and the error sentence are used as the negative example data of the discrimination large model training set; In addition, the modification traces of real users are additionally introduced as the samples to be recalled. The modification traces of users include the original error sentence and the sentence after the user's modification, that is, the error correction results of the user feedback are introduced.
[0126] Furthermore, for the data that the lightweight error correction model cannot correct correctly, such as high-frequency ambiguity scenarios (such as de, di, de, zuo, zuo, zhiding, zhiding), complex grammar structures, etc., the discrimination large model is used to label the error-free positive example sentence and the error correction result pair of the lightweight error correction model, and the error sentence and the corrected result pair, and expand them into the discrimination large model training set to improve the diversity and authenticity of the discrimination large model training set, thereby enhancing the discrimination ability and robustness of the discrimination large model for the output of the lightweight error correction model.
[0127] Furthermore, based on the training set, the discrimination large model is trained, including: determining the target training data from the training set according to the discrimination type of the discrimination task; fine-tuning the large language model based on the target training data to obtain the discrimination large model.
[0128] The construction of the discrimination large model can be realized through the discrimination large model construction module. The discrimination large model construction module includes: to improve the overall reasoning efficiency, field constraints are imposed on the output of the discrimination large model, so that the discrimination large model can complete the discrimination task under the premise of outputting a very small number of tokens. The discrimination large model only returns the option of the correct word corresponding to the modification position (only outputs one character), that is, the option corresponding to the original word or the word modified by the lightweight error correction model. Then, the discrimination data format is defined according to the discrimination type of the discrimination task, that is, according to the discrimination type of the discrimination task, the target training data is determined from the training set, and based on the training set with a specific data format, fine-tuning is performed on the large model (such as Qwen) to train a discrimination large model with stronger semantic understanding and discrimination ability.
[0129] To meet the requirements of engineering deployment, the trained discriminative large model was quantized and its inference accelerated to improve inference speed and save deployment resources. The discriminative large model is mainly used to judge the semantic consistency, collocation rationality, and contextual coherence of low-confidence or difficult examples routed from the lightweight error correction model, thereby deciding whether to adopt the candidate modification suggestions output by the lightweight error correction model. If adopted, the candidate modification suggestions from the lightweight error correction model are returned; otherwise, the result is directly filtered, thus significantly improving the final error correction accuracy while ensuring recall.
[0130] Based on the above embodiments, the text correction method provided in this application further includes: obtaining the correction results fed back by the user and the newly added content in the text corpus of the target domain based on a preset period; and retraining multiple lightweight correction models and a large discrimination model based on the correction results and the newly added content.
[0131] In this embodiment, it can be understood that the lightweight error correction model and the large discrimination model used in the above embodiments need to be dynamically updated, and the dynamic update can be achieved through the model dynamic update module.
[0132] The model dynamic update module includes: periodically collecting the filtering results of the online discrimination model, obtaining the correction results for missed reports through the discrimination model's annotation, and adding them to the discrimination model's fine-tuning training set after confirmation. User-reported false positives and false negatives, along with recently collected domain data, construct a new error correction training set to avoid false positives from new words and expressions. This triggers incremental fine-tuning or periodic retraining of the lightweight error correction model and the discrimination model, ensuring the overall accuracy and recall rate.
[0133] Next, examples will be given to illustrate how to use the text correction method provided in the embodiments of this application. Figure 2 Flowchart of the text correction method provided in the embodiments of this application Figure 2 .like Figure 2 As shown, the implementation steps of this method are as follows:
[0134] 1. Through a multi-source data collection module, large-scale corpora are continuously collected from partner news organizations, publishing platforms, and public corpora to build and dynamically update the text corpus. Simultaneously, operations personnel initialize the business lexicon, including high-frequency correct / incorrect word pairs within the domain.
[0135] 2. Based on the collected text corpus, the small model training data synthesis module automatically and on a large scale constructs hierarchical and diverse error-correction sentence pairs for error correction tasks such as spelling and grammar by using confusion sets, grammar rule templates and back-translation or discrimination large model-assisted generation strategies. These pairs are then combined with error-free positive sentences in the corpus to form the training dataset, i.e., the small model error correction training set.
[0136] 3. By triggering the error correction mini-model building module, multiple lightweight error correction models (such as spelling error correction models, grammar error correction models and other specialized models) are trained on the training datasets of each task, and versioned and stored in the mini-model library for online inference.
[0137] 4. The large model training data synthesis module automatically constructs the training set for the large discrimination model (i.e., the large model discrimination training set) based on the modification results of the error correction small model on the training dataset. The training set of the large discrimination model mainly includes: the false positive results of the small model on the training dataset for sentences that were originally without errors; the correct modification results obtained by methods such as edit distance for error-correction negative example sentence pairs in the training dataset; and modification results from real user modification traces and typical ambiguities and complex structures obtained by the annotation of the large discrimination model, so as to improve the diversity and authenticity of the discrimination set.
[0138] 5. After triggering the discriminative large model construction module, the data format is defined based on the discriminative task. The training set of the discriminative large model is used to fine-tune it to obtain a discriminative large model with stronger semantic understanding and discriminative ability. The discriminative large model is then quantitatively optimized to improve inference efficiency and save deployment resources while ensuring discriminative ability.
[0139] 6. For user-inputted text to be corrected, the inference and prediction module immediately starts: First, it loads multiple lightweight error correction models from the error correction mini-model library to perform parallel and rapid inference on the input text, generating several candidate modification suggestions. These suggestions include the error location, error type, original word, suggested modification, and confidence level, achieving high recall quickly. Based on rules and the confidence levels of the candidate modification suggestions from each lightweight error correction model, a comprehensive evaluation and routing process is performed. High-quality candidate modification suggestions with consistent results or confidence levels above the confidence threshold are directly adopted and output, forming a rapid response path. For inconsistent or low-confidence difficult examples, the original text and candidate suggestions are routed to the discriminative large model. The discriminative large model performs semantic consistency, collocation rationality, and contextual coherence judgments, ultimately determining whether to adopt or filter the candidate modification suggestion output by the lightweight error correction model, thereby improving overall accuracy while reducing calls to the discriminative large model. All models are loaded upon initial startup; if the aforementioned models already exist during subsequent inferences, the loading operation is not repeated.
[0140] 7. When text correction is in progress, the model dynamic update module continuously collects online feedback and new data, and periodically triggers the small model training data synthesis module and the error correction small model construction module to automatically build training datasets and incrementally train or periodically retrain the error correction small model library; periodically triggers the large model training data synthesis module and the discrimination large model construction module to automatically build training sets and incrementally train or periodically retrain the discrimination large model, realizing closed-loop iteration of data, models and rules, and ensuring that performance continues to self-evolve and optimize over time.
[0141] Furthermore, the aforementioned inference and prediction module includes: loading spelling correction models, grammar correction models, and other specialized correction models from the error correction small model library, and loading the large discriminative model. First, multiple lightweight error correction models perform rapid, parallel preliminary analysis and correction on the same input text, initially generating several candidate correction suggestions to achieve high recall. Each candidate result includes the error location, error type, original word, suggested correction, and corresponding confidence level. A comprehensive evaluation and routing is performed based on rules and the confidence levels of the candidate correction suggestions from each lightweight error correction model: when the correction suggestions from multiple lightweight error correction models are consistent, the correction suggestion is adopted. This path handles most simple cases and ensures low system latency. When they are inconsistent, a voting strategy is used to select a correction suggestion from the candidate suggestions. The high-confidence correction suggestion selected through testing and evaluation is directly adopted using the confidence threshold obtained from the test evaluation. Suggestions with lower confidence levels are routed to the large discriminative model. After being trained on large-scale data, the lightweight error correction model demonstrates good recognition capabilities for specific error patterns. Results with high confidence are considered correct corrections made by the lightweight model, while those with low confidence are ambiguous and prone to false positives. Therefore, these results are further processed by the discriminative model. The discriminative model receives the results from the lightweight error correction model, including the original text, the correction location, the original word, and the model's suggested corrections. It evaluates the semantic consistency, collocation rationality, and contextual coherence of the sentence before and after the correction. If the discriminative model outputs an option with the corrected word, the suggestion from the lightweight error correction model is returned and retained. If it outputs an option with the original word, the lightweight error correction model is considered to have made an error, and this result is filtered out. This module achieves fast and high recall through parallel inference using the lightweight error correction model, and then the small number of highly ambiguous results are accurately judged by the discriminative model. This reduces the online inference burden on the large model and significantly improves the overall error correction accuracy.
[0142] The following technical benefits can be achieved through the embodiments of this application:
[0143] (1) Significantly improve error correction accuracy while ensuring low latency: Most high-confidence samples are directly processed by a lightweight error correction model to ensure response speed; ambiguous samples are discriminated by minimizing the output of a large model, thereby reducing false alarm rate and false negative rate.
[0144] (2) Significantly reduce the frequency of large model calls and resource consumption: By using confidence routing, batch discrimination and quantization strategies, high-cost discrimination is limited to necessary samples, thereby improving resource utilization and peak load.
[0145] (3) Support for continuous learning and maintainability: The dynamic update loop can incorporate user feedback and new words into the training and vocabulary in a timely manner, maintaining the ability to adapt to the evolution of domain language.
[0146] In summary, it can be understood that the method provided in this application forms a complete text correction method and corresponding system based on hybrid collaboration of large and small models and dynamic data enhancement. It makes full use of business and user data to construct high-quality training data. On this data, multiple lightweight error correction models are trained to achieve preliminary error correction with high recall. Based on the comprehensive confidence assessment, the processing results are intelligently sorted, and simple error correction and complex and difficult error correction are respectively handled by the fast channel (simultaneous and rapid processing by lightweight error correction models) and the discrimination large model channel. This realizes an optimized strategy that enables the large model to efficiently and accurately complete the error correction result discrimination even in resource-constrained environments.
[0147] The text correction method and system ultimately achieved the optimal balance between accuracy, recall, response speed, and deployment cost under limited data and computing resources.
[0148] Furthermore, it can be understood that the text correction system adopts a hierarchical processing strategy, regularly collecting feedback data from domain users to improve the utilization rate of user data and continuously enhance the model's ability to understand new domain terms and expressions. Based on the pre-trained language model, a lightweight error correction model is trained using industry data. The large model is then fine-tuned using the modification results of the lightweight error correction model, enabling the large model to have a good ability to discriminate the error correction results of the lightweight error correction model. The lightweight error correction model is responsible for rapid initial error correction, while the large model is responsible for refined discrimination of ambiguous results. Based on the training task, data, and pre-training capabilities, the system can quickly determine whether the modifications of the lightweight error correction model are reasonable with a small number of labels generated, thereby improving the overall accuracy.
[0149] By dynamically allocating errors based on probability thresholds, most simple errors are efficiently handled and corrected by a lightweight error correction model, while complex errors are accurately verified by a large-scale discriminative model. Simultaneously, the results of the large-scale discriminative model are continuously collected and labeled to form new training data, continuously improving its discriminative ability. Furthermore, a quantization scheme is provided for the large-scale discriminative model, effectively reducing cost and space requirements. Overall, this achieves efficient and accurate error correction while maintaining controllable resources and data.
[0150] Furthermore, the embodiments of this application are applicable to high-concurrency, low-latency text correction scenarios such as news editing, book publishing, and internet content platforms. The text correction system is deployed on cloud servers or edge computing nodes and integrated with content production tools (such as news editing systems and publishing proofreading platforms) through API interfaces. After the user inputs the text to be corrected, the text correction system acquires business terminology and user feedback data through a multi-source data collection module. Combined with the collaborative processing of a small correction model library and a large discrimination model, it achieves real-time text proofreading. The text correction system supports multi-task parallel processing, adapting to the rapid proofreading needs of breaking news articles in the news industry, as well as the precise correction needs of professional terminology in the publishing field.
[0151] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0152] Figure 3 This is a schematic diagram of the structure of the text correction device provided in the embodiments of this application, as shown below. Figure 3 As shown, the text correction device provided in this embodiment includes:
[0153] The determination module 301 is used to perform parallel error correction processing on the target text using multiple lightweight error correction models to obtain candidate modification suggestions corresponding to each lightweight error correction model.
[0154] The routing module 302 is used to route multiple candidate modification suggestions based on confidence level assessment to obtain a first route and a second route, wherein the confidence level of the candidate modification suggestions in the first route is less than or equal to the confidence level threshold, and the confidence level of the candidate modification suggestions in the second route is greater than the confidence level threshold.
[0155] The determination module 301 is used to input the candidate modification suggestions in the first split into the large discrimination model for discrimination, and obtain the discrimination result of whether to adopt the candidate modification suggestions;
[0156] The error correction module 303 is used to perform text error correction on the target text based on the candidate modification suggestions indicated by the discrimination result and the candidate modification suggestions in the second split.
[0157] In one possible implementation, the text correction device further includes a processing module (not shown), which is used for:
[0158] For the same error correction type of the target text, determine whether the candidate modification suggestions corresponding to multiple lightweight error correction models are consistent;
[0159] If there is a discrepancy, a splitting process for multiple candidate modification suggestions will be performed;
[0160] If they match, the candidate modification suggestion will be determined as the candidate modification suggestion in the second subdivision.
[0161] In one possible implementation, multiple lightweight error correction models are trained in the following manner:
[0162] Acquire a text corpus of the target domain;
[0163] The text corpus is preprocessed to obtain an initial corpus set. The preprocessing includes cleaning, noise reduction and sentence segmentation.
[0164] Determine the task type for the error correction task;
[0165] For any task type, the initial corpus is processed based on the dataset processing method to generate a training dataset. The training dataset includes multiple error-correction sentence pairs. The dataset processing methods include obfuscation replacement, rule perturbation, and back translation.
[0166] Multiple lightweight error correction models were trained using the training dataset.
[0167] In one possible implementation, the processing module is used for:
[0168] Determine the training strategy for the lightweight error correction model based on the task type;
[0169] Based on the training strategy, multiple lightweight error correction models are trained using the training dataset.
[0170] In one possible implementation, the large discriminative model is trained in the following manner:
[0171] Acquire false alarm data from multiple lightweight error correction models;
[0172] Correcting errors in the training dataset – correcting sentence pairs to obtain correctly modified data;
[0173] In the error-correction sentence pair, the erroneous sentence and the correctly corrected data are identified as negative examples.
[0174] Obtain the error correction results from user feedback and use the error correction results as incremental training data;
[0175] A training set is generated based on false positive data, negative example data, and incremental training data.
[0176] A large discrimination model is trained based on the training set.
[0177] In one possible implementation, the processing module is used for:
[0178] Based on the discrimination type of the discrimination task, target training data is determined from the training set;
[0179] Based on the target training data, the large language model is fine-tuned to obtain the discriminative large model.
[0180] In one possible implementation, the processing module is further configured to:
[0181] Based on a preset cycle, obtain the error correction results from user feedback and the newly added content in the text corpus of the target domain;
[0182] Based on the error correction results and the added content, multiple lightweight error correction models and a large discrimination model are retrained.
[0183] In one possible implementation, the determining module 301 is used for:
[0184] The candidate suggestions from the first split are input into the large-scale discrimination model. In the large-scale discrimination model, the correlation between the candidate suggestions and the correct modification suggestions is learned to obtain the discrimination result of whether to adopt the candidate modification suggestions.
[0185] The text correction device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0186] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented by processing element calls to software, while others are implemented in hardware. For example, a processing module can be a separate processing element, or it can be integrated into an integrated circuit within the above device. Alternatively, it can be stored as program code in the device's memory, and its functions can be called and executed by a processing element. The implementation of other modules is similar. Moreover, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. During implementation, each step of the above method or each of the above modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.
[0187] For example, these modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more Digital Signal Processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). As another example, when a module is implemented by calling program code through a processing element, that processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together to implement a System-On-a-Chip (SOC).
[0188] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device 400 provided in this application embodiment may include: a processor 401, and a memory 402 communicatively connected to the processor, wherein:
[0189] The memory stores the instructions that the computer executes;
[0190] The processor executes computer execution instructions stored in memory to implement the method described in the foregoing method embodiments.
[0191] It should be understood that processor 401 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor. Memory 402 may include high-speed random access memory (RAM), and may also include non-volatile memory (NVM), such as at least one disk storage device, or a USB flash drive, external hard drive, read-only memory, disk, or optical disc, etc.
[0192] Optionally, the electronic device 400 may also include a communication interface 403. In specific implementations, if the communication interface 403, memory 402, and processor 401 are implemented independently, they can be interconnected via a bus to complete communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not imply that there is only one bus or one type of bus.
[0193] Optionally, in a specific implementation, if the communication interface 403, memory 402 and processor 401 are integrated on a single integrated circuit, then the communication interface 403, memory 402 and processor 401 can communicate through an internal interface.
[0194] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed, are used to implement the methods described in any of the foregoing embodiments.
[0195] It is understood that the computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0196] An exemplary computer-readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the computer-readable storage medium. Of course, the computer-readable storage medium can also be a component of the processor. The processor and the computer-readable storage medium can reside in an ASIC. Alternatively, the processor and the computer-readable storage medium can exist as discrete components in an electronic device.
[0197] The integrated modules implemented as software functional modules described above can be stored in a computer-readable storage medium. These software functional modules, stored in a computer-readable storage medium, include several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application.
[0198] This application also provides a computer program product, including a computer program that, when executed, implements the method described in any of the foregoing embodiments.
[0199] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0200] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0201] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as these combinations of technical features do not contradict each other, they should be considered within the scope of this specification.
[0202] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0203] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A text error correction method, characterized in that, include: The target text is processed in parallel by multiple lightweight error correction models to obtain candidate modification suggestions corresponding to each of the lightweight error correction models. Based on confidence assessment, multiple candidate modification suggestions are split into a first split and a second split, wherein the confidence of the candidate modification suggestions in the first split is less than or equal to a confidence threshold, and the confidence of the candidate modification suggestions in the second split is greater than a confidence threshold. For the candidate modification suggestions in the first split, the candidate modification suggestions are input into the large discrimination model for discrimination, and the discrimination result of whether to adopt the candidate modification suggestions is obtained; Based on the candidate modification suggestions indicated by the discrimination result and the candidate modification suggestions in the second split, text correction is performed on the target text.
2. The method according to claim 1, characterized in that, Before the confidence-based assessment and triage of the multiple candidate modification suggestions, the method further includes: For the same error correction type of the target text, determine whether the candidate modification suggestions corresponding to the multiple lightweight error correction models are consistent; If there is a discrepancy, a splitting step is performed on the multiple candidate modification suggestions; If they match, the candidate modification suggestion is determined as the candidate modification suggestion in the second split.
3. The method according to claim 1 or 2, characterized in that, The multiple lightweight error correction models are trained in the following manner: Acquire a text corpus of the target domain; The text corpus is preprocessed to obtain an initial corpus set. The preprocessing includes cleaning, noise reduction and sentence segmentation. Determine the task type for the error correction task; For any task type, the initial corpus is processed based on the dataset processing method to generate a training dataset. The training dataset includes multiple error-correction sentence pairs. The dataset processing method includes obfuscation replacement, rule perturbation, and back translation. The aforementioned training dataset is used to train the multiple lightweight error correction models.
4. The method according to claim 3, characterized in that, The step of training the multiple lightweight error correction models using the training dataset includes: Based on the task type, determine the training strategy for the lightweight error correction model; Based on the training strategy and using the training dataset, the multiple lightweight error correction models are trained.
5. The method according to claim 3, characterized in that, The discriminative large model is trained in the following way: Acquire false alarm data output by multiple lightweight error correction models; Correcting errors in the training dataset – correcting sentence pairs to obtain correctly modified data; The erroneous sentence and the correctly modified data in the error-correction sentence pair are identified as negative example data. Obtain the error correction results from user feedback and use the error correction results as incremental training data; A training set is generated based on the false positive data, the negative example data, and the incremental training data; The discrimination model is trained based on the training set.
6. The method according to claim 5, characterized in that, The process of training the large-scale discriminative model based on the training set includes: Based on the discrimination type of the discrimination task, target training data is determined from the training set; Based on the target training data, the large language model is fine-tuned to obtain the discriminative large model.
7. The method according to claim 1 or 2, characterized in that, Also includes: Based on a preset cycle, obtain the error correction results from user feedback and the newly added content in the text corpus of the target domain; Based on the error correction results and the newly added content, the multiple lightweight error correction models and the large discrimination model are retrained.
8. The method according to claim 1 or 2, characterized in that, The step of inputting candidate modification suggestions from the first splitting process into a large-scale discrimination model for judgment, and obtaining a judgment result on whether to adopt the candidate modification suggestions, includes: The candidate suggestions from the first split are input into the large-scale discrimination model. In the large-scale discrimination model, the correlation between historical candidate suggestions and correct modification suggestions is learned, and the candidate modification suggestions are judged according to the correlation to obtain a judgment result on whether to adopt the candidate modification suggestions.
9. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed, are used to implement the method as described in any one of claims 1-8.