Training method and device of grammar error correction model, electronic equipment and storage medium

By conducting target language sample training and error feature recognition on the initial syntax error correction model, the problem of low training efficiency of syntax error correction model is solved, and the syntax error correction performance and training efficiency are improved.

CN120524948APending Publication Date: 2025-08-22TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410199422.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-22
Publication Date
2025-08-22

AI Technical Summary

Technical Problem

In the prior art, the training efficiency of the syntax error correction model is low and the error correction performance is insufficient, so the performance of both cannot be improved at the same time.

Method used

By training the initial syntax error correction model based on the first information sample set of the target language, an intermediate syntax error correction model is obtained, and then feature recognition and training of the intermediate model is used to obtain the target syntax error correction model.

Benefits of technology

It significantly improves the syntax recognition performance of the grammar error correction model for the target language and improves training efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120524948A_ABST
    Figure CN120524948A_ABST
Patent Text Reader

Abstract

The invention provides a training method and device of a grammar error correction model, electronic equipment and a storage medium. The method comprises the steps of training an initial grammar error correction model based on a first information sample set of a target language to obtain an intermediate grammar error correction model; obtaining a second information sample set of the target language, each second information sample in the second information sample set having a grammar error of the target language, and each second information sample carrying a sample tag for the grammar error; performing error feature recognition on the second information sample features corresponding to the second information samples to obtain target features associated with grammar errors in the second information sample features; and in combination with the target features and the sample labels, training the intermediate grammar error correction model to obtain a target grammar error correction model. According to the method and the device, the training efficiency of the grammar error correction model can be improved while the error correction performance of the grammar error correction model is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device, and storage medium for training a grammatical error correction model. Background Art

[0002] Artificial Intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, pre-trained models, operating / interaction systems, and mechatronics. Pre-trained models, also known as large models or basic models, can be fine-tuned and widely applied to downstream tasks across various AI disciplines. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0003] In related technologies, the training of grammatical correction models is often carried out using a large number of training samples carrying sample labels. Due to the high cost of labeling sample labels, a small number of sample labels cannot effectively improve the error correction performance of the grammatical correction model, and a large number of sample labels will lead to low training efficiency of the grammatical correction model. Therefore, related technologies cannot take into account both the error correction performance and training efficiency of the grammatical correction model. Summary of the Invention

[0004] The embodiments of the present application provide a training method, a grammatical error correction method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product for a grammatical error correction model, which can effectively improve the error correction performance of the grammatical error correction model while improving the training efficiency of the grammatical error correction model.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] The present invention provides a method for training a grammatical error correction model, including:

[0007] Training an initial grammatical error correction model based on a first information sample set of a target language to obtain an intermediate grammatical error correction model;

[0008] wherein the grammar recognition performance of the intermediate grammar correction model for the target language is greater than that of the initial grammar correction model;

[0009] Acquire a second information sample set in a target language, wherein each second information sample in the second information sample set has a grammatical error in the target language, and each second information sample carries a sample label for the grammatical error;

[0010] performing error feature recognition on the second information sample features corresponding to each of the second information samples, to obtain a target feature associated with the grammatical error in each of the second information sample features;

[0011] The intermediate grammatical error correction model is trained in combination with the target features and the sample labels to obtain a target grammatical error correction model.

[0012] The present invention provides a method for grammatical error correction, including:

[0013] Acquiring information to be corrected that has grammatical errors in a target language, performing feature extraction on the information to be corrected, and obtaining features to be corrected corresponding to the information to be corrected;

[0014] Invoking a target grammatical error correction model to perform grammatical error correction on the information to be corrected based on the features to be corrected, thereby obtaining target information corresponding to the information to be corrected, wherein the target information does not have the grammatical error and has the same language meaning as the information to be corrected;

[0015] The target grammatical error correction model is trained based on the above-mentioned grammatical error correction model training method.

[0016] The present invention provides a training device for a grammatical error correction model, including:

[0017] an initial training module for training an initial grammar correction model based on a first set of information samples in a target language to obtain an intermediate grammar correction model; wherein the intermediate grammar correction model has a grammar recognition performance for the target language that is greater than that of the initial grammar correction model;

[0018] an identification module configured to obtain a set of second information samples in a target language, wherein each second information sample in the set of second information samples has a grammatical error in the target language and each second information sample carries a sample label for the grammatical error; perform error feature identification on second information sample features corresponding to each second information sample, and obtain a target feature associated with the grammatical error in each second information sample feature;

[0019] The target training module is used to train the intermediate grammatical error correction model in combination with the target features and the sample labels to obtain a target grammatical error correction model.

[0020] In the above scheme, the above-mentioned initial training module is also used to perform feature extraction on each first information sample in the first information sample set to obtain the first information sample features corresponding to the first information sample; call the initial grammatical error correction model, and perform grammatical error correction on each first information sample based on the features of each first information sample to obtain the first prediction information corresponding to each first information sample, and the first prediction information has the same language meaning as the corresponding first information sample; combine the first prediction information and the first information sample to train the initial grammatical error correction model to obtain the intermediate grammatical error correction model.

[0021] In the above scheme, the first information sample includes multiple first component information, and the above initial training module is also used to perform feature extraction on each first component information to obtain a first component feature, obtain a position feature corresponding to the first component information, and fuse the position feature and the first component feature to obtain a target component feature corresponding to the first component information; wherein, the position feature corresponding to the first component information is used to indicate the position of the first component information in the first information sample; according to the position of each first component information in the first information sample, the target component features corresponding to each first component information are feature spliced ​​to obtain the first information sample feature.

[0022] In the above scheme, the initial grammatical error correction model includes a feature conversion layer and an information prediction layer. The above initial training module is also used to perform the following processing for each first information sample feature: calling the feature conversion layer to perform feature conversion on the first information sample feature to obtain a conversion feature corresponding to the first information sample feature, and the feature dimension of the conversion feature is smaller than that of the first information sample feature; calling the information prediction layer to perform grammatical error correction on the corresponding first information sample based on the conversion feature to obtain the first prediction information corresponding to the first information sample.

[0023] In the above scheme, the initial grammatical error correction model includes multiple feature conversion layers, and the above initial training module is also used to call the first feature conversion layer, perform feature conversion on the first information sample feature, and obtain the first conversion feature corresponding to the first information sample feature; traverse i to perform the following processing: call the i-th feature conversion layer, perform feature conversion on the i-1-th conversion feature, and obtain the i-th conversion feature; wherein 2≤i≤N, N is the number of the feature conversion layers; determine the N-th conversion feature as the conversion feature corresponding to the first information sample feature.

[0024] In the above scheme, the above-mentioned initial training module is also used to determine the information similarity between the first information sample and the corresponding first prediction information for each first information sample; summing up the information similarities to obtain the initial loss value of the initial grammatical error correction model; based on the initial loss value, the initial grammatical error correction model is trained to obtain the intermediate grammatical error correction model.

[0025] In the above scheme, the above initial training module is also used to perform the following processing on each second information sample in the second information sample set: for each second component information in the second information sample, feature extraction is performed on the second component information to obtain second component features, the position features corresponding to the second component information are obtained, and the position features and the second component features are fused to obtain target component features corresponding to the second component information; wherein, the position features corresponding to the second component information are used to indicate the position of the second component information in the second information sample; according to the position of each second component information in the second information sample, the target component features corresponding to each second component information are feature spliced ​​to obtain the second information sample features corresponding to the second information sample.

[0026] In the above scheme, the above-mentioned error feature recognition is realized through a feature recognition model, and the second information sample feature includes multiple sub-features. The above-mentioned recognition module is also used to perform the following processing for each second information sample feature: calling the feature recognition model, performing error feature recognition on each sub-feature in the second information sample feature, and obtaining a feature recognition result for each sub-feature; wherein the feature recognition result is used to indicate whether the corresponding sub-feature is associated with the grammatical error; based on the feature recognition result, determining the target feature associated with the grammatical error in the second information sample feature.

[0027] In the above scheme, the above-mentioned identification module is also used to, for each of the sub-features, determine the sub-feature as the target sub-feature when the feature recognition result of the sub-feature indicates that the sub-feature is associated with the grammatical error; when the number of the target sub-features is one, determine the target sub-feature as the target feature; when the number of the target sub-features is multiple, perform feature splicing on each of the target sub-features in the order of their positions in the second information sample feature to obtain the target feature.

[0028] In the above scheme, the second information sample feature includes multiple feature elements, and the error feature identification is implemented through an element recognition model. The above recognition module is also used to perform the following processing for each second information sample feature: for each feature element in the second information sample feature, call the element recognition model, perform element recognition on the feature element, and obtain the element recognition result corresponding to the feature element; wherein the element recognition result is used to indicate whether the corresponding feature element is associated with the grammatical error; based on the element recognition result, perform element update on each feature element in the second information sample feature to obtain the target feature.

[0029] In the above scheme, the above-mentioned identification module is also used to, for each of the feature elements, determine the feature element as a target feature element when the element identification result indicates that the feature element is not associated with the grammatical error; when the element identification result indicates that the feature element is associated with the grammatical error, determine the feature element as a reference feature element; update the element value of each of the target feature elements in the second information sample feature to the opposite number of the corresponding element value, and update the element value of each of the reference feature elements in the second information sample feature to zero to obtain an adjusted feature; and fuse the adjusted feature and the second information sample feature to obtain the target feature.

[0030] In the above scheme, the above-mentioned target training module is also used to call the intermediate grammatical correction model for each second information sample, perform grammatical correction on the second information sample based on the target feature corresponding to the second information sample, and obtain the second prediction information corresponding to the second information sample, and the second prediction information has the same language meaning as the corresponding second information sample; combine the second prediction information and the sample label to train the intermediate grammatical correction model to obtain the target grammatical correction model.

[0031] In the above scheme, the above target training module is also used to determine the intermediate loss value corresponding to each second information sample, in combination with the sample label carried by the second information sample and the second prediction information corresponding to the second information sample; summing up the intermediate loss values ​​to obtain the overall loss value of the intermediate grammatical error correction model; based on the overall loss value, training the intermediate grammatical error correction model to obtain the target grammatical error correction model.

[0032] In the above solution, the initial training module is further configured to obtain a plurality of candidate languages, where different candidate languages ​​correspond to different grammatical rules; and in response to a selection instruction for the plurality of candidate languages, determine the selected candidate language as the target language.

[0033] The present invention provides a grammatical error correction device, comprising:

[0034] An extraction module is used to obtain information to be corrected that has grammatical errors in the target language, perform feature extraction on the information to be corrected, and obtain features to be corrected corresponding to the information to be corrected;

[0035] The error correction module is used to call a target grammatical error correction model, perform grammatical error correction on the information to be corrected based on the features to be corrected, and obtain target information corresponding to the information to be corrected, wherein the target information does not have the grammatical error and the target information has the same language meaning as the information to be corrected; wherein the target grammatical error correction model is trained based on the training method of the above-mentioned grammatical error correction model.

[0036] An embodiment of the present application provides an electronic device, including:

[0037] a memory for storing computer-executable instructions or computer programs;

[0038] The processor is used to implement the training method of the grammatical error correction model provided in the embodiment of the present application when executing the computer-executable instructions or computer program stored in the memory.

[0039] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions for causing a processor to execute and implement the training method of the grammatical error correction model provided in the embodiment of the present application.

[0040] An embodiment of the present application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the grammatical error correction model training method described in the embodiment of the present application.

[0041] The embodiments of the present application have the following beneficial effects:

[0042] An initial grammatical error correction model is trained based on a first set of target language information samples to obtain an intermediate grammatical error correction model. Error features are identified for second information sample features corresponding to each second information sample to obtain target features associated with grammatical errors in the second information sample features. The intermediate grammatical error correction model is trained based on the target features and sample labels to obtain a target grammatical error correction model. Thus, by training the initial grammatical error correction model based on the first set of target language information samples, the grammatical error recognition performance of the grammatical error correction model for the target language is significantly improved. The intermediate grammatical error correction model is then trained based on a second set of information samples carrying sample labels for grammatical errors to obtain a target grammatical error correction model. This significantly improves the error correction performance of the grammatical error correction model based on the significantly improved grammatical error recognition performance. Furthermore, by identifying error features for second information sample features corresponding to each second information sample to obtain target features associated with grammatical errors in the second information sample features, the intermediate grammatical error correction model is trained using lightweight target features, significantly improving training efficiency. This effectively improves both the error correction performance of the grammatical error correction model and the training efficiency of the grammatical error correction model. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 Schematic diagram of the architecture of the training system of the grammatical error correction model provided in the embodiment of the present application;

[0044] Figure 2 Schematic diagram of the structure of an electronic device for training a grammatical error correction model provided in an embodiment of the present application;

[0045] Figure 3 This is a schematic diagram of the structure of an electronic device for grammatical error correction provided by an embodiment of the present application. Figure 2 ;

[0046] Figure 4 This is a flow chart of the training method of the grammatical error correction model provided in the embodiment of the present application. Figure 1 ;

[0047] Figure 5 This is a flow chart of the training method of the grammatical error correction model provided in the embodiment of the present application. Figure 2 ;

[0048] Figure 6 This is a flow chart of the training method of the grammatical error correction model provided in the embodiment of the present application. Figure 3 ;

[0049] Figure 7 This is a flow chart of the training method of the grammatical error correction model provided in the embodiment of the present application. Figure 4 ;

[0050] Figure 8 This is a flow chart of the training method of the grammatical error correction model provided in the embodiment of the present application. Figure 5 ;

[0051] Figure 9 Schematic diagram of the process of the grammatical error correction method provided in the embodiment of the present application;

[0052] Figure 10 This is a schematic diagram of the principle of the training method of the grammatical error correction model provided in the embodiment of the present application. Figure 1 ;

[0053] Figure 11 This is a schematic diagram of the principle of the training method of the grammatical error correction model provided in the embodiment of the present application. Figure 2 ;

[0054] Figure 12 The principle of the training method of the grammatical error correction model provided in the embodiment of the present application is shown as follows: Figure 3 . DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0056] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0057] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0059] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0060] 1) Artificial Intelligence (AI): This is an interdisciplinary discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, pre-trained models, operating / interaction systems, and mechatronics. Pre-trained models, also known as large models or basic models, can be fine-tuned and widely applied to downstream tasks across various AI disciplines. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0061] 2) Machine Learning (ML): This is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning. Pretrained models are the latest development in deep learning, integrating these techniques.

[0062] 3) Convolutional Neural Networks (CNN): These are a type of feed-forward neural network (FNN) with a deep structure that incorporates convolutional computations. They are a representative algorithm for deep learning. CNNs possess representation learning capabilities and can perform shift-invariant classification on input images based on their hierarchical structure.

[0063] 4) In response to: used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed can be in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations executed are executed.

[0064] 5) Convolutional Layer: Each convolutional layer in a convolutional neural network consists of several convolutional units, whose parameters are optimized through a backpropagation algorithm. The purpose of the convolution operation is to extract different features of the input. The first convolutional layer may only extract low-level features such as edges, lines, and corners. Networks with more layers can iteratively extract more complex features from these low-level features.

[0065] 6) Pooling Layer: After feature extraction in the convolutional layer, the output feature map is passed to the pooling layer for feature selection and information filtering. The pooling layer contains a pre-defined pooling function, which replaces the result of a single point in the feature map with the feature map statistics of its adjacent area. The pooling layer selects the pooling area in the same way as the convolution kernel scans the feature map, and is controlled by the pooling size, stride, and padding.

[0066] 7) Fully-Connected Layer: A fully-connected layer in a convolutional neural network is equivalent to a hidden layer in a traditional feedforward neural network. It is located at the end of the hidden layer of a convolutional neural network and only transmits signals to other fully-connected layers. Feature maps lose their spatial topology in a fully-connected layer, becoming flattened into vectors and passing through an activation function.

[0067] 8) Large Language Model (LLM): Also known as a large language model or large model, a large language model is a deep learning model trained using large amounts of text data. It contains billions or even more parameters and can be used to generate and understand natural language text. Through training, the model can learn the statistical laws and semantic associations of language to build a massive language knowledge base, thereby simulating human language comprehension and generation capabilities. Large language models have the following characteristics:

[0068] Learning ability: Through training on massive amounts of text data, large language models can learn rich language knowledge and expressions, including grammar, semantics, and common expression habits.

[0069] Pattern recognition: Large language models can identify common text patterns and semantic associations, such as the co-occurrence relationship between words, the logical structure and semantic roles of sentences, etc.

[0070] Contextual understanding: Large language models can capture contextual information in text, understand the impact of previous text on subsequent text, and generate appropriate responses based on the context.

[0071] Generative capabilities: Large language models can generate relevant natural language text based on input information, including answering questions, generating articles, and conducting conversations.

[0072] Resolving ambiguity: Despite the polysemy and ambiguity of language, large language models resolve ambiguity through contextual information and language regularities, providing more accurate and appropriate text generation or understanding.

[0073] Large language models have a wide range of application scenarios. They can be applied to intelligent customer service, intelligent question and answer, natural language generation, advertising recommendations, games and other fields. They can improve the efficiency and accuracy of human-computer interaction and enhance user experience.

[0074] 9) Natural Language Processing (NLP): This is a key area of ​​research in computer science and artificial intelligence. It studies theories and methods that enable effective communication between humans and computers using natural language. Natural language processing is a discipline that integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language, the language we use daily, so it is closely related to the study of linguistics, yet also has important differences. Natural language processing is not simply the study of natural language in general, but rather the development of computer systems, particularly software systems, that can effectively implement natural language communication. As such, it is a part of computer science, and its primary applications include machine translation, automatic summarization, opinion extraction, text classification, question answering, text semantic comparison, and speech recognition.

[0075] During the implementation of the embodiments of this application, the applicant discovered that the related technology has the following problems:

[0076] In related technologies, the training of grammatical correction models is often carried out using a large number of training samples carrying sample labels. Due to the high cost of labeling sample labels, a small number of sample labels cannot effectively improve the error correction performance of the grammatical correction model, and a large number of sample labels will lead to low training efficiency of the grammatical correction model. Therefore, related technologies cannot simultaneously improve the error correction performance and training efficiency of the grammatical correction model.

[0077] Embodiments of the present application provide a training method, a grammatical error correction method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product for a grammatical error correction model, which can effectively improve the error correction performance of the grammatical error correction model while improving the training efficiency of the grammatical error correction model. The following describes an exemplary application of the training system for the grammatical error correction model provided by the embodiments of the present application.

[0078] See also Figure 1 , Figure 1This is a schematic diagram of the architecture of the training system 100 for the grammatical error correction model provided in an embodiment of the present application. The terminal (terminal 400 is shown as an example) is connected to the server 200 via the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.

[0079] The terminal 400 is used for the user to use the client 410 and display target information on a graphical interface 410-1 (graphic interface 410-1 is shown as an example). The terminal 400 and the server 200 are connected to each other via a wired or wireless network.

[0080] In some embodiments, the server 200 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal 400 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart TV, a smart watch, a car terminal, etc., but is not limited to this. The electronic device provided in the embodiment of the present application can be implemented as a terminal or as a server. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiment of the present application.

[0081] In some embodiments, the server 200 trains an initial grammar correction model based on the first information sample set and the second information sample set of the target language to obtain a target grammar correction model, and sends the target grammar correction model to the terminal 400.

[0082] In other embodiments, the terminal 400 trains an initial grammatical error correction model based on the first information sample set and the second information sample set of the target language to obtain a target grammatical error correction model, and sends the target grammatical error correction model to the server 200 .

[0083] In other embodiments, the embodiments of the present application can be implemented with the help of cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network within a wide area network or local area network to realize data calculation, storage, processing, and sharing.

[0084] Cloud technology is a general term for network, information, integration, management platform, and application technologies used in the cloud computing business model. It can form a resource pool that can be used flexibly and conveniently on demand. Cloud computing technology will become a key support. The backend services of technical network systems require a large amount of computing and storage resources.

[0085] See also Figure 2 , Figure 2 is a structural diagram of an electronic device 500 for training a grammatical error correction model provided by an embodiment of the present application, wherein: Figure 2 The electronic device 500 shown may be Figure 1 The server 200 or the terminal 400 in Figure 2 The electronic device 500 shown includes: at least one processor 430, a memory 450, and at least one network interface 420. The various components in the electronic device 500 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to including a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 440 is not described in detail. Figure 2 Various buses are labeled as bus system 440 .

[0086] The processor 430 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0087] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 430.

[0088] The memory 450 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.

[0089] In some embodiments, the memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.

[0090] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, and driver layer, which are used to implement various basic services and process hardware-based tasks;

[0091] The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include Bluetooth, Wireless Fidelity (WiFi), and Universal Serial Bus (USB).

[0092] In some embodiments, the training device for the grammatical error correction model provided in the embodiments of the present application can be implemented in software. Figure 2 A training device 455 for a grammatical error correction model stored in memory 450 is shown. This device can be software in the form of a program or plug-in, and includes the following software modules: an initial training module 4551, a recognition module 4552, and a target training module 4553. These modules are logical and can be arbitrarily combined or further separated based on the functions they implement. The functions of each module will be described below.

[0093] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device for grammatical error correction provided by an embodiment of the present application. Figure 2 ,in, Figure 3 The electronic device 600 shown may be Figure 1 The server 200 or the terminal 400 in Figure 3 The electronic device 600 shown includes: at least one processor 530, a memory 550, and at least one network interface 520. The various components in the electronic device 600 are coupled together via a bus system 540. It is understood that the bus system 540 is used to achieve connection and communication between these components. In addition to including a data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 540 is not described in detail. Figure 3 Various buses are labeled as bus system 540 .

[0094] The processor 530 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0095] The memory 550 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 550 may optionally include one or more storage devices that are physically remote from the processor 530.

[0096] The memory 550 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 550 described in the embodiments of the present application is intended to include any suitable type of memory.

[0097] In some embodiments, the memory 550 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.

[0098] Operating system 551, including system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0099] The network communication module 552 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 520. Exemplary network interfaces 520 include Bluetooth, Wireless Fidelity (WiFi), and Universal Serial Bus (USB).

[0100] In some embodiments, the grammatical error correction device provided in the embodiments of the present application can be implemented in software. Figure 3 A grammatical error correction device 555 stored in memory 550 is shown. This device can be software in the form of a program or plug-in, and includes the following software modules: an extraction module 5551 and an error correction module 5552. These modules are logical and can be arbitrarily combined or further separated according to the functions they implement. The functions of each module will be described below.

[0101] In other embodiments, the training device of the grammatical error correction model provided in the embodiments of the present application can be implemented in hardware. As an example, the training device of the grammatical error correction model provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the training method of the grammatical error correction model provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0102] In some embodiments, the terminal or server can implement the training method of the grammatical error correction model provided in the embodiment of the present application by running a computer program or computer executable instructions. For example, the computer program can be a native program in the operating system (for example, a dedicated grammatical error correction model training program) or a software module, for example, a grammatical error correction model training module that can be embedded in any program (such as an instant messaging client, a photo album program, an electronic map client, a navigation client); for example, it can be a local (Native) application (APP, Application), that is, a program that needs to be installed in the operating system to run. In short, the above-mentioned computer program can be an application, module or plug-in in any form.

