Text intelligent error correction method and device, electronic equipment and storage medium

By building an error correction dataset and training text error detection and correction models, and utilizing translation standard rules and large language models, we solved the problems of low efficiency and accuracy in text review and achieved efficient and intelligent error correction of translated texts.

CN120781850APending Publication Date: 2025-10-14CHINA INTERNET NEWS CENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510892159.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-10-14

AI Technical Summary

Technical Problem

Existing technologies have low efficiency and accuracy in text review. The limitations of intelligent models lead to the inability to detect some errors, affecting the comprehensiveness and accuracy of text correction.

Method used

By constructing an error correction dataset containing correct and incorrect examples, training the target text error detection model and error correction model, using translation standard rules to detect and correct translation texts that do not comply with the rules, and combining large language models to fine-tune instructions, intelligent error correction of translation texts can be achieved.

Benefits of technology

It improves the comprehensiveness of text error detection and the accuracy of error correction, enhances the ability to detect and correct text that does not conform to translation standard rules, and improves the accuracy of text error correction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120781850A_ABST
    Figure CN120781850A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent text error correction method and device, electronic equipment and a storage medium, and the method comprises the steps: setting a translation standard rule, pre-standardizing standard translation, screening out a correct example sentence from a corpus based on the translation standard rule, converting the correct example sentence to obtain a wrong example sentence, and carrying out the recognition of the wrong example sentence. And pre-training a target text error detection model and a target text error correction model through the error correction data set, so that the target text error detection model can detect a translation text which does not conform to a translation standard rule. Meanwhile, the target text error correction model can modify the translation text which does not conform to the translation standard rule into the text which conforms to the translation standard rule, detection and error correction of the text which does not conform to the translation standard rule are achieved, the comprehensiveness of error detection and error correction is improved, then the text error detection rate is increased, and the text error correction accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of text detection technology, and in particular to a text intelligent error correction method, device, electronic device and storage medium. Background Art

[0002] Currently, before publishing text information such as news reports, books, and translated texts, the texts need to be reviewed for accuracy. Currently, this is usually done manually, word by word, which is inefficient and inaccurate.

[0003] In order to improve the efficiency and accuracy of text review, relevant technologies have proposed using intelligent models to review spelling and grammatical errors in text information. Although this method can improve the efficiency and accuracy of review to a certain extent, due to the limitations of model training, there are still some errors that cannot be detected by the model, resulting in low text review accuracy. Summary of the Invention

[0004] In view of this, an embodiment of the present invention provides a text intelligent error correction method, device, electronic device and storage medium to improve the accuracy of text error correction.

[0005] According to one aspect of the present invention, a method for intelligent text error correction is provided, the method comprising:

[0006] Obtain the target translation text to be tested;

[0007] Inputting the target translation text into a pre-trained target text error detection model, and obtaining a text error detection result output by the target text error detection model, wherein the target text error detection model is trained based on a pre-constructed error correction dataset, the error correction dataset including a plurality of correct example sentences constructed based on translation standard rules, and a plurality of error example sentences obtained by transforming the plurality of correct example sentences;

[0008] If the text error detection result is a translation error, inputting the target translation text into a pre-trained target text error correction model, wherein the target text error correction model is obtained by fine-tuning a large language model based on the error correction dataset;

[0009] Obtain a target correct text corresponding to the target translation text output by the target text error correction model.

[0010] According to another aspect of the present invention, a text intelligent error correction device is provided, the device comprising:

[0011] An acquisition module, used to acquire the target translation text to be detected;

[0012] a detection module, configured to input the target translation text into a pre-trained target text error detection model and obtain text error detection results output by the target text error detection model, wherein the target text error detection model is trained based on a pre-constructed error correction dataset, the error correction dataset including a plurality of correct example sentences constructed based on translation standard rules, and a plurality of erroneous example sentences obtained by transforming the plurality of correct example sentences;

[0013] an input module, configured to input the target translated text into a pre-trained target text error correction model when the text error detection result is a translation error, the target text error correction model being obtained by fine-tuning a large language model based on the error correction dataset;

[0014] The error correction module is used to obtain a target correct text corresponding to the target translation text output by the target text error correction model.

[0015] According to another aspect of the present invention, there is provided an electronic device, comprising:

[0016] processor; and

[0017] Memory for storing programs,

[0018] The program includes instructions, which, when executed by the processor, enable the processor to execute any of the above-mentioned intelligent text error correction methods.

[0019] According to another aspect of the present invention, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute any of the above-mentioned text intelligent error correction methods.

[0020] One or more technical solutions provided in the embodiments of the present invention pre-standardize standard translation by setting translation standard rules, screen out correct examples from the corpus based on the translation standard rules, and obtain incorrect examples after transforming the correct examples, thereby obtaining an error correction data set consisting of correct examples and incorrect examples, and pre-training a target text error detection model and a target text error correction model with the error correction data set, so that the target text error detection model can detect translation texts that do not conform to the translation standard rules, and at the same time, the target text error correction model can modify translation texts that do not conform to the translation standard rules into texts that conform to the translation standard rules. When the target translation text to be detected is obtained, the target translation text is input into the pre-trained target text error detection model to detect whether the target translation text conforms to the translation standard rules. If it does not conform to the translation standard rules, the target translation text is input into the target text error correction model, so that the target text error correction model modifies the text in the target translation text that does not conform to the translation standard rules to obtain the target correct text. By applying the embodiments of the present invention, the detection and correction of texts that do not conform to the translation standard are realized, the comprehensiveness of error detection and correction is improved, thereby improving the text error detection rate and the accuracy of text error correction. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Further details, features and advantages of the present invention are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:

[0022] Figure 1 A flowchart of a text intelligent error correction method provided by an embodiment of the present invention;

[0023] Figure 2 A schematic diagram of a process for constructing an error correction data set in an embodiment of the present invention;

[0024] Figure 3 A flowchart of a target text detection model training process according to an embodiment of the present invention;

[0025] Figure 4 A flowchart of a target text error correction model training process according to an embodiment of the present invention;

[0026] Figure 5 A schematic diagram of a flow chart of a text intelligent error correction device provided by an embodiment of the present invention;

[0027] Figure 6 A block diagram of an exemplary electronic device capable of implementing the embodiments of the present invention is shown. DETAILED DESCRIPTION

[0028] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.

[0029] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.

