Text error correction method and device, equipment and storage medium

By using large language model and sliding window technology to correct text errors in complex language environments, the problem that the existing technology cannot effectively correct errors is solved, and high accuracy and personalized error correction are achieved.

CN119443087APending Publication Date: 2025-02-14CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 0 Cites 10 Cited by

Patent Information

Application Number
CN202411515290.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The prior art cannot effectively perform text error correction in complex or changing language environments, resulting in reduced error correction accuracy.

Method used

The large language model is used to identify error probability for error correction text, and combined with preset hot word weight table and sliding window technology, the replacement vocabulary that most satisfyes the context is selected from the replacement candidate vocabulary for error correction.

Benefits of technology

Effective error correction of text in complex or changing language environments, improve error correction accuracy, and customize personalized error correction methods according to user's language preferences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119443087A_ABST
    Figure CN119443087A_ABST
Patent Text Reader

Abstract

The invention discloses a text error correction method and device, equipment and a storage medium, and relates to the technical field of artificial intelligence, and the text error correction method comprises the steps that an obtained text to be corrected is input into a large language model, error probability recognition is conducted on each vocabulary in the text to be corrected based on the large language model, and the error probability of each vocabulary in the text to be corrected is obtained; error vocabularies in the text to be corrected are obtained, and the large language model is obtained by training a language model based on a professional field corpus; matching replacement candidate vocabularies of the wrong vocabularies from a preset hot word weight table, wherein the preset hot word weight table is created based on daily common words, industry terms and user feedback data of the user; based on a large language model and a preset sliding window, screening target replacement vocabularies which most meet the context of the error vocabularies from the replacement candidate vocabularies; and performing error correction on the to-be-corrected text by using the target replacement vocabulary, so that effective error correction on the to-be-corrected text in a complex or changing language environment is realized, and the accuracy of text error correction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a text error correction method, apparatus, device and storage medium. Background Art

[0002] Artificial intelligence applied to text correction can handle typos and grammatical errors, as well as improper use of punctuation and incorrect word collocation, thereby bringing users a more convenient and efficient text processing experience.

[0003] At present, artificial intelligence in the field of text error correction mainly relies on static rules or preset error correction models. However, static rules or error correction models lack the ability to dynamically adjust to specific global contexts or user habits. As a result, the current error correction models or rules cannot effectively correct text in complex or changing language environments, thereby reducing the accuracy of text error correction.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of this application is to provide a text correction method, which aims to solve the technical problem that commonly used technical solutions cannot effectively correct text in complex or changing language environments, thereby reducing the accuracy of text correction.

[0006] To achieve the above objectives, the present application proposes a text error correction method, the method comprising:

[0007] Inputting the acquired text to be corrected into a large language model, performing error probability identification on each word in the text to be corrected based on the large language model, and obtaining the erroneous words in the text to be corrected, wherein the large language model is obtained by training the language model based on professional domain corpus;

[0008] Matching candidate replacement words for the wrong words from a preset hot word weight table, wherein the preset hot word weight table is created based on the user's daily words, industry terms, and user feedback data;

[0009] Based on the large language model and the preset sliding window, selecting a target replacement word that best satisfies the context of the erroneous word from the replacement candidate words;

[0010] The target replacement vocabulary is used to correct the text to be corrected.

[0011] In one embodiment, the step of selecting a target replacement vocabulary that best satisfies the context of the erroneous vocabulary from the replacement candidate vocabulary based on the large language model and the preset sliding window includes:

[0012] Determine the current error correction section of the text to be corrected within a preset sliding window;

[0013] Selecting hot words to be replaced corresponding to the erroneous words in the current error correction paragraph from the candidate replacement words;

[0014] Determine the replacement probability of each hot word combination composed of the hot words to be replaced based on the large language model;

[0015] The target replacement hot word in the hot word combination with the maximum replacement probability is determined as the target replacement word that best satisfies the wrong word context.

[0016] In one embodiment, the step of determining the replacement probability of each hot word combination composed of the hot words to be replaced based on the large language model includes:

[0017] Based on the large language model and according to the semantics of the current error correction paragraph, distribution probability processing is performed on each of the hot words to be replaced one by one to determine the semantic fit probability of the hot word combination composed of each of the hot words to be replaced;

[0018] Obtaining the weight of each of the hot words to be replaced from the preset hot word weight table;

[0019] The semantic fit probabilities are weighted based on the weights to determine the replacement probabilities of the hot word combinations.

[0020] In one embodiment, the step of performing error probability identification on each word in the text to be corrected based on the large language model to obtain the erroneous words in the text to be corrected includes:

[0021] Performing context analysis on each word in the text to be corrected based on the large language model to determine a probability score that the word belongs to a corresponding position;

[0022] Based on the large language model, words whose probability model is less than a preset probability threshold are screened out from the words to obtain incorrect words in the error correction text.

[0023] In one embodiment, the step of matching the replacement candidate vocabulary of the wrong vocabulary from the preset hot word weight table includes:

[0024] Convert the wrong words into phonetic expressions;

[0025] Obtaining homophone hot words with the same pinyin expression as the said hot word weight table from a preset hot word weight table;

[0026] Determine the edit distance between the wrong word and each hot word in the preset hot word weight table;

[0027] Determining the semantic similarity between the wrong word and each of the hot words;

[0028] Based on the feature weights of the homophonic hot words, screenwriter distance and semantic similarity, a comprehensive score is given to each of the hot words;

[0029] A replacement candidate vocabulary is matched to the incorrect vocabulary based on the comprehensive score.

[0030] In one embodiment, the step of acquiring the large language model includes:

[0031] Conduct vertical analysis on professional terms and professional texts in professional fields to obtain professional corpus in the professional fields;