[0103] The training method of the grammatical error correction model provided in the embodiment of the present application will be explained in combination with the exemplary application and implementation of the server or terminal provided in the embodiment of the present application.

[0104] See also Figure 4 , Figure 4 This is a flow chart of the training method of the grammatical error correction model provided in the embodiment of the present application. Figure 1 , will combine Figure 4 Steps 101 to 104 are shown for illustration. The training method of the grammatical error correction model provided in the embodiment of the present application can be implemented by the server or the terminal alone, or by the server and the terminal in collaboration. The following will be illustrated by taking the server alone as an example.

[0105] In step 101, an initial grammatical error correction model is trained based on a first information sample set of a target language to obtain an intermediate grammatical error correction model.

[0106] In some embodiments, the target language refers to a natural language with corresponding grammatical rules. For example, the target language may be a natural language such as English, French, or Chinese. The target language corresponds to the grammatical rules one-to-one.

[0107] In some embodiments, the number of first information samples in the above-mentioned first information sample set is less than the number of second information samples in the second information sample set, and each first information sample in the first information sample set does not carry a sample label, thereby effectively reducing the label annotation cost of the information sample and effectively improving the training efficiency.

[0108] In some embodiments, the information presentation forms of the first information sample in the first information sample set and the second information sample in the second information sample set may be voice information, video information, text information, or other information presentation forms.

[0109] In some embodiments, the first information sample set includes multiple first information samples, all of which are natural language samples described in the target language. The first information samples can be samples in various natural language expression forms such as video samples, audio samples or text samples.

[0110] In some embodiments, the initial grammatical error correction model can be a deep learning model such as a natural language processing model or a large language model. A large language model refers to a deep learning model trained using large amounts of text data that can generate natural language text or understand the meaning of language text. Large language models can handle a variety of natural language tasks, such as text classification, question-answering, and conversation, and are an important path to artificial intelligence. Large language models are designed to understand and generate human language. They are trained on large amounts of text data and can perform a wide range of tasks, including text summarization, translation, sentiment analysis, and more. Large language models are characterized by their large scale and contain billions of parameters, which help them learn complex patterns in language data.

[0111] In some embodiments, an initial grammar correction model is trained based on a first information sample set of a target language to obtain an intermediate grammar correction model. Since the first information sample set is described in the target language, the grammatical rules in the first information sample set include at least part of the grammatical rules of the target language. The initial grammar correction model is trained using the first information sample set so that the grammatical recognition performance of the intermediate grammar correction model obtained by training for the target language is greater than the grammatical recognition performance of the initial grammar correction model for the target language.

[0112] In some embodiments, before step 101, the target language may be determined by: obtaining multiple candidate languages, where different candidate languages ​​correspond to different grammatical rules; and in response to a selection instruction for the multiple candidate languages, determining the selected candidate language as the target language.

[0113] In some embodiments, the candidate languages ​​correspond one-to-one to grammatical rules, and different candidate grammars correspond to different grammatical rules. The candidate languages ​​refer to natural languages ​​with corresponding grammatical rules. For example, the target language can be English, French, Chinese and other natural languages, and the target language corresponds one-to-one to grammatical rules.

[0114] As an example, English, French and Chinese languages ​​are obtained, and in response to a selection instruction for Chinese, Chinese is determined as the target language. An initial grammar correction model is trained based on a first information sample set of Chinese to obtain an intermediate grammar correction model. The grammar recognition performance of the intermediate grammar correction model for Chinese is greater than the grammar recognition performance of the initial grammar correction model for Chinese.

[0115] In some embodiments, see Figure 5 , Figure 5 This is a flow chart of the training method of the grammatical error correction model provided in the embodiment of the present application. Figure 2 , Figure 4 Step 101 shown can be performed by Figure 5 Steps 1011 to 1013 are shown to be implemented.

[0116] In step 1011 , for each first information sample in the first information sample set, feature extraction is performed on the first information sample to obtain a first information sample feature corresponding to the first information sample.

[0117] In some embodiments, the feature extraction refers to a process of converting non-vector information into vector information.

[0118] In some embodiments, the above-mentioned first information sample includes multiple first component information, and the above-mentioned step 1011 can be implemented in the following manner: for each first component information, feature extraction is performed on the first component information to obtain the first component feature, the position feature corresponding to the first component information is obtained, and the position feature and the first component feature are fused to obtain the target component feature corresponding to the first component information; according to the position of each first component information in the first information sample, the target component feature corresponding to each first component information is feature spliced ​​to obtain the first information sample feature.

[0119] In some embodiments, the above-mentioned first information sample includes multiple first component information, and the above-mentioned multiple first component information constitute the first information sample. For example, when the first information sample is a text sample, the above-mentioned first component information can be a component word of the text sample. The position feature corresponding to the first component information is used to indicate the position of the first component information in the first information sample. Different first component information has different positions in the first information sample.

[0120] As an example, the expression of the target composition feature corresponding to the first composition information may be:

[0121] Z 1i ={w 1i , d 1i} (1)

[0122] Among them, Z 1i Used to indicate the target composition feature corresponding to the first composition information 1i, w 1i Used to indicate the position feature corresponding to the first component information 1i, d 1i Used to indicate the first composition feature corresponding to the first composition information 1i.

[0123] As an example, the expression of the first information sample feature may be:

[0124] Z1={Z 11 …Z 1i …Z 1N} (2)

[0125] Among them, Z is used to indicate the characteristics of the first information sample, Z 11 …Z 1i …Z 1N It is used to indicate the target component feature corresponding to each first component information, and N is used to indicate the number of first component information.

[0126] In some embodiments, the first component feature is used to indicate the language meaning of the corresponding first component information, and the position feature corresponding to the first component information is used to indicate the position of the first component information in the first information sample. The target component feature corresponding to the first component information is obtained by fusing the first component feature and the position feature. Then, the target component feature can comprehensively indicate the language meaning of the corresponding first component information and the position of the first component information in the first information sample.

[0127] In step 1012, an initial syntax correction model is called to perform syntax correction on each first information sample based on the characteristics of each first information sample to obtain first prediction information corresponding to each first information sample.

[0128] In some embodiments, the first prediction information has the same language meaning as that indicated by the corresponding first information sample.

[0129] In some embodiments, due to the low grammatical correction performance of the initial grammatical correction model, when the first information sample contains grammatical errors for the target language, the first prediction information obtained by grammatical correction through the initial grammatical correction model may still contain grammatical errors for the target language. In this case, it is possible that both the first information sample and the corresponding first prediction information have grammatical errors for the target language.

[0130] In some embodiments, due to the low grammatical correction performance of the initial grammatical correction model, when the first information sample does not have grammatical errors for the target language, the first prediction information obtained by grammatical correction through the initial grammatical correction model may have grammatical errors for the target language. In this case, the first information sample may not have grammatical errors for the target language, but the corresponding first prediction information may have grammatical errors for the target language.

[0131] In some embodiments, due to the low grammatical correction performance of the initial grammatical correction model, when the first information sample does not have grammatical errors for the target language, the first prediction information obtained by grammatical correction through the initial grammatical correction model may not have grammatical errors for the target language. In this case, it is possible that both the first information sample and the corresponding first prediction information do not have grammatical errors for the target language.

[0132] In some embodiments, the above-mentioned initial grammatical error correction model includes a feature conversion layer and an information prediction layer. The above-mentioned step 1012 can be implemented as follows: the following processing is performed for each first information sample feature: calling the feature conversion layer to perform feature conversion on the first information sample feature to obtain the conversion feature corresponding to the first information sample feature; calling the information prediction layer to perform grammatical error correction on the corresponding first information sample based on the conversion feature to obtain the first prediction information corresponding to the first information sample.

[0133] In some embodiments, the feature dimension of the conversion feature is smaller than that of the first information sample feature. The above-mentioned feature conversion is used to downsample the first information sample feature so that the obtained conversion feature significantly reduces the feature dimension of the first information sample feature without losing key information in the first information sample feature. The above-mentioned feature conversion layer can be a convolutional neural network such as a Transformer network for feature conversion.