[0030] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc. mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0031] It should be noted that the modifications of "one" and "multiple" mentioned in the present invention are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0032] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0033] In order to improve the accuracy of text error correction, the present invention provides a text intelligent error correction method, device, electronic device and storage medium. The text intelligent error correction method provided by the present invention can be applied to any electronic device with text intelligent error correction function, such as a computer, server or mobile terminal. The following describes the solution of the present invention with reference to the accompanying drawings:

[0034] like Figure 1 As shown, Figure 1 A flowchart of a text intelligent error correction method provided by an embodiment of the present invention may include the following steps:

[0035] S101, obtaining a target translation text to be detected;

[0036] S102, input the target translation text into a pre-trained target text error detection model, and obtain a text error detection result output by the target text error detection model, wherein the target text error detection model is trained based on a pre-constructed error correction data set, the error correction data set includes a plurality of correct example sentences constructed based on translation standard rules, and a plurality of error example sentences obtained by transforming the plurality of correct example sentences;

[0037] S103, in the case of a translation error in the text error detection result, input the target translation text into a pre-trained target text error correction model, the target text error correction model is obtained by instructing fine-tuning of a large language model based on the error correction data set;

[0038] S104, obtain the target correct text corresponding to the target translation text output by the target text error correction model.

[0039] In the embodiment of the application, by setting the translation standard rule, the standard translation is pre-specified, the correct example sentences are selected from the corpus based on the translation standard rule, the error example sentences are obtained by transforming the correct example sentences, and the error correction data set composed of the correct example sentences and the error example sentences is obtained. The target text error detection model and the target text error correction model are pre-trained through the error correction data set, so that the target text error detection model can detect the translation text that does not conform to the translation standard rule, and the target text error correction model can modify the translation text that does not conform to the translation standard rule to the text that conforms to the translation standard rule. In the case of obtaining the target translation text to be detected, the target translation text is input into the pre-trained target text error detection model to detect whether the target translation text conforms to the translation standard rule. If it does not conform to the translation standard rule, the target translation text is input into the target text error correction model, so that the target text error correction model modifies the text in the target translation text that does not conform to the translation standard rule to obtain the target correct text. By applying the embodiment of the application, the detection and error correction of the text that does not conform to the translation standard are realized, the comprehensiveness of error detection and error correction is improved, and the text error detection rate is improved, and the text error correction accuracy is improved.

[0040] S101-S104 are exemplarily described as follows:

[0041] In S101, the target translation text to be detected can be a text of any language and any source, which can be set according to actual application scenarios. For example, the target translation text can be an English news text, a novel text, etc. obtained by translating Chinese, English, Japanese, etc. After obtaining the target translation text, it can be input into the pre-trained target text error detection model.

[0042] The target text error detection model is used to detect errors in the target translation text. These errors can include spelling and grammatical errors, as well as errors that do not conform to translation specifications. Translation specifications define the standard representation of the same words between different languages. When translating text from one language to another, it is generally necessary to ensure that the translated text conforms to translation specifications. Therefore, in order to detect non-standard translations in the target error text, a correction dataset can be pre-set and used to train the target text error detection model and the target text error correction model. This dataset can be used to detect and correct content in the translated text that does not conform to translation specifications.

[0043] The error correction dataset may include multiple correct examples based on standard translation rules, as well as incorrect examples obtained by transforming the correct examples. These standard translation rules may be general rules in the translation industry, such as those found in books or conference publications defining translation rules. These standards may define translation standards in multiple fields, such as current affairs, entertainment, and medicine. Accordingly, the error correction dataset may also include correct and incorrect examples in these fields.

[0044] In one possible embodiment, Figure 2 As shown, the error correction data set can be obtained by following the steps S11-S14:

[0045] S11 . Generate translation standard rules based on the translation standard text, wherein the translation standard rules include each standard word and description information of each standard word.

[0046] As mentioned above, translation standard rules (also called QA rules) are usually defined by translation standard texts in books and conference publications. These translation standard texts usually have different text formats, and the content in this text form cannot be directly used by computers. Therefore, it is necessary to extract text and convert the format of the translation standard text to obtain translation standard rules that can be used by computers.

[0047] In a possible embodiment, the format of the translation standard rule can be preset, and the format of the translation standard rule can include standard words and description information of the standard words, where the standard words refer to standard expressions in a target language, and the description information of the standard words can include an identification, a version, a language, a classification, an explanation, and a hit instance of the standard words. The identification of the standard words can be an ID of the standard words, the version can be used to identify an update of the standard words, the classification can include mandatory, recommended, and prompt, and the use of the standard words with different classifications is different. For example, if the classification of the translation standard word is mandatory, the word must be used for translation in an actual translation scenario, if the classification of the translation standard word is recommended, the word is not mandatory, and can be selected by a user according to an actual application scenario. The explanation of the standard words refers to an interpretation of the standard words in a preset language, and the preset language is usually a source language in translation, and the hit instance is an example sentence containing the standard words in a public text. The translation standard rule can further include an explanation of the standard words, such as an application scenario of the standard words, replaceable words, and the like.

[0048] For example, in the case of eco-civilization, the translation standard text "Construction of an ecological system refers to abandoning and transcending the extensive development mode and unreasonable consumption mode, improving the civilization concept and quality of the whole society, limiting human activities within the range that can be borne by the natural environment, and taking the road of civilized development with the development of production, the prosperity of life, and the good ecology. This concept is usually translated as ecological civilization, but ecology and its derivative word ecological refer to the relationship between organisms and their surrounding environment, and civilization is the sum of material and spiritual wealth created by human beings. Simply combining the two words together can easily cause confusion and misunderstanding among foreign readers.

[0049] The word eco- is commonly used as a prefix in English, and its meaning is: a combining form representing ecology; also with the more general sense “environment”, “nature”, “natural habitat”, that is, this prefix can represent ecology, or more broadly represent natural environment, nature, natural habitat, etc. Therefore, “ecosystem” is translated as eco-civilization, which has a broader meaning; sometimes it can also be translated as eco-environmental progress according to the context, which means culture and progress focusing on ecological environmental protection. If the context refers to the protection and restoration of natural ecosystems and biodiversity, “ecological civilization system” can also be translated as ecological conservation.

[0050] Based on the above translation standard text, the following translation standard rules can be obtained:

[0051] Table 1 Translation Standard Rule Example

[0052]

[0053]

