Text error correction model training method and device and electronic equipment

By acquiring and enhancing different types of text data sets and training text error correction models, the problems of low reusability and high manual labeling cost in the prior art are solved, and efficient text error correction processing is achieved.

CN119294387APending Publication Date: 2025-01-10PEOPLE'S INSURANCE COMPANY OF CHINA

Patent Information

Application Number
CN202411515130.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing text error correction model has low reusability, and the training data sets are generated by manual annotation, resulting in high labor costs and low efficiency.

Method used

By obtaining text data sets with error-free features and error-free features, data enhancement is performed separately to generate training data sets, and using the initial large language model for training to generate text error correction models.

Benefits of technology

It reduces the workload of manual labeling, improves training efficiency, realizes unified error correction processing for various types of error characteristics, and improves the reusability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119294387A_ABST
    Figure CN119294387A_ABST
Patent Text Reader

Abstract

The invention discloses a text error correction model training method and apparatus, and an electronic device. The method comprises the steps of obtaining a first text data set and a second text data set; wherein the first text data set is a data set without a first error feature; the second text data set is a data set with a second error feature; performing data enhancement on the first text data set according to the first error feature to generate a first training data set; generating a second training data set according to the second error feature, the second text data set and a data enhancement large model; and training an initial large language model according to the first text data set, the first training data set, the second text data set and the second training data set to obtain a text error correction model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of artificial intelligence technology, and specifically relates to a training method, device and electronic equipment for a text error correction model. Background Art

[0002] In the relevant text error correction technology, on the one hand, the situations where there are errors in the words in the text itself are corrected, and on the other hand, the situations where there are no single word errors in the text but there are problems or unreasonableness in grammar or professional perspectives in various fields are corrected.

[0003] Among them, the text correction technology processes the above two types of text errors by inputting data with specific labels as input data into a BERT model with a specific network structure. The model needs to be adjusted according to the text correction task, and the training data set for training the model is numerous and complex, and is generated by manual annotation. Therefore, there are problems such as low model reusability, high labor costs and low efficiency. Summary of the invention

[0004] The embodiments of the present application provide a training method, device and electronic device for a text error correction model, which can solve the problems of low reusability of the text error correction model and high labor cost and low efficiency caused by manual annotation of the training data set of the text error correction model.

[0005] In a first aspect, an embodiment of the present application provides a method for training a text error correction model, the method comprising: obtaining a first text data set and a second text data set; wherein the first text data set is a data set without a first error feature; the second text data set is a data set with a second error feature; data enhancement is performed on the first text data set according to the first error feature to generate a first training data set; a second training data set is generated according to the second error feature, the second text data set and a data enhancement large model; an initial large language model is trained according to the first text data set, the first training data set, the second text data set and the second training data set to obtain a text error correction model.

[0006] In a second aspect, an embodiment of the present application provides a training device for a text error correction model, the device comprising: an acquisition module, used to acquire a first text data set and a second text data set; wherein the first text data set is a data set without a first error feature; the second text data set is a data set with a second error feature; a training data generation module, used to perform data enhancement on the first text data set according to the first error feature to generate a first training data set; and to generate a second training data set according to the second error feature, the second text data set and a data enhancement large model; a model training module, used to train an initial large language model according to the first text data set, the first training data set, the second text data set and the second training data set to obtain a text error correction model.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0008] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0009] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the method described in the first aspect.

[0010] In a sixth aspect, an embodiment of the present application provides a computer program product, comprising a computer program stored on a non-transitory computer-readable storage medium, wherein the computer program comprises a program or instructions, and when the program or instructions are executed, the steps of the method described in the first aspect are implemented.