[0032] Performing unsupervised pre-training on the language model based on the professional corpus to obtain an initial training language model;

[0033] The knowledge text in the professional field is integrated based on the preset RAG to optimize the initial training language model to obtain a large language model.

[0034] In addition, to achieve the above purpose, the present application also proposes a text error correction device, which includes:

[0035] An error recognition module is used to input the acquired text to be corrected into a large language model, perform error probability recognition on each word in the text to be corrected based on the large language model, and obtain the erroneous words in the text to be corrected, wherein the large language model is obtained by training the language model based on professional domain corpus;

[0036] A matching module, used to match candidate replacement words of the wrong words from a preset hot word weight table, wherein the preset hot word weight table is created based on the user's daily words, industry terms and user feedback data;

[0037] A screening module, configured to screen a target replacement vocabulary that best satisfies the context of the erroneous vocabulary from the replacement candidate vocabulary based on the large language model and a preset sliding window;

[0038] A replacement module is used to use the target replacement vocabulary to correct the text to be corrected.

[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes a text correction device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the text correction method described above.

[0040] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the text error correction method described above are implemented.

[0041] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the text error correction method described above are implemented.

[0042] One or more technical solutions proposed in this application have at least the following technical effects:

[0043] The large language model obtained by training the speech model with the corpus in the professional field as sample data is used to identify the error probability of the text to be corrected input by the user, and determine the incorrect vocabulary of each word in the text to be corrected. Since the large language model is obtained by training the corpus in the professional field, the use of the large language model for error correction can avoid the failure to recognize professional terms, or the misidentification of uncommon proprietary words as incorrect words, and then accurately identify the incorrect words from the text to be corrected. The preset hot word weight table representing the user's word usage habits is created in advance based on the user's daily language, professional terms and user feedback data. After the incorrect word is identified, the preset hot word weight table is used to identify the incorrect word. The candidate words for replacing the wrong words are matched in the word weight table, so that the hot words selected to replace the wrong words are the user's accustomed expressions, thereby realizing a personalized error correction method customized according to the user's word preference, and in order to make the screened candidate words for replacement more consistent with the contextual semantics of the text to be corrected, therefore, after screening out the candidate words for replacement, it is also necessary to use a large language model and a preset sliding window to select the target replacement words that best meet the semantics, so as to use the target replacement words to replace the corresponding wrong words, and realize the correction of the text to be corrected. Therefore, it is possible to realize effective correction of the text to be corrected in a complex or changing language environment, and improve the accuracy of text correction. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0046] Figure 1 A flowchart of the first embodiment of the text error correction method of the present application is provided;

[0047] Figure 2 A schematic diagram of the error correction principle provided for Example 1 of the text error correction method of this application;

[0048] Figure 3 A flowchart of the second embodiment of the text error correction method of this application is provided;

[0049] Figure 4 A flowchart of vocabulary replacement provided for the second embodiment of the text error correction method of the present application;

[0050] Figure 5 A flowchart of the third embodiment of the text error correction method of this application is provided;

[0051] Figure 6 A flowchart of the fourth embodiment of the text error correction method of the present application is provided;

[0052] Figure 7 A flowchart of Embodiment 5 of the text error correction method of this application is provided;

[0053] Figure 8 This is a schematic diagram of the module structure of the text error correction device of the embodiment of the present application;

[0054] Fig. 9 It is a schematic diagram of the device structure of the hardware operating environment involved in the text error correction method in the embodiment of the present application.

[0055] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0056] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0057] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0058] The main solution of the embodiment of the present application is: the error correction server inputs the acquired text to be corrected into a large language model, and identifies the error probability of each word in the text to be corrected based on the large language model to obtain the erroneous words in the text to be corrected, and the large language model is obtained after training the language model based on professional field corpus; the replacement candidate words of the erroneous words are matched from a preset hot word weight table, and the preset hot word weight table is created based on the user's daily words, industry terms and user feedback data; based on the large language model and the preset sliding window, the target replacement word that best meets the context of the erroneous word is selected from the replacement candidate words; and the text to be corrected is corrected using the target replacement word.

[0059] In this embodiment, for ease of description, the following description is made with the error correction server as the execution entity.

[0060] The existing technologies mainly rely on static rules or preset error correction models. However, static rules or error correction models lack the ability to dynamically adjust to specific global contexts or user habits. Therefore, the current error correction models or rules cannot effectively correct text errors in complex or changing language environments, thereby reducing the accuracy of text error correction.

[0061] The present application provides a solution, which uses a large language model obtained by training a speech model using corpus in a professional field as sample data to identify the error probability of the text to be corrected input by the user, and determines the incorrect vocabulary of each word in the text to be corrected. Since the large language model is obtained by training based on corpus in a professional field, using the large language model for error correction can avoid the failure to recognize professional terms, or misidentifying uncommon proprietary words as incorrect words, and then accurately identifying incorrect words from the text to be corrected. A preset hot word weight table representing the user's word usage habits is created in advance based on the user's daily language, professional terms and user feedback data. After the incorrect word is identified , match the replacement candidate words of the wrong words from the preset hot word weight table, so that the hot word selected to replace the wrong word is the user's accustomed expression, thereby realizing a personalized correction method customized according to the user's word preference, and in order to make the screened replacement candidate words more consistent with the contextual semantics of the text to be corrected, therefore, after screening out the replacement candidate words, it is also necessary to use a large language model and a preset sliding window to select the target replacement word that best meets the semantics, so as to use the target replacement word to replace the corresponding wrong word, and realize the correction of the text to be corrected. Therefore, it is possible to realize effective correction of the text to be corrected in a complex or changing language environment, and improve the accuracy of text correction.

[0062] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, an error correction server, etc. The following takes the error correction server as an example to illustrate this embodiment and the following embodiments.

