Text error correction method and device, equipment and medium

By adding target small sample cases to the error correction prompt words, the text error correction ability of the large model is stimulated, and the error correction results are displayed in engineering, various problems of text error correction in the existing technology are solved, improving the accuracy and user experience.

CN119940350APending Publication Date: 2025-05-06INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510015558.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

While improving text accuracy, existing text error correction technologies have dependencies on specific error types, demand for large amounts of labeled data, real-time and efficiency issues, limitations of contextual understanding, error transmission issues, and privacy and security issues.

Method used

By adding small sample cases of error correction targets to the error correction prompt words, the big model's ability to correct text errors is stimulated, and the error correction results are displayed through engineering means, and replacement options are provided to improve user experience and operation convenience.

Benefits of technology

It improves the accuracy and efficiency of text error correction, simplifies the generation process of error correction results, confirms the location of error correction, and provides user-friendly error correction results display and replacement options, improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119940350A_ABST
    Figure CN119940350A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a text error correction method and device, equipment and a medium, and relates to the technical field of artificial intelligence. The method comprises the steps of obtaining a to-be-processed text, and determining a target error correction prompt data set according to a text error correction requirement of the to-be-processed text; inputting the to-be-processed text and the target error correction prompt data set into a trained text error correction model to obtain candidate error correction texts; determining a candidate error correction position and a corresponding candidate error correction strategy according to the to-be-processed text and the candidate error correction text; and according to the candidate error correction position and the candidate error correction strategy, performing error correction on the to-be-processed text to obtain a target error correction text. And the accuracy of text error correction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of artificial intelligence technology, and in particular to a text error correction method, device, equipment and medium. Background Art

[0002] With the popularity of the Internet and mobile devices, text information has become an important part of people's daily life and work. Whether it is email, social media, online documents or academic papers, the accuracy and reliability of text information are crucial to the transmission and understanding of information. However, due to input errors, grammatical errors, spelling errors, etc., there are often errors in text information, which may cause trouble in the transmission and understanding of information. Therefore, text error correction technology came into being, which can help users find and correct errors in text and improve the accuracy and reliability of text. In summary, how to improve the accuracy of text error correction is crucial. Summary of the invention

[0003] The present invention provides a text error correction method, device, equipment and medium to improve the accuracy of text error correction.

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

[0005] Acquire a text to be processed, and determine a target error correction prompt data set according to the text error correction requirements of the text to be processed;

[0006] Inputting the to-be-processed text and the target error correction prompt data set into a trained text error correction model to obtain a candidate error correction text;

[0007] Determining candidate error correction positions and corresponding candidate error correction strategies according to the text to be processed and the candidate error correction texts;

[0008] According to the candidate error correction positions and the candidate error correction strategies, the text to be processed is corrected to obtain a target error correction text.

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

[0010] The error correction prompt data set determination module is used to obtain the text to be processed and determine the target error correction prompt data set according to the text error correction requirements of the text to be processed;

[0011] A candidate error correction text determination module is used to input the text to be processed and the target error correction prompt data set into a trained text error correction model to obtain a candidate error correction text;

[0012] A candidate error correction strategy determination module, used to determine a candidate error correction position and a corresponding candidate error correction strategy based on the text to be processed and the candidate error correction text;

[0013] The target error correction text determination module is used to correct the text to be processed according to the candidate error correction positions and the candidate error correction strategies to obtain the target error correction text.

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

[0015] one or more processors;

[0016] A memory for storing one or more programs;

[0017] When one or more programs are executed by one or more processors, the one or more processors can execute any text error correction method provided by the embodiments of the present invention.