[0011] In an embodiment of the present application, a first text data set and a second text data set are obtained, wherein the first text data set is a data set without a first error feature, and the second text data set is a data set with a second error feature, data enhancement is performed on the first text data set according to the first error feature to generate a first training data set, and a second training data set is generated according to the second error feature, the second text data set, and a data enhancement large model, and then the initial large language model is trained according to the first text data set, the first training data set, the second text data set, and the second training data set to obtain a text error correction model. It is achieved that corresponding training data sets are generated in different ways based on different types of error features, and a training data set is constructed using a data enhancement large model, which can reduce the workload of manual annotation and improve efficiency, so that the error text with various types of error features can be uniformly corrected by the text error correction model obtained by training the initial large language model. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 It is a flowchart of a method for training a text error correction model provided in an embodiment of the present application; Figure 2 It is a flowchart of another method for training a text error correction model provided in an embodiment of the present application; Figure 3 It is a structural schematic diagram of a training device for a text error correction model provided in an embodiment of the present application; Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0013] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0014] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0015] In the following, in conjunction with the accompanying drawings, the training method, device and electronic device of the text error correction model provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.

[0016] Figure 1 A flowchart of a method for training a text error correction model provided by an embodiment of the present application is shown, and the method can be executed by an electronic device. Figure 1 , the method may include the following steps.

[0017] Step 102, obtaining a first text data set and a second text data set; wherein the first text data set is a data set without a first error feature; and the second text data set is a data set with a second error feature.

[0018] The first error feature includes errors in the text or words themselves, such as extra-word errors, missing-word errors, and wrong spelling errors. The second error feature includes grammatical errors, such as non-compliance errors, fixed paradigm errors, word order errors, and concept duplication errors.

[0019] Step 104: perform data enhancement on the first text data set according to the first error feature to generate a first training data set.

[0020] Among them, for the first error feature, errors in the text or words themselves, by performing data enhancement on the first text data set, that is, transforming the text or words in the first text data set, generating a new text, such as inserting, deleting and replacing the text or words in the text, generating a diversified first training data set containing the first error feature for training the initial large language model. It should be noted that when performing data enhancement on the first error feature, the distribution of the transformed text or words in the first text data set is controlled to avoid multiple transformations of high-frequency text or words, and to ensure the balance of transformation types and the balance of the transformed text or words.

[0021] Step 106: Generate a second training data set based on the second error feature, the second text data set, and the data enhancement model.

[0022] The data enhancement large model is used to generate new and diversified texts based on the second error feature. For the second error feature, in terms of grammatical errors in the text, the data enhancement large model can better analyze and understand the meaning and association of the text in the second text data set, so as to use the data enhancement large model to identify the second error feature in the second text data set, transform the second text data set based on the second error feature, or generate a diversified second training data set containing the second error feature based on the prompt of the second error feature, so as to be used for training the initial large language model.

[0023] Step 108: Train the initial large language model according to the first text data set, the first training data set, the second text data set, and the second training data set to obtain a text error correction model.

[0024] In an embodiment of the present application, a first text data set and a second text data set are obtained, wherein the first text data set is a data set without a first error feature, and the second text data set is a data set with a second error feature, data enhancement is performed on the first text data set according to the first error feature to generate a first training data set, and a second training data set is generated according to the second error feature, the second text data set, and a data enhancement large model, and then the initial large language model is trained according to the first text data set, the first training data set, the second text data set, and the second training data set to obtain a text error correction model. It is achieved that corresponding training data sets are generated in different ways based on different types of error features, and a training data set is constructed using a data enhancement large model, which can reduce the workload of manual annotation and improve efficiency, so that the error text with various types of error features can be uniformly corrected by the text error correction model obtained by training the initial large language model.

[0025] In one implementation, the above-mentioned step 106 generates a second training data set according to the second error feature, the second text data set and the data enhancement model, including the following steps.

[0026] Step 1061: Analyze the second error feature of the second text data set to determine a prompt text corresponding to the second error feature.

[0027] Among them, the second text data set is a data set with a second error feature, and the second text data set includes marks of annotation errors, so that these marks are summarized, that is, the second error features of the second text data set are analyzed, and multiple second error features can be classified. Different categories of second error features correspond to different prompt texts, and the prompt text can provide prompts for the generation of the second training data set. For example, the prompt text corresponding to the compliance error is: adjust the second text data set using preset rules; the prompt text corresponding to the fixed paradigm error is: rewrite a text using a fixed paradigm; the prompt text corresponding to the word order error is: adjust a certain word or word in a text to another position in the text; the prompt text corresponding to the concept duplication error is: summarize the higher-level concepts of each parallel entity concept separated by a comma in a text and add it to the parallel entity concept of the text. Based on the above prompt text, the data enhancement model can generate the second training data set indicated by the prompt text according to the above prompt texts.