[0063] Based on this, the present application embodiment provides a text error correction method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the text error correction method of this application.

[0064] In this embodiment, the text error correction method includes steps S10 to S40:

[0065] Step S10, inputting the acquired text to be corrected into a large language model, performing error probability recognition on each word in the text to be corrected based on the large language model, and obtaining the erroneous words in the text to be corrected, wherein the large language model is obtained by training the language model based on professional domain corpus;

[0066] It should be noted that the text to be corrected can be a text that needs to be checked and corrected for typos, words and / or grammar, and can also be a text converted from speech. Among them, the text to be corrected can be a professional article, paper, novel or report, etc., without specific limitation. The large language model can be a kind of large model, a natural language processing model with large-scale parameters and complex computing structure, which can understand and generate human language by training a large amount of data through deep learning technology. The professional field can be a professional field such as medical, legal or technical. The professional field corpus can be professional terms in the professional field and the usage of professional terms.

[0067] It can be understood that in order to enable the model used for error correction to accurately identify professional terms and users of professional terms in professional fields, and to avoid the inability to correctly identify professional terms and the usage of professional terms when identifying erroneous words in the text to be corrected, a large language model obtained by training the language model based on professional field corpus is used to identify the error probability of the text to be corrected input by the user, so as to identify words with higher error probability according to the semantics of the text to be corrected, thereby improving the accuracy of identifying erroneous words.

[0068] Step S20, matching candidate replacement words of the wrong word from a preset hot word weight table, wherein the preset hot word weight table is created based on the user's daily words, industry terms and user feedback data;

[0069] It should be noted that the hot words in the preset hot word weight table include the user's idioms and professional terms, wherein the idioms include professional terms that the user is accustomed to using. The replacement candidate vocabulary can be a hot word that can replace the wrong vocabulary, and the replacement candidate vocabulary can include one or more, which is determined according to the actual situation of the wrong vocabulary. Everyday words can be the user's idioms when speaking, or they can be idioms when writing texts such as articles or papers. Professional terms can be proper nouns in the industry to which the user belongs, or names commonly used in the industry. For example, in the medical field: cerebral infarction is also called stroke, Alzheimer's disease is often called senile dementia, etc.; for example, in the legal field: imaginary competition is also called imaginary multiple crimes, etc. User feedback data can be recommended words or suggested words selected by the user in history, etc.

[0070] It is understandable that in order to make the hot words replacing the wrong words conform to the user's idioms, a hot word list containing the user's idioms or words is created in advance based on the user's daily use, industry terms and user feedback data. Because the frequency of users' idioms or words is different in different language scenarios, in order to make the hot words replacing the wrong words accurately replaced with the user's idioms according to the scenario, after creating the hot word list, the hot words in the hot word list can also be annotated with weights to obtain a preset hot word weight table, and then the replacement candidate words for the wrong words are matched from the preset hot word weight table to achieve a more personalized text correction experience, so that the corrected text is more in line with the corresponding user's language style.

[0071] In a specific implementation, creating a preset hot word weight table can specifically include: extracting frequently used professional terms and keywords from the user's frequently used documents, industry reports or user-specified content to construct a preliminary hot word table. Among them, extracting frequently used professional terms and keywords can be to use natural language processing tools such as TF-IDF analysis, word frequency statistics and other methods to identify and select hot words, that is, frequently used professional terms and keywords; then set an initial weight for each hot word, in order to provide a standardized starting point for subsequent adjustments, therefore, the initial weight can be set to 1.0 by default; when the user uses the hot word weight table for text editing or error correction, the user can provide feedback on the replacement of a specific hot word. Specifically, it can be done in the form of clicking to accept or modify the suggestion, or / and setting an interface that allows the user to directly evaluate and suggest the use of the hot word, and directly obtain user feedback data such as user evaluation and suggestions; after obtaining the user feedback data, the weight of the hot word is automatically adjusted according to the user's feedback. For example, if the user frequently rejects the suggested replacement of a hot word, the weight of the word is lowered, and if the user accepts a suggestion, the weight of the word can be slightly increased.

[0072] The specific implementation method of adjusting the hot word weight may be:

[0073] When the user modifies the hotword to be replaced, the weight of the hotword manually selected by the user increases by 0.1; the weight of the hotword originally calculated by the system decreases by 0.1. Ensure that the weight update remains within a reasonable range, for example, the weight can be set between 0.5 and 1.5.

[0074] In order to ensure that the preset hot word weight table can reflect the current user needs and industry trends, it is necessary to regularly evaluate the hot word table and weights. Based on the evaluation results, it may be necessary to add new hot words or remove no longer relevant words from the table in order to more accurately learn and adapt to the user's language habits and preferences, improve the personalization of text processing and user satisfaction, and the dynamic management strategy of hot word weights also enhances the flexibility and responsiveness of the error correction server, enabling it to adapt to changes in user needs in a timely manner.

[0075] Step S30, based on the large language model and the preset sliding window, selecting a target replacement word that best meets the context of the erroneous word from the replacement candidate words;

[0076] It should be noted that the preset sliding window may be the window of the paragraph that needs to be processed currently, that is, the preset sliding window may mark the context range of the vocabulary that needs to be corrected currently, so as to determine the erroneous vocabulary that needs to be corrected at the current moment.

[0077] It can be understood that since it is not necessary to analyze the semantics of the entire text to be corrected to determine whether the candidate replacement vocabulary conforms to the semantics of the text to be corrected, and the semantics of the context of the corresponding erroneous vocabulary can be used to determine whether the candidate replacement vocabulary conforms to the semantics of the text to be corrected. Therefore, by presetting the sliding window, the data size of the text content that needs to be analyzed each time can be reduced, so that when the large language model analyzes the candidate replacement vocabulary, it can reduce the text content that needs to be analyzed while ensuring that the analysis of the candidate replacement vocabulary conforms to the semantics of the text to be corrected, thereby improving the processing efficiency of the large language model.