[0054] For example, the Chinese word “fan” is a polysemous word, which has different meanings in different contexts: in the food context, “fan” refers to a fine strip-shaped food made of green beans, sweet potatoes and other starch, which is soft and flexible, and is often used in cooking soup, cold dishes or stir-fried dishes. In the context of network culture, “fan” is the transliteration of English “fans”, which refers to a group of people who are extremely fond of and support a person (such as a star, an athlete, a public figure, etc.) or a thing (such as film and television, music, games, etc.). For this word, the two different interpretations can be distinguished by brief description, interpretation, etc., and the corresponding standard translation can be determined by matching the context.

[0055] Text extraction is performed on the translation standard text, and information extraction is performed on the extracted text according to the content contained in the above standard translation rules, that is, the translation standard rules can be obtained. The translation standard rules can include translation standard words and their description information in multiple languages and multiple fields.

[0056] S12, match each standard translation text in the preset corpus with each standard word contained in the translation standard rule, and determine that the standard translation text containing at least one standard word is a correct example sentence.

[0057] The preset corpus can be obtained by crawling standard translation texts in public texts. For example, the preset corpus can be obtained from an official news website, and the preset corpus contains multiple translation examples.

[0058] As a possible implementation, the standard translation text from the official news website can be segmented into sentences to obtain multiple translation examples. For example, the standard translation text can be segmented using a spaCy model to obtain multiple translation examples. The SpaCy model is a pre-trained NLP pipeline in the SpaCy library, designed for fast natural language processing tasks (such as word segmentation, part-of-speech tagging, and named entity recognition).

[0059] In a possible embodiment, each translation example in a preset corpus can be segmented to obtain a plurality of segmentation results corresponding to the translation example. For example, segmentation can be performed by a spacy model or a jieba segmentation tool to obtain a plurality of segmentation results contained in the translation example. For each segmentation result of each translation example, word part-of-speech tagging, statistics, and word frequency statistics can also be performed, wherein the word part-of-speech can include verbs, nouns, adjectives, etc., and the word frequency of a word refers to the frequency of occurrence of the word in the corpus. After obtaining the part-of-speech and word frequency results of each segmentation result, the translation example identification, the segmentation result, and the part-of-speech and word frequency of each segmentation result can be stored in a database to obtain a final corpus.

[0060] As mentioned above, the preset corpus is obtained from an official news website. Therefore, it can be assumed that all translation examples included in the preset corpus conform to international communication standards. For each translation example in the preset corpus, the word segmentation results contained therein can be matched with the standard words contained in the translation standard rules. If the word segmentation results contained in the translation example sentence include the standard words in the translation standard rules, the translation example sentence can be determined to be a correct example sentence according to the QA rules. If the word segmentation results of the translation example sentence do not include the words in the translation standard rules, the translation example sentence is determined to be a normal correct example sentence.

[0061] As a possible implementation method, a preset number of correct examples of QA rules that meet the QA rules can be screened from the preset corpus by replacing the sample. For example, the standard words contained in the QA rules can be queried in the preset corpus, and 200 translation examples can be selected from the translated examples containing the translated standard words found as correct examples that meet the QA rules. Each query is performed in the full preset corpus. As shown in Table 2, the standard expression eco-system with rule ID W-FAKE-20401-GF-1.1.6-SUB1-EN is retrieved from the international communication corpus using eco-system as the keyword to retrieve sentences containing the keyword. These sentences are regarded as correct examples of the QA rule.

[0062] Table 2 Translation standard rule matching examples

[0063] Rule ID Standard expression Rule Statement W-FAKE-20401-GF-1.1.6-SUB1-EN eco-system The expression for ecosystem is eco-system.

[0064] S13 . For each correct example sentence, transform each correct example sentence according to a plurality of preset error types and a preset probability of each error type to obtain each incorrect example sentence.

[0065] In actual applications, error types can be divided into two categories, namely general error types and special error types. Among them, general error types can include component redundancy, component missing, space errors, spelling errors, etc., which are applicable to any word. Special error types include capitalization errors, homonymous word replacement errors, homonymous word replacement errors, synonym replacement errors, noun singular and plural errors, proper noun singular and plural errors, punctuation errors, verb tense errors, adjective errors, adverb errors, etc. The preset probability of each error type refers to the proportion of the error type of the obtained error sentence in the total number of error sentences. The probability can be set according to the actual application scenario. As a possible implementation method, the probability of the error type can be set according to the following example:

[0066] Table 3 Examples of common error types

[0067]

[0068]

[0069] Table 4 Examples of special error types

[0070]

[0071]

[0072]

[0073] The correct example sentence usually includes multiple segmentation results. When transforming the correct example sentence, one or more segmentation results can be transformed according to a preset error type. In one possible embodiment, the transformation weight of each segmentation result in the correct example sentence can be determined by the following steps:

[0074] S21, according to the preset transformation number and the preset probability distribution of each preset transformation number, determine the transformation segmentation number in each correct example sentence.

[0075] The preset transformation number and the preset probability distribution of the preset transformation number can be selected according to the actual application scene. As a possible implementation, the transformation number can be set to {0, 1, 2, 3, 4, 5}, and the preset probability distribution corresponding to each preset transformation number is {0.01, 0.2, 0.2, 0.25, 0.25, 0.09}. For example, in the case of 1000 correct example sentences, the number of correct example sentences with transformation number 0 is 1000*0.01=10, the number of correct example sentences with transformation number 1 is 1000*0.2=200, the number of correct example sentences with transformation number 2 is 1000*0.2=200, the number of correct example sentences with transformation number 3 is 1000*0.25=250, the number of correct example sentences with transformation number 4 is 1000*0.25=250, and the number of correct example sentences with transformation number 5 is 1000*0.09=90.

[0076] After obtaining the number of correct example sentences corresponding to each transformation number, the preset corpus can be sampled according to the number of correct example sentences to obtain a set of correct example sentences corresponding to each transformation number. In some possible embodiments, there may be a case where the correct example sentence contains fewer segmentation results, but the correct example sentence set corresponding to the correct example sentence corresponds to a larger transformation number. In this case, it may be necessary to transform more segmentation results without actual meaning, resulting in a smaller difference between the error example sentence and the correct example sentence after transformation. Therefore, an additional transformation number condition can be added. If the transformation number corresponding to the correct example sentence is greater than 20% of the number of segmentation results contained in the correct example sentence, the number of segmentation results is 20% of the transformation number corresponding to the correct example sentence.

[0077] For example, the transformation segmentation number of the correct example sentence can be determined by the following formula:

[0078]