[0028] Step 1062, when the type of the second error feature is a non-compliance error, the prompt text and the second text data set are input into the data enhancement model for data enhancement to generate a second training data set for the target business field.

[0029] Among them, the non-compliance error is that the second error feature does not involve whether the preset rules of the current target business field are met. The target business field is determined based on the second text data set, that is, when data enhancement is performed through the data enhancement large model, the generated second training data set is limited to the target business field, so that the generated second training data set can better train the initial large language model applied to the target business field.

[0030] In an embodiment of the present application, the prompt text corresponding to the second error feature is determined based on the analysis of the second error feature of the second text data set, so as to prompt the generation of the second training data set according to the prompt text. In the case where the type of the second error feature is a non-compliance error, such as a fixed paradigm error, a word order error, and a concept duplication error, this type of error is not restricted by preset rules, and the data enhancement large model does not need to generate the second training data set according to the preset rules. The prompt text and the second text data set are input into the data enhancement large model for data enhancement, and a second training data set for the target business field can be generated. The second training data set has diversity, which can be used to train the initial large language model to improve the efficiency and quality of model training.

[0031] In one implementation, the method further includes: step 1063, when the type of the second error feature is a compliance error, adjusting the second text data set according to preset rules of the target business field to generate the second training data set.

[0032] In an embodiment of the present application, the compliance error refers to whether the second error feature satisfies the preset rules of the current target business field. When the type of the second error feature is a compliance error, the second text data set is adjusted according to the preset rules of the target business field. For example, the preset rules require that "date" only include x year y month z day, then the "date" is expanded to x year y month z day u hour v minute w second. The expanded error text can be used as a second training data set, that is, a second training data set is generated for training the initial large language model.

[0033] In one implementation, the first error feature includes at least one. The above step 104 performs data enhancement on the first text data set according to the first error feature to generate a first training data set, including the following steps.

[0034] Step 1041: for at least one target text in the first text data set, adjust the target text according to at least one of the first error features to obtain an error text having the first error feature.

[0035] Among them, the target text is adjusted according to the first error feature to obtain an error text with the first error feature. The error text may include one first error feature or multiple first error features. The embodiment of the present application is not limited and can be specifically controlled according to the requirements of the required training data set.

[0036] Step 1042: determine at least one of the erroneous texts as the first training data set.

[0037] In an embodiment of the present application, the first error feature is an error in the text or word itself. At least one target text in the first text data set is adjusted according to at least one first error feature, such as repeating text or words, deleting text or words, replacing text or words, etc., to obtain an error text containing the first error feature. The at least one error text obtained is determined as the first training data set, that is, a first training data set is generated for training the initial large language model.

[0038] In one implementation, the first error feature includes multiple-word errors, missing-word errors, and wrong-word errors. The above step 1041 adjusts the target text according to at least one of the first error features to obtain an error text with the first error feature, including at least one of the following.

[0039] (1) Repeating a word or phrase at a preset position of the target text a preset number of times to obtain a first error text with multiple word errors.

[0040] The preset position may include one or more positions, the preset position may be a continuous position or a discontinuous position, and the preset number of times may include one or more times.

[0041] (2) Deleting a first preset number of characters or words from the target text to obtain a second erroneous text with a few character errors.

[0042] The first preset number may be one or more, and the multiple characters or words may be continuous or discontinuous.

[0043] (3) A second preset number of characters or words in the target text are replaced with similar characters or words to obtain a third erroneous text with typos.

[0044] The second preset number may be one or more, and the multiple characters or words may be continuous or discontinuous.

[0045] In an embodiment of the present application, a first erroneous text with multiple word errors is obtained by repeating the text or words at a preset position of the target text a preset number of times, and / or a first preset number of words or words in the target text are deleted to obtain a second erroneous text with fewer word errors, and / or a second preset number of words or words in the target text are replaced with similar characters or similar words to obtain a third erroneous text with typos, wherein the preset position, preset number of times, first preset number, second preset number, and whether the adjusted text or words are continuous can be flexibly adjusted, so that the generated first training data set has diversity, which can be used to train the initial large language model and improve the efficiency and quality of model training.