[0078] In a specific implementation, before using a preset sliding window to calibrate the context range of the current vocabulary that needs error correction, it is necessary to predetermine the size of the preset sliding window, that is, determine the size X of the sliding window, which usually depends on the average sentence length of the text or the optimal context size. For example, X=3 or 5 can be selected, which is sufficient to provide sufficient context while maintaining the manageability of the calculation.

[0079] Step S40: Correct the text to be corrected using the target replacement vocabulary.

[0080] It can be understood that since the target replacement vocabulary is the vocabulary that best matches the semantics of the text to be corrected and the user's word usage habits selected from the preset hot word weight table through a large language model, using the target replacement vocabulary to correct the text to be corrected can achieve effective correction of the text to be corrected in a complex or changing language environment, thereby improving the accuracy of text correction.

[0081] In the specific implementation, refer to Figure 2, since the LLM (Large Language Model) model can perform well in professional fields and can accurately express probability information, it provides a basis for subsequent vocabulary matching and replacement. First, the corpus of the professional field and the general LLM are trained to build an LLM model with optimized probability expression. Then initialize the hot word weight table of each user, with an initial weight of 1.0, and continuously update the weight table according to the hot word table provided by the user and user feedback. Enable the error correction server to dynamically adjust the weight of each hot word to reflect the current user's focus and needs. After making these preliminary preparations, the user inputs the LLM after the probability expression optimization to perform the probability annotation of each word and obtain the probability annotation result of the word. By screening out words with lower probabilities, a potential error vocabulary is formed to identify possible erroneous inputs. Then, the hot word table and the potential error vocabulary table are matched to generate a vocabulary replacement candidate table. Finally, through the sliding window set to X, X words to be replaced are taken in turn to generate all possible combinations, and the probability of each combination is calculated using LLM. The probability of the combination is weighted in combination with the hot word weight table, and the combination with the largest probability is output as the output of the current window. This process is repeated until all the words to be replaced are calculated, and finally the optimized output result is generated.

[0082] The present embodiment provides a text error correction method, which uses a large language model obtained by training a speech model using corpus in a professional field as sample data to perform error probability recognition on a text to be corrected input by a user, and determines the incorrect vocabulary of each word in the text to be corrected. Since the large language model is obtained by training based on corpus in a professional field, using the large language model for error correction can avoid the failure to recognize professional terms, or misidentifying uncommon proprietary words as incorrect words, and then accurately identifying incorrect words from the text to be corrected. A preset hot word weight table representing the user's word usage habits is created in advance based on the user's daily language, professional terms, and user feedback data. When an incorrect word is recognized, After the collection, the candidate words for replacing the wrong words are matched from the preset hot word weight table, so that the hot words selected to replace the wrong words are the user's accustomed expressions, thereby realizing a personalized correction method customized according to the user's word preference, and in order to make the screened candidate words for replacement more consistent with the contextual semantics of the text to be corrected, therefore, after the candidate words for replacement are screened, it is also necessary to use a large language model and a preset sliding window to select the target replacement words that best meet the semantics, so as to use the target replacement words to replace the corresponding wrong words, and realize the correction of the text to be corrected. Therefore, it is possible to realize effective correction of the text to be corrected in a complex or changing language environment, and improve the accuracy of text correction.

[0083] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , step S30 also includes steps S31 to S34:

[0084] Step S31, determining the current error correction paragraph of the text to be corrected within a preset sliding window;

[0085] Step S32, selecting hot words to be replaced corresponding to the erroneous words in the current error correction paragraph from the candidate replacement words;

[0086] Step S33, determining the replacement probability of each hot word combination composed of the hot words to be replaced based on the large language model;

[0087] Step S34, determining the target replacement hot word in the hot word combination with the maximum replacement probability as the target replacement word that best satisfies the wrong word context.

[0088] It should be noted that the current error correction paragraph can be a paragraph in the text to be corrected that is currently marked by the preset sliding window. The hot word to be replaced can be a hot word in the candidate vocabulary that corresponds to the wrong word in the current error correction paragraph. The hot word combination can be a combination of hot words to be replaced corresponding to different wrong words. For example, there are 3 wrong words in the current error correction paragraph, and each word corresponds to 3 hot words to be replaced, so there are 27 hot word combinations. The replacement probability can be understood as determining the replacement probability according to the degree to which the semantics of the current error correction paragraph are satisfied, that is, the higher the degree to which the hot word combination satisfies the semantics of the current error correction paragraph, the higher the replacement probability.

[0089] It is understandable that since the candidate replacement words are hot words that can replace the wrong words, they may not completely conform to the semantics of the text to be corrected. In order to screen the hot words corresponding to the wrong words in the previous correction paragraph from the hot words that replace the wrong words (replacement candidate words), and determine the target replacement words that best conform to the semantics of the text to be corrected from the hot words to be replaced, therefore, after determining the hot words to be replaced, it is necessary to determine the replacement probability of the hot word combination composed of the hot words to be replaced according to the large language model, so as to facilitate the target replacement words in the hot word combination that best conform to the context of the wrong words, so as to achieve effective correction of the text to be corrected in a complex or changing language environment and improve the accuracy of text correction.