[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement any text error correction method provided by an embodiment of the present invention when executed.

[0019] The embodiment of the present invention provides a text correction scheme, which obtains the text to be processed, and determines the target correction prompt data set according to the text correction requirements of the text to be processed; inputs the text to be processed and the target correction prompt data set into the trained text correction model to obtain candidate correction text; determines the candidate correction position and the corresponding candidate correction strategy according to the text to be processed and the candidate correction text; corrects the text to be processed according to the candidate correction position and the candidate correction strategy to obtain the target correction text. The above scheme, by inputting the target correction prompt data set and the text to be processed into the text correction model together, obtains the candidate correction text, stimulates the text correction ability of the text correction model, and improves the accuracy of the candidate correction text; at the same time, according to the text to be processed and the candidate correction text, determines the candidate correction position and the corresponding candidate correction strategy, and then determines the target correction text, which improves the accuracy of the determined target correction text, that is, improves the accuracy of text correction.

[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 is a flowchart of a text error correction method provided by Embodiment 1 of the present invention;

[0023] Figure 2 is a flow chart of a text error correction method provided by Embodiment 2 of the present invention;

[0024] Figure 3 is a structural schematic diagram of a text error correction device provided by Embodiment 4 of the present invention;

[0025] Figure 4 It is a structural schematic diagram of an electronic device for implementing a text error correction method provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION

[0026] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0027] Big model technology: A large neural network model based on deep learning, with large-scale parameters and high-performance computing capabilities, widely used in natural language processing, computer vision and other fields.

[0028] Text correction: refers to the process of identifying and correcting incorrect spelling, grammar, word usage or formatting in a text. Text correction can help users improve the accuracy and readability of documents and avoid misunderstandings or adverse consequences caused by text errors.

[0029] Embodiment 1

[0030] Figure 1 It is a flowchart of a text correction method provided in Example 1 of the present invention. This embodiment can be applied to the situation of correcting text. The method can be executed by a text correction device. The device can be implemented in software and / or hardware and can be configured in an electronic device that carries the text correction function.

[0031] See also Figure 1 The text error correction method shown includes:

[0032] S110: Obtain a text to be processed, and determine a target error correction prompt data set according to the text error correction requirements of the text to be processed.

[0033] The text to be processed refers to the text that needs to be corrected. The text error correction requirement refers to the requirement for correcting the text to be processed. The embodiment of the present invention does not impose any limitation on the text error correction requirement, which can be set by the technician according to experience or needs.

[0034] Among them, the target error correction prompt dataset refers to a dataset that can be used to instruct the text error correction model to pay attention to certain error types in the text to be processed, that is, the target error correction prompt dataset can be used to stimulate the text error correction model to pay attention to errors of key error correction types in the text to be processed.

[0035] Specifically, the text to be processed and the corresponding text error correction requirements are obtained, and the target error correction prompt data set is determined according to the text error correction requirements.

[0036] S120, inputting the text to be processed and the target error correction prompt data set into the trained text error correction model to obtain candidate error correction texts.

[0037] The text error correction model can be used to correct the text to be processed and output the corrected text to be processed, that is, output the candidate error correction text. The candidate error correction text refers to the text obtained after the error correction of the text to be processed.

[0038] It should be noted that the embodiment of the present invention does not impose any limitation on the network structure of the text error correction model, which can be set by technicians based on experience or needs.

[0039] Specifically, the text to be processed and the target error correction prompt data set are input into the trained text error correction model, and the candidate error correction text is output.

[0040] S130: Determine candidate error correction positions and corresponding candidate error correction strategies according to the text to be processed and the candidate error correction texts.

[0041] The candidate error correction position refers to the data position in the text to be processed that is different from the candidate error correction text. The candidate error correction strategy refers to the strategy of the candidate error correction text to correct the data in the text to be processed that is at the candidate error correction position. Exemplarily, the candidate error correction strategy may include content to be corrected and content that has been corrected.

[0042] In an optional embodiment, candidate error correction positions and corresponding candidate error correction strategies are determined based on the text to be processed and the candidate error correction texts, including: comparing the text to be processed with the candidate error correction texts character by character to determine the candidate error correction position in the text to be processed; determining the content to be corrected in the text to be processed and the corrected content in the candidate error correction text according to the candidate error correction position; determining the candidate error correction strategy for the corresponding candidate error correction position according to the content to be corrected and the corrected content.

[0043] The content to be corrected refers to the content with errors in the text to be processed. The corrected content refers to the content that has been corrected in the candidate correction text. It should be noted that the content to be corrected and the corrected content in the same candidate correction position correspond to each other.

[0044] Specifically, the text to be processed and the candidate correction texts are compared character by character or word by word to determine the parts of the text to be processed and the candidate correction texts that are different, and then the candidate correction position, the content to be corrected and the corrected content are determined; based on the content to be corrected and the corrected content in the same candidate correction position, the candidate correction strategy for the aforementioned candidate correction position is determined.

[0045] For example, the candidate error correction strategy for any candidate error correction position may be to replace the content to be corrected with the corrected content.

[0046] It can be understood that by comparing the characters of the text to be processed with the candidate correction text, the candidate correction position in the text to be processed is determined, and then the candidate correction strategy is determined based on the content to be corrected and the corrected content at the candidate correction position, thereby improving the accuracy of the determined candidate correction strategy.

[0047] S140, correcting the text to be processed according to the candidate error correction positions and the candidate error correction strategies to obtain a target error correction text.

[0048] The target error correction text refers to the text obtained after error correction of the text to be processed.

[0049] In an optional embodiment, the text to be processed is corrected according to the candidate correction positions and the candidate correction strategies to obtain the target correction text, including: in response to the position correction instruction, determining whether the candidate correction strategy corresponding to the candidate correction position is the target correction strategy; if so, correcting the content to be corrected at the corresponding candidate correction position in the text to be processed according to the target correction strategy to obtain the target correction text.

[0050] The position error correction instruction can be used to indicate whether to accept the candidate error correction strategy corresponding to the candidate error correction position. The target error correction strategy refers to the candidate error correction strategy that can be used, that is, the candidate error correction strategy accepted by the user.

[0051] Exemplarily, for any candidate error correction position, in response to the position correction instruction of the candidate error correction position, it is determined whether the candidate error correction strategy corresponding to the candidate error correction position is the target error correction strategy; if so, the content to be corrected at the candidate error correction position in the text to be processed is corrected according to the target error correction strategy; it is determined whether the content to be corrected at all candidate error correction positions in the text to be processed has been corrected, and if so, the target error correction text is obtained.

[0052] It can be understood that by determining whether the candidate error correction strategy is the target error correction strategy based on the position error correction instruction, if so, the content to be corrected at the corresponding candidate error correction position is corrected according to the target error correction strategy to obtain the target error correction text. Through the selectivity of the candidate error correction strategy, the text to be processed is corrected, thereby improving the accuracy of the target error correction text.

[0053] The embodiment of the present invention provides a text correction scheme, which obtains the text to be processed, and determines the target correction prompt data set according to the text correction requirements of the text to be processed; inputs the text to be processed and the target correction prompt data set into the trained text correction model to obtain candidate correction text; determines the candidate correction position and the corresponding candidate correction strategy according to the text to be processed and the candidate correction text; corrects the text to be processed according to the candidate correction position and the candidate correction strategy to obtain the target correction text. The above scheme, by inputting the target correction prompt data set and the text to be processed into the text correction model together, obtains the candidate correction text, stimulates the text correction ability of the text correction model, and improves the accuracy of the candidate correction text; at the same time, according to the text to be processed and the candidate correction text, determines the candidate correction position and the corresponding candidate correction strategy, and then determines the target correction text, which improves the accuracy of the determined target correction text, that is, improves the accuracy of text correction.

[0054] Embodiment 2

[0055] Figure 2 It is a flow chart of a text correction method provided in the second embodiment of the present invention. Based on the above embodiments, this embodiment further refines the operation of "determining the target error correction prompt data set according to the text error correction requirements of the text to be processed" into "determining the key error correction type and error correction prompt data corresponding to the text to be processed according to the text error correction requirements; determining the candidate small sample cases from the historical small sample cases according to the key error correction type, and determining the target small sample cases from the candidate small sample cases according to the error correction prompt data" to improve the determination mechanism of the target small sample cases. It should be noted that for the parts not described in detail in the embodiments of the present invention, please refer to the description of other embodiments.

[0056] S210: Obtain the text to be processed, and determine the key error correction type and error correction prompt data corresponding to the text to be processed according to the text error correction requirements.

[0057] The key error correction type refers to the error type for which the text to be processed is corrected. Exemplarily, the key error correction type may include at least one of a spelling error type, a grammatical error type, and an inappropriate word type.

[0058] The error correction prompt data refers to data used to prompt the error correction process of the text error correction model. Exemplarily, the error correction prompt data may include text return format, text return content, and text error processing method. The text return format refers to the output format of the candidate error correction text. The text return content refers to the content in the output candidate error correction text. The text error processing method refers to the method for processing errors in the text to be processed.

[0059] For example, the text correction requirements may include: please read the following text carefully and find all wrong characters and words, and return them in a specified format; if there is no error content, return the original text, if there is an error, return the corrected article; note that only wrong characters need to be found, no need to pay attention to grammar; no explanation is required, etc. The embodiment of the present invention does not impose any limitation on the specified format, which can be set by technicians according to experience or needs.

[0060] For example, text correction requirements may include: Identity, as a professional text correction tool, it can receive the article text entered by the user, find the typos in the text through the built-in algorithm, and return the results to the user in a specified format. Steps for processing user input, 1. Parse the article text entered by the user and understand its meaning; 2. Find the typos in the article and give the correct form of the typos according to the context; 3. The correction results can be returned to the user in a specified format for easy viewing and subsequent processing. Now, please think step by step according to the content entered by the user and the steps for processing the user input, and return the typos in the article, the corresponding correct text after modification, and the sentence to which the typos belong, and output them in a specified format. Requirements, 1. You can refer to the following examples when thinking; 2. You only need to output the typos in the article, the corresponding correct text after modification, and the sentence to which the typos belong in the specified format; 3. You only need to modify the typos according to the context semantics, and do not replace the entire word; 4. You only need to output in a specified format, and do not output the content entered by the user; 5. The sample content cannot be output.

[0061] S220. Determine candidate small sample cases from historical small sample cases based on the key error correction type, and determine target small sample cases from the candidate small sample cases based on the error correction prompt data.

[0062] Among them, historical small sample cases refer to small sample cases in the past. Candidate small sample cases refer to historical small sample cases that include key error correction types. Target small sample cases refer to candidate small sample cases that can be input into the text error correction model. Exemplarily, the target small sample cases include case error types, case error correction methods, and text output formats.

[0063] The case error type refers to the error type included in the target small sample case. The case error correction method refers to the method by which the target small sample case handles errors. The text output format refers to the output format of the target small sample case, that is, the return format.

[0064] It can be understood that the target small sample cases include case error types, case correction methods and text output formats, which improves the richness of the target small sample cases, so as to stimulate the text correction model's focus on correcting the processed text, and improve the accuracy of subsequent correction of the processed text based on the text correction model.

[0065] Specifically, candidate small sample cases including errors of key error correction types are determined from historical small sample cases; and candidate small sample cases that meet the error correction prompt data are used as target small sample cases.

[0066] It should be noted that, according to the error correction prompt data, a preset case threshold number of target small sample cases is determined from the candidate small sample cases. The embodiment of the present invention does not impose any limitation on the size of the preset case threshold, which can be set by technicians based on experience or needs, or determined repeatedly through a large number of experiments.

[0067] S230: Input the text to be processed and the target error correction prompt data set into the trained text error correction model to obtain candidate error correction texts.

[0068] S240: Determine candidate error correction positions and corresponding candidate error correction strategies according to the text to be processed and the candidate error correction texts.

[0069] S250: Correct the text to be processed according to the candidate error correction positions and the candidate error correction strategies to obtain a target error correction text.

[0070] The embodiment of the present invention provides a text error correction scheme, which refines the operation of determining a target error correction prompt data set according to the text error correction requirements of the text to be processed into determining the key error correction type and error correction prompt data corresponding to the text to be processed according to the text error correction requirements; determining candidate small sample cases from historical small sample cases according to the key error correction type, and determining the target small sample case from the candidate small sample cases according to the error correction prompt data, thereby improving the determination mechanism of the target small sample case. The above scheme improves the accuracy of the determined target small sample case by determining the target small sample case from historical small sample cases according to the key error correction type and error correction prompt data determined according to the text error correction requirements.

[0071] On the basis of the above technical solution, if the target error correction prompt data set also includes target text error correction requirements, the method also includes: updating the preset candidate text error correction requirements according to the error correction prompt data to obtain the target text error correction requirements of the text to be processed.

[0072] The target text error correction requirement refers to the requirement of the text error correction model when correcting the text to be processed. Exemplarily, the target text error correction requirement can be understood as data for annotating the error correction process of the text error correction model. For example, the target text error correction requirement can include the text return format and the prohibition of generating data other than text.

[0073] The error correction requirements for candidate texts refer to general basic error correction requirements. The embodiments of the present invention do not impose any restrictions on the error correction requirements for candidate texts, which may be set by technicians based on experience or needs. For example, the error correction requirements for candidate texts may include data other than prohibited generated texts.

[0074] It can be understood that by updating the preset candidate text correction requirements according to the correction prompt data, the target text correction requirements of the text to be processed are obtained, thereby improving the applicability and reliability of the target text correction requirements; at the same time, the introduced target text correction requirements realize the text correction model's prompt supplement for error correction of the text to be processed, thereby improving the accuracy of subsequent text correction models in correcting the text to be processed.

[0075] Embodiment 3

[0076] The embodiment of the present invention provides a text error correction method based on the above embodiment. It should be noted that for the parts not described in detail in the embodiment of the present invention, reference can be made to the descriptions of other embodiments.

[0077] Existing text error correction technology solutions mainly include rule-based methods, machine learning-based methods, deep learning-based methods and large model-based methods.

[0078] For example, the rule-based method is to identify and correct errors in the text by pre-setting a series of grammar rules, spelling rules and semantic rules. These rules are usually designed and written by linguists and experts according to the characteristics of the language. For example, rules can be set to identify common spelling errors, grammatical errors or unreasonable phrase combinations. When the text is entered, the system will check it according to these rules, and once it finds that it does not meet the rules, it will make suggestions for modification. The advantage of this method is that the rules are clear and easy to understand, and it works better for some errors with strong regularity. However, its limitation is that it is difficult for the rules to cover all error types, and the ability to handle complex errors or context-related errors is limited.

[0079] For example, a machine learning-based method is to identify errors in text by training models. This method usually includes two stages: feature engineering and model training. In the feature engineering stage, researchers will design different features according to the error type, such as word frequency, contextual information, grammatical structure, etc. In the model training stage, these features are used to train a classifier or regression model to enable it to predict whether there are errors in the text and give correction suggestions. The advantage of this method is that it can automatically extract features by learning a large amount of data, and it also has a certain ability to handle errors where the rules are not obvious. But its performance depends largely on the quality of the features and the complexity of the model.

[0080] Exemplary, deep learning-based methods use neural networks, especially recurrent neural networks and encoder-decoder architectures based on self-attention mechanisms, to process text data. Deep learning models can automatically learn complex language features from large amounts of text data, thereby improving the ability to identify and correct errors. For example, sequence-to-sequence models and attention mechanisms can be used to implement end-to-end text error correction systems. The advantage of this approach is that the model can capture long-range dependencies and contextual information, and has a better processing effect on complex errors.

[0081] Exemplarily, the large model-based method is to implement text error correction using large-scale pre-trained language models. These models are usually pre-trained on hundreds of millions of text corpora, thereby gaining a deep understanding and extensive knowledge of the language. In the error correction task, the large model can predict the most likely correct sequence based on the input text sequence. Because the large models have powerful language generation capabilities, they can directly generate correct text without the need to clearly define the error type. In addition, the large models can also be fine-tuned to adapt to specific error correction tasks, further improving the error correction performance. The advantage of this method is that the model is powerful, can handle various types of errors, and does not require complex feature engineering. Although existing text error correction technical solutions can identify and correct errors in text to a certain extent, they still have some limitations, such as dependence on specific error types, the need for a large amount of labeled data, and real-time and efficiency issues in practical applications.

[0082] In summary, existing text error correction technology solutions can identify and correct errors in text to a certain extent, but they still have some limitations, mainly in the following aspects: rule-based methods rely heavily on pre-set rules, which often only cover limited error types and are powerless for some complex or uncommon errors. In addition, the formulation of rules usually requires the participation of linguists and experts, which makes the updating and maintenance of rules expensive; although machine learning and deep learning-based methods can automatically extract features through learning data, they usually require a large amount of labeled data to train the model. Acquiring this data is not only time-consuming and labor-intensive, but also in some fields or languages, high-quality data may be difficult to obtain, which limits the scope of application of these methods. Existing text error correction technologies, especially those based on deep learning and large models, often require high computing resources, which may cause delays in real-time application scenarios and affect user experience. In addition, the complexity of the model may also make it difficult to deploy on mobile devices or resource-constrained environments. Although methods based on deep learning and large models have made breakthroughs in context understanding, they still have difficulty in fully understanding complex contexts and semantic relationships, especially when dealing with polysemy, slang or domain-specific terms, which may result in incorrect correction suggestions. Therefore, although the existing text error correction technology has made some progress in improving text quality and user experience, it still has many limitations. Therefore, a new method is urgently needed to solve these problems in order to improve the accuracy and efficiency of text error correction.

[0083] The purpose of the embodiment of the present invention is to provide a text correction method based on large model technology, which aims to solve the problems existing in the prior art, such as dependence on specific error types, the need for a large amount of annotated data, real-time and efficiency issues, limitations of context understanding, error transmission issues, and privacy and security issues. By adding a small sample case of correction (i.e., a target small sample case) to the correction prompt word (i.e., the target correction prompt data set) to stimulate the ability of the large model (i.e., the text correction model) to correct text, the accuracy of text correction is improved. In addition, by indicating in the correction prompt word that the corrected text is directly returned, the character string after the original text and the corrected text is compared to confirm the position of the correction, and based on engineering means, the position, the corrected typos, and whether to replace the option are directly displayed to the user, thereby improving the user experience and the convenience of operation.

[0084] The main content of the embodiment of the present invention is to provide an efficient and accurate text error correction method based on the big model technology. The core idea of ​​the method is to stimulate the ability of the big model to correct text errors by adding a small sample case of error correction in the error correction prompt word. Specifically, first obtain the text data to be corrected (i.e., the text to be processed) input by the user or received by the system, and then design and generate error correction prompt words (i.e., the target error correction prompt data set) containing small sample cases of error correction. These error correction prompt words not only contain information about the error type and correction method, but also indicate that the big model is required to directly return the text after error correction.

[0085] The steps of the text error correction method provided by the embodiment of the present invention include: step 1, obtaining the text data to be corrected (i.e., obtaining the text to be processed). The text data input by the user or received by the system may contain various types of errors, such as spelling errors, grammatical errors, inappropriate words, etc. Step 2, preparing error correction prompt words. According to the text data to be corrected, design and generate error correction prompt words. The error correction prompt words contain some target small sample cases, which show common error types and correct correction methods. At the same time, it is noted in the error correction prompt words that the large model is required to directly return the corrected text. Step 3, input the text data to be corrected and the error correction prompt words into the large model. After the large model receives these input data, it will understand the task requirements according to the target small sample cases and the target text correction requirements in the error correction prompt words, and generate the corrected text, i.e., the candidate error correction text. Step 4, the large model generates the corrected text. Based on its powerful language generation ability and understanding of the target small sample cases, the large model generates a corrected text, i.e., the candidate error correction text. The candidate correction text should correct the errors in the original text (i.e., the text to be processed) while maintaining the intent and context of the original text. Step 5: By comparing the text to be processed with the candidate correction text character by character or word by word, find out the differences between the text to be processed and the candidate correction text, and determine the candidate correction position and candidate correction strategy. Step 6: Engineered display of the correction results and provide replacement options. The correction results (including candidate correction positions and candidate correction strategies) are displayed to the user in a user-friendly manner, including indicating the location of the error (i.e., the candidate correction position), the wrong characters or words (i.e., the content to be corrected), and the correction suggestions provided by the large model (i.e., the corrected content). At the same time, a replacement option is provided so that the user can choose whether to accept the correction suggestion. Step 7: The user confirms the correction result and makes a replacement. The user decides whether to accept the correction suggestion of the large model based on the display of the correction result and the replacement option. If the user accepts, the system will automatically replace the erroneous text; if the user does not accept, the system keeps the original text unchanged.

[0086] The embodiment of the present invention utilizes the capability of a large model and combines the design of error correction prompt words to realize automatic recognition and correction of errors in text. This method not only improves the accuracy of text error correction, but also improves the user experience through an engineered display method.

[0087] The embodiment of the present invention stimulates the ability of the large model to correct text by adding a small sample case of the target for correction in the correction prompt word, so that the large model can better understand the error type and correction method, thereby improving the accuracy of text correction. In the error correction prompt word, it is indicated that the text after correction is directly returned, which simplifies the generation process of the correction result; the large model directly returns the text after correction (i.e., the candidate correction text), reduces the intermediate links, and improves the real-time and efficiency of correction. The embodiment of the present invention confirms the position of the correction by comparing the character string of the original text and the text after correction. This step enables the user to clearly know which positions have errors and provides replacement options; the user can choose whether to accept the correction suggestion based on the displayed results, thereby improving user participation and the accuracy of correction. The embodiment of the present invention directly displays the correction results to the user through engineering means, including the position, the corrected typos, and the option of whether to replace, providing a friendly user interface and a convenient operation method; the user can intuitively see the correction suggestions and replace them as needed, thereby improving user experience and satisfaction.

[0088] In summary, the embodiment of the present invention provides a text error correction method based on large model technology, which improves the accuracy of text error correction by adding a small sample case of error correction target in the prompt word; at the same time, by simplifying the generation process of error correction results, confirming the error correction position and providing replacement options, the user experience and operation convenience are improved. These advantages make the present invention have a wide range of application prospects in the field of text error correction.

[0089] The text error correction method based on the big model technology proposed in the embodiment of the present invention has good practical value compared with the text error correction method using the big model technology in the prior art. The small sample cases of the target are added to the error correction prompt words, and the return method is pointed out in the error correction prompt words, and the engineering display scheme is explained. The big model is developing rapidly, and the general capabilities of the big model may be continuously improved in the future. In the future, we can try to use better big models to correct text errors and improve the adoption rate of text error correction.

[0090] It should be noted that the information collected in the embodiments of the present invention is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data comply with the relevant laws, regulations and standards of relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse; if the user chooses to refuse, the expert decision-making process will be entered.

[0091] Embodiment 4

[0092] Figure 31 is a schematic diagram of the structure of a text error correction device provided in Embodiment 4 of the present invention. This embodiment is applicable to the case of correcting text errors, and the method can be executed by a text error correction device, which can be implemented in software and / or hardware, and can be configured in an electronic device that carries a text error correction function.

[0093] like Figure 3 As shown, the device includes: an error correction prompt data set determination module 310, a candidate error correction text determination module 320, a candidate error correction strategy determination module 330 and a target error correction text determination module 340. Among them,

[0094] The error correction prompt data set determination module 310 is used to obtain the text to be processed and determine the target error correction prompt data set according to the text error correction requirements of the text to be processed;

[0095] A candidate error correction text determination module 320 is used to input the text to be processed and the target error correction prompt data set into a trained text error correction model to obtain a candidate error correction text;

[0096] A candidate error correction strategy determination module 330 is used to determine a candidate error correction position and a corresponding candidate error correction strategy according to the text to be processed and the candidate error correction text;

[0097] The target error correction text determination module 340 is used to correct the text to be processed according to the candidate error correction positions and the candidate error correction strategies to obtain the target error correction text.

[0098] The embodiment of the present invention provides a text correction scheme, which obtains the text to be processed, and determines the target correction prompt data set according to the text correction requirements of the text to be processed; inputs the text to be processed and the target correction prompt data set into the trained text correction model to obtain candidate correction text; determines the candidate correction position and the corresponding candidate correction strategy according to the text to be processed and the candidate correction text; corrects the text to be processed according to the candidate correction position and the candidate correction strategy to obtain the target correction text. The above scheme, by inputting the target correction prompt data set and the text to be processed into the text correction model together, obtains the candidate correction text, stimulates the text correction ability of the text correction model, and improves the accuracy of the candidate correction text; at the same time, according to the text to be processed and the candidate correction text, determines the candidate correction position and the corresponding candidate correction strategy, and then determines the target correction text, which improves the accuracy of the determined target correction text, that is, improves the accuracy of text correction.

[0099] Optionally, if the target error correction prompt data set includes a target small sample case, the error correction prompt data set determination module 310 includes:

[0100] An error correction type determination unit, used to determine a key error correction type and error correction prompt data corresponding to the text to be processed according to the text error correction requirement;

[0101] The small sample case determination unit is used to determine candidate small sample cases from historical small sample cases according to the key error correction type, and to determine target small sample cases from the candidate small sample cases according to the error correction prompt data.

[0102] Optionally, if the target error correction prompt data set also includes a target text error correction requirement, the device further includes:

[0103] The text error correction requirement determination unit is used to update the preset error correction requirement of the candidate text according to the error correction prompt data to obtain the target text error correction requirement of the text to be processed.

[0104] Optionally, the target small sample case includes case error type, case error correction method and text output format.

[0105] Optionally, the candidate error correction strategy determination module 330 includes:

[0106] A candidate error correction position determination unit, used for comparing characters of the text to be processed with the candidate error correction text to determine the candidate error correction position in the text to be processed;

[0107] A correction content determination unit, used to determine the content to be corrected in the text to be processed and the corrected content in the candidate correction text according to the candidate correction position;

[0108] The candidate error correction strategy determining unit is used to determine the candidate error correction strategy of the corresponding candidate error correction position according to the to-be-corrected content and the corrected content.

[0109] Optionally, the target error correction text determination module 340 includes:

[0110] a target error correction strategy determination unit, configured to determine, in response to a position error correction instruction, whether the candidate error correction strategy corresponding to the candidate error correction position is a target error correction strategy;

[0111] The target error correction text determination unit is used to, if yes, correct the to-be-corrected content at the corresponding candidate error correction position in the to-be-processed text according to the target error correction strategy to obtain the target error correction text.

[0112] The text correction device provided in the embodiment of the present invention can execute the text correction method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing each text correction method.

[0113] In the technical solution of the present invention, the collection, storage, use, processing, transmission, provision and disclosure of the texts to be processed, text correction requirements, historical small sample cases and candidate text correction requirements are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0114] According to an embodiment of the present invention, the present invention also provides an electronic device, a readable storage medium and a computer program product.