[0046] In one implementation, the above step 108 trains the initial large language model according to the first text data set, the first training data set, the second text data set and the second training data set to obtain a text error correction model, including the following steps.

[0047] Step 1081, input the first training data set and the second training data set into the initial large language model to perform text error correction processing according to the error correction task instruction, and obtain the corrected text and the error type corresponding to the corrected text.

[0048] Among them, the error correction task instructions can be pre-set or determined according to the input data. For example, the instruction for the text error correction task is: "You are an expert in the text error correction of clauses. You will carefully review the typos in the clauses and return your review results in json format." The output in json format returned by the text error correction model is {"error type": "error 1", "correct text": "***"}. For another example, the instruction for the grammatical error correction task is: "You are an expert in the text review of clauses. You will carefully review the grammatical errors in the clauses and return your review results in json format." The output in json format returned by the text error correction model is {"error type": "error 2", "correct text": "***"}.

[0049] Step 1082: According to the corrected text, the error type corresponding to the corrected text, the first text data set, and the second text data set, the parameters of the initial large language model are adjusted until the initial large language model converges to obtain the text correction model.

[0050] In an embodiment of the present application, a first training data set containing a first error feature and a second training data set containing a second error feature are input into an initial large language model and text error correction processing is performed according to the error correction task instruction to obtain a corrected text and an error type corresponding to the corrected text. The error type corresponding to the corrected text summarizes and explains the error correction process so that the large language model can better understand the error correction process and improve the performance of the text error correction model. Thus, the parameters of the initial large language model are updated and adjusted using the corrected text, the error type corresponding to the corrected text, and the first text data set and the second text data set until the model meets the preset model convergence conditions, thereby obtaining a trained text error correction model for correcting the text to be corrected. The text error correction model can uniformly correct erroneous texts with various types of error features without adjusting the model structure for different types of errors, thereby improving the reusability of the text error correction model.

[0051] In one implementation, the training of the above-mentioned initial large language model may include decomposing the parameter matrix C (n×n) of the initial large language model into two decomposition matrices A (n×m) and B (m×n), updating A and B, and after the training is completed, adding A, B and C to obtain the parameters of the final text error correction model. Specifically, the parameter matrix of the initial large language model is W0, and W0 is decomposed into A and B, and A and B are used as ΔW, where ΔW=A*B. A and B are updated during the training process to obtain a new ΔW, and the newly obtained ΔW is added to the original W0 to obtain the parameters of the trained text error correction model. By updating the decomposed A and B, the amount of parameters that need to be learned during the model training process is reduced, thereby reducing resource consumption and shortening the training cycle.

[0052] Figure 2 A flowchart of another text error correction model training method provided in an embodiment of the present application is shown in FIG. Figure 2 , the method may include the following steps.

[0053] Step 201: Acquire a first text data set and generate a text error correction training data set.

[0054] Here, a first unlabeled text dataset is obtained, such as insurance clauses, contracts, official documents, etc., which has no text errors. The first text dataset is repeated, deleted, replaced, etc. to obtain a text error correction training dataset including text errors.

[0055] Step 202: Acquire a second text data set and generate a grammar error correction training data set.

[0056] A second text dataset with annotations is obtained, and the second text dataset includes grammatical errors. The grammatical errors in the second text dataset are summarized and summarized to generate prompt texts corresponding to different categories of grammatical errors. An example of the generated prompt text is shown in Table 1. A corresponding grammatical error correction training dataset is generated according to the prompt text.

[0057] Table 1.

[0058] For errors that do not meet compliance requirements, the second text dataset is adjusted according to the preset rules of the target business field to generate a grammar error correction training dataset. For fixed pattern errors, word order errors, and concept duplication errors, data enhancement is performed through prompt text, the second text dataset, and a data enhancement model to generate a grammar error correction training dataset for the target business field.

[0059] Step 203 , training the initial large language model using the first text data set, the text error correction training data set, the second text data set, and the grammar error correction training data set until the initial large language model converges to obtain a trained text error correction model.