[0090] In the specific implementation, for each window position, the hot words that may correspond to each word to be replaced in the current window are extracted from the hot word table, and all possible hot word combinations are generated. For example, if there are three words to be replaced in the window, and each word has three possible hot word replacement options, the number of combinations generated is 3×3×3=27 combinations; then the entire combination is input into the LLM as a sequence, and the trained LLM is used to calculate the probability of each combination appearing as a whole in a given context, and then the probability of each combination is weighted using the hot word weight table, and the hot word combination with the highest weighted probability is selected as the replacement result of the window, thereby ensuring that the selected replacement word is not only semantically appropriate, but also in line with the user's preferences, and the preset sliding window is slid forward to the position of the next window, and the above process is repeated until the entire text is processed, and the error correction of the entire text to be corrected is completed.

[0091] Furthermore, step S33 also includes:

[0092] Based on the large language model and according to the semantics of the current error correction paragraph, distribution probability processing is performed on each of the hot words to be replaced one by one to determine the semantic fit probability of the hot word combination composed of each of the hot words to be replaced;

[0093] Obtaining the weight of each of the hot words to be replaced from the preset hot word weight table;

[0094] The semantic fit probabilities are weighted based on the weights to determine the replacement probabilities of the hot word combinations.

[0095] It should be noted that the semantic fit probability can be the probability of replacing the corresponding wrong word with a hot word determined according to the semantic fit of the current error correction paragraph. The replacement probability is the probability of replacing the corresponding wrong word determined according to the user's usage habits after ensuring semantic fit.

[0096] It can be understood that in order to achieve the goal of making the hot words finally selected when correcting the text to be corrected not only satisfy the semantics of the correction paragraph, but also ensure personalized correction based on the user's usage habits, therefore, after determining whether the semantic fit probability of each hot word combination representation is consistent with the semantic degree of the current correction paragraph, it is also necessary to weight the semantic fit probability according to the weight of the user's habitual expressions recorded in the preset hot word table, so as to determine the target replacement vocabulary that best satisfies the semantics of the current correction paragraph and also satisfies the user's usage habits.

[0097] In the specific implementation, refer to Figure 4 , after setting the sliding window size and generating the hot layer combination of the current vocabulary to be replaced according to the sliding window, suppose we have a sequence S, which contains a series of hot words to be replaced [w1, w2, ..., w n ], each w iis the result of replacement in a given context and possible hot word selection. Let the semantic fit probability of sequence S be P(S). Since the semantic fit probability P(S) of the entire sequence can be defined in the form of a product, where the probability of occurrence of each word is calculated given all the previously replaced hot words, the calculation formula for the semantic fit probability can be:

[0098] P(S)=P(w1)×P(w2|w1)×P(w3|w1,w2)×…×P(w n |w1,w2,…,w n-1 )

[0099] Among them, here P(w i |w1,w2,…,w i-1 ) represents the conditional probability of the i-th hot word under the condition that the first i-1 hot words are known.

[0100] Since the LLM model can predict the probability distribution of the next word based on the previous word order (i.e., context). The LLM model can accept the first i-1 words of the sequence as input, and then output the probability distribution for predicting the i-th word. That is, from the beginning to the end of the hot word to be replaced, the current hot words are input step by step, and the conditional probability of the next hot word is calculated. This step-by-step process involves adding each hot word to the current input sequence and requesting the model to update its probability output to determine the semantic fit probability of each sequence. The hot word weight table is then used to weight the probability of each combination. The weight can be adjusted based on the acceptance rate or rejection rate of the hot word in the user's historical data. The formula for calculating the weighted probability is:

[0101] Among them, P original is the original probability calculated by LLM, w i is the weight of the i-th hot word in the combination.

[0102] For each window, the hot word combination with the highest weighted probability is selected as the replacement result of the window. This ensures that the selected replacement words are not only semantically appropriate, but also in line with the user's preferences. Through step-by-step replacement, an optimized replacement text output is finally generated.

[0103] It should be noted that the sliding window-based replacement strategy can make full use of contextual information and effectively improve the overall quality and personalization of the text through the deep learning ability of LLM and the personalized adjustment of hot word weights.

[0104] Based on the first and second embodiments of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be described in detail later. Figure 5 , step S10 also includes steps S11 to S12:

[0105] Step S11, performing context analysis on each word in the text to be corrected based on the large language model to determine a probability score of the word belonging to a corresponding position;

[0106] Step S12, based on the large language model, filter out words whose probability model is less than a preset probability threshold from the words to obtain the wrong words in the error correction text.

[0107] It should be noted that the probability score may be the probability that each word should appear in the corresponding text position. The preset probability threshold may be the error probability for determining the need for error correction.

[0108] It is understandable that the accuracy and reliability of predictions are improved by using large language models (LLMs) trained with big data for vocabulary probability prediction. This makes vocabulary selection not only based on statistical data, but also based on a deep understanding of context and language structure, significantly improving the semantic coherence and naturalness of text processing.

[0109] It is understandable that since the text to be corrected is a highly professional text, the large language model can accurately identify the professional terms in the text to be corrected, and can also accurately identify the user's idioms. Therefore, using the large language model to identify the probability hot score of each word in the text to be corrected can improve the accuracy of the probability score, thereby improving the accuracy of the large language model in identifying erroneous words in the text to be corrected.

[0110] It can be understood that since the large language model performs probability scoring on the words that currently need to be scored based on the context of the text, using the large language model to identify incorrect words in the text to be corrected can accurately identify incorrect words from complex or changing texts.

[0111] In the specific implementation, the LLM model, which has been optimized with a large amount of professional domain corpus data, processes the text to be corrected input by the user and generates a probability score for each word in the text. This probability reflects the possibility of each word appearing in a given context. The probability score of each word is evaluated according to a pre-set probability threshold, and those words below the threshold are marked as potential error words. These words are considered unlikely to be correct in the current context, possibly due to spelling errors, grammatical errors, or inappropriate word use. All marked low-probability words can also be collected into a potential error vocabulary table. This table will be used in the subsequent error correction process, including vocabulary replacement and user feedback loops.