[0079] Where K is the transformation segmentation number, and N is the number of segmentation results contained in the correct example sentence. represents the 20% of the number of words in the sentence, rounded down. K final is the final transformation segmentation number.

[0080] S22, based on the word frequency of each word segmentation result and the QA rule hit result, calculate the transformation weight of each word segmentation result.

[0081] In order to enhance the recognition effect of the standard words contained in the QA rule, it is necessary to transform the standard words contained in the correct example sentence as much as possible to obtain the error example sentence during the construction of the error correction data set. Therefore, a larger weight can be set for the word segmentation result that hits the QA rule. For example, the transformation weight of the word segmentation result that hits the QA rule in the correct example sentence can be set to a preset maximum value, which can be set according to the actual application scene, such as 99. For the word segmentation result that does not hit the QA rule in the correct example sentence, the word segmentation weight of the word segmentation result can be calculated according to the word frequency of the word segmentation result. For example, the TF-IDF frequency of the word segmentation result in the preset corpus can be calculated as the word segmentation weight of the word segmentation result.

[0082] In a possible embodiment, due to the limitation of the word segmentation tool, there may be new words as word segmentation results, such as the word segmentation result does not exist in the preset dictionary, then it can be determined that the word segmentation result is a new word. For these word segmentation results, a smaller weight can be set for them, such as the transformation weight can be set to a preset minimum value, which can be set according to the actual application scene, such as 1.

[0083] As a possible implementation, the transformation weight of each word segmentation result in the correct example sentence can be set according to the following scheme:

[0084] Firstly, check whether the rule keyword exists in the sentence, if the rule keyword exists, give the highest weight 99 to the position of the keyword. Secondly, for the position not belonging to the rule keyword, detect whether the word of the position exists in the word frequency library of the international dissemination corpus, and take the logarithm (base 10) of the corresponding word frequency as the weight. Finally, the word neither belongs to the keyword nor belongs to the international dissemination corpus, and the default value is 1. After completing the assignment of each position, normalize it to generate a sampling probability distribution, and randomly select K positions of the sentence according to the sampling probability distribution.

[0085] Specifically, set the correct example sentence S=(w1, w2,..., w N ), then:

[0086]

[0087] Where S is a sentence, w i represents the word of the i-th position, and N is the length of the sentence. Keyword is the set of standard words that hit the sentence. F is the word frequency library of the international dissemination corpus, and f(w i ) represents the word frequency of the i-th position. Let the weight of each position be weight i, the normalized sampling probability is p i In practical applications, the above formula can be adjusted by increasing constants, coefficients, etc. to obtain the weight of each position segmentation result.

[0088] As shown in Table 5, taking the correct sentence "The meeting analyzed economic development." as an example, where "economic development" is the standard expression, and the key word weight is 99, the word frequencies of other words The, meeting, analyzed and English period are 29861736, 273081, 18158 and 183354648 respectively, and the corresponding weights are 8.48, 6.43, 5.25 and 9.26 respectively, and the normalized probability distribution is 0.04, 0.03, 0.02, 0.44, 0.44, 0.04. When the number of errors is greater than 1, "economic" and "development" have a greater possibility of being selected and modified.

[0089] Table 5 Modification Number and Modification Position Selection Example

[0090]

[0091] S23, based on the transformation weight of each said segmentation result and the preset error type, transforming each said correct example sentence to obtain each error example sentence.

[0092] According to the part of speech of the selected position word, different error type probability distributions are set, and error types are randomly selected to perform corresponding editing operations to generate error example sentences.

[0093] As shown in Table 6, taking the correct sentence "The meeting analyzed economic development." as an example, "economic development" is the standard expression, "development" is the selected word, and the error type is synonym replacement error. The synonyms of "development" are evolve, grow, progress, and advance, with word frequencies of 11, 2, 1, and 1 respectively, and the normalized probability distribution is 0.73, 0.13, 0.07, and 0.07. "Evolve" has the greatest possibility of being selected to replace "development", and the error sentence "The meeting analyzed economic evolve." is generated.

[0094] Table 6 Synthesis of Error Sentence Example

[0095]

[0096] S14: performing word-level comparison on the correct example sentences and the incorrect example sentences, and generating actual error labels for the correct example sentences and the incorrect example sentences.

[0097] Perform word-level text comparison on the correct and incorrect sentences after word segmentation. Generate an error detection label for each word in the incorrect sentence based on the inconsistent results with the correct sentence. The error detection label is a binary label: CORRECT and INCORRECT. CORRECT represents a correct word, and INCORRECT represents an incorrect word.

[0098] As shown in Table 7, taking the correct sentence "The meeting analyzed economic development." and the incorrect sentence "The meeting analyzed economic evolve." as examples, a text comparison is performed on the correct and incorrect sentences. The incorrect sentence is divided into 6 words, and the corresponding labels are CORRECT, CORRECT, CORRECT, CORRECT, INCORRECT, and CORRECT. The word "evolve" in the incorrect sentence is different from "development" in the correct sentence, so it is labeled as INCORRECT.

[0099] Table 7 Examples of text error detection labels

[0100]

[0101] Through the above steps, a correction dataset can be obtained, which contains correct sentences, incorrect sentences, and error detection labels for correct and incorrect sentences. Specifically, it contains correct / incorrect labels for the word segmentation results contained in the correct and incorrect sentences. In the present invention, error detection of the translated text can be implemented based on the target error text detection model of the correction dataset. In one possible implementation, Figure 3 As shown in the figure, the target error text detection model can be pre-trained by the following steps:

[0102] S31. Input each example sentence included in the error correction data set into an initial text error detection model; wherein the example sentences include correct example sentences and erroneous example sentences.

[0103] The text error detection model can be a model constructed based on a transformer structure. The Transformer model is a deep learning architecture based on self-attention mechanism (Self-Attention), which dynamically allocates weights by calculating the correlation between each element (such as a word) in the input sequence and other elements, so as to capture long-distance dependencies.

[0104] In S32, the text error detection model performs word embedding on each of the example sentences to obtain an input vector corresponding to each of the example sentences.

[0105] The text error detection model can first perform word segmentation on each of the input example sentences. The word segmentation can be performed by using a regular expression. For example, the English text can be segmented by spaces and punctuation marks to obtain multiple word segments of each example sentence.