[0134] For example, see Figure 11 , Figure 11 This is a schematic diagram of the principle of the training method of the grammatical error correction model provided in the embodiment of the present application, calling the feature conversion layer 31, and performing the first information sample feature ( Figure 11The information prediction layer 32 is called to perform grammatical correction on the corresponding first information sample based on the conversion feature to obtain the first prediction information corresponding to the first information sample.

[0135] In some embodiments, the above-mentioned initial grammatical error correction model includes multiple feature conversion layers. The above-mentioned calling of the feature conversion layer to perform feature conversion on the first information sample feature to obtain the conversion feature corresponding to the first information sample feature can be achieved in the following way: calling the first feature conversion layer to perform feature conversion on the first information sample feature to obtain the first conversion feature corresponding to the first information sample feature; traversing i to perform the following processing: calling the i-th feature conversion layer to perform feature conversion on the i-1-th conversion feature to obtain the i-th conversion feature; determining the N-th conversion feature as the conversion feature corresponding to the first information sample feature.

[0136] In some embodiments, 2≤i≤N, N is the number of feature conversion layers, and the feature dimension of the (i-1)th conversion feature is smaller than the feature dimension of the (i)th conversion feature.

[0137] For example, see Figure 11 , Figure 11 The characteristic conversion layer 31 shown in FIG includes characteristic conversion layer 311 , characteristic conversion layer 312 . . . characteristic conversion layer 31N.

[0138] For example, see Figure 11 , call the first feature conversion layer 311 to perform feature conversion on the first information sample feature to obtain the first conversion feature corresponding to the first information sample feature; call the second feature conversion layer to perform feature conversion on the first conversion feature to obtain the second conversion feature; call the Nth feature conversion layer 31N to perform feature conversion on the N-1th conversion feature to obtain the Nth conversion feature; determine the Nth conversion feature as the conversion feature corresponding to the first information sample feature.

[0139] In this way, by calling the first feature conversion layer, the first information sample feature is converted to obtain the first conversion feature corresponding to the first information sample feature; traverse i to perform the following processing: call the i-th feature conversion layer, perform feature conversion on the i-1-th conversion feature, and obtain the i-th conversion feature; determine the N-th conversion feature as the conversion feature corresponding to the first information sample feature, thereby achieving N-fold dimensionality reduction for the first information sample feature, thereby achieving an effective reduction in the feature dimension of the first information sample feature, and subsequently performing grammatical correction through the conversion feature, which makes the grammatical correction faster and effectively improves the correction efficiency of grammatical correction.

[0140] In step 1013, the initial grammatical error correction model is trained in combination with the first prediction information and the first information sample to obtain an intermediate grammatical error correction model.

[0141] In some embodiments, the above-mentioned step 1013 can be implemented as follows: for each first information sample, determine the information similarity between the first information sample and the corresponding first prediction information; sum up the information similarities to obtain the initial loss value of the initial grammatical error correction model; based on the initial loss value, train the initial grammatical error correction model to obtain an intermediate grammatical error correction model.

[0142] In some embodiments, the information similarity refers to the similarity between the first information sample and the corresponding first grammatical information. The information similarity may refer to the Manhattan distance, Euclidean distance, etc. between the first information sample and the corresponding first grammatical information.

[0143] In some embodiments, the first information sample in the above-mentioned first information sample set may be an information sample that does not carry a sample label for grammatical errors, thereby effectively reducing the label annotation cost in the process of training the grammatical correction model, thereby effectively improving the training efficiency of the grammatical correction model.

[0144] In this way, the first information sample in the first information sample set can be an information sample that does not carry a sample label for grammatical errors, thereby effectively reducing the label annotation cost in the process of training the grammatical correction model, thereby effectively improving the training efficiency of the grammatical correction model.

[0145] In step 102, a second information sample set in the target language is obtained.

[0146] In some embodiments, each second information sample in the second information sample set has a grammatical error in the target language, and each second information sample carries a sample label for the grammatical error.

[0147] In some embodiments, since each second information sample in the second information sample set has grammatical errors in the target language, training the intermediate grammatical correction model through each second information sample in the second information sample set can effectively improve the grammatical correction performance of the intermediate grammatical correction model.

[0148] In some embodiments, after executing the above step 102, the second information sample characteristics can also be determined in the following manner: the following processing is performed on each second information sample in the second information sample set: for each second component information in the second information sample, feature extraction is performed on the second component information to obtain the second component feature, the position feature corresponding to the second component information is obtained, and the position feature and the second component feature are fused to obtain the target component feature corresponding to the second component information; according to the position of each second component information in the second information sample, the target component feature corresponding to each second component information is feature spliced ​​to obtain the second information sample feature corresponding to the second information sample.

[0149] In some embodiments, the position feature corresponding to the second component information is used to indicate the position of the second component information in the second information sample.

[0150] In some embodiments, the above-mentioned second information sample includes multiple second component information, and the above-mentioned multiple second component information constitutes the second information sample. For example, when the second information sample is a text sample, the above-mentioned second component information can be the constituent words of the text sample. The position feature corresponding to the second component information is used to indicate the position of the second component information in the second information sample. Different second component information has different positions in the second information sample.

[0151] As an example, the expression of the target composition feature corresponding to the second composition information may be:

[0152] Z 1i ={w 1i , d 1i} (3)

[0153] Among them, Z 1i Used to indicate the target composition feature corresponding to the second composition information 1i, w 1i Used to indicate the position feature corresponding to the second component information 1i, d 1i Used to indicate the second composition feature corresponding to the second composition information 1i.

[0154] As an example, the expression of the second information sample feature may be:

[0155] Z1={Z 11 …Z 1i …Z 1N} (4)

[0156] Among them, Z is used to indicate the characteristics of the second information sample, Z 11 …Z 1i …Z 1N It is used to indicate the target component feature corresponding to each second component information, and N is used to indicate the number of second component information.

[0157] In some embodiments, the second component feature is used to indicate the language meaning of the corresponding second component information, and the position feature corresponding to the second component information is used to indicate the position of the second component information in the second information sample. The target component feature corresponding to the second component information is obtained by fusing the second component feature and the position feature. Then, the target component feature can comprehensively indicate the language meaning of the corresponding second component information and the position of the second component information in the second information sample.

[0158] In step 103, error feature recognition is performed on the second information sample features corresponding to each second information sample to obtain a target feature associated with a grammatical error in each second information sample feature.

[0159] In some embodiments, the above-mentioned error feature recognition is used to identify sub-features associated with grammatical errors in the second information sample feature or to identify feature elements associated with grammatical errors in the second information sample feature. The above-mentioned target feature can be a sub-feature associated with grammatical errors in the second information sample feature, or it can be a feature composed of feature elements associated with grammatical errors in the second information sample feature, which will be explained separately below.

[0160] In some embodiments, see Figure 6 , Figure 6 This is a flow chart of the training method of the grammatical error correction model provided in the embodiment of the present application. Figure 3 ,Error feature recognition is achieved through the feature recognition model.,The second information sample feature includes multiple sub-features, Figure 4 The step 103 shown can be performed for each second information sample feature. Figure 6 Steps 1031A to 1032A are implemented as shown.

[0161] In step 1031A, the feature recognition model is called to perform error feature recognition on each sub-feature in the second information sample feature to obtain a feature recognition result for each sub-feature.

[0162] In some embodiments, the feature recognition result is used to indicate whether the corresponding sub-feature is associated with a grammatical error.

[0163] In some embodiments, the feature recognition model may be a classification model such as a random forest model or a decision tree model. The feature recognition model is used to classify sub-features and determine whether the sub-features are associated with grammatical errors.

[0164] In some embodiments, the above-mentioned step 1031A can be implemented as follows: for each sub-feature in the second information sample feature, call the feature recognition model, perform error feature recognition on the sub-feature, and obtain the association probability between the sub-feature and the grammatical error; when the association probability is greater than the probability threshold, determine the feature recognition result of the sub-feature as the first feature recognition result; when the association probability is less than or equal to the probability threshold, determine the feature recognition result of the sub-feature as the second feature recognition result.

[0165] In some embodiments, the first feature recognition result indicates that the sub-feature is associated with a grammatical error, and the second feature recognition result indicates that the sub-feature is not associated with a grammatical error. The sub-feature includes multiple feature elements in the second information sample feature.

[0166] As an example, the second information sample feature includes sub-feature A, sub-feature B and sub-feature C. The feature recognition result of sub-feature A indicates that sub-feature A is associated with a grammatical error, the feature recognition result of sub-feature B indicates that sub-feature B is not associated with a grammatical error, and the feature recognition result of sub-feature C indicates that sub-feature C is associated with a grammatical error.

[0167] In step 1032A, based on the feature recognition result, a target feature associated with a grammatical error in the second information sample feature is determined.

[0168] In some embodiments, the above-mentioned step 1032 can be implemented in the following manner: for each sub-feature, when the feature recognition result of the sub-feature indicates that the sub-feature is associated with a grammatical error, the sub-feature is determined as a target sub-feature; when the number of target sub-features is one, the target sub-feature is determined as the target feature; when the number of target sub-features is multiple, the target sub-features are feature spliced ​​according to the order of their positions in the second information sample feature to obtain the target feature.

[0169] As an example, the second information sample feature includes sub-feature A, sub-feature B and sub-feature C. The feature recognition result of sub-feature A indicates that sub-feature A is associated with a grammatical error, the feature recognition result of sub-feature B indicates that sub-feature B is not associated with a grammatical error, and the feature recognition result of sub-feature C indicates that sub-feature C is associated with a grammatical error. Then sub-feature A and sub-feature C are target sub-features. When there are multiple target sub-features, the target sub-features are feature spliced ​​according to the order of their positions in the second information sample feature to obtain the target feature: {sub-feature A, sub-feature C}.

[0170] As an example, the second information sample feature includes sub-feature A, sub-feature B and sub-feature C. The feature recognition result of sub-feature A indicates that sub-feature A is associated with a grammatical error, the feature recognition result of sub-feature B indicates that sub-feature B is not associated with a grammatical error, and the feature recognition result of sub-feature C indicates that sub-feature C is not associated with a grammatical error. Then sub-feature A is the target sub-feature. When the number of target sub-features is one, the target sub-feature (sub-feature A) is determined as the target feature.

[0171] In this way, by performing error feature identification on each sub-feature in the second information sample feature, and when the feature identification result indicates that a sub-feature is associated with a grammatical error, the corresponding sub-feature is determined as a target sub-feature and feature concatenation is performed to obtain a target feature. Because a sub-feature includes multiple feature elements, performing error feature identification on each sub-feature effectively improves the efficiency of generating the target feature, as the number of sub-features is significantly greater than the number of feature elements.

[0172] In some embodiments, see Figure 7 , Figure 7 This is a flow chart of the training method of the grammatical error correction model provided in the embodiment of the present application. Figure 4 The second information sample features include multiple feature elements, and the error feature recognition is achieved through the element recognition model. Figure 4 The step 103 shown can be performed for each second information sample feature. Figure 7 Steps 1031B to 1032B are implemented as shown.

[0173] In 1031B, for each characteristic element in the second information sample feature, the element recognition model is called to perform element recognition on the characteristic element to obtain an element recognition result corresponding to the characteristic element.

[0174] In some embodiments, the element recognition result is used to indicate whether the corresponding characteristic element is associated with a grammatical error, and the above-mentioned characteristic element is the smallest component unit in the second information sample feature.

[0175] In some embodiments, the element recognition model may be a classification model such as a random forest model or a decision tree model. The element recognition model is used to classify feature elements and determine whether the feature elements are associated with grammatical errors.

[0176] In some embodiments, the above-mentioned step 1031A can be implemented as follows: for each characteristic element in the second information sample feature, call the element recognition model, perform erroneous element recognition on the characteristic element, and obtain the association probability between the characteristic element and the grammatical error; when the association probability is greater than the probability threshold, the element recognition result of the characteristic element is determined as the first element recognition result; when the association probability is less than or equal to the probability threshold, the element recognition result of the characteristic element is determined as the second element recognition result.

[0177] In some embodiments, the first element recognition result is used to indicate that the characteristic element is associated with a grammatical error, and the second element recognition result is used to indicate that the characteristic element is not associated with a grammatical error.

[0178] As an example, the second information sample features include feature element A, feature element B and feature element C. The element recognition result of feature element A indicates that feature element A is associated with a grammatical error, the element recognition result of feature element B indicates that feature element B is not associated with a grammatical error, and the element recognition result of feature element C indicates that feature element C is associated with a grammatical error.

[0179] In 1032B, based on the element recognition result, each characteristic element in the second information sample feature is updated to obtain the target feature.

[0180] In some embodiments, the above-mentioned step 1032B can be implemented as follows: for each feature element, when the element recognition result indicates that the feature element is not associated with a grammatical error, the feature element is determined as a target feature element; when the element recognition result indicates that the feature element is associated with a grammatical error, the feature element is determined as a reference feature element; the element value of each target feature element in the second information sample feature is updated to the opposite of the corresponding element value, and the element value of each reference feature element in the second information sample feature is updated to zero to obtain an adjusted feature; the adjusted feature and the second information sample feature are merged to obtain the target feature.

[0181] As an example, when the second information sample feature is: {feature element A, feature element B, feature element C}, feature element A and feature element B are target feature elements, feature element C is a reference feature element, the element values ​​of feature element A and feature element B are updated to the opposite numbers of the corresponding element values, and the element value of feature element C is updated to zero, and the resulting adjusted feature can be: {-feature element A, -feature element B, 0}.

[0182] Continuing with the above example, the above fusion of the adjustment feature and the second information sample feature to obtain the target feature can be achieved as follows: the adjustment feature and the second information sample feature are added to obtain the target feature. The expression of the above target feature can be: {0, 0, feature element C}.

[0183] As an example, when the second information sample feature is: {feature element A, feature element B, feature element C}, feature element A is the target feature element, feature element B and feature element C are reference feature elements, the element value of feature element A is updated to the opposite of the corresponding element value, and the element values ​​of feature element B and feature element C are updated to zero, and the resulting adjusted feature can be: {-feature element A, 0, 0}.

[0184] In some embodiments, the above-mentioned step 1032B can be implemented as follows: for each feature element, when the element recognition result indicates that the feature element is not associated with a grammatical error, the feature element is determined as a target feature element; when the element recognition result indicates that the feature element is associated with a grammatical error, the feature element is determined as a reference feature element; the element value of each target feature element in the second information sample feature is updated to zero to obtain the target feature.

[0185] As an example, when the second information sample feature is: {feature element A, feature element B, feature element C}, feature element A and feature element B are target feature elements, feature element C is the reference feature element, and the element values ​​of feature element A and feature element B are updated to zero, and the obtained target feature can be: {0, 0, feature element C}.

[0186] In this way, for each characteristic element in the second information sample feature, the element recognition model is called to perform element recognition on the characteristic element to obtain the element recognition result corresponding to the characteristic element. Based on the element recognition result, the element of each characteristic element in the second information sample feature is updated to obtain the target feature. Since the characteristic element is the smallest component unit in the second information sample feature, by performing element recognition on the characteristic element, the recognition accuracy of the second information sample feature is significantly improved, and the accuracy of the determined target feature is effectively improved.

[0187] In step 104, the intermediate grammatical error correction model is trained in combination with the target features and sample labels to obtain a target grammatical error correction model.

[0188] In some embodiments, see Figure 8 , Figure 8 This is a flow chart of the training method of the grammatical error correction model provided in the embodiment of the present application. Figure 5 , Figure 4 Step 104 shown may be performed by executing Figure 8Steps 1041 to 1042 are shown to be implemented.

[0189] In step 1041, for each second information sample, the intermediate grammatical error correction model is called, and grammatical error correction is performed on the second information sample based on the target feature corresponding to the second information sample to obtain second prediction information corresponding to the second information sample.

[0190] In some embodiments, the second prediction information has the same language meaning as that indicated by the corresponding second information sample.

[0191] In some embodiments, the above-mentioned step 1041 can be implemented as follows: the following processing is performed for each second information sample feature: calling the feature conversion layer to perform feature conversion on the target feature corresponding to the second information sample to obtain the conversion feature corresponding to the second information sample; calling the information prediction layer to perform grammatical error correction on the corresponding second information sample based on the conversion feature corresponding to the second information sample to obtain the second prediction information corresponding to the second information sample.

[0192] In some embodiments, the feature dimension of the conversion feature is smaller than that of the second information sample feature. The above-mentioned feature conversion is used to downsample the second information sample feature so that the obtained conversion feature significantly reduces the feature dimension of the second information sample feature without losing key information in the second information sample feature. The above-mentioned feature conversion layer can be a convolutional neural network such as a Transformer network for feature conversion.

[0193] For example, see Figure 11 , Figure 11 This is a schematic diagram of the principle of the training method of the grammatical error correction model provided in the embodiment of the present application, calling the feature conversion layer 31, and performing the second information sample feature ( Figure 11 The information prediction layer 32 is called to perform grammatical correction on the corresponding second information sample based on the conversion feature to obtain second prediction information corresponding to the second information sample.

[0194] In step 1042, the intermediate grammatical error correction model is trained in combination with the second prediction information and the sample label to obtain a target grammatical error correction model.

[0195] In some embodiments, the error correction performance of the intermediate grammar error correction model for the target language is lower than the grammar error correction performance of the target grammar error correction model for the target language.

[0196] In some embodiments, the above-mentioned step 1042 can be implemented as follows: for each second information sample, combining the sample label carried by the second information sample and the second prediction information corresponding to the second information sample, determine the intermediate loss value corresponding to the second information sample; sum up the intermediate loss values ​​to obtain the overall loss value of the intermediate grammatical error correction model; based on the overall loss value, train the intermediate grammatical error correction model to obtain the target grammatical error correction model.

[0197] In some embodiments, the above-mentioned combination of the sample label carried by the second information sample and the second prediction information corresponding to the second information sample to determine the intermediate loss value corresponding to the second information sample can be achieved in the following manner: determine the label similarity between the sample label carried by the second information sample and the second prediction information corresponding to the second information sample, and determine the label similarity as the intermediate loss value corresponding to the second information sample.

[0198] In some embodiments, the above-mentioned label similarity refers to the similarity between the sample label carried by the second information sample and the second prediction information corresponding to the second information sample. The above-mentioned label similarity may refer to the Manhattan distance, Euclidean distance, etc. between the sample label carried by the second information sample and the second prediction information corresponding to the second information sample.

[0199] As an example, the expression for the above overall loss value can be:

[0200] L Z =L1+…+L N (5)

[0201] Among them, L Z Used to indicate the overall loss value, L1…L N Used to indicate the intermediate loss value corresponding to each second information sample.

[0202] In this way, by combining the target features and sample labels, the intermediate grammatical error correction model is trained to obtain the target grammatical error correction model. Since each second information sample has grammatical errors in the target language, each second information sample in the second information sample set trains the intermediate grammatical error correction model, which can effectively improve the grammatical error correction performance of the intermediate grammatical error correction model, so that the trained target grammatical error correction model has higher grammatical error correction performance for the target language.

[0203] In this way, an initial grammatical error correction model is trained based on a first set of information samples in a target language to obtain an intermediate grammatical error correction model. Error features are identified for the second information sample features corresponding to each second information sample to obtain target features associated with grammatical errors in the second information sample features. The intermediate grammatical error correction model is trained based on the target features and sample labels to obtain a target grammatical error correction model. Thus, by training the initial grammatical error correction model based on the first set of information samples in the target language, the grammatical error correction model's grammatical recognition performance for the target language is significantly improved. The intermediate grammatical error correction model is then trained based on a second set of information samples carrying sample labels for grammatical errors to obtain a target grammatical error correction model. This significantly improves the grammatical error correction performance of the grammatical error correction model, while significantly improving the grammatical error correction performance. Furthermore, by identifying error features for the second information sample features corresponding to each second information sample to obtain target features associated with grammatical errors in the second information sample features, the intermediate grammatical error correction model is trained using lightweight target features, significantly improving training efficiency. This effectively improves both the error correction performance of the grammatical error correction model and the training efficiency of the grammatical error correction model.

[0204] See also Figure 9 , Figure 9 This is a flow chart of the grammatical error correction method provided by the embodiment of the present application, which will be combined with Figure 9 Steps 201 to 202 are shown for illustration. The grammatical error correction method provided in the embodiment of the present application can be implemented by the server or the terminal alone, or by the server and the terminal in collaboration. The following description will be made using the server alone as an example.

[0205] In step 201, information to be corrected that has grammatical errors in a target language is obtained, and features are extracted from the information to be corrected to obtain features to be corrected corresponding to the information to be corrected.

[0206] In some embodiments, the above-mentioned information to be corrected includes multiple target component information. The above-mentioned feature extraction of the information to be corrected to obtain the features to be corrected corresponding to the information to be corrected can be achieved in the following way: for each target component information, feature extraction is performed on the target component information to obtain the target component feature, the position feature corresponding to the target component information is obtained, and the position feature and the target component feature are fused to obtain the target component feature corresponding to the target component information; wherein the position feature corresponding to the target component information is used to indicate the position of the target component information in the information to be corrected; according to the position of each target component information in the information to be corrected, the target component features corresponding to each target component information are feature spliced ​​to obtain the feature of the information to be corrected.

[0207] In step 202, a target grammatical error correction model is called to perform grammatical error correction on the information to be corrected based on the features of the information to be corrected, and obtain target information corresponding to the information to be corrected.

[0208] In some embodiments, the target information does not have grammatical errors, and the target information has the same language meaning as the information to be corrected, and the target grammatical correction model is trained based on the training method of the above-mentioned grammatical correction model.

[0209] In some embodiments, when the information to be corrected has grammatical errors for the target language, the target information does not have grammatical errors for the target language. When the information to be corrected does not have grammatical errors for the target language, the target information is identical to the information to be corrected.

[0210] In this way, by obtaining information to be corrected that has grammatical errors in the target language, feature extraction is performed on the information to be corrected to obtain the features to be corrected corresponding to the information to be corrected, and the target grammatical correction model is called. Based on the features to be corrected, grammatical correction is performed on the information to be corrected to obtain the target information corresponding to the information to be corrected. Since the target grammatical correction model is trained by the training method of the grammatical correction model provided in the embodiment of the present application, it has high grammatical correction performance, so that the target information corresponding to the obtained information to be corrected can realize accurate correction of the information to be corrected.

[0211] The following describes an exemplary application of the embodiment of the present application in an actual English grammar correction application scenario.

[0212] The embodiment of the present application makes full use of the massive knowledge contained in the large language model, and through the method of transfer learning and knowledge injection, it is trained on the error correction parallel data to better deal with various different grammatical error correction problems. The embodiment of the present application can adopt the decoder-side architecture of the mainstream transformer model as the basis, replacing the previous seq2seq and seq2edits schemes to achieve English grammatical error correction. The embodiment of the present application is a purely generative task, and the application process generates corrected English text through given instructions and English text to be corrected. The training method of the grammatical error correction model provided in the embodiment of the present application is divided into two stages:

[0213] In the first phase, a large-scale English error correction data was used to perform a second pre-training on the large language model base, enhancing its English grammar error correction capabilities through transfer learning. This method updates global parameters, enabling the model to better understand and correct grammatical errors.

[0214] In the second phase, we combined instruction data with a small-scale, high-quality dataset of English grammar corrections to construct high-quality supervised fine-tuning data. Using this data, we performed instruction alignment learning on the large language model, further improving its correction capabilities and ultimately producing a large model for English grammar corrections.

[0215] Specifically, the large language model base is first pre-trained twice using a large amount of automatically generated, randomly altered, coarse supervised data. This method updates global parameters, achieving transfer learning. Then, local parameters are fine-tuned using a small amount of manually annotated data, gradually optimizing the model through aligned learning. This multi-stage, progressive learning approach enables the model to gradually converge on the target generation task, ultimately achieving high accuracy and recall.

[0216] Through the training method of the grammatical error correction model provided in the embodiments of this application, the grammatical error correction model can fully utilize large-scale data and massive knowledge to improve grammatical error correction capabilities. At the same time, through the strategies of transfer learning and instruction alignment learning, the grammatical error correction model can better adapt to specific task requirements and achieve good results on small sample data, thereby improving the model's usability.

[0217] The embodiments of the present application can be applied to English rewriting on the PC side and English correction on the browser side. It can help users correct grammatical errors in problematic English sentences input / scanned, and assist users in improving their English learning level, thereby improving the user's learning experience on the browser.

[0218] To achieve this goal, the present embodiment adopts a progressive learning method of secondary pre-training and supervised fine-tuning. In the secondary pre-training stage, the large language model focuses on the English grammar correction task through transfer learning. Subsequently, in the supervised fine-tuning stage, the model is fine-tuned with instructions to give it specialized capabilities. After these two stages of learning, the model can achieve high accuracy and recall in the English grammar correction task.

[0219] Through the grammar correction method provided in the embodiments of the present application, users can easily input or scan problematic English sentences into a PC or browser to obtain help with grammar correction. This is a useful auxiliary tool for users learning English and can improve their writing quality and language expression ability. At the same time, through the grammar correction method provided in the embodiments of the present application on the browser, users can better enjoy the process of learning English and improve the quality of the learning experience.

[0220] In some embodiments, see Figure 10 , Figure 10 This is a schematic diagram of the principle of the training method of the grammatical error correction model provided in the embodiment of the present application. Figure 1 ,like Figure 10As shown, the training method of the grammatical correction model provided in the embodiment of the present application can train the initial grammatical correction model 11 through secondary pre-training, and train the intermediate grammatical correction model 12 through supervised fine-tuning to obtain the target grammatical correction model 13. First, the universal large language model base is pre-trained twice by receiving the non-instruction correction text to enhance its error correction ability (the model after the secondary pre-training does not have the error correction ability, but it can enable the model after the secondary pre-training to have the ability to recognize the grammar of the target language, laying the foundation for the subsequent supervised fine-tuning module to train the error correction ability of the large model, thereby enhancing the error correction ability of the large model after the final training). At this stage, the model uses a large amount of unguided text to learn, extract and understand the patterns and rules of English grammatical correction, so that it has stronger error correction ability.

[0221] Next, the large language model that has undergone secondary pre-training enters the supervised fine-tuning module. At this stage, the model uses the error correction text with instructions for supervised fine-tuning. By introducing the annotated error correction text data, the model can more accurately learn and adjust its parameters to adapt to specific error correction tasks. In this way, the model after supervised fine-tuning, that is, the error correction large model, can more accurately correct English grammar errors and provide high-quality correction suggestions. Through the training method of the grammar correction model provided by the embodiment of the present application, the large language model base module enhances the error correction ability of the model in the secondary pre-training stage, and the supervised fine-tuning module further optimizes and adjusts the model so that it performs better on specific tasks. This step-by-step iterative training method makes it possible to make full use of a large amount of unsupervised data and a small amount of supervised data, thereby improving the overall error correction performance and accuracy.

[0222] In some embodiments, large language models commonly use the Transformer decoder architecture, whose key components are as follows: Self-Attention Layer: The self-attention layer is one of the core components of the Transformer. It captures the dependencies between different positions in the input sequence, thereby better understanding contextual information. The self-attention mechanism allows the model to dynamically assign different attention weights to each output token based on other tokens in the input sequence. This enables the model to consider both global and local contextual information. Feed-Forward Neural Network Layer: The feed-forward neural network layer is another important component in the Transformer decoder. It uses a multi-layer perceptron (MLP) to perform nonlinear transformations and mapping on the output of the self-attention layer. Positional Encoding: To incorporate positional information of the sequence into the model, the Transformer decoder uses a positional encoding to represent the position of each token in the input sequence. The positional encoding is a learnable or fixed vector that is added to the input embedding vector to provide a representation of positional information. Multi-layer stacking and residual connections: The Transformer decoder is typically constructed by stacking multiple identical self-attention layers and feed-forward neural network layers. In each sublayer, residual connections and layer normalization are applied. Residual connections allow gradients to propagate better in the network and help prevent the problem of vanishing or exploding gradients. Generating Output: In the Transformer decoder, the output layer is usually a fully connected linear layer that maps the output of the last layer of the decoder to the dimensions of the target vocabulary. For large language models, a softmax-based generation strategy is often used to generate the next token or word based on the probability distribution of the output layer.

[0223] In some embodiments, see Figure 11 , Figure 11 It is a schematic diagram of the principle of the training method of the grammatical error correction model provided in the embodiment of the present application. The secondary pre-training process of the large language model refers to further pre-training using a targeted data set after a pre-training has been carried out (usually a language model pre-training based on large-scale unsupervised text data). The large language model adopts a generative pre-training method, which is a language model based on the Transformer decoder structure. The model is unidirectional, which means that during the training and generation process, the model can only process text sequences from left to right (or from right to left) in sequence. In the large language model, given a text sequence w=w1w2…w n , first we need to transform each word w iMapped into a dense vector representation. This process can be achieved by multiplying and adding the word wi with the two matrices respectively, namely:

[0224] v i =V t ·t i +V p (6)

[0225] Among them, v i Expressing word w i The dense vector representation of V t Is a token embedding matrix, which is used to map input words into dense word embedding vectors, t i represents w i The index in the vocabulary (tokenindex), V p It is a position embedding matrix, which is used to introduce position information so that the model can perceive the relative position relationship of each word in the input sequence. Through this mapping process, each word w in the text sequence i are converted into corresponding dense vectors v i , these vectors will be passed as input to the next layer of the large language model for further processing and prediction. After encoding in the input layer, the model obtains the representation vector sequence v=(v1,v2,…,v n ). Next, v is fed into the model's encoding layer, which consists of N Transformer modules. Thanks to the self-attention mechanism, each representation vector in each layer incorporates information about the representation vector at the previous position, thus imbuing each representation vector with rich contextual information. After these multiple layers of encoding, the large language model can generate a hierarchical, combinatorial representation of each word.

[0226] The specific calculation process can be expressed as follows:

[0227] h (L) =Transformer-Block (L) (h (0) ) (7)

[0228] Among them, h (L) ∈R d×n Represents the representation vector sequence of the Lth layer, n is the sequence length, d is the model hidden layer dimension, and L is the total number of model layers.

[0229] The output layer of the grammatical error correction model is based on the representation h of the last layer (L) , the conditional probability of predicting each position can be expressed as:

[0230]

[0231] Among them, P(w i |w1,…,w i-1 ) means that given the first i-1 words w1,…,w i-1 In the case of , predict the i-th word w i The conditional probability of . Softmax is a softmax function used to normalize the vector. W e Is a weight matrix used to map the representation vector To the output space, b out is the bias vector. Through multi-layer encoding, the large language model can obtain a hierarchical combined representation of each word, where each representation vector incorporates contextual information from multiple encoding layers.

[0232] In some embodiments, see Figure 11 , for the feature transformation layer, the linear transformation feature W is obtained by linearly transforming the input features of the feature transformation layer q , linear transformation feature W e and linear transformation feature W v . Call the self-attention layer to linearly transform the feature W q , linear transformation feature W e and linear transformation feature W v Perform feature fusion to obtain fusion features, add the fusion features and input features to obtain linear transformation features W d , call the feedforward network to linearly transform the feature W d Perform feature transformation to obtain transformed features, and add the transformed features and fusion features to obtain feature transformation results.

[0233] In some embodiments, see Figure 12 , Figure 12 The principle of the training method of the grammatical error correction model provided in the embodiment of the present application is shown as follows: Figure 3 Through unsupervised language model pre-training and secondary pre-training, the large language model has enhanced its grammatical error correction capabilities. The purpose of supervised fine-tuning is to adapt it to the characteristics of the English grammar error correction task based on general semantic transfer learning.

[0234] At this stage, it is necessary to use a labeled data set for training. The data set is represented by D. Each sample consists of a text sequence x=x1x2…x with an input length of n. n And the corresponding error-corrected text y=y1y2…y m First, the text sequence x is input into the large language model with enhanced error correction capability, and the hidden layer output h corresponding to the last word is obtained from the last layer of the model. (L)Then, by applying a combination of a fully connected layer and a softmax function, the hidden layer output is transformed to obtain the prediction result, which is defined as follows:

[0235] P(y|x)=Softmax(h (L) W y ) (9)

[0236] Indicate x i is the corresponding y i The probability of , for the entire labeled data set (D), the optimization objective function is defined as follows:

[0237] L FT (D)=-∑ {(x,y)∈D} logP(y|x) (10)

[0238] In this objective function, the cross entropy loss between the error correction result predicted by the model and the actual error correction result is calculated for each sample (x, y) in the labeled dataset D, and the losses of all samples are summed.

[0239] Furthermore, after fine-tuning for a specific task, the weight matrix of a generative language model typically exhibits a lower intrinsic rank. This means that mapping parameter updates to a smaller subspace will not significantly impact the effectiveness of learning.

[0240] The embodiment of the present application, that is, by adding the product of a low-rank matrix as a trainable parameter on the bypass of the original weight matrix while keeping the pre-trained model parameters unchanged, to simulate the change in parameters. Specifically, assuming that the pre-trained weight is W0 with a dimension of d×k, the trainable parameter is ΔW=BA, where WB (with a dimension of d×r) and WA (with a dimension of r×d) are low-rank matrices. During initialization, matrix A is initialized with a Gaussian function, and matrix B is initialized with zero to ensure that there is no effect on the original model before training begins (that is, the parameter change is 0).

[0241] The embodiments of the present application can not only make full use of the rich knowledge contained in the large language model, but also have good migration capabilities, and can be easily applied to other end-to-end generation tasks, such as text translation and document summarization. By performing transfer learning and knowledge injection on error correction data, the solution enables the model to more comprehensively solve various types of grammatical error correction problems. By using a large amount of rough supervision data generated by construction, secondary pre-training is performed and global parameters are trained with large-scale data. In the second stage, the pre-trained parameters are frozen (due to the large amount of parameters), and only a small amount of newly added parameters are trained to adjust the small amount of parameters corresponding to the small-scale data. By adopting a multi-stage progressive learning method, it is eventually possible to converge well on small sample training data to achieve higher accuracy and recall.

[0242] The embodiment of the present application solves the problem that all knowledge of the related art seq2seq scheme comes from parallel training data, which requires the collection of a large number of error-correction sentence pairs. The seq2edits scheme uses the editing operations between the incorrect sentences and the corrected sentences as learning targets, and requires the editing operation sequences to be annotated for the training data, a process that may require manual participation. However, the embodiment of the present application can efficiently utilize the knowledge contained in the large language model itself, without the need for manual annotation of the editing operation sequences, greatly improving efficiency and reducing costs.

[0243] The embodiments of the present application utilize the rich knowledge contained in the large language model and perform transfer learning and knowledge injection on the error correction data, so that the model can better cope with various different grammatical error correction problems.

[0244] Specifically, the large language model is first pre-trained twice using large-scale constructed English error correction data to enhance its English grammar correction capabilities. This transfer learning approach provides the model with a broader grammatical knowledge base. Next, high-quality supervised fine-tuning data is created by combining instruction data with small-scale, high-quality English grammar correction data. The large language model is trained using instruction alignment, enabling it to perform English grammar correction. Ultimately, a large-scale English grammar correction model is obtained. Furthermore, the large language model is pre-trained twice using a large amount of automatically generated, coarse supervised data based on random changes. This approach updates global parameters, achieving the goal of transfer learning. Then, local parameters are fine-tuned using small-scale manually annotated data, using a small amount of data for a small number of parameters. Through a multi-stage progressive learning approach, the model gradually converges to the target generation task, ultimately achieving high accuracy and recall.

[0245] It is understandable that in the embodiments of the present application, when data such as information to be corrected is involved, when the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0246] The following continues to describe the exemplary structure of the grammar error correction model training device 455 provided in the embodiment of the present application as a software module. In some embodiments, such as Figure 2 As shown, the software modules in the grammatical error correction model training device 455 stored in the memory 450 may include: an initial training module 4551, which is used to train the initial grammatical error correction model based on a first information sample set of the target language to obtain an intermediate grammatical error correction model; wherein the grammatical recognition performance of the intermediate grammatical error correction model for the target language is greater than that of the initial grammatical error correction model; an identification module 4552, which is used to obtain a second information sample set of the target language, wherein each second information sample in the second information sample set has a grammatical error in the target language, and each second information sample carries a sample label for the grammatical error; error feature identification is performed on the second information sample features corresponding to each second information sample, to obtain a target feature associated with the grammatical error in each second information sample feature; and a target training module 4553, which is used to train the intermediate grammatical error correction model in combination with the target feature and the sample label to obtain a target grammatical error correction model.

[0247] In some embodiments, the above-mentioned initial training module is also used to perform feature extraction on each first information sample in the first information sample set to obtain first information sample features corresponding to the first information sample; call the initial grammatical error correction model, and perform grammatical error correction on each first information sample based on the features of each first information sample to obtain first prediction information corresponding to each first information sample, and the first prediction information has the same language meaning as indicated by the corresponding first information sample; combine the first prediction information and the first information sample to train the initial grammatical error correction model to obtain an intermediate grammatical error correction model.

[0248] In some embodiments, the first information sample includes multiple first component information. The above-mentioned initial training module is also used to perform feature extraction on each first component information to obtain a first component feature, obtain a position feature corresponding to the first component information, and fuse the position feature and the first component feature to obtain a target component feature corresponding to the first component information; wherein the position feature corresponding to the first component information is used to indicate the position of the first component information in the first information sample; according to the position of each first component information in the first information sample, the target component feature corresponding to each first component information is feature spliced ​​to obtain the first information sample feature.

[0249] In some embodiments, the initial grammatical error correction model includes a feature conversion layer and an information prediction layer. The above-mentioned initial training module is also used to perform the following processing for each first information sample feature: calling the feature conversion layer to perform feature conversion on the first information sample feature to obtain a conversion feature corresponding to the first information sample feature, and the feature dimension of the conversion feature is smaller than that of the first information sample feature; calling the information prediction layer to perform grammatical error correction on the corresponding first information sample based on the conversion feature to obtain the first prediction information corresponding to the first information sample.

[0250] In some embodiments, the initial grammatical error correction model includes multiple feature conversion layers, and the above-mentioned initial training module is also used to call the first feature conversion layer, perform feature conversion on the first information sample feature, and obtain the first conversion feature corresponding to the first information sample feature; traverse i to perform the following processing: call the i-th feature conversion layer, perform feature conversion on the i-1-th conversion feature, and obtain the i-th conversion feature; wherein 2≤i≤N, N is the number of feature conversion layers; determine the N-th conversion feature as the conversion feature corresponding to the first information sample feature.

[0251] In some embodiments, the above-mentioned initial training module is also used to determine the information similarity between the first information sample and the corresponding first prediction information for each first information sample; sum up the information similarities to obtain the initial loss value of the initial grammatical error correction model; based on the initial loss value, train the initial grammatical error correction model to obtain an intermediate grammatical error correction model.

[0252] In some embodiments, the above-mentioned initial training module is also used to perform the following processing on each second information sample in the second information sample set: for each second component information in the second information sample, feature extraction is performed on the second component information to obtain the second component feature, the position feature corresponding to the second component information is obtained, and the position feature and the second component feature are fused to obtain the target component feature corresponding to the second component information; wherein the position feature corresponding to the second component information is used to indicate the position of the second component information in the second information sample; according to the position of each second component information in the second information sample, the target component feature corresponding to each second component information is feature spliced ​​to obtain the second information sample feature corresponding to the second information sample.

[0253] In some embodiments, the above-mentioned error feature recognition is implemented through a feature recognition model, and the second information sample feature includes multiple sub-features. The above-mentioned recognition module is also used to perform the following processing for each second information sample feature: calling the feature recognition model, performing error feature recognition on each sub-feature in the second information sample feature, and obtaining a feature recognition result for each sub-feature; wherein the feature recognition result is used to indicate whether the corresponding sub-feature is associated with a grammatical error; based on the feature recognition result, determining the target feature associated with the grammatical error in the second information sample feature.

[0254] In some embodiments, the above-mentioned identification module is also used to, for each sub-feature, determine the sub-feature as a target sub-feature when the feature recognition result of the sub-feature indicates that the sub-feature is associated with a grammatical error; when the number of target sub-features is one, determine the target sub-feature as the target feature; when the number of target sub-features is multiple, perform feature splicing on each target sub-feature in the order of their positions in the second information sample feature to obtain the target feature.

[0255] In some embodiments, the second information sample feature includes multiple feature elements, and error feature identification is implemented through an element recognition model. The above-mentioned recognition module is also used to perform the following processing for each second information sample feature: for each feature element in the second information sample feature, call the element recognition model, perform element recognition on the feature element, and obtain the element recognition result corresponding to the feature element; wherein the element recognition result is used to indicate whether the corresponding feature element is associated with a grammatical error; based on the element recognition result, perform element update on each feature element in the second information sample feature to obtain the target feature.

[0256] In some embodiments, the above-mentioned identification module is also used to, for each feature element, determine the feature element as a target feature element when the element identification result indicates that the feature element is not associated with a grammatical error; determine the feature element as a reference feature element when the element identification result indicates that the feature element is associated with a grammatical error; update the element value of each target feature element in the second information sample feature to the opposite of the corresponding element value, and update the element value of each reference feature element in the second information sample feature to zero to obtain an adjusted feature; and fuse the adjusted feature and the second information sample feature to obtain the target feature.

[0257] In some embodiments, the above-mentioned target training module is also used to call the intermediate grammatical correction model for each second information sample, perform grammatical correction on the second information sample based on the target features corresponding to the second information sample, and obtain second prediction information corresponding to the second information sample, where the second prediction information has the same language meaning as indicated by the corresponding second information sample; combine the second prediction information and the sample label to train the intermediate grammatical correction model to obtain the target grammatical correction model.

[0258] In some embodiments, the above-mentioned target training module is also used to determine, for each second information sample, the intermediate loss value corresponding to the second information sample in combination with the sample label carried by the second information sample and the second prediction information corresponding to the second information sample; summing up the intermediate loss values ​​to obtain the overall loss value of the intermediate grammatical error correction model; based on the overall loss value, training the intermediate grammatical error correction model to obtain the target grammatical error correction model.

[0259] In some embodiments, the initial training module is further configured to obtain multiple candidate languages, where different candidate languages ​​correspond to different grammatical rules; and in response to selection instructions for the multiple candidate languages, determine the selected candidate language as the target language.

[0260] The following continues to describe the exemplary structure of the grammar error correction device 555 provided in the embodiment of the present application as a software module. In some embodiments, such as Figure 3 As shown, the software modules stored in the grammatical correction device 555 of the memory 550 may include: an extraction module 5551, used to obtain information to be corrected that has grammatical errors in the target language, perform feature extraction on the information to be corrected, and obtain features to be corrected corresponding to the information to be corrected; a correction module 5552, used to call a target grammatical correction model, perform grammatical correction on the information to be corrected based on the features to be corrected, and obtain target information corresponding to the information to be corrected, wherein the target information does not have the grammatical errors, and the target information has the same language meaning as indicated by the information to be corrected; wherein the target grammatical correction model is trained based on the above-mentioned grammatical correction model training method.

[0261] An embodiment of the present application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the grammatical error correction model training method described in the embodiment of the present application.

[0262] The embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the processor will execute the training method of the grammatical error correction model provided by the embodiment of the present application, for example, Figure 4 The training method of the grammatical error correction model is shown.

[0263] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or various electronic devices including one or any combination of the above memories.

[0264] In some embodiments, computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0265] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).

