Multi-input Chinese spelling error correction method and system, electronic equipment and medium

By combining the results of multiple spelling error correction models to build a prompt word template, and inputting a large language model to improve the accuracy of Chinese spelling error correction, solving the problem of semantic deviation between the error correction results and the original sentence in the prior art.

CN119443089APending Publication Date: 2025-02-14GUIZHOU CLOUD PIONEER TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510026587.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The error correction results generated by the existing large language model in the Chinese spelling correction task have a large semantic deviation from the original sentence.

Method used

By obtaining the error correction results output by different types of spelling error correction models for the same sentence, a prompt word template is constructed, and the error correction results are incorporated into the prompt word as input to the large language model, and the output results are determined to avoid semantic bias.

Benefits of technology

The recall rate of correct results in the set is improved, effectively avoiding the semantic deviation between the error correction results generated by the large language model and the original sentence.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119443089A_ABST
    Figure CN119443089A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of natural language processing, and discloses a multi-input Chinese spelling error correction method and system, electronic equipment and a medium, and the method comprises the steps: obtaining error correction results output by different types of spelling error correction models for the same sentence to be corrected; determining a cue word according to the cue word template and a candidate set composed of the error correction results; inputting the cue word into a large language model, and determining an output result; and determining a correct Chinese spelling result of the sentence to be corrected according to the output result. According to the method, the error correction results of the spelling error correction models of different types are integrated into the cue word to serve as input of the large language model, the recall rate of the correct results in the set is increased, in addition, through the specific cue word template, the large language model cannot directly generate an error correction sentence, and the error correction efficiency is improved. And the output result corresponding to the prompt word template is generated, so that relatively large semantic deviation between the error correction result freely generated by the large language model and the original sentence is effectively avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] The spelling correction task aims to find and correct incorrect words in the input text. It is an important research direction in Natural Language Processing (NLP) and is widely used in scenarios such as Optical Character Recognition (OCR), Automatic Speech Recognition (ASR), and editorial review. Due to the accuracy of the recognition algorithm and the accuracy of manual input, a large number of texts with spelling errors will appear in these scenarios. These texts with errors will seriously affect downstream tasks. In order to solve the problem of spelling errors in text, a large number of domain experts are often required to manually correct the input text. The manual correction method has pain points such as high investment and low efficiency.

[0003] In order to solve the problem of low efficiency of manual error correction, existing technologies use large language models to assist in error correction tasks. With the excellent results shown by ChatGPT in the past two years, large language models (LLM) have been proven to be effective in many NLP tasks. For the task of Chinese spelling correction, most existing works use large language models directly for error correction. When LLM is asked to correct a piece of text with errors, due to the structure of the model, LLM tends to generate freely. Although this mechanism will make the generated correction sentence completely correct in spelling and grammar, the generated correction result may have a large semantic deviation from the original sentence. Summary of the invention

[0004] In order to overcome the problem that the error correction results generated by the existing large language model have a large semantic deviation from the original sentence, the present invention provides a multi-input Chinese spelling correction method, system, electronic device and medium.

[0005] In a first aspect, in order to solve the above technical problems, the present invention provides a multi-input Chinese spelling correction method, comprising: Obtaining the correction results output by different types of spelling correction models for the same sentence to be corrected; Determine a prompt word according to a candidate set consisting of a prompt word template and various error correction results; wherein the prompt word is a model input constructed according to an input template in the prompt word template of the candidate set; Input the prompt word into the large language model to determine the output result; wherein the output result is the result output by the large language model according to the output template in the prompt word template; Determine the correct Chinese spelling of the sentence to be corrected based on the output results.

[0006] In a second aspect, the present invention provides a multi-input Chinese spelling correction system, comprising: The error correction result acquisition module is used to obtain the error correction results output by different types of spelling error correction models for the same sentence to be corrected; A prompt word construction module is used to determine a prompt word according to a candidate set consisting of a prompt word template and various error correction results; wherein the prompt word is a model input constructed by the candidate set according to an input template in the prompt word template; The output result determination module is used to input the prompt word into the large language model to determine the output result; wherein the output result is the result output by the large language model according to the output template in the prompt word template The correct Chinese spelling determination module is used to determine the correct Chinese spelling result of the sentence to be corrected according to the output result.