[0060] Through the embodiments of the present application, corresponding training data sets are generated in different ways based on different types of error features, and the training data set is constructed using a data enhancement large model, which can reduce the workload of manual annotation and improve efficiency, so that erroneous texts with various types of error features can be uniformly corrected through the text error correction model obtained by training the initial large language model.

[0061] It should be noted that the training method of the text error correction model provided in the embodiment of the present application can be executed by a training device for the text error correction model, or a control module in the training device for the text error correction model for executing the training method for the text error correction model. In the embodiment of the present application, the training device for the text error correction model provided in the embodiment of the present application is taken as an example to illustrate the training method for the text error correction model executed by the training device for the text error correction model.

[0062] Figure 3 A schematic diagram of the structure of a text error correction model training device provided in an embodiment of the present application is shown. Figure 3 As shown, the device 300 includes: an acquisition module 31, a training data generation module 32 and a model training module 33.

[0063] Among them, the acquisition module 31 is used to acquire a first text data set and a second text data set; wherein the first text data set is a data set without a first error feature; the second text data set is a data set with a second error feature; the training data generation module 32 is used to perform data enhancement on the first text data set according to the first error feature to generate a first training data set; and to generate a second training data set according to the second error feature, the second text data set and a data enhancement large model; the model training module 33 is used to train an initial large language model according to the first text data set, the first training data set, the second text data set and the second training data set to obtain a text error correction model.

[0064] In one implementation, the training data generation module 32 can be used to analyze the second error feature of the second text data set to determine the prompt text corresponding to the second error feature; when the type of the second error feature is a non-compliance error, the prompt text and the second text data set are input into the data enhancement model for data enhancement to generate a second training data set for the target business field; wherein the target business field is determined based on the second text data set.

[0065] In one implementation, the training data generation module 32 may also be used to adjust the second text data set according to preset rules of the target business field to generate the second training data set when the type of the second error feature is a compliance error.

[0066] In one implementation, the training data generation module 32 can be used to adjust at least one target text in the first text data set according to at least one of the first error features to obtain an erroneous text with the first error feature; and determine at least one of the erroneous texts as the first training data set.

[0067] In one implementation, the first error feature includes multiple-word errors, fewer-word errors, and wrong-word errors. The training data generation module 32 can be used to (1) repeat the characters or words at a preset position of the target text for a preset number of times to obtain a first error text with multiple-word errors; (2) delete the first preset number of characters or words in the target text to obtain a second error text with fewer-word errors; (3) replace the second preset number of characters or words in the target text with similar characters or similar words to obtain a third error text with wrong-word errors.

[0068] In one implementation, the model training module 33 can be used to input the first training data set and the second training data set into the initial large language model to perform text correction processing according to the error correction task instructions to obtain the corrected text and the error type corresponding to the corrected text; according to the corrected text, the error type corresponding to the corrected text, the first text data set and the second text data set, the parameters of the initial large language model are adjusted until the initial large language model converges to obtain the text correction model.

[0069] The training device of the text error correction model in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device, and for example, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc., and the embodiment of the present application does not specifically limit it.

[0070] The training device of the text error correction model in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0071] The training device of the text error correction model provided in the embodiment of the present application can achieve Figure 1 and Figure 2 To avoid repetition, the various processes implemented in the method embodiment are not described here.

[0072] Based on the same technical concept, an embodiment of the present application further provides an electronic device, which is used to execute the above-mentioned text error correction model training method. Figure 4 A schematic diagram of the structure of an electronic device for implementing each embodiment of the present application. Electronic devices may have relatively large differences due to different configurations or performances, and may include a processor (processor) 401, a communication interface (Communications Interface) 402, a memory (memory) 403 and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404. The processor 401 can call a computer program stored in the memory 403 and can be run on the processor 401 to execute the various steps of the above-mentioned text error correction model training method embodiment, and can achieve the same technical effect, to avoid repetition, it will not be repeated here.

[0073] The above electronic device structure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, the input unit may include a graphics processing unit (GPU) and a microphone, and the display unit may be configured with a display panel in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit includes a touch panel and at least one of other input devices. The touch panel is also called a touch screen. Other input devices may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0074] The memory can be used to store software programs and various data. The memory may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory may include a volatile memory or a non-volatile memory, or the memory may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DRRAM).