[0266] By way of example, computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed across multiple sites and interconnected by a communication network.

[0267] In summary, the embodiments of the present application have the following beneficial effects:

[0268] (1) By training the initial grammatical error correction model based on the first information sample set of the target language, an intermediate grammatical error correction model is obtained. By identifying the error features of the second information sample features corresponding to each second information sample, a target feature associated with the grammatical error in the second information sample features is obtained. The intermediate grammatical error correction model is trained in combination with the target feature and the sample label to obtain a target grammatical error correction model. In this way, by training the initial grammatical error correction model based on the first information sample set of the target language, the grammatical recognition performance of the grammatical error correction model for the target language is significantly improved. Then, by training the intermediate grammatical error correction model with the second information sample set carrying the sample label for the grammatical error, a target grammatical error correction model is obtained. Thus, on the basis of the significant improvement in the grammatical recognition performance, the error correction performance of the grammatical error correction model is significantly improved. At the same time, by identifying the error features of the second information sample features corresponding to each second information sample, a target feature associated with the grammatical error in the second information sample features is obtained. By training the intermediate grammatical error correction model with the lightweight target feature, the training efficiency can be significantly improved, thereby effectively improving the error correction performance of the grammatical error correction model while improving the training efficiency of the grammatical error correction model.

[0269] (2) By calling the first feature conversion layer, the first information sample feature is converted to obtain the first conversion feature corresponding to the first information sample feature; traversing i to perform the following processing: calling the i-th feature conversion layer, performing feature conversion on the i-1-th conversion feature, and obtaining the i-th conversion feature; determining the N-th conversion feature as the conversion feature corresponding to the first information sample feature, thereby achieving N-fold dimensionality reduction for the first information sample feature, thereby achieving an effective reduction in the feature dimension of the first information sample feature, and subsequently performing grammatical correction through the conversion feature, making the grammatical correction faster and effectively improving the correction efficiency of the grammatical correction.