[0115] Embodiment 5

[0116] Figure 4 It is a structural diagram of an electronic device for implementing a text error correction method provided by Embodiment 5 of the present invention. Electronic device 410 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0117] like Figure 4 As shown, the electronic device 410 includes at least one processor 411, and a memory connected to the at least one processor 411 in communication, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 to the random access memory (RAM) 413. In the RAM 413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, the ROM 412, and the RAM 413 are connected to each other via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.

[0118] Multiple components in the electronic device 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0119] Processor 411 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. Processor 411 performs the various methods and processes described above, such as a text error correction method.

[0120] In some embodiments, the text error correction method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 418. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the text error correction method described above may be performed. Alternatively, in other embodiments, the processor 411 may be configured to execute the text error correction method in any other appropriate manner (e.g., by means of firmware).

[0121] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

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

[0123] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.

[0124] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device 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 a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0125] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may 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), a blockchain network, and the Internet.

[0126] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0127] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0128] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A text error correction method, characterized in that: include: Acquire a text to be processed, and determine a target error correction prompt data set according to the text error correction requirements of the text to be processed; Inputting the to-be-processed text and the target error correction prompt data set into a trained text error correction model to obtain a candidate error correction text; Determining candidate error correction positions and corresponding candidate error correction strategies according to the text to be processed and the candidate error correction texts; According to the candidate error correction positions and the candidate error correction strategies, the text to be processed is corrected to obtain a target error correction text.