[0112] The use of large language models can effectively identify and mark words that may be incorrect, providing data support for further error correction operations. By combining the powerful language understanding capabilities of large language models, error detection is made more accurate and efficient.

[0113] The preset probability threshold may be determined by a user to define a probability threshold for identifying potential erroneous words. Typically, this threshold is set at the lower 10% or a specific percentile of the model output probability, and this threshold may be adjusted according to actual needs and model performance.

[0114] Based on the above embodiments of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be described in detail later. Figure 6 , step S20 also includes steps S21 to S26:

[0115] Step S21, converting the erroneous words into pinyin expressions;

[0116] Step S22, obtaining homophone hot words with the same pinyin expression as the hot word weight table;

[0117] Step S23, determining the edit distance between the wrong word and each hot word in the preset hot word weight table;

[0118] Step S24, determining the semantic similarity between the wrong word and each of the hot words;

[0119] Step S25, comprehensively scoring each of the hot words based on the feature weights of the homophonic hot words, screenwriter distance, and semantic similarity;

[0120] Step S26, matching candidate replacement words for the incorrect words based on the comprehensive score.

[0121] It should be noted that the pinyin expression can be the conversion of the wrong word into pinyin. The homophone hot word can be a hot word with the same pinyin as the wrong word. The edit distance can be an algorithm to measure the degree of difference between two strings, that is, to calculate the minimum number of single-character editing operations required to convert one string into another. The allowed editing operations include replacement, insertion, and deletion. Semantic similarity evaluates the similarity of words, phrases, and sentences in the text by calculating the semantic relationship between them. It not only takes into account the word form and syntactic structure, but also involves the semantic relationship and contextual information of the words.

[0122] It can be understood that by integrating multiple factors such as pinyin features, edit distance and semantic similarity, the vocabulary matching algorithm can accurately identify and match suitable hot words to replace potential erroneous words, thereby improving the accuracy of replacement and the overall readability of the text.

[0123] In the specific implementation, the hot word list and the potential wrong words marked from the text will be used for multi-dimensional matching to find the most suitable replacement options. The multiple dimensions include syllable structure and phonological features, edit distance, and semantic similarity. Specifically, since homophones or near-phonetic errors are very common, the pinyin conversion tool can be used to convert each word into a corresponding pinyin representation to facilitate the identification of syllable pronunciation and structure; the pinyin of each potential wrong word and hot word is compared, and by calculating the edit distance between the pinyins or using character-level similarity analysis of the pinyins, it is determined which hot words are similar to the wrong words in pronunciation.

[0124] The specific implementation of pronunciation similarity can be: suppose we have two strings A and B, with lengths of m and n respectively, D[i][j] represents the minimum number of editing operations required to convert the first i characters of string A into the first j characters of string B. The specific formula is:

[0125] D[i][j]=min(D[i-1][j]+1, D[i][j-1]+1, D[i-1][j-1]+(A[i]≠B[j]))

[0126] Where D p is the Pinyin edit distance matrix, (A[i]≠B[j]) is 1 if the Pinyin characters are different, and 0 if they are the same. Then, D[m][n] is calculated recursively to be the minimum number of edit operations required to completely convert string A into string B.

[0127] And calculate the edit distance between each potential error word and the hot word, that is, the minimum single-character editing operation (insertion, deletion, replacement) required to transform one word into another word. The formula and calculation method are the same as those described above for the pinyin edit distance.

[0128] Use a semantic embedding model (such as Word2Vec or BERT) to generate a vector representation for each word and calculate the cosine similarity between these vectors. The specific formula is:

[0129]

[0130] Among them, υ1 and υ2 are the vector representations of two words.

[0131] Based on the above embodiments of the present application, in the fifth embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be described in detail later. Figure 7 , the acquisition of the large language model includes steps S1 to S3:

[0132] Step S1, vertically analyzing professional terms and professional texts in a professional field to obtain professional corpus in the professional field;

[0133] Step S2, performing unsupervised pre-training on the language model based on the professional corpus to obtain an initial training language model;

[0134] Step S3, based on the preset RAG, the knowledge text in the professional field is integrated to optimize the initial training language model to obtain a large language model.

[0135] It should be noted that unsupervised pre-training can be a method of extracting useful features by learning the structure and distribution of the data itself in the absence of labeled data.

[0136] It is understandable that by training large language models with customized corpora for specific professional fields such as medicine, law or technology, it is ensured that the model can demonstrate high professionalism and high-accuracy language understanding capabilities in applications in these fields, thereby improving the accuracy of the language model's vocabulary probability prediction in this field.

[0137] It can be understood that the RAG (Retrieval-Augmented Generation) technology combines the information in a large-scale knowledge base with the predictive power of the language model, enhancing the model's contextual understanding and information accuracy when generating probabilities.

[0138] In the specific implementation, after selecting an open source large-scale language model, professional field corpus is collected, wherein the professional field corpus covers a wide range of professional terms and rich context examples, and the professional field corpus has high quality, accuracy and standardized format. Specifically, the wide coverage of professional terms can ensure that the corpus contains enough industry-specific terms and proper nouns, and these terms should widely cover the core concepts and common vocabulary in the field; rich context examples can mean that the collected texts should include the usage of proper nouns and terms in various contexts to help the model learn the diverse uses and semantics of these words; high quality and accuracy can mean that the corpus must be reviewed by professionals to ensure the professionalism and technical accuracy of the text and avoid containing erroneous or outdated information; format standardization can mean appropriate preprocessing of the text, including text cleaning, removal of irrelevant information, standardized format, etc., to ensure the consistency and clarity of the input data.