[0270] (3) The first information sample in the first information sample set may be an information sample that does not carry a sample label for grammatical errors, thereby effectively reducing the label annotation cost in the process of training the grammatical error correction model, thereby effectively improving the training efficiency of the grammatical error correction model.

[0271] (4) By performing error feature recognition on each sub-feature in the second information sample feature, when the feature recognition result indicates that the sub-feature is associated with a grammatical error, the corresponding sub-feature is determined as a target sub-feature and feature splicing is performed to obtain a target feature. Since the sub-feature includes multiple feature elements, by performing error feature recognition on each sub-feature, the number of sub-features is significantly greater than the number of feature elements, thereby effectively improving the efficiency of generating the target feature.

[0272] (5) For each characteristic element in the second information sample feature, the element recognition model is called to perform element recognition on the characteristic element to obtain the element recognition result corresponding to the characteristic element. Based on the element recognition result, the element of each characteristic element in the second information sample feature is updated to obtain the target feature. Since the characteristic element is the smallest component unit in the second information sample feature, by performing element recognition on the characteristic element, the recognition accuracy of the second information sample feature is significantly improved, and the accuracy of the determined target feature is effectively improved.

[0273] (6) After fine-tuning for a specific task, the weight matrix of the generative language model usually exhibits a lower intrinsic rank (IntrinsicRank). That is, mapping the parameter update amount to a smaller subspace will not have a significant impact on the effectiveness of learning.