[0106] In the model training, the input text usually needs to be converted into tokens, which are the basic units of text processing. In natural language understanding, one token usually corresponds to one word. As a possible implementation, a pre-set dictionary can be used to match each segmented word to determine whether the word exists in the dictionary. If a word exists in the dictionary, the word is directly identified as a valid word and recorded as a token. For words not in the dictionary, a longest string greedy matching algorithm is used to further segment the words. Specifically, the algorithm starts from the end of the word and cuts forward character by character until a prefix (front string) that exists in the multilingual dictionary is found. Once a valid prefix is identified, it is considered as a qualified sub-word and recorded as a token. The remaining part is treated as a new string to be processed (back string) and the above process is repeated. This process continues until the entire original word is decomposed into a series of qualified sub-words tokens, ensuring that all text features can be composed of verified sub-words. For example, the word abcdefg does not exist in the pre-set dictionary, so it is cut from g to the front, such as matching fg, efg, defg…, and the word that matches the pre-set dictionary can be removed. The above steps are repeated. The obtained tokens can be expressed by the following formula

[0107] TOKENS = [token1, token2, token3, …, token t ]

[0108] wherein, TOKENS is a set of words or characters after text segmentation, t represents that the text has t words or characters, and the upper limit of the text length is 64 words or characters by default.

[0109] After obtaining the tokens contained in each example, each token can be mapped into a vector space to form a word vector, thereby achieving word embedding for each example sentence. Word embedding is a technique in natural language processing (NLP) that is used to convert discrete words or symbols into continuous numerical vectors so that machine learning models can process and understand text data. As a possible implementation, each token can be mapped into a 768-dimensional dense vector space according to a preset mapping table to obtain a word vector.

[0110] In one possible embodiment, to enhance the text error detection model's learning of the relationships between the word segmentation results contained in an example, position information can be added to the input vector corresponding to each example sentence. For example, a 768-dimensional position vector can be assigned to each word or character's position in its sequence. This helps the model understand the relative order of words.

[0111] Each word vector and each position vector constitutes, for example, a corresponding input vector. In a possible embodiment, the word vector and the position vector may be added and regularized to ensure that the vector has a uniform scale, thereby serving as a word-level vector representation.

[0112] we i =Embedding(token i )

[0113] pe i =Embedding(pos i )

[0114] e i =we i +pe i

[0115] E=Layernorm([e1,e2,e3,…,e t ])

[0116] Among them, token i is the i-th word or character, pos i is the position of the i-th word or character, we i is the word vector of the i-th word or character, pe i is the position vector of the i-th word or character, e i is the vector representation of the i-th word or character, E is the set of t word or character vector representations, and is regularized. The above embeddings are all trainable weights.

[0117] S33. Perform self-attention calculation on each input vector to obtain text features of each input vector.

[0118] Self-attention is a mechanism for processing sequence data. Its core idea is to capture long-distance dependencies by dynamically weighting and integrating information at different positions in the sequence. As a possible implementation, the text error detection model may include an encoder consisting of 6 layers, each of which is a multi-head self-attention layer with 12 attention heads. The encoder accepts the initial vector representation of words or characters as input, generates a QKV vector, and uses the generated QKV vector to perform multi-head self-attention calculations to evaluate the association weights between different positions, thereby capturing the dependencies between words. Exemplarily, each multi-head self-attention layer can generate text features through the following steps:

[0119] S331. Receive word vectors from the previous layer or initial input.

[0120] In terms of input vectors, the input vector I1 of the first attention layer is the vector representation of words or characters, and the input vectors I k The hidden vector H output by the previous attention layer k-1 , which can be specifically expressed by the following formula:

[0121]

[0122] Among them, I k is the input vector of the k-th self-attention layer, When k=1, the input vector is a set E of word or character vector representations. <k≤6时,输入向量为k-1层输出的隐藏向量H k-1 ,

[0123] S332. Generate three vectors, query (Query, Q), key (Key, K) and value (Value, V), for each input vector. Each vector is obtained through its own linear transformation.

[0124] In terms of 12-head QKV vector generation, the input vector generates query vector, key vector, and value vector respectively, where the query vector is the query vector of the word, which is suitable for calculating the degree of association between the word and the key vector of other words. The key vector is the key vector of the word, which is suitable for calculating the degree of association between the query vector of other words and the word. The value vector is the value vector of the word, which is suitable for constructing new vector representations of other words based on the attention weight. In order to learn different text features, 12 attention heads are set to map the query vector, key vector, and value vector to 12 different subspaces, each of which represents different text features. Specifically, each QKV vector can be represented by the following formula:

[0125] Q=I k W query

[0126] K=I k W key

[0127] V=I k W value

[0128] Q j =QW j query ,j=1,2,3,…,12

[0129] K j =KW j key ,j=1,2,3,…,12

[0130] V j =VW j value ,j=1,2,3,…,12

[0131] Where Q is the query vector, W query is the weight of the input variable mapped to the query vector, K is the key vector, W key is the weight of the input variable mapped to the key vector, V is the value vector, W value is the weight of the input variable mapped to the value vector, Q j is the query vector of the j-th attention head, W j queryis the weight of mapping the query vector to the jth attention head vector, K j is the key vector of the j-th attention head, W j key is the weight of the key vector mapped to the j-th attention head vector, V j is the value vector of the j-th attention head, W j value is the weight of the value vector mapped to the j-th attention head vector, The above related weights W are all trainable weights.

[0132] S333. Use the generated QKV vector to perform multi-head self-attention calculation to evaluate the association weights between different positions, thereby capturing the dependency relationship between words.

[0133] In terms of attention calculation, the similarity between the query vector and the key vector of different attention heads is calculated, and the attention weight score between each word or character is generated by the softmax function. The context vector of different attention heads is obtained by multiplying the attention weight score and the value vector. Finally, the context vectors of different attention heads are spliced ​​and mapped, and the residual block I is added. k , after regularization, a new context vector is generated, which can be expressed by the following formula:

[0134]

[0135] head k =Concate(head1,head2,head3,…,head h )W concate

[0136] M k =Layernorm(head+I k )

[0137] Among them, head j is the context vector representation set of the j-th attention head, head k It is the context vector representation of the k-th self-attention layer, which is composed of 12 attention heads. M k is the context vector representation head k Add residual block I k The new context vector representation set is formed by d is 64 by default. is used to avoid attention weight The variance of is too large. The above-mentioned weights W are all trainable weights.

[0138] S334. Input the self-attention result into the feedforward neural network and output the hidden vector.

[0139] The results of the attention calculation are integrated, and after nonlinear transformation and residual connection, the output hidden vector of the layer is generated for the next layer processing or final output. Specifically:

[0140] H k =Layernorm(GELU(MW hidden1 )W hidden2 +M k )

[0141] Among them, W hidden1 is the first fully connected layer, W hidden2 is the second fully connected layer, H k is the set of hidden vectors of the output words of the k-th self-attention layer, The above related W are all trainable weights.

[0142] S34. Output an error detection label for each of the example sentences based on the text features of each of the input vectors.

[0143] The text error detection model can also include a fully connected layer. The text features output by the multi-head attention layer can be input into the fully connected layer. The fully connected layer can calculate the text features and output the judgment vector. Specifically, the input 768-dimensional hidden vector H k , output 2D vector;

[0144] H detection =Layernorm(H k W detection1 )W detection2

[0145] Among them, H detection is the error detection label vector for each word or character, W detection1 is the first fully connected layer, W detection2 is the second fully connected layer, l is the number of false detection labels, which defaults to 2.

[0146] After the fully connected layer, a softmax mapping layer can be connected to perform normalization and calculate the probability of incorrect detection labels;

[0147] p detection =softmax(H detection )

[0148] Among them, p detection is the probability distribution of error detection labels for each word or character, l is the number of false detection labels, which defaults to 2.

[0149] According to the probability distribution of error detection labels, output the error detection label type with the highest probability for each word.

[0150] detection=argmax(p detection )

[0151] Here, detection is the error detection label for each word or character. If the detection label is CORRECT, then the word is correct. If the detection label is INCORRECT, then it is an error and needs further modification.

[0152] S35, calculating a first difference between the error detection label of each of the example sentences and the actual error label of each of the example sentences;

[0153] S36. Adjusting parameters of the text error detection model based on the first difference until the first difference converges;

[0154] S37: Use the text error detection model corresponding to the first difference convergence as the target text error detection model.

[0155] The first difference can be obtained according to a preset loss function, which can be set according to the actual application scenario. As a possible implementation, the loss function can be a cross entropy function. Specifically, the first difference between the error detection label and the actual error label can be calculated according to the following formula:

[0156]

[0157] Among them, Loss detection is the error detection loss function, N is the number of words or characters in a single sentence, the maximum is 64, M d is the number of incorrectly detected labels, is the weight of the j-th type of error detection label, is the CORRECT label weight, is the INCORRECT label weight, is the actual error label of the i-th word of the j-th error detection label, is the error detection label of the i-th word of the j-th category error detection label.

[0158] After obtaining the first difference, parameters in the text error detection model can be updated using a backpropagation algorithm based on the first difference. The parameters may include the embeddings and weights W from the above step until the first difference converges. Convergence of the first difference means that the first difference is less than a preset first difference threshold or the difference between two first difference values ​​is less than the preset first difference threshold.

[0159] When the first difference converges, the current text error detection model is determined to be the target text error detection model, which is capable of identifying words in the translation text that do not conform to the translation standard rules. In practical applications, after the target translation text is input into the target text error detection model, an error detection result of the target text error detection model for the target translation text data can be obtained. If the error detection result indicates that the text is correct, no additional processing of the target translation text is required. If the error detection result indicates that the text is incorrect, the target translation text can be input into the target text error correction model to use the target text error correction model to correct the errors in the target translation text.

[0160] In this invention, the target text error correction model can be obtained by fine-tuning an existing large language model using an error correction dataset. Instruction fine-tuning is an optimization technique for pre-trained language models (such as GPT and PaLM). Its core goal is to fine-tune the model by clarifying the input data of the instruction, so that it can more accurately understand and execute user instructions, thereby achieving efficient migration in a variety of downstream tasks. The existing large language model can be selected according to actual needs, such as the Qwen2.5-1.5B-Instrnct model.

[0161] In one possible embodiment, Figure 4 As shown, the target text error correction model can be obtained by the following steps:

[0162] S41, splicing the erroneous sentences and the preset error correction instructions in the error correction data set to obtain input instructions, and using the correct sentences corresponding to the erroneous sentences as the answer texts corresponding to the input instructions.

[0163] In order to enable the large language model to realize the function of converting erroneous text into correct text, the large language model can be fine-tuned by inputting erroneous example sentences and preset error correction instructions into the large language model so that the large language model outputs the corresponding correct example sentences. Therefore, the erroneous example sentences and the preset error correction instructions in the error correction data set can be spliced ​​as the instruction fine-tuning input of the large language model, and the correct example sentences corresponding to the erroneous example sentences can be used as the answer text corresponding to the instruction fine-tuning input. The above-mentioned preset error correction instructions can be set according to the actual application scenario. For example, the error correction instruction can be "Fix grammatical errors in this sentence, and if the sentence is correct, only return the raw sentence:".

[0164] Exemplarily, an instruction fine-tuning input and answer text can be expressed by the following formula.

[0165] Input_text=Prompt+Incorrect_sent

[0166] Output_text=Correct_sent

[0167] Among them, Input_text is the model input text, Prompt is the error correction instruction, Incorrect_sent is the incorrect sentence, Output_text is the model output text, and Correct_sent is the correct sentence.

[0168] S42: Input the input instruction into the initial large language model, and obtain the answer prediction result output by the large language model.

[0169] The Qwen2.5 model includes a tokenizer that tokenizes the input text, obtains the tokens contained in the input text, and maps the tokens to the latent space through the original embedding layer of the Qwen2.5-1.5B-Instrnct model. Specifically, it can be expressed by the following formula:

[0170] input_ids=Tokenizer(Input_text)

[0171]

[0172] Where B is the batch size, T is the sequence length, and H is the hidden layer dimension. The embedding weights are frozen during fine-tuning and are not updated.

[0173] The multi-head attention layer is included in the large language model, and the calculation logic can refer to the description above, which will not be repeated here. When the large language model is instructed to fine-tune, the original weights of the multi-head attention layer in the large language model can be maintained, and a low-rank matrix of the Query matrix and the Value matrix is additionally constructed. During instruction fine-tuning training, only the low-rank matrix weights are updated, and the low-rank matrix is combined into the original Query matrix and Value matrix after matrix multiplication. The Query matrix, Key matrix, and Value matrix are used for attention calculation. Specifically, the above process can be represented by the following formula:

[0174] Q = Q0 + AQ

[0175] AQ = A Q B Q

[0176] V = V0 + AV

[0177] AV = A V B V

[0178]