[0139] Use the collected professional domain corpus to perform unsupervised pre-training and fine-tuning on the selected open source large-scale language model, so that the model can better understand and generate text in professional fields, thereby improving its token probability prediction effect in professional fields.

[0140] Furthermore, RAG technology can be used to enhance the output probability quality of LLM, especially by combining the BGE model and the Chroma vector database. This method can provide prior knowledge for the model by retrieving relevant knowledge texts, and improve the accuracy of the model in predicting word probabilities in professional fields.

[0141] Specifically, the BGE model is used to generate embedding vectors for text fragments or words, which can accurately capture the multi-dimensional characteristics of vocabulary and context. These embedding vectors are used to compare similarity with the text in the knowledge base to find the most relevant information. The Chroma vector database contains a large number of preprocessed embedding vectors that represent a wide range of domain knowledge and data. In RAG, the Chroma database is used to store and retrieve knowledge items that match the embedding vectors generated by BGE. The cosine similarity is used to measure the similarity between the embedding vectors generated by BGE and the vectors in the Chroma database. Cosine similarity is obtained by calculating the dot product of two vectors and dividing them by their modulus, ranging from -1 to 1, where 1 indicates complete similarity. The formula for calculating cosine similarity is:

[0142]

[0143] Among them, A and B represent two vectors.

[0144] The similarity threshold can be set to 0.8, and only when the similarity between the retrieved knowledge text and the query vector is higher than this threshold, it is considered for the generation process. This ensures that only highly relevant knowledge is used to assist the output of the LLM. The selected knowledge text will be integrated into the input of the LLM. By injecting this high-quality, highly relevant external information into the generation process, the accuracy of the model's predicted vocabulary probability can be significantly improved.

[0145] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the text error correction method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0146] This application also provides a text correction device, please refer to Figure 8 , the text error correction device comprises:

[0147] The error recognition module 10 is used to input the acquired text to be corrected into a large language model, and perform error probability recognition on each word in the text to be corrected based on the large language model to obtain the erroneous words in the text to be corrected, wherein the large language model is obtained by training the language model based on professional domain corpus;

[0148] A matching module 20, for matching candidate replacement words of the wrong words from a preset hot word weight table, wherein the preset hot word weight table is created based on the user's daily words, industry terms and user feedback data;

[0149] A screening module 30, configured to screen a target replacement vocabulary that best satisfies the context of the erroneous vocabulary from the replacement candidate vocabulary based on the large language model and a preset sliding window;

[0150] The replacement module 40 is used to correct the text to be corrected using the target replacement vocabulary.

[0151] Optionally, the screening module 30 is further used to determine the current correction paragraph of the text to be corrected within a preset sliding window; screen the hot words to be replaced corresponding to the erroneous words in the current correction paragraph from the replacement candidate words; determine the replacement probability of the hot word combination composed of each of the hot words to be replaced based on the large language model; and determine the target replacement hot word in the hot word combination with the maximum replacement probability as the target replacement word that best meets the context of the erroneous word.

[0152] Optionally, the screening module 30 is further used to perform distribution probability processing on each of the hot words to be replaced one by one based on the large language model and the semantics of the current error correction paragraph, to determine the semantic fit probability of the hot word combination composed of each of the hot words to be replaced; obtain the weight of each of the hot words to be replaced from the preset hot word weight table; perform weighted processing on each of the semantic fit probabilities based on the weight, to determine the replacement probability of each of the hot word combinations.

[0153] Optionally, the error identification module 10 is further used to perform context analysis on each word in the text to be corrected based on the large language model to determine the probability score of the word belonging to the corresponding position; based on the large language model, filter out words from the words whose probability model is less than a preset probability threshold to obtain the erroneous words in the correction text.

[0154] Optionally, the matching module 20 is further used to convert the incorrect vocabulary into a pinyin expression; obtain a homophonic hot word that is the same as the pinyin expression from a preset hot word weight table; determine the edit distance between the incorrect vocabulary and each hot word in the preset hot word weight table; determine the semantic similarity between the incorrect vocabulary and each of the hot words; perform a comprehensive score on each of the hot words based on the feature weights of the homophonic hot words, the editing distance and the semantic similarity; and match the replacement candidate vocabulary of the incorrect vocabulary based on the comprehensive score.

[0155] Optionally, the error recognition module 10 is also used to perform vertical analysis on professional terms and professional texts in a professional field to obtain professional corpus in the professional field; perform unsupervised pre-training on a language model based on the professional corpus to obtain an initial training language model; and optimize the initial training language model by integrating the knowledge text in the professional field based on a preset RAG to obtain a large language model.

[0156] The text error correction device provided by the present application adopts the text error correction method in the above embodiment, which can solve the technical problem that the commonly used technical solutions cannot effectively correct text in a complex or changing language environment, thereby reducing the accuracy of text error correction. Compared with the prior art, the beneficial effects of the text error correction device provided by the present application are the same as the beneficial effects of the text error correction method provided by the above embodiment, and the other technical features of the text error correction device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0157] The present application provides a text correction device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the text correction method in the above-mentioned embodiment 1.

[0158] Reference below Fig. 9 , which shows a schematic diagram of the structure of a text error correction device suitable for implementing the embodiment of the present application. The text error correction device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The text error correction device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0159] like Fig. 9As shown, the text error correction device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the text error correction device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the text correction device to communicate with other devices wirelessly or by wire to exchange data. Although the text correction device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0160] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0161] The text error correction device provided by the present application adopts the text error correction method in the above embodiment, which can solve the technical problem that the commonly used technical solutions cannot effectively correct text errors in complex or changing language environments, thereby reducing the accuracy of text error correction. Compared with the prior art, the beneficial effects of the text error correction device provided by the present application are the same as the beneficial effects of the text error correction method provided by the above embodiment, and the other technical features in the text error correction device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0162] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0163] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0164] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the text error correction method in the above-mentioned embodiment.