[0007] In a third aspect, the present invention provides a computing device, including a memory, a processor, and a program stored in the memory and running on the processor, wherein the processor implements the steps of the above-mentioned multi-input Chinese spelling correction method when executing the program.

[0008] In a fourth aspect, the present invention provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes the steps of the multi-input Chinese spelling correction method as described above.

[0009] The beneficial effects of the present invention are as follows: the present application combines the correction results of multiple different types of spelling correction models into the prompt word as the input of the large language model, thereby improving the recall rate of the correct results in the set. In addition, the present application uses a specific prompt word template so that the large language model does not directly generate a corrected sentence, but generates an output result corresponding to the prompt word template, thereby effectively avoiding a large semantic deviation between the correction result freely generated by the large language model and the original sentence. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0011] Figure 1 A schematic diagram of a multi-input Chinese spelling error correction method according to an embodiment of the present invention; Figure 2 A schematic flow chart of a multi-input Chinese spelling error correction method according to another embodiment of the present invention; Figure 3 The present invention is a schematic diagram of the structure of a multi-input Chinese spelling correction system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0012] The following examples are provided to further explain and supplement the present invention and do not constitute any limitation to the present invention.

[0013] A method, system, electronic device and medium for correcting Chinese spelling errors by multiple inputs according to an embodiment of the present invention will be described below in conjunction with the accompanying drawings.

[0014] like Figure 1 As shown, the present invention provides a multi-input Chinese spelling error correction method, comprising: S1. Obtaining the correction results output by different spelling correction models for the same sentence to be corrected.

[0015] S2. Determine a prompt word according to a candidate set consisting of a prompt word template and various error correction results; wherein the prompt word is a model input constructed according to an input template in the prompt word template of the candidate set.

[0016] S3. Input the prompt word into the large language model to determine the output result; wherein the output result is the result output by the large language model according to the output template in the prompt word template.

[0017] S4. Determine the correct Chinese spelling result of the sentence to be corrected according to the output result.

[0018] The present application integrates the correction results of multiple different types of spelling correction models into the prompt word as the input of the large language model, thereby improving the recall rate of the correct results in the collection. In addition, the present application uses a specific prompt word template so that the large language model does not directly generate the corrected sentence, but generates the output result corresponding to the prompt word template, thereby effectively avoiding the large semantic deviation between the correction result freely generated by the large language model and the original sentence.

[0019] In this embodiment, most Chinese spelling correction methods are based on pre-trained language models, and the correction methods can be roughly divided into three categories: (1) end-to-end detection and correction network; (2) integrating multimodal features such as pinyin, glyphs, voice, external dictionaries, etc. into the pre-training process of the model; (3) integrating multimodal features into the downstream network.

[0020] Based on the above, by optimizing and transforming the pre-trained model, multimodal information is integrated into the model's training phase, making the pre-trained model more adept at Chinese spelling error correction tasks. Many other researchers have integrated this multimodal information into the downstream error correction network through special network structures, such as using graph neural networks to model the similarity of similar-sounding and similar-looking characters; or first constructing candidate similar-sounding Chinese characters through a pinyin confusion set, and then modeling the dependency relationship between two adjacent Chinese characters based on an attention network; or incorporating multimodal information of speech and images into the model to enhance the overall error correction effect.

[0021] However, due to reasons such as parameter settings, network structure, and the number of actual training samples, the error correction capabilities of different models of a single error correction model are different. Therefore, in this embodiment, the error correction results of multiple spelling error correction models are used as the input of the large language model, which improves the recall rate of correct results in the set.

[0022] In addition, by constructing a prompt word template, the present application ensures that the large language model does not directly generate a corrected sentence, but generates an output result corresponding to the prompt word template, thereby effectively avoiding a large semantic deviation between the correction result freely generated by the large language model and the original sentence.

[0023] The prompt word template is a structured Prompt-SEL template of a large model. The structured Prompt-SEL template can have various templates, among which the following elements need to be included: Instruction: Instruction is the specific task you want the large model to perform.

[0024] Context: Background information, or contextual information, which can guide the model to make better responses.

[0025] InputData: Input data, which tells the model what data needs to be processed.

[0026] OutputIndicator: Output indicator, telling the model what type or format we want to output.

[0027] Through the prompt word template, the language model can output the desired result, rather than outputting freely generated error correction results like conventional language models, which results in a large semantic deviation from the original sentence.