[0179] wherein Q0 and V0 are the original Query matrix and Value matrix, AQ is the weight change obtained after low-rank matrix multiplication of the Query matrix, AV is the weight change obtained after low-rank matrix multiplication of the Value matrix, Q is the new Query matrix after combination, V is the new Value matrix after combination, K is the original Key matrix. A Q and B Q are low-rank matrices of the Query matrix, with dimensions and r is the low-rank dimension. A V and B V are low-rank matrices of the Value matrix, with dimensions and r is the low-rank dimension. d k is the dimension of the Key.

[0180] After attention calculation, the self-attention result is input to the feed-forward neural network FFN, and then residual addition operation and normalization processing are performed to output the hidden vector.

[0181] h' = RMSNorm(h + Attention(h))

[0182] h'' = RMSNorm(h' + FFN(h'))

[0183] FFN(x) = W2·SiLU(W1·x + b1) + b2

[0184]

[0185]

[0186] Where h is the input hidden vector, h′ and h″ are the output hidden vectors of the self-attention and feedforward neural networks, and H is the dimension of the input vector. is a learnable scaling parameter (weight vector), W1 and W2 are the weight matrices of the feedforward neural network, b1 and b2 are the bias terms of the feedforward neural network, and x is the input of the FFN network, that is, the self-attention result mentioned above.

[0187] Map the hidden vectors output by the self-attention layer and the feedforward neural network to the vocabulary space and output the corrected sentence.

[0188]

[0189] Where V is the vocabulary size, h is the hidden vector, and y is the answer prediction output by the model.

[0190] S43. Calculate a second difference between the answer prediction result and the answer text, and adjust parameters of the large language model based on the second difference through a back propagation method until the second difference converges.

[0191] S44: Use the large language model obtained when the second difference converges as a target text error correction model.

[0192] The second difference can be calculated based on the cross entropy loss function. For example, it can be calculated by the following formula:

[0193]

[0194] Among them, Loss is the cross entropy loss between the model prediction result and the true correct sentence. i |y <i ) is the probability of predicting the i-th token. weight i is the prediction weight of the i-th token. When the i-th token belongs to the user instruction part Prompt (including error correction instructions and error sentence text), the weight is 0 and the loss is negligible. When the i-th token belongs to the model output part Answer, the weight is 1, and the loss of model prediction and real data is maintained for backpropagation.

[0195] The intelligent text error correction method provided by the embodiment of the present invention is applied. By constructing an error correction data set and training a target text error detection model and a target text error correction model based on the error correction data set, the target text error detection model is used to identify spelling, grammar and translation standard errors in the text, thereby improving the detection rate of erroneous translated texts and thus improving the accuracy of translated text error detection.

[0196] Based on the same inventive concept, the embodiment of the present invention also provides a text intelligent error correction device, such as Figure 5 As shown, the apparatus 500 may include:

[0197] An acquisition module 501 is used to acquire a target translation text to be detected;

[0198] A detection module 502 is configured to input the target translation text into a pre-trained target text error detection model and obtain text error detection results output by the target text error detection model, wherein the target text error detection model is trained based on a pre-constructed error correction dataset, wherein the error correction dataset includes a plurality of correct example sentences constructed based on translation standard rules and a plurality of error example sentences obtained by transforming the plurality of correct example sentences;

[0199] An input module 503 is configured to input the target translation text into a pre-trained target text error correction model when the text error detection result is a translation error, wherein the target text error correction model is obtained by fine-tuning a large language model based on the error correction dataset;

[0200] The error correction module 504 is configured to obtain a target correct text corresponding to the target translation text output by the target text error correction model.

[0201] In a possible embodiment, the error correction data set is constructed by the following steps:

[0202] Generating a translation standard rule based on the translation standard text, wherein the translation standard rule includes each standard word and description information of each standard word;

[0203] Matching each standard translation text in a preset corpus with each standard word included in the translation standard rule, and determining that the standard translation text containing at least one standard word is a correct example sentence;

[0204] For each correct example sentence, transform each correct example sentence according to a plurality of preset error types and a preset probability of each error type to obtain each incorrect example sentence;

[0205] A word-level comparison is performed on each correct example sentence and each incorrect example sentence to generate actual error labels for each correct example sentence and each incorrect example sentence.

[0206] In a possible embodiment, the target text error detection model is pre-trained by the following steps:

[0207] Inputting each example sentence included in the error correction data set into an initial text error detection model; wherein the example sentences include correct example sentences and erroneous example sentences;

[0208] The text error detection model performs word embedding on each of the example sentences to obtain an input vector corresponding to each of the example sentences; performs self-attention calculation on each of the input vectors to obtain text features of each of the input vectors; and outputs an error detection label for each of the example sentences based on the text features of each of the input vectors;

[0209] calculating a first difference between the error detection label of each of the example sentences and the actual error label of each of the example sentences;

[0210] Adjusting parameters of the text error detection model based on the first difference until the first difference converges;

[0211] The text error detection model corresponding to the first difference convergence is used as the target text error detection model.

[0212] In a possible embodiment, the target text error correction model is pre-trained through the following steps:

[0213] splicing the error example sentences and the preset error correction instructions in the error correction data set to obtain input instructions, and using the correct example sentences corresponding to the error example sentences as the answer text corresponding to the input instructions;

[0214] Inputting the input instruction into an initial large language model, and obtaining an answer prediction result output by the large language model;

[0215] Calculating a second difference between the answer prediction result and the answer text, and adjusting parameters of the large language model based on the second difference by back propagation until the second difference converges;

[0216] The large language model when the second difference converges is used as the target text error correction model.

[0217] Among them, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in the present invention are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0218] An exemplary embodiment of the present invention further provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, wherein the computer program, when executed by the at least one processor, causes the electronic device to perform a method according to an embodiment of the present invention.

[0219] The exemplary embodiments of this application further provide a non-transitory computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, causes the computer to perform the method according to the embodiments of this application.

[0220] The exemplary embodiments of this application further provide a computer program product comprising a computer program, wherein the computer program, when executed by a processor of a computer, causes the computer to perform the method according to the embodiments of this application.

[0221] Reference Figure 6 will now be described, which is an example of a hardware device that can be applied to various aspects of the application. The electronic device is intended to represent a wide variety of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computer devices. The electronic device can also represent a variety of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown here, their connections, and their functions, as well as their

