Text information error correction model training system based on deep learning
By training a deep learning-based text information error correction model system, combined with data augmentation and reinforcement learning mechanisms, the problem of insufficient model generalization ability in existing technologies has been solved, achieving efficient text error correction and multi-scenario adaptability, and improving the accuracy and efficiency of error correction.
Patent Information
- Application Number
- CN202511726980.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-02-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing text correction technologies lack simulation of real-world error scenarios in model training data construction, resulting in insufficient model generalization ability. Furthermore, the model optimization process relies on a single loss function, failing to fully incorporate the characteristics of the error correction task and making it difficult to quickly integrate user feedback data for iterative optimization, thus limiting the accuracy and efficiency of error correction.
A deep learning-based text information error correction model training system is adopted, including a data input and preprocessing module, a model inference module, a result evaluation module, a reinforcement learning signal generation module, and a model optimization module. By constructing a high-frequency confusion vocabulary, a dynamic time warping algorithm, and a reinforcement learning mechanism, combined with a pre-trained model based on the Transformer architecture, data augmentation and model parameter optimization are performed to achieve efficient error correction processing.
It improves the recognition and correction capabilities of the text error correction model, solves the problems of limited coverage and insufficient deep semantic capture of traditional methods, and achieves optimization of model stability and adaptability, making it suitable for large-scale text data processing and multi-scenario error correction needs.
Smart Images