[0028] Optionally, determining a prompt word according to a candidate set consisting of a prompt word template and each error correction result, and inputting the prompt word into a large language model to determine an output result includes: Add a subscript to each error correction result in the candidate set and determine the prompt word; Input the prompt word into the large language model to determine the target subscript; wherein the target subscript is the subscript corresponding to the error correction result without spelling errors selected by the language model from various error correction results; The target index is used as the output of the large language model.

[0029] In this embodiment, based on the semantic understanding and reasoning ability of LLM, the result subscript without spelling errors is selected in the input set, and the final correction result is obtained according to the subscript. This method does not use LLM to generate correction results for the correction sentences, and can effectively avoid the semantic deviation phenomenon caused by freely generated correction sentences.

[0030] For example, different spelling correction models may output correction results such as 1. "I'm very busy next week so I can't attend your dance" and 2. "I'm very busy next week so I can't go to your dance." Inputting the above correction results into a conventional large language model may output "I'm very busy next week so I can't attend your dance." It can be seen that there is a semantic deviation between the output results of the conventional large language model and the original sentence.

[0031] However, after reconstructing each error correction result into a prompt word based on the prompt word template, it becomes: "1. I am very busy next week so I can't attend your dance", "2. I am very busy next week so I can't attend your dance", it can be seen that all error correction results have subscripts "1" and "2". At this time, when the above prompt words are input into the large language model, the large language model will not freely generate error correction sentences, but directly output the subscript "2" corresponding to the correct error correction sentence, that is, the target subscript, which can effectively avoid the semantic deviation problem caused by freely generating error correction results. Optionally, the correct Chinese spelling result of the sentence to be corrected is determined based on the output result, including: The error correction result corresponding to the target subscript is used as the correct Chinese spelling result of the sentence to be corrected.

[0032] For example, after reconstructing each error correction result into prompt words based on the prompt word template, it becomes: "1. I am very busy next week so I can't attend your dance", "2. I am very busy next week so I can't attend your dance", and the large language model outputs the target subscript "2", and the corresponding "2" "I am very busy next week so I can't attend your dance" is used as the correct Chinese spelling result of the sentence to be corrected.

[0033] Optionally, taking the error correction result corresponding to the target subscript as the correct Chinese spelling of the sentence to be corrected also includes: If the large language model outputs an empty set, it is determined that no error correction is required.

[0034] In this embodiment, when the large language model outputs an empty set, it indicates that the input prompt words all have spelling errors, that is, all error correction results are incorrect Chinese spellings. At this time, it is determined that no error correction is required.

[0035] Optionally, the large language model adjusts parameters using the LoRA method during training.

[0036] In the parameter adjustment of the model in this embodiment, the parameters of the large language model are fine-tuned by the LoRA (Low-rank adaptation of large language models, LoRA) method, which consumes little resources and only sacrifices a small number of indicators compared to full parameter fine-tuning, which can effectively reduce the LLM fine-tuning cost.

[0037] Optionally, the large language model is trained by adjusting parameters using the LoRA method, including: After adding the new residual parameters to the weight parameters of the large language model, the large language model is trained.

[0038] In this example, LoRA assumes that LLM has captured a lot of general knowledge, and the learning of specific tasks can guide the model to adapt to new tasks through a small number of additional parameters. This approach has been proven to be effective in practice, especially in resource-constrained situations, and can significantly improve the efficiency and practicality of model fine-tuning.

[0039] Optionally, a new residual parameter is added to the weight parameter of the large language model, and the formula is as follows: ; in, Represents the result output by the large language model, represents the weight parameter, Represents the residual parameter, where B∈d×r, A∈r×k, B and A are newly added residual parameters, and r represents rank, and r∈min(d,k), d and k are preset hyperparameters.

[0040] The main method of LoRA in this embodiment is to freeze the matrix parameters of a pre-trained model and choose to replace them with matrices A and B, and only update A and B in downstream tasks. The models are over-parameterized, they have a smaller intrinsic dimension, and the model mainly relies on this low intrinsic dimension to adapt to the task. Assuming that the change in the model parameters when adapting the task is low-rank, the low-rank adaptive method LoRA is introduced, which simulates the change in parameters through low-rank decomposition, thereby realizing indirect training of large models with extremely small parameters.

