Multi-language spelling error correction method based on big language model modeling
By combining a large language model with a zero-shot detection and generative correction integration mechanism, the problems of overcorrection and cross-language adaptability in existing spelling correction technologies are solved, achieving efficient and accurate multilingual spelling correction, especially with significant improvements in low-resource languages.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-04-07
AI Technical Summary
Existing spell correction technologies suffer from problems such as overcorrection, poor language performance with low resource usage, inability to adapt to complex error types in multiple languages, error accumulation due to separation of detection and correction, and insufficient cross-language processing capabilities.
A multilingual spelling correction method based on a large language model is adopted. Through a zero-shot detection and generation correction integration mechanism, multilingual training data construction, word-level probability deviation determination and end-to-end supervised fine-tuning framework, combined with MiniHash and BK tree optimization, efficient and accurate spelling correction is achieved.
It significantly improves the accuracy of spell correction in multiple languages, especially in low-resource languages, where the F1 score increases from 8.5% to 71.0%. It also suppresses overcorrection, enhances the system's robustness and cross-scenario adaptability, and supports downstream NLP task optimization.
Smart Images

Figure CN121809462A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of natural language processing and artificial intelligence application technology, and in particular to a multilingual spelling correction method based on large language model modeling. Background Technology
[0002] With the acceleration of globalization and the widespread adoption of internet technology, the importance of textual information in daily life and industrial production is becoming increasingly prominent. Especially in fields such as social media, online education, cross-language communication, news publishing, intelligent customer service, and machine translation, the accuracy and readability of text directly impact the efficiency and quality of information transmission. Spelling errors, as one of the most common types of errors in text processing, are widely present in user-generated content, multilingual documents, and learning materials in low-resource languages. For example: 1. Social Media and Content Moderation: On platforms like Facebook, Twitter, and TikTok, user-generated text often contains spelling errors, especially by non-native speakers or users of languages with limited resources. Automatic spell correction systems can provide real-time suggestions or automatic corrections to improve content quality and user experience. 2. Language learning and education support: In language learning or writing support tools such as Duolingo and Grammarly, spelling correction functions help learners identify and correct spelling errors, thereby improving their language expression skills; 3. Cross-language information retrieval and machine translation: In systems such as Google Translate and Baidu Translate, spelling errors in the input text directly affect the translation quality and the accuracy of the search results. Spell correction, as a preprocessing step, can significantly improve the performance of downstream tasks; 4. Low-resource language text processing: In languages such as Indonesian, Vietnamese, and Burmese, the scarcity of digital resources and the complexity of language forms limit the effectiveness of traditional spelling correction tools, thus hindering the development of localized information services.
[0003] Despite the development of spell correction technology over the years, it still faces many technical challenges in practical applications: First, existing generative large language models with spell correction technology have problems of "overcorrection" and "illusion". Generative large language models, represented by the GPT series, are prone to "over-modification" in spell correction, that is, replacing the originally correct words with other reasonable words, which violates the principle of "minimum modification" and affects the original meaning of the text. Secondly, existing spelling correction technologies lack low-resource language data. Traditional supervised learning methods rely on large-scale labeled data, but low-resource languages lack high-quality spelling error-correct comparison corpora, resulting in poor model performance on these languages. Third, existing spelling correction technologies cannot be applied to the complex and diverse types of errors. Spelling errors include not only misplaced, missing, and redundant letters, but also complex situations such as incorrect addition or deletion of spaces and word splitting and combination. Traditional rule-based or statistical methods are difficult to fully cover these issues. Fourth, existing spelling correction technologies are insufficient in their ability to handle multiple languages in a unified manner. Most existing methods are designed for a single language and lack a unified architecture to support multilingual spelling correction, making it difficult to achieve cross-language knowledge transfer. Finally, existing spell correction technologies are prone to error accumulation due to the separation of detection and correction. In the traditional process, error detection and correction are carried out in two steps, and missed or false detections in the detection stage will directly affect the final error correction effect.
[0004] To address the above issues, it is necessary to develop a spell correction method that can balance detection accuracy, correction precision, cross-language adaptability, and data efficiency.
[0005] Large language models, with their powerful language understanding and generation capabilities, offer new possibilities for spell correction. However, how to effectively curb their tendency to "overcorrect" and improve their performance on low-resource languages remains an open question. Summary of the Invention
[0006] The purpose of this invention is to address the aforementioned problems by designing a multilingual spelling correction method based on a large language model. This method aims to overcome the limitations of existing spelling correction techniques, improve the error detection rate and the accuracy of correction results, while suppressing the tendency of generative models to over-correct. This invention can improve the performance of large language models in multilingual spelling correction, especially in language processing for low-resource languages, providing a more accurate and efficient text correction solution, particularly in low-resource languages such as Indonesian and Vietnamese. This achieves the goal of significantly improving correction performance without relying on large-scale labeled data.
[0007] The technical solution of the present invention to achieve the above objectives is a multilingual spelling correction method based on large language model modeling, which includes the following steps: Step 1: Prepare the original article data and the original dictionary data; Step 2: Construct training data based on the corpus dataset, and generate spelling error sample pairs through three perturbation strategies: word replacement, space addition, and space deletion; Step 3: Use the spelling error samples to perform supervised fine-tuning of the large language model; Step four: Based on the supervised fine-tuned large language model, perform an integrated process of error detection and result generation to correct the spelling of the sentence to be corrected and obtain the final correction result.
[0008] The perturbation strategy includes a random method and a simulation method, wherein the simulation method generates error samples based on a Burkhard Keller tree or a split table and a combination table.
[0009] The integration process of error detection and result generation is as follows: First, obtain the set of spelling error detection results based on the zero-shot detection method; Secondly, obtain a preliminary set of error correction results generated by autoregression of the input sentence based on the generative language model; Finally, the detection result set is integrated with the preliminary error correction result set, and only words that are detected as errors and have correction results are replaced, and the final error correction result is output.
[0010] The zero-shot detection method identifies erroneous words by calculating the probability deviation value of each word in the input sentence and comparing the maximum deviation value corresponding to each word with a preset threshold.
[0011] The probability deviation value of the term is calculated using cross-entropy loss, and the calculation formula is as follows: In the formula, This represents the probability deviation value of the lexical unit. For instruction information, Sentences to be corrected A set of lexical terms for pseudo-tags. These are parameters of a large language model.
[0012] The preset threshold is selected by performing parameter search on the validation set and selecting the optimal value based on the Micro-F1 index.
[0013] The method follows the principle of minimal modification during spell correction, replacing only the words that are judged to be incorrect.
[0014] The method is applicable to multilingual spelling correction tasks, including low-resource languages.
[0015] An electronic device includes a processor and a memory, the memory storing a computer program, the processor executing the computer program to implement the method described above.
[0016] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0017] Compared with the prior art, this application has the following non-obvious technical features: First, this application adopts an integrated mechanism of zero-shot error detection and generative correction, which intelligently fuses the zero-shot detection results based on probability bias with the generative correction results, and only corrects errors that are consistent between the two, effectively suppressing over-correction; Secondly, this application adopts a transferable multilingual training data construction method. Through a "random + simulation" dual-mode perturbation strategy (including word replacement, space addition and deletion), high-quality training samples can be generated with only the original text and basic dictionary, which is suitable for low-resource languages. Third, this application uses a large language model to calculate the deviation value of the predicted probability at the word level based on the error judgment of word-level probability, and aggregates it into word-level error score, which improves the fineness and accuracy of detection. Fourth, this application uses MiniHash and BK tree for corpus optimization and error simulation. It employs the MiniHash algorithm for sentence deduplication and uses the Burkhard Keller tree to replace similar words, thereby enhancing the diversity and authenticity of the training data. Fifth, this application adopts a threshold adaptive optimization mechanism, which dynamically optimizes the error judgment threshold by performing threshold search based on the Micro-F1 index on the validation set, thereby improving the robustness and cross-scenario adaptability of the system. Finally, this application implements an end-to-end supervised fine-tuning framework, which unifies error detection and correction tasks into a causal language modeling form, and improves the model's sensitivity and correction ability to multilingual spelling errors through instruction fine-tuning.
[0018] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention can significantly improve the accuracy of spelling correction in multiple languages. By integrating detection and correction results, the F1 score in low-resource languages such as Vietnamese is improved from 8.5% in the base model to 71.0%. 2. This invention can effectively suppress the tendency of the generative model to overcorrect. It adopts a "detection-generation" consistency verification mechanism to avoid unnecessary modifications to correct words, which conforms to the principle of "minimum modification". 3. The method used in this invention can better meet the needs of low-resource language scenarios, requiring only a small amount of original text and dictionary to generate training data, thus solving the problem of scarce annotation data for low-resource languages; 4. This invention improves the robustness and generalization ability of the system. Through threshold optimization, multi-strategy perturbation and data deduplication, it enhances the model's adaptability to different error types and language styles. 5. This invention supports downstream NLP task optimization, provides cleaner text input, and helps improve the performance of tasks such as machine translation, information retrieval, and text classification. 6. It has good portability and scalability: the methodology and training strategies can be easily adapted to other languages, and have strong engineering application value. Attached Figure Description
[0019] Figure 1 This is a flowchart of a multilingual spelling correction method based on large language modeling as described in this invention; Figure 2 This is a data example diagram of the large language model supervised fine-tuning task described in Embodiment 1 of the present invention; Figure 3 This is a flowchart of the zero-sample spelling error detection method described in Embodiment 1 of the present invention; Figure 4 This is an example input diagram of the zero-sample spelling error detection method model described in Embodiment 1 of the present invention; Figure 5 This is a diagram showing the Vietnamese spelling detection and correction test results of a multilingual spelling correction method based on a large language model, as described in Embodiment 1 of the present invention. Detailed Implementation
[0020] The present invention will now be described in detail with reference to the accompanying drawings; A multilingual spelling correction method based on large language modeling, such as Figure 1 As shown, the method includes the following steps: S1. First, a corpus dataset needs to be prepared, which includes original article data and original dictionary data. This corpus training data is generated using a transferable dataset construction method, applicable to various language scenarios, including low-resource languages.
[0021] This includes techniques such as sentence segmentation and cleaning of the original article data to construct a high-quality corpus dataset. Each of the statements ,Depend on It consists of 10 words. And each word ,Depend on It consists of lexical units. A lexical unit represents the smallest unit when the model understands and outputs text. At the same time, based on the original dictionary data, a table of valid word splitting and a table of word collocations are generated for subsequent error simulation.
[0022] S1.1, For the original article data, data preprocessing and cleaning are first performed to parse the acquired PDF, Word, and other formatted original article data into plain text sentences of appropriate length. This step references the method in the publicly available patent "A Training Data Generation System and Method Based on Uyghur Character Recognition," which realizes text information extraction and sentence segmentation for the multilingual original article data of this invention, completing the initial data cleaning. Subsequently, the MiniHash algorithm is used to remove duplicates based on sentence similarity to ensure the diversity and high quality of the corpus.
[0023] S1.2, regarding the original dictionary information, is a crucial basis for constructing the spelling error data. Based on the original dictionary data, two auxiliary tables are generated: a word legal splitting table and a word collocation table. The word legal splitting table records which individual words can be split into two legal words that both exist in the dictionary; the word collocation table records which two legal words can be combined to form a legal word that also exists in the dictionary.
[0024] S2, Based on the aforementioned corpus and dictionary data, this step employs the transferable perturbation generation strategy proposed in this invention to construct training data. For the corpus set... Each sentence itself serves as a spelling error label, and spelling error samples are obtained by perturbing the sentences using perturbation rules, ultimately resulting in spelling error correction sample pairs. The perturbation strategies include three types: word replacement, space addition, and space deletion. These three perturbation strategies are implemented using both random and simulated methods.
[0025] S2.1, Implement the word replacement strategy. For the random method, perform one of three operations on the selected word to create a spelling error: insert or delete a letter at a random position in the word, or randomly select a word from the dictionary to replace the current word. For the simulation method, search for similar words based on a Burkhard Keller tree constructed from the dictionary to replace the original word.
[0026] S2.2, Implement a space insertion strategy. For the random method, randomly insert spaces in the middle of words. For the simulation method, for words that can be retrieved by the word valid word splitting table, split them with spaces to obtain two valid words.
[0027] S2.3, Implement a space deletion strategy. For the random method, spaces between two words are randomly deleted. For the simulation method, every two words are checked against the word collocation table; if they exist, the space between them is deleted.
[0028] S3, the training data construction process proposed in steps S1 and S2 above is highly transferable and applicable to multilingual scenarios, including both high-resource and low-resource scenarios. Its core lies in: requiring only the original unlabeled text in the target language (used to construct the corpus). With a basic dictionary (used to build a valid split table and a word collocation table), large-scale, high-fidelity spell correction training samples can be generated without the need for manual annotation of error-correct sentence pairs.
[0029] S4. Next, supervised fine-tuning of the base large language model is performed. The training in this stage aims to improve the actual effect of the designed spelling error detection scheme (S5) and spelling error correction scheme (S6). Therefore, the training data is designed in the form of "input + label" and supervised fine-tuning of the large language model is performed using causal language modeling.
[0030] Supervised fine-tuning uses the negative log-likelihood function to calculate the loss during the training of a large language model, as shown in the following formula: in, It is the set of lexical instructions for the model, that is, the description of the target task and output requirements; The set of words in the sentence to be corrected is not included in the calculation of the target loss and gradient backpropagation. The lexical labels used to train large language models are sentences that are spelled perfectly. These are parameters of a large language model.
[0031] S5 proposes a novel zero-sample spelling error detection method that leverages the causal language capabilities of a large language model. This method focuses on lexical-level probability deviations in text sequences, calculating and identifying probabilistically anomalous lexical units using a large language model to detect spelling errors.
[0032] S5.1, specifically, firstly, construct a model input containing instruction information. Sentences to be corrected The input sequence includes a sequence of pseudo-labels, which provide the word sequence of the corrected sentence up to the current time step. This input sequence guides the large language model to predict the next word at the current position and outputs its corresponding probability distribution. Subsequently, based on the consistency between the predicted probability and the pseudo-labels, the probability deviation of the word is calculated using cross-entropy loss. : in It is a set of lexical terms for pseudo-tags.
[0033] For a word composed of multiple lexical units, the maximum value of the probability deviation of all lexical units corresponding to that word is extracted as the representative value of that word. When the representative value of a word exceeds a set threshold, the word is determined to have a spelling error. in It is a Boolean value; it is true if the number of words exceeds a set threshold, and false otherwise. To set a threshold.
[0034] S5.2 Therefore, by traversing the entire sentence to be corrected, the set of probability deviation values for each word can be obtained. The above judgments are then performed sequentially, and the resulting set of spelling error detection results is obtained. : S5.3 To further improve the accuracy of spelling error detection, this invention divides a portion of the dataset, searches for threshold parameters, and selects the optimal threshold parameter based on the Micro-F1 metric. This method effectively improves the overall performance and robustness of spelling error detection.
[0035] S6, in the spelling correction stage, adopts the same task format as supervised fine-tuning, uses the instruction to spell the sentence to be corrected as the model input, and generates the corrected sequence through autoregressive generation to perform spelling correction.
[0036] S6.1, specifically, given instruction prefix Sentences to be corrected The model generates the correction results as follows: : S6.2, by comparing the original sentence With generated sentences Extract all inconsistent words to form a preliminary error correction set. ,in This represents the set of words in the original sentence and the generated sentence that do not match in the same position.
[0037] S7, ultimately based on integrated detection results With the generation of error correction results To improve the reliability of the final output, the specific adoption strategy is as follows: only when a word is detected as an error (i.e., belongs to...) And its corresponding correction results exist in The word is only replaced when it is in the middle of the sentence. Final error correction result. Build it as follows: In summary, this invention proposes a multilingual spelling error correction method based on a large language model. By designing a zero-shot-capable error correction method and a corresponding large language model training enhancement scheme, it achieves multilingual spelling error detection and correction functions, providing a solid foundation for applications such as language learning and text cleaning. The above steps comprehensively utilize various machine learning techniques and natural language processing algorithms, aiming to improve the accuracy and versatility of spelling error correction. This invention effectively suppresses the over-correction tendency of the generative model while retaining the high recall characteristics of the detection module, thereby improving the overall accuracy and robustness of the spelling error correction system.
[0038] Example 1; A Vietnamese spelling error correction method based on large language modeling, such as Figure 1 As shown, this embodiment specifically illustrates the process through a Vietnamese spelling correction task, including the following steps: S1, Data Preparation and Preprocessing: First, Vietnamese language corpora were selected as the experimental subjects. The original article data came from the WanJuan-Vietnamese open-source dataset, which covers multiple fields such as history, politics, culture, real estate, shopping, and weather, and has strong corpus diversity. The original dictionary data came from the VietnameseDictionary open-source dataset.
[0039] For the original article data, sampling was performed proportionally according to different categories and domains, followed by sentence segmentation. To ensure data quality and diversity, the MiniHash-LSH method was used for fuzzy deduplication, with the hash permutation number set to 128 and the similarity threshold set to 0.9. During the sentence cleaning process, sentences with an excessive proportion of numbers or punctuation marks, short sentence lengths, or non-standard words and punctuation were removed. The final result was a corpus of approximately 2 million high-quality sentences.
[0040] Based on the original dictionary data, a legal word splitting table and a word collocation table were further constructed. The legal word splitting table records words that can be broken down into two legal words; the word collocation table records the combination relationships between words and their legal collocations.
[0041] S2, Construct training data based on the corpus data set: After preparing and preprocessing the corpus data, each sentence itself is used as a spelling error label. By setting perturbation rules, the sentences are perturbed to generate corresponding spelling error samples, thereby constructing training data sample pairs.
[0042] The perturbation rules include three strategies: word replacement, space addition, and space deletion. In this embodiment, all three strategies are implemented through a combination of randomization and simulation.
[0043] The random method refers to inserting or deleting letters at random positions in words according to a preset ratio, or randomly replacing words, in order to simulate spelling errors that may occur in natural scenarios.
[0044] The simulation method is based on retrieving candidate words with an edit distance of less than or equal to 2 from the target word using a Burkhard Keller tree constructed from dictionary data, and then replacing the original word, or splitting the target word using a valid word splitting table, or deleting the space between two adjacent words if they exist in the word collocation table.
[0045] S3, supervised fine-tuning of large language models: To ensure the model's generalization ability, the training data samples are divided into training, validation, and test sets according to a certain ratio before use, in order to support model training, parameter tuning, and performance evaluation.
[0046] In this embodiment, the training set is used as the supervised fine-tuning task dataset input to the model. The model input consists of a description of the target task and output requirements, along with the sentence to be corrected. This guides the large language model to learn to output the correct correction result given incorrect input. Examples of model input and spell correction labels in this embodiment are shown below. Figure 2 As shown.
[0047] During training, the model parameters are optimized by comparing the differences between the model output and the spelling correction labels, participating in the calculation of the model's target loss and gradient backpropagation. This enables the large language model to master the knowledge and capabilities required for spelling correction tasks. In this embodiment, the supervised fine-tuning process allows the model to learn the linguistic features of the Vietnamese corpus and enhances its ability to correct various spelling error scenarios.
[0048] S4. A zero-shot spelling error detection method is designed based on the causal language capabilities of a large language model: Building upon the fact that supervised fine-tuning of large language models already possesses basic spelling correction capabilities, this invention proposes a zero-sample spelling error detection method based on causal language modeling capabilities to address the issues of illusion and over-correction inherent in generative error correction processes. Figure 3 As shown.
[0049] In this embodiment, an input scheme of "instruction + sentence to be corrected + pseudo-label" is constructed, such as... Figure 4As shown, the probability of each lexical unit is predicted using a large language model, and the probability deviation value at the lexical level is calculated between the lexical unit and the pseudo-label using cross-entropy loss. A larger probability deviation value indicates that there is room for substitution of the lexical unit at that position, thus suggesting a potential spelling error. In this embodiment, for Vietnamese words composed of multiple lexical units, the maximum value among the probability deviation values of the corresponding lexical units is extracted as the error value for that word, and compared with a preset threshold. If the value exceeds the threshold, the word is determined to be a spelling error.
[0050] The threshold is determined in this embodiment as follows: based on the validation set corpus data, threshold parameters are searched, the consistency between the detection results and the manually labeled results is calculated under different candidate thresholds, the Micro-F1 index is used to evaluate each candidate threshold, and finally the threshold that makes the Micro-F1 index optimal is selected as the best threshold for spelling error detection.
[0051] In the embodiment, the zero-sample spelling error detection method improves the F1 score from 8.5% to 71.0% in the Vietnamese spelling error detection task compared to the detection results of the pedestal model, significantly improving the detection performance and verifying the effectiveness of the method of the present invention.
[0052] S5, generates preliminary spell correction results using a generative method: After completing the spelling error detection, this embodiment further generates preliminary spelling correction results using a generative method. Specifically, following the task format of the supervised fine-tuning stage, the instruction information and the sentence to be corrected are concatenated to form the input sequence of the large language model. The model is then guided to predict the lexical units at each position in the sentence sequentially according to an autoregressive generation method, thereby generating a complete spelling-corrected sentence sequence.
[0053] The generated corrected sentences are matched word by word with the original sentences to be corrected. For words that differ in position, they are extracted to form a preliminary set of spell correction results.
[0054] In the Vietnamese language implementation, the preliminary spelling correction results generated using a large language model that has undergone supervised fine-tuning have been able to effectively detect spelling errors in Vietnamese sentences, with an F1 score of 64.6%, demonstrating the effectiveness of supervised fine-tuning in improving error correction accuracy.
[0055] S6, Integrate the spelling error detection result set with the preliminary error correction set: To further improve the accuracy and reliability of error correction, this embodiment integrates the zero-sample spelling error detection result set obtained in step S4 with the preliminary spelling correction result set generated in step S5. Specifically, a word is replaced only when it is both identified as an error by the zero-sample detection method and has a corresponding corrected word in the generative correction results, thus constructing the final error correction result set. This integration strategy effectively suppresses excessive modification behavior of the large language model during the error correction process while retaining the output of the detection module with high recall, ensuring the accuracy of error correction.
[0056] It is worth noting that the above-mentioned integrated strategy for error detection and result generation is universal and can be applied to any spelling correction system with zero-sample detection and generation capabilities, and is not limited to the specific training method described in this invention.
[0057] In the Vietnamese implementation, the specific performance evaluation results are as follows: Figure 5 As shown in the figure, the explanations of the multilingual spelling correction methods based on large language models are as follows: The base model is the evaluation benchmark, that is, the spelling error detection and correction results achieved by the base large language model through generative methods. The zero-shot detection method is the zero-shot spelling error detection method proposed in this invention. The ensemble method represents the final corrected text obtained by integrating the error correction results generated by the large language model with the detection results of the zero-shot spelling error detection method. Supervised fine-tuning represents the supervised fine-tuning task performed on the base large language model.
[0058] The final error correction results processed using the above-described integrated method show a significant improvement in overall performance for both spelling error identification and correction compared to using supervised fine-tuning generation methods or zero-shot detection methods alone. This verifies the effectiveness and robustness of the integrated strategy of this invention in multilingual spelling error correction tasks.
[0059] The above technical solutions only embody the preferred technical solutions of the present invention. Any modifications that may be made by those skilled in the art to certain parts thereof embody the principles of the present invention and fall within the protection scope of the present invention.
Claims
1. A multilingual spelling correction method based on large language modeling, characterized in that, The method includes the following steps: Step 1: Prepare the original article data and the original dictionary data; Step 2: Construct training data based on the corpus dataset, and generate spelling error sample pairs through a perturbation strategy; Step 3: Use the spelling error samples to perform supervised fine-tuning of the large language model; Step four: Based on the supervised fine-tuned large language model, perform an integrated process of error detection and result generation to correct the spelling of the sentence to be corrected and obtain the final correction result.
2. The method according to claim 1, characterized in that, The perturbation strategy includes a random method and a simulation method. The simulation method generates error samples based on Burkhard Keller trees or split tables and combination tables.
3. The method according to claim 1, characterized in that, The integration process of error detection and result generation is as follows: First, obtain the set of spelling error detection results based on the zero-shot detection method; Secondly, obtain a preliminary set of error correction results generated by autoregression of the input sentence based on the generative language model; Finally, the detection result set is integrated with the preliminary error correction result set, and only words that are detected as errors and have correction results are replaced, and the final error correction result is output.
4. The method according to claim 3, characterized in that, The zero-shot detection method identifies erroneous words by calculating the probability deviation value of each word in the input sentence and comparing the maximum deviation value corresponding to each word with a preset threshold.
5. The method according to claim 4, characterized in that, The probability deviation value of the term is calculated using cross-entropy loss, and the calculation formula is as follows: In the formula, This represents the probability deviation value of the lexical unit. For instruction information, Sentences to be corrected A set of lexical terms for pseudo-tags. These are parameters of a large language model.
6. The method according to claim 4, characterized in that, The preset threshold is the optimal value selected based on the Micro-F1 metric after parameter search on the validation set.
7. The method according to claim 1, characterized in that, The method follows the principle of minimum modification during spell correction, which means replacing only the words that are judged to be incorrect.
8. The method according to claim 2, characterized in that, The method is applicable to multilingual spelling correction tasks, including low-resource languages.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The device contains a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 8.