[0274] (7) The embodiments of the present application can not only make full use of the rich knowledge contained in the large language model, but also have good migration capabilities and can be easily applied to other end-to-end generation tasks, such as text translation and document summarization. By performing transfer learning and knowledge injection on error correction data, the solution enables the model to more comprehensively solve various types of grammatical error correction problems. By using a large amount of rough supervision data generated by construction for secondary pre-training, global parameters are trained with large-scale data. In the second stage, the pre-trained parameters are frozen (due to the large number of parameters), and only a small number of newly added parameters are trained to adjust the small number of parameters corresponding to the small-scale data. By adopting a multi-stage progressive learning method, it can eventually converge well on small sample training data to achieve higher accuracy and recall rate.

[0275] (8) The embodiments of the present application solve the problem that all knowledge in the related art seq2seq scheme comes from parallel training data, thus requiring the collection of a large number of error-correction sentence pairs. The seq2edits scheme uses the editing operations between the incorrect and corrected sentences as learning targets, and requires the annotation of editing operation sequences for the training data, a process that may require manual participation. However, the embodiments of the present application can efficiently utilize the knowledge inherent in the large language model itself, without the need for manual annotation of editing operation sequences, greatly improving efficiency and reducing costs.

[0276] (9) The embodiment of the present application utilizes the rich knowledge contained in the large language model, and by performing transfer learning and knowledge injection on the error correction data, the model can better cope with various different grammatical error correction problems. Specifically, the large language model is first pre-trained twice using large-scale constructed English error correction data to enhance its English grammatical error correction ability. This transfer learning method provides a broader grammatical knowledge base for the model. Then, by combining the instruction data with small-scale high-quality English grammatical error correction data, high-quality supervised fine-tuning data is created. The large language model is trained by instruction alignment, so that it has the ability to correct English grammar errors. Finally, a large-scale English grammar error correction model is obtained. In addition, a large amount of automatically generated rough supervision data based on random changes is used to perform secondary pre-training on the large language model. In this way, the global parameters are updated and the goal of transfer learning is achieved. Then, the local parameters are fine-tuned using small-scale manually annotated data, and alignment learning is performed using a small amount of data corresponding to a small amount of parameters. Through a multi-stage progressive learning method, it gradually converges to the target generation task, and finally achieves a high accuracy and recall rate.

[0277] (10) By combining the target features and sample labels, the intermediate grammatical error correction model is trained to obtain the target grammatical error correction model. Since each second information sample has grammatical errors in the target language, each second information sample in the second information sample set trains the intermediate grammatical error correction model, which can effectively improve the grammatical error correction performance of the intermediate grammatical error correction model, so that the trained target grammatical error correction model has higher grammatical error correction performance for the target language.