[0041] like Figure 2 As shown, another embodiment is used to illustrate a multi-input Chinese spelling correction method, which is specifically as follows: There is a sentence S containing 11 characters to be corrected, "require the teacher's unit to advance funds for the project", which is represented as ,in, Represents each character in S.

[0042] There are K different types of spelling correction models (such as detection network, correction network) that output a candidate set of correction results for S. , represents the correction result of the Kth spelling correction model for S output. Each spelling correction model can be a large language model of EERT based on Transformer architecture (semantic coding, speech coding and image coding). The obtained set may include =Require municipal public institutions to advance funds for projects, =Require the construction unit to advance funds for the project,......, =Requires the public unit to advance funds for the project.

[0043] Now we need to configure the prompt word template of the large language model, in which each error correction result in the candidate set X needs to have a subscript, and the prompt words are expressed as "1. Require the municipal public unit to advance the project", "2. Require the construction unit to advance the project", ..., "3. Require the public unit to advance the project".

[0044] In addition, the prompt word template also requires the large language model to only output the subscript, without freely generating new error correction results.

[0045] Input the above prompt words into the large language model, and the target subscript of the correct result is "2". Then the error correction result "Require the construction unit to advance funds for the project" corresponding to the target subscript "2" can be used as the correct Chinese spelling of the sentence to be corrected S "Require the construction unit to advance funds for the project".

[0046] In addition, the LoRA method is added to the large language model to fine-tune the parameters. It can be seen that Figure 2 X represents the prompt word input into the large language model, which will be passed through the original weight parameters of the large language model LLM weights ( ), and will also pass through the newly added residual parameter AB ( ), and finally the final output result is H through weighted summation.

[0047] Optionally, in order to verify the feasibility of this application, the following effective verification was performed.

[0048] Two data sets are used to verify this application. The first data set is the commonly used evaluation data sets SIGHAN13, SIGHAN14, and SIGHAN15. Considering that the SIGHAN data set is a Chinese text written by non-Chinese native learners, it is inconsistent with the real common error correction scenarios. In this embodiment, EC-SPELL is used as another data set. EC-SPELL consists of spelling correction data from three different fields (LAW, MED, ODW). These data are collected in real scenarios and are more in line with actual error correction scenarios. In addition, data enhancement is widely used during model training. This article uses Wang271K data to train a single input model to improve the model effect.

[0049] This article uses sentence-level accuracy (Accuracy, Acc), precision (P), recall (R) and F1 value to evaluate the performance of the model in the two tasks of error detection and error correction. The calculation formulas of the four indicators are as follows: ; in, Indicates the number of positive samples predicted as positive classes, Indicates the number of negative samples predicted as negative classes, Indicates the number of negative samples predicted as positive. Indicates the number of positive samples predicted as negative.

[0050] In the first stage, we selected five excellent single-input spelling correction models, trained them on different training data sets, and then integrated the results of three models from high to low based on the correction F1 values ​​evaluated on the test set. The five selected correction models are: SOFT-MASK builds an end-to-end detection-error correction network architecture. The detection network is composed of Bi-GRU, and the error correction network is composed of BRET. The two are connected through the Soft-Masking mechanism.

[0051] DCN generates candidate Chinese characters through a pinyin-enhanced candidate Chinese character generator, and then uses an attention-based network to model the dependencies between adjacent Chinese characters.

[0052] The LEAD Chinese spelling correction framework enables the Chinese spelling correction model to learn heterogeneous knowledge from three dimensions: phonetics, glyphs, and dictionaries, and construct positive and negative samples based on this knowledge, and adopts a unified contrastive learning-based training scheme to refine the model's representation.

[0053] In this stage, all single-input spelling correction models are based on the bert-base-chinese model. First, they are trained on the Wang271 dataset, then fine-tuned on their respective training datasets, and the fine-tuned models are evaluated on the corresponding test sets to obtain the test metrics of individual spelling correction models. When training each independent semantic error correction model, the learning rate is set to, the batch size is set to 32, and it is trained for 10 rounds. The remaining parameters follow the default values of their open-source code, and the results obtained from the last round of training are used as the final model.

[0054] In the second stage, the open-source Tongyi Qianwen Qwen1.5-7B model is used as the base, and the Qwen1.5-7B model is fine-tuned using the LoRA fine-tuning method. In the training stage, the Wang271K dataset is not used, and only the training sets corresponding to each dataset are used. The training data is based on the prompt templates, and training samples are constructed by randomly shuffling the serial numbers of the correct and incorrect sentences in the training data.