Figure CN121502360A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of text information processing, and particularly relates to a text information error correction model training system based on deep learning. BACKGROUND
[0002] With the rapid development of Internet technology and the increasing convenience of information dissemination, as the main carrier of information transmission, the amount of text information is showing explosive growth. In various text generation scenarios, due to the input habits of the inputters, language level differences and the limiting factors of input devices, there are often a large number of errors in the text, including but not limited to spelling errors, syntax errors, semantic errors and punctuation symbol usage errors. These error texts not only affect the accurate transmission of information and lead to communication misunderstandings, but also may cause serious consequences in some fields with high requirements for text quality. Therefore, it has important practical application value to automatically correct the text information and improve the text quality.
[0003] At present, the existing text correction technology mainly includes rule-based methods, statistical machine learning-based methods and deep learning-based methods. The rule-based method relies on manual construction of a large number of correction rules, which has a certain effect in specific scenarios, but the coverage is limited, it is difficult to cope with complex and variable error types, and the maintenance cost is high. The statistical machine learning-based method learns statistical rules from the corpus for error correction, but the feature engineering depends on manual design, and the ability to capture deep semantic information is insufficient, so the error correction accuracy is limited. Although the deep learning-based method has shown strong error correction potential, in the existing technology, the construction of model training data often lacks effective simulation of real error scenarios, resulting in insufficient generalization ability of the model, and the model optimization process mainly depends on a single loss function, without fully combining the characteristics of the error correction task for targeted optimization, so there is still a large space for improvement in error correction accuracy and efficiency. In addition, the model updating mechanism of the existing text correction system is not perfect, and it is difficult to quickly integrate user feedback data for iterative optimization, so the model performance cannot continuously adapt to new error types and trends in actual applications. Therefore, there is an urgent need for a text information error correction model training system that can efficiently construct training data close to real scenarios, combine reinforcement learning for precise optimization and have continuous iteration capability. SUMMARY
[0004] The application aims to provide a text information error correction model training system based on deep learning to solve the problems in the background technology.
[0005] To solve the above technical problems, the application provides the following technical solutions:
[0006] A deep learning-based text information error correction model training system includes a data input and preprocessing module, a model inference module, a result evaluation module, a reinforcement learning signal generation module, a model optimization module, and a model deployment module.
[0007] The data input and preprocessing module is used to receive the original text and the corresponding correct text, and to perform noise enhancement on the original text and standardization on the corresponding correct text to obtain the error text and the standard correct text. At the same time, the error text and the standard correct text are used to construct error-correct text training pairs and store them in the database.
[0008] The model inference module is used to load the text information error correction model and input the erroneous text into the text information error correction model for error correction processing to obtain the corrected text.
[0009] The results evaluation module is used to analyze the corrected text and the standard correct text, identify the error types of the corrected text, and calculate the quantitative indicators of the corrected text.
[0010] The reinforcement learning signal generation module is used to construct reinforcement learning reward signals based on the error types and quantification metrics of the corrected text.
[0011] The model optimization module is used to update the parameters of the text information correction model based on the reinforcement learning reward signal, obtain the updated model parameter text information correction model, and retrain the updated model parameter text information correction model to obtain a new text information correction model.
[0012] The model deployment module is used to deploy new models with text information correction as RESTful API services through the model deployment framework.
[0013] Preferably, the original text and its corresponding correct text are received through an Apache Kafka message queue. The Apache Kafka message queue has the characteristics of high throughput and low latency, which can efficiently handle the real-time transmission of large-scale text data, ensuring that the original text and the correct text can enter the system in a timely and accurate manner for subsequent processing, and providing stable and reliable support for the data input of the entire text information error correction model training system.
[0014] Preferably, the process of noise enhancement on the received original text and standardization of the corresponding correct text includes:
[0015] A high-frequency confusion word list is constructed using confusion set technology. The high-frequency confusion word list is compiled based on spelling errors that frequently occur in a large amount of real language data and covers easily confused characters or words. Each character in the original text is traversed and checked to see if it is in the high-frequency confusion word list. If it is, the character is replaced with a homophone or similar-looking character in the high-frequency confusion word list with a 30% probability, thereby introducing character-level spelling errors into the original text. At the same time, each sentence in the original text is traversed and the word order of some words in each sentence is shuffled or some words are replaced with synonyms with a 40% probability, thereby introducing grammatical and semantic errors into the original text, thus obtaining the erroneous text.
[0016] SpaCy is used to perform word segmentation on the correct text corresponding to the original text, splitting the continuous text sequence in the correct text into individual words. Each word is tagged with part of speech using Stanford CoreNLP to clarify the grammatical attributes of each word in the sentence. Case conversion is also performed to unify the case format of the text and eliminate interference that may be caused by inconsistent format. In this way, a standard correct text with standardized format and clear information is obtained.
[0017] spaCy is an open-source natural language processing library.
[0018] Preferably, the process of constructing error-correct text training pairs from the error text and the standard correct text and storing them in the database is as follows:
[0019] Align the erroneous text with the standard correct text. The alignment operation is carried out at the character level or word level. If the erroneous text and the standard correct text are the same in terms of the number of characters or words, the alignment is directly performed according to the corresponding position to ensure that each character or word in the erroneous text can form a one-to-one correspondence with the corresponding correct character or word in the standard correct text.
[0020] If the text lengths of the erroneous text and the standard correct text are inconsistent, i.e., there is a difference in the number of characters or words, the dynamic time warping algorithm is used for alignment. The dynamic time warping algorithm finds the optimal matching path by calculating the similarity between each character or word in the erroneous text and the standard correct text. It can effectively handle the alignment problem of sequences of different lengths and is used to ensure the semantic correspondence between the erroneous text and the standard correct text.
[0021] The aligned error text is combined with the standard correct text to form an error-correct text training pair of <error text, standard correct text>. The error-correct text training pair is then converted into TFRecord format and stored in the database. TFRecord format is a binary file format that can effectively store serialized tensor data. It can not only reduce the space occupied by data storage, but also improve the data loading speed, which is especially suitable for processing large-scale training data.
[0022] Preferably, the text information error correction model in the loaded text information error correction model is a pre-trained model based on the Transformer architecture, specifically including BERT, RoBERTa, and T5;
[0023] The Transformer architecture, through its self-attention mechanism, can effectively capture long-distance dependencies in text, making it suitable for handling complex contextual relationships in text correction tasks.
[0024] After loading, the pre-trained model based on the Transformer architecture receives the erroneous text obtained from the data input and preprocessing modules. The input processing layer, which includes word embedding and position encoding layers, converts the erroneous text into a vector form that the model can recognize. Then, the Transformer encoder and Transformer decoder layers perform feature extraction and processing. Finally, the output layer, which includes fully connected layers and activation function layers, generates the corrected text. The Transformer decoder layer is unique to T5.
[0025] Preferably, the process involves analyzing the corrected text and the standard correct text to identify the error types in the corrected text and calculate the quantitative indicators of the corrected text.
[0026] The error types in the corrected text include spelling errors, grammatical errors, punctuation errors, and semantic errors, and the quantitative metrics of the corrected text include CER, BLEU, and F1 Score;
[0027] For spelling errors, a dual verification is performed using preset regular expression matching rules and a manually constructed high-frequency error rule library. Each character or word in the corrected text is traversed. If an error pattern in the high-frequency error rule library is matched or does not conform to the regular expression matching rules, the corrected text is determined to have a spelling error.
[0028] To address grammatical errors, the Stanford Parser dependency parsing tool is used to analyze the syntactic structure of the corrected text, extract dependency relations, and compare them with a pre-defined grammar rule base. If abnormal dependency relations are found, the corrected text is determined to contain grammatical errors.
[0029] Regarding punctuation errors, by combining punctuation usage rules with contextual analysis, if the punctuation usage violates the punctuation usage rules or conflicts with the context, the corrected text is determined to contain punctuation errors.
[0030] To address semantic errors, the semantic vectors of the corrected text and the standard correct text are compared using a BERT-based sentence vector cosine similarity algorithm. When the similarity is lower than a preset threshold, it is determined that there is a significant semantic deviation between the corrected text and the standard correct text, i.e., the corrected text contains semantic errors.
[0031] The edit distance between the corrected text and the standard correct text is calculated using the Levenshtein distance algorithm and divided by the number of characters in the standard correct text to obtain the CER. The CER reflects the proportion of errors at the character level. The lower the value, the better the error correction effect. At the same time, the BLEU scoring function in the NLTK library is called to calculate the BLEU by comparing the overlap of 1-gram to 4-gram between the corrected text and the standard correct text in a weighted geometric mean manner. The BLEU range is 0 to 1. The higher the BLEU value, the stronger the consistency of the word sequence between the corrected text and the correct text.
[0032] The corrected text is compared with the standard correct text. The number of correctly corrected characters (TP), the number of uncorrected errors (FN), and the number of actually correct errors (FN) in the corrected text are counted. Based on this, the F1 score is calculated using the F1 formula.
[0033] The F1 formula is:
[0034] ;
[0035] in, , .
[0036] Preferably, the process of constructing a reinforcement learning reward signal based on the error type and quantification metrics of the corrected text is as follows:
[0037] Based on application scenario requirements, spelling error weights are manually set. Syntax error weighting Punctuation error weight and semantic error weights And based on the weight of spelling errors Syntax error weighting Punctuation error weight and semantic error weights As well as error types and quantitative indicators, the reinforcement learning reward signal is calculated using the reward signal formula;
[0038] The formula for the reward signal is:
[0039] ;
[0040] in, To correct the text complexity factor, This represents the sum of error type weights.
[0041] The for If the error types in the corrected text do not include spelling errors, then the... for Spelling error weighting in The value is 0, and the same applies to other error types in correcting text, excluding spelling errors.
[0042] The modified text complexity factor The value range is [0,1], and it is determined by comprehensively correcting the sentence length, lexical richness and syntactic complexity of the text.
[0043] Preferably, the method for obtaining the updated model parameter text information error correction model is as follows:
[0044] S1. Calculate the gradient of the text information error correction model parameters based on the reinforcement learning reward signal. The reinforcement learning reward signal is constructed by the reinforcement learning signal generation module based on the error type and quantification index of the corrected text. The magnitude of the reinforcement learning reward signal directly reflects the quality of the text information error correction model's error correction effect. Using the reinforcement learning reward signal as the optimization target, the partial derivatives of the text information error correction model parameters with respect to the reinforcement learning reward signal are solved through the chain rule to obtain the gradient of the text information error correction model parameters. The direction of the gradient indicates the direction in which the text information error correction model parameters need to be adjusted, and the magnitude of the gradient reflects the magnitude of the gradient adjustment of the text information error correction model parameters.
[0045] S2. The gradient is propagated to each layer of the text information error correction model through the backpropagation algorithm to update the parameters of the text information error correction model, resulting in an updated text information error correction model. The backpropagation algorithm starts from the output layer of the text information error correction model and proceeds sequentially through the output layer, Transformer decoder layer, Transformer encoder layer, and input processing layer. This ensures that the parameters of each layer of the text information error correction model can be adjusted in a targeted manner according to the reinforcement learning reward signal. At the same time, during the gradient propagation and text information error correction model parameter update process, the maximum norm of the gradient is limited by the gradient clipping technique to avoid gradient explosion due to abnormally large gradients.
[0046] The text information error correction model includes an input processing layer, a Transformer encoder layer, a Transformer decoder layer, and an output layer, with the Transformer decoder layer being unique to T5.
[0047] Preferably, the updated model parameter text information error correction model is retrained. The retraining process is based on the updated model parameter text information error correction model, loading the error and correct text training pairs processed by the data input and preprocessing module, and training with mini-batch gradient descent method to obtain the retrained updated model parameter text information error correction model. If the performance index of the retrained updated model parameter text information error correction model on the validation set meets the preset performance index, it indicates that the retrained updated model parameter text information error correction model has achieved the expected error correction performance and can be identified as a new text information error correction model.
[0048] Otherwise, a cosine annealing learning rate decay strategy is used to adjust the learning rate of the retrained updated model parameter text information error correction model, thereby increasing the likelihood that the retrained updated model parameter text information error correction model will converge to the global optimum, and then retraining is performed again.
[0049] The preset performance indicators are CER less than 0.05 and F1 Score greater than 0.8, where the performance indicators include CER and F1 Score;
[0050] The validation set is constructed from training pairs of incorrect and correct text.
[0051] Preferably, the model deployment framework is TensorFlow Serving or TorchServe.
[0052] Due to the adoption of the above technical solution, the technical progress achieved by this invention compared to the prior art is as follows:
[0053] 1. This invention constructs a high-frequency obfuscation word list through obfuscation set technology, and combines it with random character operations, word order adjustment, and synonym replacement for noise enhancement. This effectively simulates spelling, grammar, semantics, and punctuation errors in real-world scenarios, making the training data closer to actual application scenarios and providing a high-quality data foundation for model learning. At the same time, it adopts a pre-trained model based on the Transformer architecture, whose self-attention mechanism can accurately capture the contextual relationships of the text, greatly improving the ability to identify and correct complex errors. This solves the problems of limited coverage and insufficient capture of deep semantics in traditional rule-based or statistical methods.
[0054] 2. This invention introduces a reinforcement learning mechanism, constructs a reward signal based on error type and quantification index, and accurately transmits gradients to each layer of the model through the backpropagation algorithm to update parameters, making the model optimization more in line with the characteristics of the error correction task and avoiding the limitations of optimizing a single loss function. At the same time, it adopts a cosine annealing learning rate decay strategy and gradient pruning technology to ensure the stability and convergence efficiency of model training, and solves the problems of insufficient model optimization targeting, gradient explosion or slow convergence in existing deep learning methods.
[0055] 3. This invention efficiently receives large-scale text data through the Apache Kafka message queue, and combines dynamic time warping algorithm to achieve text alignment and TFRecord format storage, thereby improving the efficiency and standardization of data processing. The model deployment module adopts a model deployment framework to deploy the model as a RESTful API service, which is convenient for integration with various application systems and meets the error correction needs of different scenarios. Attached Figure Description
[0056] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0057] Figure 1 This is a schematic diagram of the system functional modules of the present invention. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0059] Examples, such as Figure 1 The aforementioned deep learning-based text information error correction model training system includes a data input and preprocessing module, a model inference module, a result evaluation module, a reinforcement learning signal generation module, a model optimization module, and a model deployment module, which work together to complete the text information error correction model training task.
[0060] A data input and preprocessing module, which is used to receive the original text and the correct text corresponding to the original text, perform noise enhancement on the original text and normalization processing on the corresponding correct text to obtain the error text and the standard correct text, and at the same time construct an error-correct text training pair from the error text and the standard correct text and store it in the database;
[0061] A model inference module, which is used to load a text information error correction model and input the error text into the text information error correction model for error correction processing to obtain the corrected text;
[0062] A result evaluation module, which is used to analyze the corrected text and the standard correct text, identify the error types of the corrected text and calculate the quantitative indicators of the corrected text;
[0063] A reinforcement learning signal generation module, which is used to construct a reinforcement learning reward signal based on the error types and quantitative indicators of the corrected text;
[0064] A model optimization module, which is used to update the parameters of the text information error correction model according to the reinforcement learning reward signal to obtain a text information error correction model with updated model parameters, and retrain the text information error correction model with updated model parameters to obtain a new text information error correction model;
[0065] A model deployment module, which is used to deploy the new text information error correction model as a RESTful API service through a model deployment framework.
[0066] Furthermore, taking the Chinese text error correction scenario as an example, the working principle of the text information error correction model training system based on deep learning according to the present invention is shown:
[0067] Receive a batch of original texts and the correct texts corresponding to the original texts through the Apache Kafka message queue, where the original texts contain various errors, such as:
[0068] Original text 1: "He ran away happily" (the use of "de" is incorrect, it should be "di");
[0069] Original text 2: "I ate an apple yesterday and will go to sell bananas tomorrow" ("sell" is a semantic error, it should be "buy");
[0070] Original text 3: "The weather is really nice today" (missing punctuation, an exclamation mark should be added at the end). The correct texts corresponding to the original texts are respectively:
[0071] Correct text 1: "He ran away happily";
[0072] Correct text 2: "I ate an apple yesterday and will go to buy bananas tomorrow";
[0073] Correct text 3: "The weather is really nice today!";
[0074] Noise enhancement is performed on the original text. For the original text 1, using the constructed high-frequency confusion word list (including "的-地-得"), since the error of "的" already exists in the original text 1, no additional replacement is required. At the same time, with a 40% probability, the phrase "跑了" in the sentence is replaced with a synonym "跑掉了", obtaining the incorrect text 1: "他高兴的跑掉了".
[0075] For the original text 2, with a 30% probability, "苹果" is replaced with the similar-looking character "平果", obtaining the incorrect text 2: "我昨天吃了平果,明天去卖香蕉".
[0076] For the original text 3, with a 40% probability, the order of some words is scrambled to "今天真好天气啊", obtaining the incorrect text 3: "今天真好天气啊".
[0077] Standardization is performed on the correct text corresponding to the original text. Using spaCy to tokenize the correct text 1, obtaining "他 / 高兴地 / 跑了", and performing词性标注 (pos tagging) through Stanford CoreNLP, "他" (pronoun), "高兴地" (adverb), "跑了" (verb); unifying the case (there is no case problem here), obtaining the standard correct text 1. Similarly, processing the correct text 2 and 3 to obtain the corresponding standard correct text 2 and 3.
[0078] Based on this, incorrect-correct text training pairs are constructed from the incorrect texts and the standard correct texts and stored in the database. Character-level alignment is performed between the incorrect text 1 and the standard correct text 1, forming an incorrect-correct text training pair of <“他高兴的跑掉了”, “他高兴地跑了”>. For incorrect texts and standard correct texts with inconsistent lengths, the dynamic time warping algorithm is used for alignment. For example, after aligning the incorrect text 3 "今天真好天气啊" with the standard correct text 3 "今天天气真好啊!", an incorrect-correct text training pair is constructed. All training pairs are converted to the TFRecord format and stored in the database.
[0079] Load the pre-trained T5 model based on the Transformer architecture as the initial text information correction model. Input the incorrect texts 1, 2, and 3 obtained above into the model for correction processing, and the output corrected text 1: "他高兴地跑掉了", corrected text 2: "我昨天吃了苹果,明天去买香蕉", corrected text 3: "今天天气真好啊".
[0080] Comparing the corrected text 1 with the standard correct text 1, it is found that there is a difference between "ran away" in the corrected text 1 and "ran" in the standard correct text 1, but no new errors are introduced, and the original error of "de" has been corrected, and there are no other error types; comparing the corrected text 2 with the standard correct text 2, the corrected text 2 is completely correct, and the original errors of "pingguo" and "sell" have been corrected; comparing the corrected text 3 with the standard correct text 3, it is found that the corrected text 3 lacks "!" at the end of the sentence, there is a punctuation error; taking the wrong text 1 as an example, the edit distance between the corrected text 1 and the standard correct text 1 is 1 (the character "diao"), and the number of characters in the standard correct text 1 is 7, so CER = 1 / 7 ≈ 0.14. Taking the wrong text 2 as an example, through the BLEU scoring function of the NLTK library, the BLEU value of the corrected text 2 and the standard correct text 2 is 1.0 (perfect match). Taking the wrong text 3 as an example, count the number of corrected correct characters, uncorrected error characters and actually correct error characters in the corrected text 3, substitute them into the F1 formula and calculate to get F1Score = 0.85. Based on this, the error types and quantitative indicators of the corrected text are obtained.
[0081] Based on the requirements of the application scenario, the weights are set manually: the weight of spelling errors is 0.2, the weight of grammar errors is 0.3, the weight of punctuation errors is 0.1, and the weight of semantic errors is 0.4. Combining the error types and quantitative indicators, calculate the reinforcement learning reward signal through the reward signal formula. Taking the corrected text 3 as an example, it has a punctuation error, the corresponding weight is 0.1, the quantitative indicator CER = 0.05, F1Score = 0.85, BLEU = 0.9, and the text complexity factor C is 0.6. Then the reinforcement learning reward signal = 0.6×[0.4×(1 - 0.05)+0.3×0.85+0.2×0.9]-0.1 = 0.6×(0.38+0.255+0.18)-0.1 = 0.6×0.815-0.1 = 0.489-0.1 = 0.389.
[0082] Based on the aforementioned reinforcement learning reward signals, the gradient of the model parameters is calculated using the chain rule. The gradient is then propagated sequentially to the input processing layer, Transformer encoder layer, decoder layer, and output layer of the T5 model using the backpropagation algorithm, updating the parameters of each layer to obtain the updated model. Error-corrected and correct text training pairs are loaded from the database, and the updated model is retrained using mini-batch gradient descent with a batch size of 32. Performance is evaluated on the validation set every 10 training epochs. If, after 50 epochs, the model achieves a CER of 0.04 and an F1 Score of 0.82 on the validation set, the preset performance metrics are met, training is stopped, and a new text information correction model is obtained. This new model is then deployed as a RESTful API service using the TensorFlow Serving framework. If the performance is not met, a cosine annealing learning rate decay strategy is used to adjust the learning rate before continuing training.
[0083] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A deep learning-based text information error correction model training system, characterized in that, include: The data input and preprocessing module is used to receive the original text and the corresponding correct text, and to perform noise enhancement on the original text and standardization on the corresponding correct text to obtain the error text and the standard correct text. At the same time, the error text and the standard correct text are used to construct error-correct text training pairs and store them in the database. The model inference module is used to load the text information error correction model and input the erroneous text into the text information error correction model for error correction processing to obtain the corrected text. The results evaluation module is used to analyze the corrected text and the standard correct text, identify the error types of the corrected text, and calculate the quantitative indicators of the corrected text. The reinforcement learning signal generation module is used to construct reinforcement learning reward signals based on the error types and quantification metrics of the corrected text. The model optimization module is used to update the parameters of the text information correction model based on the reinforcement learning reward signal, obtain the updated model parameter text information correction model, and retrain the updated model parameter text information correction model to obtain a new text information correction model. The model deployment module is used to deploy new models with text information correction as RESTful API services through the model deployment framework.
2. The text information error correction model training system based on deep learning according to claim 1, characterized in that, The original text and its corresponding correct text are received via an Apache Kafka message queue.
3. The text information error correction model training system based on deep learning according to claim 2, characterized in that, The process of noise enhancement of the original text and standardization of the corresponding correct text: A high-frequency obfuscation word list is constructed using obfuscation set technology. Each character in the original text is traversed and checked to see if it is in the high-frequency obfuscation word list. If it is, it is replaced with a homophone or similar-looking character in the high-frequency obfuscation word list with a 30% probability, introducing character-level errors into the original text. At the same time, each sentence in the original text is traversed and the word order in each sentence is shuffled or synonyms are replaced with a 40% probability, introducing grammatical and semantic errors into the original text, thereby obtaining the erroneous text. We used spaCy to perform word segmentation on the correct text corresponding to the original text, splitting the continuous text sequence in the correct text into individual words. For each word, we used Stanford CoreNLP to perform part-of-speech tagging and case conversion, thereby obtaining the standard correct text.
4. The text information error correction model training system based on deep learning according to claim 3, characterized in that, The process of constructing error-correct text training pairs from error text and standard correct text and storing them in the database: The erroneous text and the standard correct text are aligned at the character level or word level. If the text lengths of the erroneous text and the standard correct text are inconsistent, a dynamic time warping algorithm is used for alignment. The aligned erroneous text and the standard correct text are combined into erroneous-correct text training pairs, and the erroneous-correct text training pairs are converted into TFRecord format and stored in the database.
5. The text information error correction model training system based on deep learning according to claim 4, characterized in that, The text information error correction model mentioned is a pre-trained model based on the Transformer architecture, specifically including BERT, RoBERTa, and T5.
6. The text information error correction model training system based on deep learning according to claim 4, characterized in that, The process of analyzing the corrected text and the standard correct text to identify the error types in the corrected text and calculate the quantitative indicators of the corrected text: The corrected text is identified by regular expressions and rule matching to identify spelling errors, by dependency parsing to detect grammatical errors, and by punctuation errors based on punctuation usage rules and context. At the same time, a semantic similarity calculation model is used to compare the semantic differences between the corrected text and the standard correct text to identify semantic errors. Based on this, error types including spelling errors, grammatical errors, punctuation errors and semantic errors are obtained. The edit distance between the corrected text and the standard correct text is calculated using the Levenshtein distance algorithm and divided by the number of characters in the standard correct text to obtain the CER. At the same time, the BLEU score function of the NLTK library is used to calculate the BLEU score between the corrected text and the standard correct text. The corrected text is compared with the standard correct text. The number of corrected characters, the number of uncorrected errors, and the number of actually correct errors in the corrected text are counted. Based on this, the number of corrected characters, the number of uncorrected errors, and the number of actually correct errors are used to calculate the F1 Score using the F1 formula. This yields quantitative indicators including CER, BLEU, and F1 Score.
7. The text information error correction model training system based on deep learning according to claim 6, characterized in that, The process of constructing reinforcement learning reward signals based on error types and quantitative indicators of corrected text: Based on the application scenario requirements, the weights of spelling errors, grammar errors, punctuation errors, and semantic errors are manually set. Then, based on the weights of spelling errors, grammar errors, punctuation errors, and semantic errors, as well as the error type and quantitative indicators, the reinforcement learning reward signal is calculated using the reward signal formula.
8. The text information error correction model training system based on deep learning according to claim 7, characterized in that, The method for obtaining the updated model parameter text information error correction model: S1. Calculate the gradient of the text information error correction model parameters based on the reinforcement learning reward signal; S2. The gradient is propagated to each layer of the text information error correction model through the backpropagation algorithm to update the parameters of the text information error correction model, thus obtaining the updated model parameter text information error correction model. The text information error correction model consists of an input processing layer, a Transformer encoder layer, a Transformer decoder layer, and an output layer.
9. The text information error correction model training system based on deep learning according to claim 8, characterized in that, The text information error correction model with updated model parameters is retrained. If the performance index of the retrained text information error correction model with updated model parameters on the validation set meets the preset performance index, then a new text information error correction model is obtained. Otherwise, the learning rate of the retrained text information error correction model is adjusted using a cosine annealing learning rate decay strategy, and then retrained again. The preset performance indicators are CER less than 0.05 and F1Score greater than 0.8, where the performance indicators include CER and F1Score.
10. The text information error correction model training system based on deep learning according to claim 9, characterized in that, The model deployment framework is either TensorFlow Serving or TorchServe.
Citation Information
Cited By
A two-stage large-scale model training method and system for Chinese text error correction.
CN122311352A