[0222] As shown in Figure 6 , the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0223] Multiple components within electronic device 600 are connected to I / O interface 605, including an input unit 606, an output unit 607, a storage unit 608, and a communication unit 609. Input unit 606 can be any type of device capable of inputting information into electronic device 600. Input unit 606 can receive input numeric or character information and generate key input signals related to user settings and / or function control of the electronic device. Output unit 607 can be any type of device capable of presenting information and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. Storage unit 608 may include, but is not limited to, a magnetic disk or an optical disk. Communication unit 609 allows electronic device 600 to exchange information / data with other devices via computer networks such as the Internet and / or various telecommunication networks and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver and / or a chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.

[0224] The computing unit 601 can be various general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above. For example, in some embodiments, any of the above-mentioned text intelligent error correction methods can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 600 via the ROM 602 and / or the communication unit 609. In some embodiments, the computing unit 601 can be configured to execute any of the above-mentioned text intelligent error correction methods by any other appropriate means (for example, by means of firmware).

[0225] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. Such program code can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0226] In the context of the present invention, machine-readable medium can be a tangible medium that can contain or store a program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0227] As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and / or device (e.g., a magnetic disk, an optical disk, a memory, a programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal used to provide machine instructions and / or data to a programmable processor.

[0228] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0229] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0230] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.

Claims

1. A text intelligent error correction method, characterized in that: The method comprises: Obtain the target translation text to be tested; Inputting the target translation text into a pre-trained target text error detection model, and obtaining a text error detection result output by the target text error detection model, wherein the target text error detection model is trained based on a pre-constructed error correction dataset, the error correction dataset including a plurality of correct example sentences constructed based on translation standard rules, and a plurality of error example sentences obtained by transforming the plurality of correct example sentences; If the text error detection result is a translation error, inputting the target translation text into a pre-trained target text error correction model, wherein the target text error correction model is obtained by fine-tuning a large language model based on the error correction dataset; Obtain a target correct text corresponding to the target translation text output by the target text error correction model.

2. The method according to claim 1, characterized in that The error correction dataset is constructed by the following steps: Generating a translation standard rule based on the translation standard text, wherein the translation standard rule includes each standard word and description information of each standard word; Matching each standard translation text in a preset corpus with each standard word included in the translation standard rule, and determining that the standard translation text containing at least one standard word is a correct example sentence; For each correct example sentence, transform each correct example sentence according to a plurality of preset error types and a preset probability of each error type to obtain each incorrect example sentence; A word-level comparison is performed on each correct example sentence and each incorrect example sentence to generate actual error labels for each correct example sentence and each incorrect example sentence.

3. The method according to claim 2, characterized in that The target text error detection model is pre-trained by the following steps: Inputting each example sentence included in the error correction data set into an initial text error detection model; wherein the example sentences include correct example sentences and erroneous example sentences; The text error detection model performs word embedding on each of the example sentences to obtain an input vector corresponding to each of the example sentences; performs self-attention calculation on each of the input vectors to obtain text features of each of the input vectors; and outputs an error detection label for each of the example sentences based on the text features of each of the input vectors; calculating a first difference between the error detection label of each of the example sentences and the actual error label of each of the example sentences; Adjusting parameters of the text error detection model based on the first difference until the first difference converges; The text error detection model corresponding to the first difference convergence is used as the target text error detection model.

4. The method according to claim 1, wherein The target text error correction model is pre-trained by the following steps: splicing the error example sentences and the preset error correction instructions in the error correction data set to obtain input instructions, and using the correct example sentences corresponding to the error example sentences as the answer text corresponding to the input instructions; Inputting the input instruction into an initial large language model, and obtaining an answer prediction result output by the large language model; Calculating a second difference between the answer prediction result and the answer text, and adjusting parameters of the large language model based on the second difference by back propagation until the second difference converges; The large language model when the second difference converges is used as the target text error correction model.

5. A text intelligent error correction device, characterized in that: The device comprises: An acquisition module is used to obtain the target translation text to be detected; a detection module, configured to input the target translation text into a pre-trained target text error detection model and obtain text error detection results output by the target text error detection model, wherein the target text error detection model is trained based on a pre-constructed error correction dataset, the error correction dataset including a plurality of correct example sentences constructed based on translation standard rules, and a plurality of erroneous example sentences obtained by transforming the plurality of correct example sentences; an input module, configured to input the target translated text into a pre-trained target text error correction model when the text error detection result is a translation error, the target text error correction model being obtained by fine-tuning a large language model based on the error correction dataset; The error correction module is used to obtain a target correct text corresponding to the target translation text output by the target text error correction model.

6. The device according to claim 5, characterized in that The error correction dataset is constructed by the following steps: Generating a translation standard rule based on the translation standard text, wherein the translation standard rule includes each standard word and description information of each standard word; Matching each standard translation text in a preset corpus with each standard word included in the translation standard rule, and determining that the standard translation text containing at least one standard word is a correct example sentence; For each correct example sentence, transform each correct example sentence according to a plurality of preset error types and a preset probability of each error type to obtain each incorrect example sentence; A word-level comparison is performed on each correct example sentence and each incorrect example sentence to generate actual error labels for each correct example sentence and each incorrect example sentence.

7. The device according to claim 6, characterized in that The target text error detection model is pre-trained by the following steps: Inputting each example sentence included in the error correction data set into an initial text error detection model; wherein the example sentences include correct example sentences and erroneous example sentences; The text error detection model performs word embedding on each of the example sentences to obtain an input vector corresponding to each of the example sentences; performs self-attention calculation on each of the input vectors to obtain text features of each of the input vectors; and outputs an error detection label for each of the example sentences based on the text features of each of the input vectors; calculating a first difference between the error detection label of each of the example sentences and the actual error label of each of the example sentences; Adjusting parameters of the text error detection model based on the first difference until the first difference converges; The text error detection model corresponding to the first difference convergence is used as the target text error detection model.

8. The device according to claim 5, characterized in that The target text error correction model is pre-trained by the following steps: splicing the error example sentences and the preset error correction instructions in the error correction data set to obtain input instructions, and using the correct example sentences corresponding to the error example sentences as the answer text corresponding to the input instructions; Inputting the input instruction into an initial large language model, and obtaining an answer prediction result output by the large language model; Calculating a second difference between the answer prediction result and the answer text, and adjusting parameters of the large language model based on the second difference by back propagation until the second difference converges; The large language model when the second difference converges is used as the target text error correction model.

9. An electronic device comprising: processor; as well as Memory for storing programs, The program includes instructions, which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 4.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 4.