[0055] In addition, three types of prompts for the input of the Qwen1.5-7B model are constructed according to different prompt templates. One is Prompt-GEN-1, which directly uses the Qwen1.5-7B model to generate correction results based on the sentence to be corrected. The second is Prompt-GEN-2, which adds the correction results of multiple single-input spelling correction models, expecting that the Qwen1.5-7B model can generate more task-appropriate correction results after referring to the correction result information of each single-input spelling correction model. The third is the prompt generated based on the Prompt-SEL template, and the subscripts are included in the prompt input to the Qwen1.5-7B model, and the output result is the subscript.

[0056] In the training stage of the Qwen1.5-7B model, when fine-tuning the parameters, the learning rate is set to , the batch size is set to 1, fp16 precision is used, it is trained for 1 round, the LoRA parameter is set to 16, and the training target weights are and .

[0057] In addition, for sighan13 and sighan14, no additional processing is performed on the words "的", "得", and "地". For the "[UNK]" symbols generated in the prediction results of the single-input spelling correction models in the first stage, they are replaced with the characters corresponding to the positions in the input sentence. All training and prediction stages use a single 4090 24G graphics card.

[0058] Table 1 below shows the experimental results of three single-input spelling correction models and different prompt word templates under the SIGHAN13, SIGHAN14 and SIGHAN15 datasets, fine-tuned with LoRA based on the Qwen1.5-7B base. Prompt-SEL is the prompt word template corresponding to the application.

[0059] Table 1 By comparing the experimental results of spelling correction using LLM for three different prompt words, it can be found that the correction F1 value of the method proposed in this application on the SIGHAN13, SIGHAN14, and SIGHAN15 datasets is improved by 9.6%, 24.9%, and 33.2% respectively compared with the Prompt-GEN-1 method that directly generates correction results, and is improved by 7.7%, 17.4%, and 12.6% compared with the Prompt-GEN-2 method that adds a multi-input integrated set.

[0060] The experimental results show that the method proposed in this application has obvious advantages over the method of directly using LLM to generate error correction results. By comparing the effects of Prompt-SEL and the single-input spelling correction model, the error correction F1 value is improved by 0.9%, 1.1%, and 0.4% respectively compared with the best performing single-input spelling correction model. The experimental results show that the method proposed in this application can effectively improve the multi-input integration effect.

[0061] In summary, the multi-input Chinese spelling correction method proposed in this application can effectively improve the Chinese spelling correction effect. When using LLM for Chinese spelling correction tasks, incorporating the correction results of multiple single small models into the prompt word is an effective method to improve the LLM correction effect.

[0062] like Figure 3 As shown, the present invention provides a multi-input Chinese spelling correction system, comprising: The error correction result acquisition module is used to obtain the error correction results output by different types of spelling error correction models for the same sentence to be corrected; A prompt word construction module is used to determine a prompt word according to a candidate set consisting of a prompt word template and various error correction results; wherein the prompt word is a model input constructed by the candidate set according to an input template in the prompt word template; An output result determination module is used to input the prompt word into the large language model to determine the output result; wherein the output result is the result output by the large language model according to the output template in the prompt word template; The correct Chinese spelling determination module is used to determine the correct Chinese spelling result of the sentence to be corrected according to the output result.

[0063] Optionally, the prompt word construction module is specifically used for: Add a subscript to each error correction result in the candidate set and determine the prompt word; The output result determination module is specifically used for: Input the prompt word into the large language model to determine the target subscript; wherein the target subscript is the subscript corresponding to the error correction result without spelling errors selected by the language model from various error correction results; The target index is used as the output of the large language model.

[0064] Optionally, the correct Chinese spelling determination module is specifically used to: The error correction result corresponding to the target subscript is used as the correct Chinese spelling result of the sentence to be corrected.

[0065] Optionally, a no correct result judgment module is also included, which is specifically used to: If the large language model outputs an empty set, it is determined that no error correction is required.

[0066] Optionally, a training module is also included, specifically for: After adding the new residual parameters to the weight parameters of the large language model, the large language model is trained.