[0075] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor.

[0076] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the training method embodiment of the above-mentioned text error correction model is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0077] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0078] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned text error correction model training method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0079] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0080] An embodiment of the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes a program or instructions. When the program or instructions are executed, the various processes of the above-mentioned text error correction model training method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they will not be repeated here.

[0081] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0082] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0083] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A training method for a text error correction model, characterized in that: include: Acquire a first text data set and a second text data set; wherein the first text data set is a data set without a first error feature; and the second text data set is a data set with a second error feature; Performing data enhancement on the first text data set according to the first error feature to generate a first training data set; Generate a second training data set according to the second error feature, the second text data set, and the data enhancement model; The initial large language model is trained according to the first text data set, the first training data set, the second text data set and the second training data set to obtain a text error correction model.

2. The method according to claim 1, characterized in that The step of generating a second training data set according to the second error feature, the second text data set, and the data enhancement model includes: Analyze the second error feature of the second text data set to determine a prompt text corresponding to the second error feature; In the case where the type of the second error feature is a non-compliance error, the prompt text and the second text data set are input into the data enhancement model for data enhancement to generate a second training data set for the target business field; wherein the target business field is determined based on the second text data set.

3. The method according to claim 2, characterized in that The method further comprises: When the type of the second error feature is a compliance error, the second text data set is adjusted according to the preset rules of the target business field to generate the second training data set.

4. The method according to claim 1, characterized in that: The step of performing data enhancement on the first text data set according to the first error feature to generate a first training data set includes: For at least one target text in the first text data set, adjusting the target text according to at least one of the first error features to obtain an error text having the first error feature; At least one of the error texts is determined as the first training data set.

5. The method according to claim 4, characterized in that The first error feature includes an over-word error, a missing word error, and a wrong word error; the step of adjusting the target text according to at least one of the first error features to obtain an error text having the first error feature includes at least one of the following: Repeating the characters or words at the preset position of the target text for a preset number of times to obtain a first error text with multiple word errors; Deleting a first preset number of characters or words from the target text to obtain a second error text with a few character errors; A second preset number of characters or words in the target text are replaced with similar characters or similar words to obtain a third erroneous text with typos.

6. The method according to claim 1, characterized in that The initial large language model is trained according to the first text data set, the first training data set, the second text data set and the second training data set to obtain a text error correction model, including: Inputting the first training data set and the second training data set into the initial large language model to perform text error correction processing according to the error correction task instruction, thereby obtaining a corrected text and an error type corresponding to the corrected text; According to the corrected text, the error type corresponding to the corrected text, the first text data set, and the second text data set, the parameters of the initial large language model are adjusted until the initial large language model converges to obtain the text correction model.

7. A training device for a text error correction model, characterized in that: include: An acquisition module, used to acquire a first text data set and a second text data set; wherein the first text data set is a data set without a first error feature; and the second text data set is a data set with a second error feature; A training data generation module, configured to perform data enhancement on the first text data set according to the first error feature to generate a first training data set; and to generate a second training data set according to the second error feature, the second text data set and a data enhancement model; The model training module is used to train the initial large language model according to the first text data set, the first training data set, the second text data set and the second training data set to obtain a text error correction model.

8. An electronic device, characterized in that: It includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method for training a text error correction model as described in any one of claims 1 to 6.

9. A readable storage medium, characterized in that: The readable storage medium stores programs or instructions, and when the programs or instructions are executed by the processor, the steps of the training method of the text error correction model as described in any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes a program or instructions, which, when executed, implement the steps of the training method of the text error correction model as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Unified management distributed web crawler system

    CN108875091A

  • Chinese grammar error correction method and device based on data enhancement

    CN113822054A

  • Intelligent search content error correction and rewriting method and system

    CN117034909A

  • Multi-source text-oriented Vietnamese grammar error correction method and device

    CN118194855A

  • Data processing method and device and electronic equipment

    CN118349853A

Cited By

  • Text detection method and device for publications based on large models

    CN119761351A