[0165] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0166] The computer-readable storage medium may be included in the text correction device; or may exist independently without being assembled into the text correction device.

[0167] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by a text correction device, the text correction device: inputs the acquired text to be corrected into a large language model, performs error probability identification on each word in the text to be corrected based on the large language model, and obtains the erroneous words in the text to be corrected, wherein the large language model is obtained by training the language model based on professional field corpus; matches the replacement candidate words of the erroneous words from a preset hot word weight table, wherein the preset hot word weight table is created based on the user's daily words, industry terms and user feedback data; based on the large language model and a preset sliding window, selects the target replacement word that best meets the context of the erroneous word from the replacement candidate words; and uses the target replacement word to correct the text to be corrected.

[0168] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0169] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0170] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0171] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned text error correction method, and can solve the technical problem that the commonly used technical solutions cannot effectively correct text errors in complex or changing language environments, thereby reducing the accuracy of text error correction. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the text error correction method provided by the above-mentioned embodiment, and will not be repeated here.

[0172] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned text error correction method when executed by a processor.

[0173] The computer program product provided by the present application can solve the technical problem that the commonly used technical solutions cannot effectively correct text errors in complex or changing language environments, thereby reducing the accuracy of text error correction. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the text error correction method provided by the above embodiment, and will not be repeated here.

[0174] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A text error correction method, characterized in that: The method includes: Inputting the acquired text to be corrected into a large language model, performing error probability identification on each word in the text to be corrected based on the large language model, and obtaining the erroneous words in the text to be corrected, wherein the large language model is obtained by training the language model based on professional domain corpus; Matching candidate replacement words for the wrong words from a preset hot word weight table, wherein the preset hot word weight table is created based on the user's daily words, industry terms, and user feedback data; Based on the large language model and the preset sliding window, selecting a target replacement word that best satisfies the context of the erroneous word from the replacement candidate words; The target replacement vocabulary is used to correct the text to be corrected.

2. The method according to claim 1, characterized in that The step of selecting a target replacement vocabulary that best satisfies the context of the erroneous vocabulary from the replacement candidate vocabulary based on the large language model and the preset sliding window comprises: Determine the current error correction section of the text to be corrected within a preset sliding window; Selecting hot words to be replaced corresponding to the erroneous words in the current error correction paragraph from the candidate replacement words; Determine the replacement probability of each hot word combination composed of the hot words to be replaced based on the large language model; The target replacement hot word in the hot word combination with the maximum replacement probability is determined as the target replacement word that best satisfies the wrong word context.

3. The method according to claim 2, characterized in that The step of determining the replacement probability of each hot word combination composed of the hot words to be replaced based on the large language model comprises: Based on the large language model and according to the semantics of the current error correction paragraph, distribution probability processing is performed on each of the hot words to be replaced one by one to determine the semantic fit probability of the hot word combination composed of each of the hot words to be replaced; Obtaining the weight of each of the hot words to be replaced from the preset hot word weight table; The semantic fit probabilities are weighted based on the weights to determine the replacement probabilities of the hot word combinations.

4. The method according to claim 1, characterized in that The step of performing error probability identification on each word in the text to be corrected based on the large language model to obtain the erroneous words in the text to be corrected comprises: Performing context analysis on each word in the text to be corrected based on the large language model to determine a probability score that the word belongs to a corresponding position; Based on the large language model, words whose probability model is less than a preset probability threshold are screened out from the words to obtain incorrect words in the error correction text.

5. The method according to claim 1, characterized in that The step of matching the replacement candidate vocabulary of the wrong vocabulary from the preset hot word weight table includes: Convert the wrong words into phonetic expressions; Obtaining homophone hot words with the same pinyin expression as the said hot word weight table from a preset hot word weight table; Determine the edit distance between the wrong word and each hot word in the preset hot word weight table; Determining the semantic similarity between the wrong word and each of the hot words; Based on the feature weights of the homophonic hot words, screenwriter distance and semantic similarity, a comprehensive score is given to each of the hot words; A replacement candidate vocabulary is matched to the incorrect vocabulary based on the comprehensive score.

6. The method according to claim 1, characterized in that The step of acquiring the large language model includes: Conduct vertical analysis on professional terms and professional texts in professional fields to obtain professional corpus in the professional fields; Performing unsupervised pre-training on the language model based on the professional corpus to obtain an initial training language model; The knowledge text in the professional field is integrated based on the preset RAG to optimize the initial training language model to obtain a large language model.

7. A text error correction device, characterized in that: The device comprises: An error recognition module is used to input the acquired text to be corrected into a large language model, perform error probability recognition on each word in the text to be corrected based on the large language model, and obtain the erroneous words in the text to be corrected, wherein the large language model is obtained by training the language model based on professional domain corpus; A matching module, used to match candidate replacement words of the wrong words from a preset hot word weight table, wherein the preset hot word weight table is created based on the user's daily words, industry terms and user feedback data; A screening module, configured to screen a target replacement vocabulary that best satisfies the context of the erroneous vocabulary from the replacement candidate vocabulary based on the large language model and a preset sliding window; A replacement module is used to use the target replacement vocabulary to correct the text to be corrected.

8. A text error correction device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the text error correction method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the text error correction method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the text error correction method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Method for realizing automatic transcription of hot word extraction specification based on NLP

    CN120632053A

  • Intelligent text error correction method based on mouse interaction

    CN120633637A

  • An intelligent text correction method based on mouse interaction

    CN120633637B

  • Image-text propaganda article intelligent design method based on large model and knowledge base

    CN120765809A

  • A large model and knowledge base-based intelligent design method for graphic publicity materials

    CN120765809B