[0067] Optionally, the training module is specifically used to: Add a new residual parameter to the weight parameter of the large language model. The formula is as follows: ; in, Represents the result output by the large language model, represents the weight parameter, Represents the residual parameter, where B∈d×r, A∈r×k, B and A are newly added residual parameters, and r represents rank, and r∈min(d,k), d and k are preset hyperparameters.

[0068] The embodiment of the present invention also provides a computing device, including a memory, a manager, and a program stored in the memory and running on the manager. When the manager executes the program, some or all steps of the above-mentioned multi-input Chinese spelling correction method are implemented.

[0069] Among them, the computing device can be a computer, and correspondingly, its program is computer software. The above-mentioned parameters and steps in the computing device of the present invention can refer to the parameters and steps in the embodiment of a multi-input Chinese spelling correction method above, and will not be repeated here.

[0070] Those skilled in the art know that the present invention can be implemented as a system, method or computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: it can be complete hardware, it can be complete software (including firmware, resident software, microcode, etc.), or it can be a combination of hardware and software, generally referred to as "circuit", "module" or "system" herein. In addition, in some embodiments, the present invention can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code. Computer-readable storage media can be, for example, but not limited to - electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above.

[0071] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0072] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A multi-input Chinese spelling correction method, characterized in that: include: Obtaining the correction results output by different types of spelling correction models for the same sentence to be corrected; Determine a prompt word according to a candidate set consisting of a prompt word template and each error correction result; wherein the prompt word is a model input constructed by the candidate set according to an input template in the prompt word template; Input the prompt word into the large language model to determine an output result; wherein the output result is the result output by the large language model according to the output template in the prompt word template; Determine the correct Chinese spelling result of the sentence to be corrected according to the output result; Determining a prompt word according to a candidate set consisting of a prompt word template and each error correction result, and inputting the prompt word into the large language model to determine an output result, including: Adding a subscript to each of the error correction results in the candidate set to determine a prompt word; Input the prompt word into the large language model to determine a target subscript; wherein the target subscript is a subscript corresponding to an error correction result without spelling errors selected by the language model from among the error correction results; The target index is used as an output result of the large language model.

2. The method according to claim 1, characterized in that Determining the correct Chinese spelling result of the sentence to be corrected according to the output result includes: The error correction result corresponding to the target subscript is used as the correct Chinese spelling result of the sentence to be corrected.

3. The method according to claim 2, characterized in that The error correction result corresponding to the target subscript is used as the correct Chinese spelling of the sentence to be corrected, and further includes: If the large language model outputs an empty set, it is determined that no error correction is required.

4. The method according to any one of claims 1 to 3, characterized in that: The large language model adjusts parameters using the LoRA method during training.

5. The method according to claim 4, characterized in that The large language model adjusts parameters by the LoRA method during training, including: After adding the new residual parameters to the weight parameters of the large language model, the large language model is trained.

6. The method according to claim 5, characterized in that Add a new residual parameter to the weight parameter of the large language model. The formula is as follows: ; in, Represents the result output by the large language model, represents the weight parameter, Represents the residual parameter, where B∈d×r, A∈r×k, B and A are newly added residual parameters, and r represents rank, and r∈min(d,k), d and k are preset hyperparameters.

7. A multi-input Chinese spelling correction system, characterized in that: include: The error correction result acquisition module is used to obtain the error correction results output by different types of spelling error correction models for the same sentence to be corrected; A prompt word construction module, used to determine a prompt word according to a candidate set consisting of a prompt word template and various error correction results; wherein the prompt word is a model input constructed by the candidate set according to an input template in the prompt word template; An output result determination module, used to input the prompt word into the large language model to determine the output result; wherein the output result is the result output by the large language model according to the output template in the prompt word template; A correct Chinese spelling determination module, used to determine the correct Chinese spelling of the sentence to be corrected according to the output result; The prompt word building module is specifically used for: Add a subscript to each error correction result in the candidate set and determine the prompt word; The output result determination module is specifically used for: Input the prompt word into the large language model to determine the target subscript; wherein the target subscript is the subscript corresponding to the error correction result without spelling errors selected by the language model from various error correction results; The target index is used as the output of the large language model.

8. A computing device comprising a memory, a processor, and a program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the steps of the multi-input Chinese spelling correction method as described in any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on the terminal device, the terminal device executes the steps of the multi-input Chinese spelling correction method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Medical text error correction system and medical query prompt text display method and device

    CN118093789A