[0278] (11) By obtaining information to be corrected that has grammatical errors in the target language, performing feature extraction on the information to be corrected, obtaining features to be corrected corresponding to the information to be corrected, calling a target grammatical correction model, and performing grammatical correction on the information to be corrected based on the features to be corrected, obtaining target information corresponding to the information to be corrected. Since the target grammatical correction model is trained by the grammatical correction model training method provided in the embodiment of the present application, it has high grammatical correction performance, so that the target information corresponding to the obtained information to be corrected can achieve accurate correction of the information to be corrected.

[0279] (12) By obtaining information to be corrected that has grammatical errors in the target language, performing feature extraction on the information to be corrected, obtaining features to be corrected corresponding to the information to be corrected, calling a target grammatical correction model, and performing grammatical correction on the information to be corrected based on the features to be corrected, obtaining target information corresponding to the information to be corrected. Since the target grammatical correction model is trained by the grammatical correction model training method provided in the embodiment of the present application, it has high grammatical correction performance, so that the target information corresponding to the obtained information to be corrected can achieve accurate correction of the information to be corrected.

[0280] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the scope of protection of the present application.

Claims

1. A method for training a grammatical error correction model, characterized in that: The method comprises: Training an initial grammatical error correction model based on a first information sample set of a target language to obtain an intermediate grammatical error correction model; wherein the grammar recognition performance of the intermediate grammar correction model for the target language is greater than that of the initial grammar correction model; Acquire a second information sample set in a target language, wherein each second information sample in the second information sample set has a grammatical error in the target language, and each second information sample carries a sample label for the grammatical error; performing error feature recognition on the second information sample features corresponding to each of the second information samples, to obtain a target feature associated with the grammatical error in each of the second information sample features; The intermediate grammatical error correction model is trained in combination with the target features and the sample labels to obtain a target grammatical error correction model.

2. The method according to claim 1, characterized in that The initial grammatical error correction model is trained based on the first information sample set of the target language to obtain an intermediate grammatical error correction model, including: For each first information sample in the first information sample set, extract features of the first information sample to obtain first information sample features corresponding to the first information sample; calling the initial grammatical error correction model, and performing grammatical error correction on each of the first information samples based on the features of each of the first information samples, to obtain first prediction information corresponding to each of the first information samples, wherein the first prediction information has the same language meaning as that indicated by the corresponding first information sample; The initial grammatical error correction model is trained in combination with the first prediction information and the first information sample to obtain the intermediate grammatical error correction model.

3. The method according to claim 2, characterized in that The first information sample includes a plurality of first component information, and the feature extraction of the first information sample to obtain a first information sample feature corresponding to the first information sample includes: For each piece of the first component information, extract features of the first component information to obtain first component features, obtain position features corresponding to the first component information, and fuse the position features with the first component features to obtain target component features corresponding to the first component information; The position feature corresponding to the first component information is used to indicate the position of the first component information in the first information sample; According to the position of each piece of the first component information in the first information sample, feature splicing is performed on the target component features corresponding to each piece of the first component information to obtain the first information sample features.

4. The method according to claim 2, characterized in that The initial grammatical error correction model includes a feature conversion layer and an information prediction layer. Calling the initial grammatical error correction model to perform grammatical error correction on each first information sample based on the features of each first information sample to obtain first prediction information corresponding to each first information sample includes: The following processing is performed for each of the first information sample features: calling the feature conversion layer to perform feature conversion on the first information sample feature to obtain a conversion feature corresponding to the first information sample feature, where the feature dimension of the conversion feature is smaller than that of the first information sample feature; The information prediction layer is called to perform syntax correction on the corresponding first information sample based on the conversion feature to obtain first prediction information corresponding to the first information sample.

5. The method according to claim 4, characterized in that The initial grammatical error correction model includes a plurality of feature conversion layers, and calling the feature conversion layer to perform feature conversion on the first information sample feature to obtain a conversion feature corresponding to the first information sample feature includes: Calling a first feature conversion layer to perform feature conversion on the first information sample feature to obtain a first conversion feature corresponding to the first information sample feature; Traverse i and perform the following processing: call the i-th feature conversion layer, perform feature conversion on the i-1-th conversion feature, and obtain the i-th conversion feature; Wherein, 2≤i≤N, N is the number of the feature conversion layers; The Nth conversion feature is determined as the conversion feature corresponding to the first information sample feature.

6. The method according to claim 2, characterized in that The step of training the initial grammatical error correction model by combining the first prediction information and the first information sample to obtain the intermediate grammatical error correction model includes: For each first information sample, determining an information similarity between the first information sample and the corresponding first prediction information; The information similarities are summed to obtain an initial loss value of the initial grammatical error correction model. Based on the initial loss value, the initial grammatical error correction model is trained to obtain the intermediate grammatical error correction model.

7. The method according to claim 1, characterized in that The second information sample includes a plurality of second component information. After obtaining the second information sample set in the target language, the method further includes: Perform the following processing on each second information sample in the second information sample set: For each second component information in the second information sample, perform feature extraction on the second component information to obtain a second component feature, obtain a position feature corresponding to the second component information, and fuse the position feature with the second component feature to obtain a target component feature corresponding to the second component information; The position feature corresponding to the second component information is used to indicate the position of the second component information in the second information sample; According to the position of each piece of second component information in the second information sample, feature splicing is performed on the target component features corresponding to each piece of second component information to obtain the second information sample features corresponding to the second information sample.

8. The method according to claim 1, characterized in that The error feature recognition is implemented by a feature recognition model, the second information sample feature includes a plurality of sub-features, and the error feature recognition is performed on the second information sample feature corresponding to each second information sample to obtain a target feature associated with the grammatical error in each second information sample feature, including: The following processing is performed for each of the second information sample features: Calling the feature recognition model to perform error feature recognition on each sub-feature in the second information sample feature to obtain a feature recognition result for each sub-feature; The feature recognition result is used to indicate whether the corresponding sub-feature is associated with the grammatical error; Based on the feature recognition result, a target feature associated with the grammatical error in the second information sample feature is determined.

9. The method according to claim 8, characterized in that The determining, based on the feature recognition result, a target feature associated with the grammatical error in the second information sample feature includes: For each of the sub-features, when a feature recognition result of the sub-feature indicates that the sub-feature is associated with the grammatical error, determining the sub-feature as a target sub-feature; When the number of the target sub-feature is one, determining the target sub-feature as the target feature; When there are multiple target sub-features, feature splicing is performed on each target sub-feature according to the order of positions of each target sub-feature in the second information sample feature to obtain the target feature.

10. The method according to claim 1, characterized in that The second information sample features include a plurality of feature elements, and the error feature identification is implemented by an element identification model. The error feature identification is performed on the second information sample features corresponding to each second information sample to obtain a target feature associated with the grammatical error in each second information sample feature, including: The following processing is performed for each of the second information sample features: For each characteristic element in the second information sample feature, calling the element recognition model, performing element recognition on the characteristic element, and obtaining an element recognition result corresponding to the characteristic element; The element recognition result is used to indicate whether the corresponding characteristic element is associated with the grammatical error; Based on the element recognition result, each characteristic element in the second information sample feature is updated to obtain the target feature.

11. The method according to claim 10, characterized in that The updating of each characteristic element in the second information sample feature based on the element recognition result to obtain the target feature includes: For each of the characteristic elements, when the element recognition result indicates that the characteristic element is not associated with the grammatical error, determining the characteristic element as a target characteristic element; when the element recognition result indicates that the characteristic element is associated with the grammatical error, determining the characteristic element as a reference characteristic element; Updating the element value of each target feature element in the second information sample feature to the opposite number of the corresponding element value, and updating the element value of each reference feature element in the second information sample feature to zero, to obtain an adjusted feature; The adjustment feature and the second information sample feature are fused to obtain the target feature.

12. The method according to claim 1, characterized in that The step of training the intermediate grammatical error correction model by combining the target feature and the sample label to obtain a target grammatical error correction model includes: For each second information sample, calling the intermediate grammatical error correction model, performing grammatical error correction on the second information sample based on the target feature corresponding to the second information sample, and obtaining second prediction information corresponding to the second information sample, where the second prediction information has the same language meaning as the corresponding second information sample; The intermediate grammatical error correction model is trained in combination with the second prediction information and the sample label to obtain the target grammatical error correction model.

13. The method according to claim 12, characterized in that The step of training the intermediate grammatical error correction model in combination with the second prediction information and the sample label to obtain the target grammatical error correction model includes: For each second information sample, combining the sample label carried by the second information sample and the second prediction information corresponding to the second information sample, determining an intermediate loss value corresponding to the second information sample; The intermediate loss values ​​are summed to obtain an overall loss value of the intermediate grammatical error correction model. Based on the overall loss value, the intermediate grammatical error correction model is trained to obtain the target grammatical error correction model.

14. The method according to claim 1, wherein Before training the initial grammatical error correction model based on the first information sample set in the target language to obtain the intermediate grammatical error correction model, the method further includes: Acquire multiple candidate languages, where different candidate languages ​​correspond to different grammatical rules; In response to a selection instruction for the plurality of candidate languages, the selected candidate language is determined as the target language.

15. A grammatical error correction method, characterized in that: The method comprises: Acquiring information to be corrected that has grammatical errors in a target language, performing feature extraction on the information to be corrected, and obtaining features to be corrected corresponding to the information to be corrected; Invoking a target grammatical error correction model to perform grammatical error correction on the information to be corrected based on the features to be corrected, thereby obtaining target information corresponding to the information to be corrected, wherein the target information does not have the grammatical error and has the same language meaning as the information to be corrected; The target grammatical error correction model is trained based on the method described in any one of claims 1-14.

16. A training device for a grammatical error correction model, characterized in that: The device comprises: an initial training module for training an initial grammar correction model based on a first set of information samples in a target language to obtain an intermediate grammar correction model; wherein the intermediate grammar correction model has a grammar recognition performance for the target language that is greater than that of the initial grammar correction model; an identification module configured to obtain a set of second information samples in a target language, wherein each second information sample in the set of second information samples has a grammatical error in the target language and each second information sample carries a sample label for the grammatical error; perform error feature identification on second information sample features corresponding to each second information sample, and obtain a target feature associated with the grammatical error in each second information sample feature; The target training module is used to train the intermediate grammatical error correction model in combination with the target features and the sample labels to obtain a target grammatical error correction model.

17. A grammatical error correction device, characterized in that: The device comprises: An extraction module is used to obtain information to be corrected that has grammatical errors in the target language, perform feature extraction on the information to be corrected, and obtain features to be corrected corresponding to the information to be corrected; A correction module is used to call a target grammatical correction model, perform grammatical correction on the information to be corrected based on the features to be corrected, and obtain target information corresponding to the information to be corrected, wherein the target information does not have the grammatical error and the target information has the same language meaning as the information to be corrected; wherein the target grammatical correction model is trained based on the method described in any one of claims 1 to 14.

18. An electronic device, characterized in that: The electronic device comprises: a memory for storing computer-executable instructions or computer programs; A processor, configured to implement the method according to any one of claims 1 to 15 when executing computer-executable instructions or computer programs stored in the memory.

19. A computer-readable storage medium storing computer-executable instructions, characterized in that: When the computer-executable instructions are executed by a processor, the method according to any one of claims 1 to 15 is implemented.

20. A computer program product comprising a computer program or computer executable instructions, characterized in that When the computer program or computer executable instructions are executed by a processor, the method according to any one of claims 1 to 15 is implemented.