2. The method according to claim 1, characterized in that If the target error correction prompt data set includes a target small sample case, then determining the target error correction prompt data set according to the text error correction requirement of the text to be processed includes: According to the text error correction requirement, determining the key error correction type and error correction prompt data corresponding to the text to be processed; According to the key error correction type, candidate small sample cases are determined from historical small sample cases, and according to the error correction prompt data, target small sample cases are determined from the candidate small sample cases.

3. The method according to claim 2, characterized in that If the target error correction prompt data set also includes target text error correction requirements, the method further includes: According to the error correction prompt data, the preset error correction requirements of the candidate texts are updated to obtain the error correction requirements of the target texts of the text to be processed.

4. The method according to claim 2 or 3, characterized in that: The target small sample cases include case error types, case error correction methods and text output formats.

5. The method according to claim 1, characterized in that The step of determining a candidate error correction position and a corresponding candidate error correction strategy according to the text to be processed and the candidate error correction text includes: Compare the characters of the text to be processed with the candidate error correction text to determine the candidate error correction position in the text to be processed; According to the candidate error correction positions, respectively determining the content to be corrected in the to-be-processed text and the corrected content in the candidate error correction text; According to the to-be-corrected content and the corrected content, a candidate error correction strategy for a corresponding candidate error correction position is determined.

6. The method according to claim 5, characterized in that The step of correcting the text to be processed according to the candidate error correction position and the candidate error correction strategy to obtain a target error correction text includes: In response to the position error correction instruction, determining whether the candidate error correction strategy corresponding to the candidate error correction position is a target error correction strategy; If so, according to the target error correction strategy, the to-be-corrected content at the corresponding candidate error correction position in the to-be-processed text is corrected to obtain the target error correction text.

7. A text error correction device, characterized in that: include: The error correction prompt data set determination module is used to obtain the text to be processed and determine the target error correction prompt data set according to the text error correction requirements of the text to be processed; A candidate error correction text determination module is used to input the text to be processed and the target error correction prompt data set into a trained text error correction model to obtain a candidate error correction text; A candidate error correction strategy determination module, used to determine a candidate error correction position and a corresponding candidate error correction strategy based on the text to be processed and the candidate error correction text; The target error correction text determination module is used to correct the text to be processed according to the candidate error correction positions and the candidate error correction strategies to obtain the target error correction text.

8. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement a text error correction method as described in any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a text error correction method as described in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the steps of the text error correction method according to any one of claims 1 to 6 are implemented.