WO2022095563A1 - 文本纠错的适配方法、装置、电子设备及存储介质 - Google Patents

文本纠错的适配方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2022095563A1
WO2022095563A1 PCT/CN2021/114605 CN2021114605W WO2022095563A1 WO 2022095563 A1 WO2022095563 A1 WO 2022095563A1 CN 2021114605 W CN2021114605 W CN 2021114605W WO 2022095563 A1 WO2022095563 A1 WO 2022095563A1
Authority
WO
WIPO (PCT)
Prior art keywords
text information
adaptation
text
model
information
Prior art date
Application number
PCT/CN2021/114605
Other languages
English (en)
French (fr)
Inventor
许士亭
许国伟
丁文彪
刘子韬
Original Assignee
北京世纪好未来教育科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京世纪好未来教育科技有限公司 filed Critical 北京世纪好未来教育科技有限公司
Publication of WO2022095563A1 publication Critical patent/WO2022095563A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/232Orthographic correction, e.g. spell checking or vowelisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the present application relates to the technical field of information processing, and in particular, to an adaptation method, device, electronic device and storage medium for text error correction.
  • the chip As electronic devices such as portable devices and mobile terminals become more intelligent than before, the chip has stronger analytical capabilities, and can efficiently parse and process text information, graphic information, etc.
  • the present application provides an adaptation method, device, electronic device and storage medium for text error correction.
  • an adaptation method for text error correction including:
  • the integrated processing is performed according to the first text information, the second text information and the adaptation processing strategy to obtain target text information adapted to the current scene.
  • an adaptation device for text error correction comprising:
  • an error correction module configured to perform error correction processing according to the first text information and the grammatical error correction model to obtain second text information
  • the adaptation module is configured to perform scene adaptation processing according to the first text information, the current scene information adapted to the first text information, and the adaptation model, to obtain whether the text objects in the first text information need to be modified in the current scene adaptive processing strategy;
  • the integration module is configured to perform integration processing according to the first text information, the second text information and the adaptation processing strategy to obtain target text information adapted to the current scene.
  • an electronic device comprising:
  • the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the method provided by any one of the embodiments of the present application.
  • a non-transitory computer-readable storage medium storing computer instructions
  • the computer instructions are used to cause the computer to execute the method provided by any one of the embodiments of the present application.
  • error correction processing can be performed according to the first text information and the grammatical error correction model to obtain the second text information.
  • the scene adaptation process can be performed according to the first text information, the current scene information adapted to the first text information, and the adaptation model, to obtain an adaptation processing strategy for whether the text objects in the first text information need to be modified in the current scene .
  • the integrated processing may be performed according to the first text information, the second text information and the adaptation processing strategy to obtain target text information adapted to the current scene. Whether the modification of the first text information is suitable for the adaptation processing strategy of the current scene can be obtained through the adaptation model. Therefore, according to the original information (the first text information), the adaptation processing strategy is combined with the output of the grammar error correction model.
  • the result of error correction processing (second text information) is integrated and processed, and the target text information suitable for the current scene can be obtained, so as to meet the compatibility and adaptability of error correction processing in different application scenarios, and improve the efficiency of error correction processing. Accuracy and error correction processing efficiency.
  • FIG. 1 is a schematic flowchart of an adaptation method for text error correction according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of a preparation stage before use of a syntax error correction model and an adaptation model according to an embodiment of the present application;
  • FIG. 3 is a schematic diagram of a syntax error correction model and an adaptation model in use according to an embodiment of the present application
  • FIG. 4 is a schematic diagram of an adaptation model according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a composition structure of an adaptation device for text error correction according to an embodiment of the present application.
  • FIG. 6 is a block diagram of an electronic device for implementing the adaptation method for text error correction according to an embodiment of the present application.
  • first and second herein refer to and distinguish between a plurality of similar technical terms, and do not mean to limit the order, or to limit only two meanings, for example, the first feature and the second Feature means that there are two types/two features, the first feature can be one or more, and the second feature can also be one or more.
  • the neural network model can be used to correct the spelling and semantic problems in the text information.
  • the text information when the text information is an English sentence, it can be used for grammar.
  • a deep learning model for error correction (referred to as a grammar error correction model) performs English grammar error correction on the English sentence.
  • the grammatical error correction model can be a deep learning model based on a sequence-to-sequence (Seq2Seq) structure, and the grammatical error correction model is trained based on the sample pairs in the training samples formed by a large number of correct sentences and incorrect sentences.
  • the trained grammatical error correction model is used in application scenarios such as English composition correction and title catalogue proofreading to realize the mapping of the source sequence to the target sequence, that is, the input source sequence (including English sentences with grammatical errors) to the trained grammatical error correction After the model, the target sequence is output (modified into a correct English sentence after grammatical error correction).
  • the above error correction processing cannot meet the compatibility and adaptability in different application scenarios, and an error is often reported due to incompatibility with the current application scenario. That is to say, for the error correction requirements in different application scenarios, it is impossible to perform error correction adaptation processing for different application scenarios, and even may not only fail to improve the accuracy of error correction processing, on the contrary, it will reduce the accuracy of error correction processing. As a result, error reporting and error correction processing efficiency are also greatly reduced.
  • Part of the English sentence in the A scenario is considered a grammatical error, and it may be ignored in the B scenario.
  • the entry word "A.apple" in a multiple-choice question in an entry scenario is not considered a grammatical error, but a grammatical error correction model in a text error correction scenario will consider it a grammatical error. That is to say, although the grammatical error correction model can correct the input errors or grammatical errors of some content (such as some words) in the English sentence, and locate the wrong position, for some application scenarios, this single dependence on grammatical error correction The model is flawed.
  • this application can combine the training results and training samples of the above-mentioned grammar error correction model, and use English sentences that may contain grammatical errors as the first text. information, and take the correct English sentence obtained after grammatical error correction as the second text information.
  • the first text information a plurality of text objects that constitute the first text information, and whether the first text information is to be modified (modification of all or part of the content) to the second text information (in the second text information) adapted to the current scene
  • the classification label corresponding to the adaptation processing strategy of all or part of the content) is obtained, and a training sample is obtained, and the model training of multi-scene adaptation is carried out according to the training sample, and the multi-scene adaptation model after training is obtained.
  • the adaptation model used in combination, the entire training process of the adaptation model, due to the combination of the training results and training samples of the above-mentioned grammar error correction model, is neither time-consuming nor lacks parallel corpus for model training, which can meet expectations.
  • the desired effect (error correction + scene adaptation) therefore, after the adaptation model is used in combination with the syntax error correction model, the defects in the above error correction adaptation processing can be solved, and the compatibility in different application scenarios can be satisfied. and adaptability.
  • FIG. 1 is a schematic flowchart of an adaptation method for text error correction according to an embodiment of the present application, and the method can be applied to the adaptation of text error correction.
  • the apparatus for example, the apparatus may be deployed in a terminal or a server or other processing device to execute, and may perform error correction processing, scene adaptation, text information integration, and the like.
  • the terminal may be a user equipment (UE, User Equipment), a mobile device, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA, Personal Digital Assistant), a handheld device, a computing device, a vehicle-mounted device, a wearable device, and the like.
  • the method may also be implemented by the processor invoking computer-readable instructions stored in the memory. As shown in Figure 1, it includes:
  • the first text information is the original text
  • the second text information is the error-corrected text.
  • a deep learning model based on the Seq2Seq structure (mainly composed of an encoder, a decoder and an attention mechanism) can be used for the syntax error correction model.
  • the training samples of the grammatical error correction model can include a pair of samples consisting of the correct sentence "I am good” and the wrong sentence "I are good", and the training is performed by combining a large number of sample pairs composed of correct sentences and incorrect sentences.
  • the grammar error correction model can be obtained after the training of the grammar error correction model.
  • the first text information (which may include grammatical errors, misspellings, etc.) is input into the trained grammatical error correction model, and the second text information can be output.
  • corrected sentence after error correction for example, input the wrong sentence "I are good” into the trained grammar error correction model, and output the correct sentence "I am good”.
  • S102 Perform scene adaptation processing according to the first text information, the current scene information adapted to the first text information, and an adaptation model, to obtain adaptation processing of whether the text objects in the first text information need to be modified in the current scene Strategy.
  • the first text information is the original text
  • the second text information is the error-corrected text
  • the training samples may include: first text information (original sentences that may include grammatical errors, misspellings, etc.), multiple text objects that constitute the first text information (for example, after splitting the sentence. Each word or label obtained, etc.) and the classification label corresponding to the adaptation processing strategy (such as whether each word in the original sentence needs to be modified in the current scene) (error correction suitable for various scenarios).
  • the multi-scene adaptation model training is performed. After the training, the trained multi-scene adaptation model, that is, the adaptation model can be obtained.
  • Adaptation processing such as the current scene is a single-choice, multiple-choice or indefinite-item selection item list entry scene, there is an option format (such as A.apple).
  • option format such as A.apple
  • an adaptation processing strategy for whether the text object in the first text information needs to be modified in the current scene can be output.
  • the second text information (error-corrected sentences) is obtained after performing error correction processing by the trained grammar error correction model.
  • the text object in the first text information needs to be integrated with the modified adaptation processing strategy in the current scene, for example, the current scene is a single-choice, multiple-choice or indefinite item selection item list entry scene, for the first text information
  • the first text information can be regarded as the correct sentence in the current scene in combination with the adaptation processing strategy, and the first text information containing the option format is the correct sentence.
  • target text information eg, first text information
  • error correction processing can be performed according to the first text information and the grammatical error correction model to obtain the second text information.
  • the scene adaptation process can be performed according to the first text information, the current scene information adapted to the first text information, and the adaptation model, to obtain an adaptation processing strategy for whether the text objects in the first text information need to be modified in the current scene .
  • the integrated processing may be performed according to the first text information, the second text information and the adaptation processing strategy to obtain target text information adapted to the current scene. Whether the modification of the first text information is suitable for the adaptation processing strategy of the current scene can be obtained through the adaptation model. Therefore, according to the original information (the first text information), the adaptation processing strategy is combined with the output of the grammar error correction model.
  • the result of error correction processing (second text information) is integrated and processed, and the target text information suitable for the current scene can be obtained, so as to meet the compatibility and adaptability of error correction processing in different application scenarios, and improve the efficiency of error correction processing. Accuracy and error correction processing efficiency.
  • sentence A eg, English sentence A composed of an English word sequence
  • the grammar error correction model accepts the sentence A, and outputs a new sentence B after error correction (eg, English sentence B obtained by performing error correction processing on English sentence A composed of English word sequences).
  • the adaptation model accepts the sentence A and the current scene information, checks whether the position of each word in the sentence A needs to be modified in the current scene through the adaptation model, and outputs whether the sentence A needs to be modified in the current scene through the adaptation model.
  • the modified adaptation processing strategy is based on the sentence A, whether the new sentence B and the sentence A need to be modified in the current scene.
  • the adaptation processing strategy is integrated and processed, and finally a sentence adapted to the current scene is obtained.
  • performing integrated processing according to the first text information, the second text information, and the adaptation processing strategy to obtain target text information adapted to the current scene including: acquiring an identifier corresponding to the first text information in the adaptation processing strategy information.
  • the identification information when the identification information is used to indicate that the first text information needs to be modified, for example, for a field (token) such as a word or a label in the first text information (such as an English sentence), the corresponding identification information is 1, Then, the word or label needs to be modified, the second text information is retained, and the second text information is adapted to the target text information.
  • a field such as a word or a label in the first text information (such as an English sentence
  • the identification information is used to indicate that the first text information does not need to be modified, for example, for a field (token) such as a word or a label in the first text information (such as an English sentence), the corresponding identification information is 0 , the word or label needs to be modified, the first text information is retained, and the first text information is adapted to the target text information.
  • a field such as a word or a label in the first text information (such as an English sentence)
  • the corresponding identification information is 0
  • the word or label needs to be modified
  • the first text information is retained, and the first text information is adapted to the target text information.
  • the token By indicating whether the first text information needs to be modified during scene adaptation based on the identification information, it can be accurately identified whether there is a token that needs to be modified to adapt to the current scene in the first text information (the token consists of multiple bytes), thereby improving the accuracy and speed of adaptation.
  • the method further includes: obtaining the similarity of the text objects in the first text information and the second text information in response to the edit distance operation, and aligning the first text information and the second text information according to the similarity of the text objects Process, determine the text object that has been modified in the first text information. Compare the text object in the first text information with the text object in the second text information determined to be modified by the first text information through the adaptation processing strategy, and obtain the comparison result, according to the comparison result and the adaptation processing strategy An integrated processing strategy is obtained to perform integrated processing according to the integrated processing strategy.
  • the above-mentioned alignment processing is implemented by the edit distance algorithm.
  • the edit distance algorithm can be realized by responding to the edit distance operation.
  • the edit distance operation is the process of changing a string into another string through editing operations such as adding, deleting, and replacing, and the edit distance is the process of executing the editing.
  • the order relationship of words in the sentence is considered, not limited to the mechanical replacement, movement, deletion, addition, etc. of words, but also the amount of information such as different semantics expressed by each word in the current scene.
  • alignment processing can be performed on the first text information and the second text information according to the similarity, so as to obtain the text object that needs to be modified in the first text information (for example, denoted as The first text object), in order to determine the text object in the second text information to be modified by the adaptation processing strategy (such as denoted as the second text object), so that the first text before the integration processing
  • the object and the second text object are compared to see if the first text object in the first text information needs to be modified and then integrated based on the adaptation processing strategy, which improves the accuracy of error correction and adaptation.
  • the training process of the adaptation model is also included, and a training sample can be obtained according to the first text information, a plurality of text objects constituting the first text information, and the classification labels corresponding to the adaptation processing strategy, and the training samples can be performed according to the training samples.
  • the multi-scene adaptation model is trained to obtain a trained multi-scene adaptation model, and the trained multi-scene adaptation model is used as the adaptation model.
  • model training for multi-scene adaptation is performed according to the training samples to obtain a multi-scene adaptation model after training, including: inputting the training samples into the multi-scene adaptation model, and separately calculating the values used to represent the first text information type.
  • the first loss function in one embodiment, the first text information type may be the topic type corresponding to the first text information, for example, the “probability of the topic type corresponding to the first text information” is obtained through a normalized indicator function (Softmax) layer.
  • Softmax normalized indicator function
  • a second loss function used to represent whether the first text information needs to be modified for example, the "probability of whether the words in the first text information need to be modified" are obtained through the activation function sigmoid layer.
  • Softmax normalized indicator function
  • a second loss function used to represent whether the first text information needs to be modified for example, the "probability of whether the words in the first text information need to be modified” are obtained through the activation function sigmoid layer.
  • a total loss function is obtained, and
  • the training samples are input into the multi-scene adaptation model
  • the training process of the multi-scene adaptation model further includes: after vectorizing multiple text objects of the first text information, obtaining multiple text objects corresponding to the multiple text objects.
  • the multiple feature vectors are encoded by a bidirectional encoder (Bert), and corresponding context information is added to the multiple feature vectors to obtain multiple feature vectors with context information.
  • the multiple feature vectors with context information are input into the forward feedback neural network (FFN) for classification processing, and then input to the Softmax layer and the activation function sigmoid layer respectively. After the Softmax layer operation, the above first loss function is output. After the sigmoid layer operation Output the above second loss function.
  • FNN forward feedback neural network
  • the adaptation model may include: an Embedding layer, a Bert layer, a first FFN layer corresponding to the Softmax layer, a second FFN layer corresponding to the sigmoid layer, a Softmax layer, and a sigmoid layer, respectively.
  • the new word sequence in the training sample (the original sentence is first subjected to word segmentation to obtain the new word list, and the identifier "CLS" is added before the new word list to form a special string , so that each word in the new word list can be identified in the training process of the adaptation model) to be vectorized by the Embedding layer to obtain a feature vector corresponding to each word, and the feature vector is passed through the Bert layer.
  • the feature vector corresponding to each word with context information is input into the fully connected layer (which can be the FFN corresponding to the sigmoid layer and the Softmax layer, respectively) for classification processing, and then passes through the sigmoid layer and Softmax respectively, to calculate the operation of the Softmax layer respectively.
  • model preparation stage and model use stage, including the following content:
  • FIG. 2 is a schematic diagram of a preparation stage before use of a syntax error correction model and an adaptation model according to an embodiment of the present application.
  • the model preparation stage it is divided into two steps, and it is necessary to train the syntax error correction model and
  • the adaptation model of each scenario, for different scenarios, can have n adaptation models, where n is an integer greater than or equal to 1, such as adaptation model 1, adaptation model 2, ..., adaptation model n.
  • the syntax error correction model can use the deep learning model of the Seq2Seq structure.
  • the training corpus uses pairs of correct and incorrect sentences. Such as “I am good.” and “I are good.”. During model training, input the wrong sentence “I are good.” into the grammar error correction model, and learn to output "I am good.”.
  • the adaptation model whose adaptation goal is to output whether each word in the original sentence in the current scene should be modified, the training corpus comes from manual annotation.
  • the corpus format is "I are good.”
  • the identification information is "010”
  • 0 means it should not be modified
  • 1 means it should be modified.
  • the adaptation model adopts the method of Bert+ sequence annotation, and performs two-class adaptation processing on whether each input word should be modified.
  • FIG. 3 is a schematic diagram of a grammar error correction model and an adaptation model in use according to an embodiment of the present application.
  • the syntax error correction model can be used. Perform error correction processing and identify erroneous word positions in entered sentences, thereby locating possible entry errors. But for some options like 1.A apple; B.banana, although grammatically wrong, it should be regarded as a correct sentence in the current situation.
  • FIG. 4 is a schematic diagram of an adaptation model according to an embodiment of the present application, including an Embedding layer, a Bert layer, a first FFN layer corresponding to a Softmax layer, a second FFN layer corresponding to a sigmoid layer, a Softmax layer, and a sigmoid layer.
  • the training data of the model it can be used for multiple question types such as single-choice, writing, reading comprehension, cloze, and chart filling.
  • a CLS string is used as an indicator string to indicate the question type.
  • the model can simultaneously predict the question type and whether the words in the sentence should be modified during training.
  • the original sentence "1.A apple" is subjected to word segmentation to obtain a word list, and a CLS special string is added before the word list to form a new word list.
  • Each word in the list is first vectorized by the Embedding layer and converted into a 512-dimensional feature vector.
  • Each feature vector passes through the Bert layer to obtain the feature vector representation of each word with context information, which is denoted as V, such as V cls , V 1 , V . , V A , V apple .
  • the feature vectors of words with contextual information are respectively input into the first FFN and the second FFN for corresponding classification processing.
  • the feature vectors of other words except the CLS vector are mapped to the feature vector of dimension 2, and then passed through the sigmoid layer and converted into the question type
  • the CLS vector is mapped to a 15-dimensional feature vector, and then after Softmax, the probability q_hat that the sentence comes from various topics is obtained.
  • the total loss function during model training is calculated using the following formula (1).
  • Loss CrossEntropyLoss(q_hat, q)+BinaryLoss(Y_hat, Y) (1)
  • Loss is the total loss function during model training;
  • CrossEntropyLoss(q_hat, q) is the first loss function, that is, the loss function used for topic type prediction;
  • BinaryLoss(Y_hat, Y) is the second loss function, i.e. the loss function for whether the word is modified.
  • FIG. 5 is a schematic structural diagram of an adaptation device for text error correction according to an embodiment of the present application. As shown in FIG. 5 , it includes an error correction module. 41, for performing error correction processing according to the first text information and the grammatical error correction model to obtain the second text information; the adaptation module 42, for performing error correction according to the first text information, the current scene information adapted to the first text information, and The adaptation model performs scene adaptation processing to obtain the adaptation processing strategy of whether the text objects in the first text information need to be modified in the current scene; the integration module 43 is used for according to the first text information, the second text information and the adaptation processing strategy; Configure the processing strategy for integrated processing, and obtain the target text information adapted to the current scene.
  • an error correction module. 41 for performing error correction processing according to the first text information and the grammatical error correction model to obtain the second text information
  • the adaptation module 42 for performing error correction according to the first text information, the current scene information adapted to the first text information, and
  • the adaptation model performs scene adaptation processing to obtain
  • the integration module includes a first processing sub-module for acquiring identification information corresponding to the first text information in the adaptation processing strategy; a second processing sub-module for obtaining identification information corresponding to the first text information in the identification information In the case of being modified, the second text information is retained, and the second text information is adapted to the target text information; the third processing submodule is used for retaining the first text information when the identification information indicates that the first text information does not need to be modified the first text information, and adapt the first text information to the target text information.
  • a similarity matching module is further included, which is used to obtain the similarity of the text objects in the first text information and the second text information in response to the edit distance operation; an alignment module is used for matching the text objects according to the similarity Alignment processing is performed on the first text information and the second text information to determine the modified text objects in the first text information.
  • a comparison module is further included, configured to compare the text object in the first text information with the text object in the second text information determined to be modified by the adaptation processing strategy of the first text information, to obtain The comparison result; the integration strategy generation module is used to obtain the integration processing strategy according to the comparison result and the adaptation processing strategy, so as to perform integration processing according to the integration processing strategy.
  • a sample acquisition module is further included, which is used to obtain training samples according to the first text information, a plurality of text objects constituting the first text information, and the classification labels corresponding to the adaptation processing strategy; the training module is used to obtain training samples according to the The training samples are used for multi-scene adaptation model training to obtain a multi-scene adaptation model after training; the model determination module is used to use the trained multi-scene adaptation model as an adaptation model.
  • the training module is configured to input the training samples into the multi-scene adaptation model, and respectively calculate a first loss function used to represent the type of the first text information, and a first loss function used to represent whether the first text information needs to be modified Two loss functions; a total loss function is obtained according to the first loss function and the second loss function; a multi-scene adaptation model is trained according to the back-propagation of the total loss function, and a trained multi-scene adaptation model is obtained.
  • the training module is further configured to vectorize multiple text objects of the first text information to obtain multiple feature vectors corresponding to multiple text objects; perform Bert encoding on multiple feature vectors to form multiple features
  • the corresponding context information is added to the vector to obtain multiple feature vectors with context information; the multiple feature vectors with context information are input into FFN for classification processing and then input to the Softmax layer and the sigmoid layer respectively; after the Softmax layer operation, the first output is output. Loss function; output the second loss function after the sigmoid layer operation.
  • the present application further provides an electronic device and a readable storage medium.
  • FIG. 6 it is a block diagram of an electronic device used to implement the adaptation method for text error correction according to the embodiment of the present application.
  • the electronic device may be the aforementioned deployment device or proxy device.
  • Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.
  • Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices.
  • the components shown herein, their connections and relationships, and their functions are by way of example only, and are not intended to limit implementations of the application described and/or claimed herein.
  • the electronic device includes: one or more processors 801, a memory 802, and interfaces for connecting various components, including a high-speed interface and a low-speed interface.
  • the various components are interconnected using different buses and may be mounted on a common motherboard or otherwise as desired.
  • the processor may process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface.
  • multiple processors and/or multiple buses may be used with multiple memories and multiple memories, if desired.
  • multiple electronic devices may be connected, each providing some of the necessary operations (eg, as a server array, a group of blade servers, or a multiprocessor system).
  • a processor 801 is taken as an example in FIG. 6 .
  • the memory 802 is the non-transitory computer-readable storage medium provided by the present application.
  • the memory stores instructions executable by at least one processor, so that the at least one processor executes the adaptation method for text error correction provided by the present application.
  • the non-transitory computer-readable storage medium of the present application stores computer instructions, and the computer instructions are used to cause the computer to execute the adaptation method for text error correction provided by the present application.
  • the memory 802 can be used to store non-transitory software programs, non-transitory computer-executable programs and modules, such as program instructions/modules corresponding to the adaptation method for text error correction in the embodiments of the present application.
  • the processor 801 executes various functional applications and data processing of the server by running the non-transitory software programs, instructions and modules stored in the memory 802, that is, implementing the adaptation method for text error correction in the above method embodiments.
  • the memory 802 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the electronic device, and the like. Additionally, memory 802 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 802 may optionally include memory located remotely from processor 801, which may be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
  • the electronic device adapted to the text error correction method may further include: an input device 803 and an output device 804.
  • the processor 801 , the memory 802 , the input device 803 and the output device 804 may be connected by a bus or in other ways, and the connection by a bus is taken as an example in FIG. 6 .
  • the input device 803 can receive input numerical or character information, and generate key signal input related to user settings and function control of the electronic device, such as a touch screen, keypad, mouse, trackpad, touchpad, pointing stick, one or more Input devices such as mouse buttons, trackballs, joysticks, etc.
  • Output devices 804 may include display devices, auxiliary lighting devices (eg, LEDs), haptic feedback devices (eg, vibration motors), and the like.
  • the display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
  • Various implementations of the systems and techniques described herein can be implemented in digital electronic circuitry, integrated circuit systems, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs executable and/or interpretable on a programmable system including at least one programmable processor that The processor, which may be a special purpose or general-purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device an output device.
  • the processor which may be a special purpose or general-purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device an output device.
  • machine-readable medium and “computer-readable medium” refer to any computer program product, apparatus, and/or apparatus for providing machine instructions and/or data to a programmable processor ( For example, magnetic disks, optical disks, memories, programmable logic devices (PLDs), including machine-readable media that receive machine instructions as machine-readable signals.
  • machine-readable signal refers to any signal used to provide machine instructions and/or data to a programmable processor.
  • the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or trackball) through which a user can provide input to the computer.
  • a display device eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor
  • a keyboard and pointing device eg, a mouse or trackball
  • Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (eg, visual feedback, auditory feedback, or tactile feedback); and can be in any form (including acoustic input, voice input, or tactile input) to receive input from the user.
  • the systems and techniques described herein may be implemented on a computing system that includes back-end components (eg, as a data server), or a computing system that includes middleware components (eg, an application server), or a computing system that includes front-end components (eg, a user's computer having a graphical user interface or web browser through which a user may interact with implementations of the systems and techniques described herein), or including such backend components, middleware components, Or any combination of front-end components in a computing system.
  • the components of the system may be interconnected by any form or medium of digital data communication (eg, a communication network). Examples of communication networks include: Local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
  • a computer system can include clients and servers.
  • Clients and servers are generally remote from each other and usually interact through a communication network.
  • the relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other.
  • error correction processing can be performed according to the first text information and the grammatical error correction model to obtain the second text information.
  • the scene adaptation process can be performed according to the first text information, the current scene information to which the first text information is adapted, and the adaptation model, to obtain whether the text object in the first text information needs to be modified in the current scene. processing strategy.
  • the integration processing may be performed according to the first text information, the second text information and the adaptation processing strategy to obtain target text information adapted to the current scene. Whether the modification of the first text information is suitable for the adaptation processing strategy of the current scene can be obtained through the adaptation model. Therefore, according to the original information (the first text information), the adaptation processing strategy is combined with the output of the grammatical error correction model.
  • the error correction processing result (second text information) is integrated and processed, and the target text information suitable for the current scene can be obtained, so as to meet the compatibility and adaptability of error correction processing in different application scenarios, and improve the error correction processing efficiency. Accuracy and error correction processing efficiency.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Machine Translation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请公开了一种文本纠错的适配方法、装置、电子设备及存储介质,其中,该方法包括:根据第一文本信息及语法纠错模型进行纠错处理,得到第二文本信息;根据第一文本信息、第一文本信息所适配的当前场景信息及适配模型进行场景适配处理,得到所述第一文本信息中的文本对象是否需要在当前场景下被修改的适配处理策略;根据所述第一文本信息、所述第二文本信息及所述适配处理策略进行整合处理,得到适配所述当前场景的目标文本信息。采用本申请,可以实现针对不同应用场景的纠错适配处理,且提高了纠错处理的准确率及纠错的处理效率。

Description

文本纠错的适配方法、装置、电子设备及存储介质
本申请要求于2020年11月06日提交中国专利局、申请号为202011226164.8、发明名称为“文本纠错的适配方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及信息处理的技术领域,尤其涉及一种文本纠错的适配方法、装置、电子设备及存储介质。
背景技术
随着便携设备、手机终端等电子设备相比以往更智能化,芯片的解析能力更强,可以对文本信息、图文信息等进行高效的解析及信息处理。
以文本信息为例,可以通过神经网络模型对文本中的拼写及语义等问题进行纠错处理,无需人工检查,既提高了纠错处理的准确率,又提高了纠错的处理效率。然而,该纠错处理不能解决针对不同应用场景情况下的兼容性及适配性,导致报错。也就是说,对于不同应用场景情况下的纠错需求,无法针对不同应用场景进行纠错适配处理,相关技术中,对如何实现纠错适配处理,未存在有效的解决方案。
发明内容
本申请提供了一种文本纠错的适配方法、装置、电子设备及存储介质。
根据本申请的一方面,提供了一种文本纠错的适配方法,包括:
根据第一文本信息及语法纠错模型进行纠错处理,得到第二文本信息;
根据第一文本信息、第一文本信息所适配的当前场景信息及适配模型进行场景适配处理,得到第一文本信息中的文本对象是否需要在当前场景下被修改的适配处理策略;
根据第一文本信息、第二文本信息及适配处理策略进行整合处理,得到适配当前场景的目标文本信息。
根据本申请的另一方面,提供了一种文本纠错的适配装置,包括:
纠错模块,用于根据第一文本信息及语法纠错模型进行纠错处理,得到第二文本信息;
适配模块,用于根据第一文本信息、第一文本信息所适配的当前场景信息及适配模型进行场景适配处理,得到第一文本信息中的文本对象是否需要在当前场景下被修改的适配处理策略;
整合模块,用于根据第一文本信息、第二文本信息及适配处理策略进行整合处理,得到适配当前场景的目标文本信息。
根据本申请的另一方面,提供了一种电子设备,包括:
至少一个处理器;以及
与该至少一个处理器通信连接的存储器;其中,
该存储器存储有可被该至少一个处理器执行的指令,该指令被该至少一个处理器执行,以使该至少一个处理器能够执行本申请任意一实施例所提供的方法。
根据本申请的另一方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,该计算机指令用于使该计算机执行本申请任意一项实施例所提供的方法。
采用本申请,可以根据第一文本信息及语法纠错模型进行纠错处理,得到第二文本信息。可以根据第一文本信息、第一文本信息所适配的当前场景信息及适配模型进行场景适配处理,得到第一文本信息中的文本对象是否需要在当前场景下被修改的适配处理策略。可以根据第一文本信息、第二文本信息及适配处理策略进行整合处理,得到适配当前场景的目标文本信息。由于通过适配模型可以得出第一文本信息的修改是否适配当前场景的适配处理策略,因此,根据原始信息(第一文本信息),该适配处理策略,并结合语法纠错模型输出的纠错处理结果(第二文本信息)进行整合处理,可以得到适配当前场景的目标文本信息,从而满足不同应用场景情况下纠错处理的兼容性及适配性,提高了纠错处理的准确率及纠错的处理效率。
应当理解,本部分所描述的内容并非旨在标识本申请的实施例的关键或重要特征,也不用于限制本申请的范围。本申请的其它特征将通过以下的说明书而变得容易理解。
附图说明
附图用于更好地理解本方案,不构成对本申请的限定。其中:
图1是根据本申请实施例的文本纠错的适配方法的流程示意图;
图2是根据本申请实施例的一语法纠错模型及适配模型在使用前的准备阶段示意图;
图3是根据本申请实施例的一语法纠错模型及适配模型使用过程中的示意图;
图4是根据本申请实施例的一适配模型的示意图;
图5是根据本申请实施例的文本纠错的适配装置的组成结构示意图;
图6是用来实现本申请实施例的文本纠错的适配方法的电子设备的框图。
具体实施方式
以下结合附图对本申请的示范性实施例做出说明,其中包括本申请实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本申请的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。本文中术语“第一”、“第二”表示指代多个类似的技术用语并对其进行区分,并不是限定顺序的意思,或者限定只有两个的意思,例如,第一特征和第二特征,是指代有两类/两个特征,第一特征可以为一个或多个,第二特征也可以为一个或多个。
另外,为了更好的说明本申请,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本申请同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本申请的主旨。
信息处理中,以针对的目标对象为文本信息为例,可以通过神经网络模型对文本信息中的拼写及语义等问题进行纠错处理,比如文本信息为英文句子的情况下,可以通过用于语法纠错的深度学习模型(简称语法纠错模型)对该英文句子进行英文语法纠错。该语法纠错模型可以为基于序列到序列(Seq2Seq)结构的深度学习模型,将基于大量正确句子和错误句子所构成训练样本中的样本对,来训练该语法纠错模型,训练结束后可以将训练后的语法纠错模型应用在英文作文批改和题目录入校对等应用场景中,实现将源序列映射到目标序列,即,输入源序列(包含语法错误的英文句子)到训练后的语法纠错模型后,输出目标序列(经语法纠错后修改为正确的英文句子)。
上述纠错处理,不能满足不同应用场景情况下的兼容性及适配性,常会由于与当前应用场景不适配而导致报错。也就是说,对于不同应用场景情况下的纠错需求,无法针对不同应用场景进行纠错适配处理,甚至可能不仅未能提高纠错处理的准确率,相反会减低纠错处理的准确率而导致报错,纠错的处理效率也大大的降低了。在A场景下英文句子中的部分内容算做语法错误,可能在B场景下就可以忽略。比如一个录入场景中某单选题的录入词“A.apple”并不算是语法错误,但是文本纠错场景中采用语法纠错模型会认为这是语法错误。也就是说,采用语法纠错模型虽然可以纠正英文句子中部分内容(如一些单词)输入的错误或语法错误,并定位出错误的位置,可对于一些应用场景,这种单一依赖于语法纠错模型是存在缺陷的。然而,重新训练一个B场景下的神经网络模型会非常耗时,而且可能会缺少训练模型的平行语料(平行语料库是两种语言之间翻译文本的结构化集合,这种平行语料是训练机器翻译算法的基础),导致无法训练。若只是基于少量的训练样本去做神经网络模型的微调,也会达不到想要的效果。
考虑到纠错的场景适配、纠错准确率及纠错处理效率等综合因素,本申请可以结合上述语法纠错模型的训练成果及训练样本,将可能包含语法错误的英文句子作为第一文本信息,将经语法纠错后获得的正确的英文句子作为第二文本信息。根据该第一文本信息,构成第一文本信息的多个文本对象,及第一文本信息是否要修改(全部或部分内容的修改)为适应当前场景的第二文本信息(第二文本信息中的全部或部分内容)的适配处理 策略所对应的分类标签,得到训练样本,根据该训练样本进行多场景适配的模型训练,得到训练后的多场景适配模型并作为与上述语法纠错模型结合使用的适配模型,对该适配模型的整个训练过程,由于结合了上述语法纠错模型的训练成果及训练样本,既不耗时,又不会缺少模型训练的平行语料,可以达到预期想要的效果(纠错+场景适配),因此,将适配模型与语法纠错模型结合使用后,可以解决上述纠错适配处理中的缺陷,可以满足不同应用场景情况下的兼容性及适配性。
根据本申请的实施例,提供了一种文本纠错的适配方法,图1是根据本申请实施例的文本纠错的适配方法的流程示意图,该方法可以应用于文本纠错的适配装置,例如,该装置可以部署于终端或服务器或其它处理设备执行的情况下,可以执行纠错处理、场景适配及文本信息整合等等。其中,终端可以为用户设备(UE,User Equipment)、移动设备、蜂窝电话、无绳电话、个人数字处理(PDA,Personal Digital Assistant)、手持设备、计算设备、车载设备、可穿戴设备等。在一些可能的实现方式中,该方法还可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。如图1所示,包括:
S101、根据第一文本信息及语法纠错模型进行纠错处理,得到第二文本信息。
一示例中,第一文本信息为原始文本,第二文本信息为纠错处理后的文本。对语法纠错模型的训练过程中,对于该语法纠错模型可以采用基于Seq2Seq结构的深度学习模型(主要由编码器,解码器及注意力机制)来实现。语法纠错模型的训练样本中,可以包括由正确句子“I am good”及错误句子“I are good”构成的样本对(pair),通过将大量正确句子和错误句子构成的样本对,来训练该语法纠错模型,训练结束后可以得到训练后的语法纠错模型。在训练后的语法纠错模型的使用过程中,将该第一文本信息(可能包括语法错误、单词拼写错误等的错误句子)输入训练后的语法纠错模型,可以输出得到该第二文本信息(纠错后的正确句子),比如,将错误的句子“I are good”输入训练后的语法纠错模型,输出正确句子“I am good”。
S102、根据第一文本信息、第一文本信息所适配的当前场景信息及适配模型进行场景适配处理,得到第一文本信息中的文本对象是否需要在当 前场景下被修改的适配处理策略。
一示例中,第一文本信息为原始文本,第二文本信息为纠错处理后的文本。对适配模型的训练过程中,训练样本可以包括:第一文本信息(可能包括语法错误、单词拼写错误等的原始句子)、构成第一文本信息的多个文本对象(如将句子拆分后得到的每个词或标号等等)及与适配处理策略(比如原句子中的每个词在当前场景下是否需要被修改的策略)对应的分类标签(适应于多种场景的纠错适配需求且疑似为语法错误、单词拼写错误等的正确句子),根据该训练样本进行多场景适配的模型训练,训练结束后可以得到训练后的多场景适配模型,即该适配模型。在训练后的多场景适配模型的使用过程中,将该第一文本信息(可能包括语法错误、单词拼写错误等的错误句子)输入训练后的多场景适配模型进行是否误纠错的场景适配处理,比如当前场景为单选、多选或不定项选择的题目录入场景,存在选项格式(如A.apple)。虽然从语法上来说是错误的,也就是说,通过使用上述训练后的语法纠错模型,可以得出包含该选项格式的句子为错误句子的结论并被纠错,但是在当前场景下应当被视为正确句子,需要解决当前场景中被误纠错的问题,结合使用该训练后的多场景适配模型,可以避免当前场景下应当被视为正确句子被误纠错,则将该第一文本信息输入训练后的多场景适配模型进行场景适配处理后,可以输出该第一文本信息中的文本对象是否需要在当前场景下被修改的适配处理策略。
S103、根据第一文本信息、第二文本信息及适配处理策略进行整合处理,得到适配当前场景的目标文本信息。
一示例中,根据第一文本信息(可能包括语法错误、单词拼写错误等的原始句子)、经训练后的语法纠错模型执行纠错处理后得到的第二文本信息(纠错后的句子)、该第一文本信息中的文本对象是否需要在当前场景下被修改的适配处理策略进行整合处理,比如当前场景为单选、多选或不定项选择的题目录入场景,对于第一文本信息中存在选项格式(如A.apple)的情况,结合该适配处理策略可以将第一文本信息视为在当前场景下的正确句子,得出包含该选项格式的第一文本信息为正确句子的结论后,得到适配当前场景的目标文本信息(如第一文本信息)。
采用本申请,可以根据第一文本信息及语法纠错模型进行纠错处理,得到第二文本信息。可以根据第一文本信息、第一文本信息所适配的当前 场景信息及适配模型进行场景适配处理,得到第一文本信息中的文本对象是否需要在当前场景下被修改的适配处理策略。可以根据第一文本信息、第二文本信息及适配处理策略进行整合处理,得到适配当前场景的目标文本信息。由于通过适配模型可以得出第一文本信息的修改是否适配当前场景的适配处理策略,因此,根据原始信息(第一文本信息),该适配处理策略,并结合语法纠错模型输出的纠错处理结果(第二文本信息)进行整合处理,可以得到适配当前场景的目标文本信息,从而满足不同应用场景情况下纠错处理的兼容性及适配性,提高了纠错处理的准确率及纠错的处理效率。
一示例中,可以输入句子A(如英文单词序列构成的英文句子A)和当前场景信息。语法纠错模型接受该句子A,输出纠错后的新句子B(如对英文单词序列构成的英文句子A进行纠错处理后得到的英文句子B)。适配模型接受该句子A和当前场景信息,通过适配模型检查该句子A中每个单词的位置是否在当前场景中需要被修改,通过适配模型输出该句子A是否在当前场景下需要被修改的适配处理策略,根据该句子A,该新句子B及该句子A是否在当前场景下需要被修改的适配处理策略进行整合处理,最终得到适配当前场景的句子。
一实施方式中,根据第一文本信息、第二文本信息及适配处理策略进行整合处理,得到适配当前场景的目标文本信息,包括:获取适配处理策略中对应于第一文本信息的标识信息。
一示例中,标识信息用于指示第一文本信息需要被修改的情况下,比如,针对第一文本信息(如英文句子)中的单词或标号等字段(token),相应的标识信息为1,则该单词或标号等需要被修改,保留第二文本信息,并将第二文本信息适配为目标文本信息。
一示例中,标识信息用于指示第一文本信息不需要被修改的情况下,比如,针对第一文本信息(如英文句子)中的单词或标号等字段(token),相应的标识信息为0,则该单词或标号等需要被修改,保留第一文本信息,并将第一文本信息适配为目标文本信息。
通过上述基于该标识信息来指示在场景适配时是否需要修改上述第一文本信息,可以准确的识别出该第一文本信息中是否存在适配当前场景下需要被修改的token(token由多个字节构成),从而提高适配的准确率及适 配速度。
一实施方式中,还包括:响应于编辑距离操作,得到第一文本信息及第二文本信息中文本对象的相似度,根据文本对象的相似度,对第一文本信息及第二文本信息执行对齐处理,确定第一文本信息中已被修改的文本对象。将第一文本信息中的文本对象,与第一文本信息经适配处理策略确定要修改的第二文本信息中的文本对象进行比对,得到比对结果,根据比对结果及适配处理策略得到整合处理策略,以根据整合处理策略进行整合处理。
一示例中,上述对齐处理是通过编辑距离算法来实现,考虑到第一文本信息在纠错前后的差别可能很大,需要用最少的修改来让纠错前后的两个句子基于相似度来比对后执行对齐处理,从而知道第一文本信息中的哪些字段位置被纠错。其中,该编辑距离算法可以是通过响应编辑距离操作来实现的,编辑距离操作是将一个字符串经过增加、删除、替换等编辑操作,变为另外一个字符串的过程,编辑距离是执行该编辑距离操作的情况下将一个字符串变为另外一个字符串所需要的最少编辑操作次数,以提高处理速度。通过编辑距离操作考虑句子中词的顺序关系、不限于词的机械置换、移动、删除、添加等,还考虑了在当前场景中每个词所表达的不同语义等信息量。
通过上述编辑距离操作得到该相似度后,根据该相似度可以对该第一文本信息及该第二文本信息执行对齐处理,从而获得该第一文本信息中需要被修改的文本对象(如记为第一文本对象),以便于通过适配模型确定经适配处理策略确定要修改的第二文本信息中的文本对象(如记为第二文本对象),以便在整合处理之前对该第一文本对象及该第二文本对象进行比对,看基于上述适配处理策略最终是否需要对第一文本信息中的该第一文本对象修改之后再予以整合处理,提高了纠错适配的准确率。
一实施方式中,还包括适配模型的训练过程,可以根据第一文本信息、构成第一文本信息的多个文本对象及与适配处理策略对应的分类标签,得到训练样本,根据训练样本进行多场景适配的模型训练,得到训练后的多场景适配模型,将训练后的多场景适配模型作为该适配模型。
一实施方式中,根据训练样本进行多场景适配的模型训练,得到训练后的多场景适配模型,包括:将训练样本输入多场景适配模型,分别计算 用于表征第一文本信息类型的第一损失函数,在一实施方式中,第一文本信息类型可以是第一文本信息对应的题目类型,比如经过归一化指示函数(Softmax)层得到“第一文本信息对应的题目类型概率”,以及用于表征第一文本信息是否需要被修改的第二损失函数,比如经过激活函数sigmoid层得到“第一文本信息中的词是否需要修改的概率”。根据第一损失函数及第二损失函数,得到总损失函数,根据总损失函数的反向传播训练多场景适配模型,得到训练后的多场景适配模型。
一实施方式中,将训练样本输入多场景适配模型,在多场景适配模型的训练过程中还包括:将第一文本信息的多个文本对象向量化后,得到对应多个文本对象的多个特征向量,将多个特征向量进行双向编码器(Bert)编码,为多个特征向量分别添加对应的上下文信息,得到带上下文信息的多个特征向量。将带上下文信息的多个特征向量,输入前向反馈神经网络(FFN)进行分类处理后分别输入Softmax层及激活函数sigmoid层,经Softmax层运算后输出上述第一损失函数,经sigmoid层运算后输出上述第二损失函数。
一示例中,适配模型可以包括:Embedding层、Bert层、分别对应Softmax层的第一FFN层及对应sigmoid层的第二FFN层、Softmax层及sigmoid层。在适配模型的训练过程中,可以先把训练样本中的新单词序列(将原始句子先经过分词处理,得到该新单词列表,在新单词列表前添加标识符“CLS”形成一特殊字符串,从而便于后续在该适配模型的训练过程中可以识别出该新单词列表)中的每个单词通过Embedding层进行向量化后得到对应每个单词的特征向量,将该特征向量通过Bert层进行编码及通过单词序列的人工标注,得到新单词列表中每一个单词token向量包含在新单词列表的位置信息,以根据该位置新计算得到上下文信息,从而得到带上下文信息的对应每个单词的特征向量。将该带上下文信息的对应每个单词的特征向量输入全连接层(可以是分别对应sigmoid层和Softmax层的FFN)中进行分类处理后再分别经过sigmoid层和Softmax,以分别计算经Softmax层运算后输出的第一损失函数,经sigmoid层运算后输出的第二损失函数,根据第一损失函数和第二损失函数得到总损失函数后通过总损失函数的反向传播,训练上述多场景适配模型,直至网络收敛,从而得到训练后的多场景适配模型,将该训练后的多场景适配模型作为该适 配模型来使用。
应用示例:
应用本申请实施例一处理流程,可以分为如下模型准备阶段及模型使用阶段,包括如下内容:
一、模型准备阶段
图2是根据本申请实施例的一语法纠错模型及适配模型在使用前的准备阶段示意图,如图2所示,在模型准备阶段,分为2步,需要分别训练语法纠错模型和每个场景的适配模型,针对不同场景,可以有n个适配模型,n为大于等于1的整数,如适配模型1,适配模型2,……,适配模型n。
语法纠错模型,可以使用Seq2Seq结构的深度学习模型。训练语料使用正确和错误句子组成的pair。如“I am good.”和“I are good.”。模型训练时,输入错误的句子“I are good.”到语法纠错模型中,并学习输出“I am good.”。
适配模型,其适配目标是输出在当前场景下原句子中的每个词是否应当被修改,训练语料来自人工标注。语料格式为“I are good.”,标识信息为“010”,0代表不应该被修改,1代表应当被修改。适配模型采用Bert+序列标注的方式,对输入的每个单词进行是否应当被修改的二分类适配处理。
二、模型使用阶段
图3是根据本申请实施例的一语法纠错模型及适配模型使用过程中的示意图,以英文题目录入场景为例,由于英文题目录入时可能会存在一些录入错误,可以通过语法纠错模型进行纠错处理并识别出录入句子中有错的单词位置,从而定位可能的录入错误。但是像对应一些选项格式(如1.A apple;B.banana)虽然从语法上来说是错误的,但在当前场景下应当被视为正确的句子。使用语法纠错模型及适配模型(如英文题目录入场景的适配模型)的过程中,可以输入句子A“1.A apple”和场景i;句子A经过语法纠错模型和适配模型,通过语法纠错模型输出纠错后句子B“A apple”,说明纠错后句子B中删除了句子A中的内容『1.』。通过编辑距离操作对齐句子A和句子B,计算句子A和句子B间的相似度并确定句子A中的哪些位置已被修改。通过适配模型输出包含标识信息的适配处理策略 (句子A中每个token位置在当前英文题目录入场景是否应当被修改),比如输出由标识信息构成的字符串『0 0 0 0』,说明句子A“1.A apple”中的四个token没有内容应当被修改,即内容『1.』在当前英文题目录入场景为误纠错。对语法纠错模型输出的纠错后句子B、通过编辑距离操作确定的句子A中的哪些位置已被修改、适配模型输出的适配处理策略(句子A中每个token位置在当前英文题目录入场景是否应当被修改)进行整合处理,输出最终作为目标文本的修改句子『1.A apple』,从而通过适配模型解决了误纠错,仍采用句子A“1.A apple”作为该目标文本。
三、适配模型的结构及训练过程
在当前英文题目录入场景中,题目类型不同会导致内容校对时需求的一些变化,使用如下适配模型,可以使得语法纠错模型对不同题目进行内容校对。图4是根据本申请实施例的一适配模型的示意图,包括Embedding层、Bert层、对应Softmax层的第一FFN层、对应sigmoid层的第二FFN层、Softmax层及sigmoid层。就模型的训练数据而言,可以分别针对单选、写作、阅读理解、完形填空、图表填空等多种题目类型,针对每种题目类型使用一个CLS字符串作为指示字符串并表示该题目类型,比如单选,可以用$SingleChoice$来作为该CLS字符串,以表示题目为单选类型。一条训练数据由(S,Y,q)组成,S为题目中的一句话,由n个单词组成;Y为标识信息“0,1”组成的长度为n的向量,代表一句话中每个单词是否需要纠错的;q代表题目类型标签,如单选题的题目S=“1.A apple”,Y=[0,0,0,0],q=$SingleChoice$,代表题目类型为单选题。
基于上述模型结构及上述训练数据进行训练的过程中,模型可以在训练时会同时预测题目类型以及句子中单词是否应当被修改。原始句子“1.A apple”先经过分词,得到单词列表,在单词列表前添加CLS特殊字符串,组成新的单词列表。列表中的每个单词先经过Embedding层进行向量化处理并转化成512维度的特征向量。每个特征向量经过Bert层,得到带上下文信息的每个单词的特征向量表示,记为V,如V cls、V 1、V .、V A、V apple。带上下文信息的单词的特征向量分别输入第一FFN及第二FFN进行对应的分类处理,除CLS向量外其他单词的特征向量映射为维度为2的特征向量,再经过sigmoid层,转化成题目类型概率单词是否需要修改的概率Y_hat。CLS向量映射为15维的特征向量,再经过Softmax,得到该句子 来自多种题目的概率q_hat。模型训练时的总损失函数采用如下公式(1)计算得到。
Loss=CrossEntropyLoss(q_hat,q)+BinaryLoss(Y_hat,Y)  (1)
公式(1)中,Loss为模型训练时的总损失函数;CrossEntropyLoss(q_hat,q)为第一损失函数,即用于题目类型预测的损失函数;BinaryLoss(Y_hat,Y)为第二损失函数,即用于单词是否被修改的损失函数。
采用如图4所示上述适配模型的结构,在判断每个单词是否应当被修改时,不仅考虑了单词所处句子的上下文信息,而且会考虑到题目类型。适配模型的训练过程中可以通过句子自动推断题目类型,因此,基于适配模型在判断单词是否需要被修改时会把题目类型当做比较重要的一个因素,并且由于这种对题目类型自动推断的能力,在使用阶段不需要输入题目类型,避免了人工操作,可以实现对一张试卷的整体题目内容自动进行校对,从而节约了工作成本,同时提高了处理效率。
根据本申请的实施例,提供了一种文本纠错的适配装置,图5是根据本申请实施例的文本纠错的适配装置的组成结构示意图,如图5所示,包括纠错模块41,用于根据第一文本信息及语法纠错模型进行纠错处理,得到第二文本信息;适配模块42,用于根据第一文本信息、第一文本信息所适配的当前场景信息及适配模型进行场景适配处理,得到第一文本信息中的文本对象是否需要在当前场景下被修改的适配处理策略;整合模块43,用于根据第一文本信息、第二文本信息及适配处理策略进行整合处理,得到适配当前场景的目标文本信息。
一实施方式中,整合模块,包括第一处理子模块,用于获取适配处理策略中对应于第一文本信息的标识信息;第二处理子模块,用于在标识信息指示第一文本信息需要被修改的情况下,保留第二文本信息,并将第二文本信息适配为目标文本信息;第三处理子模块,用于在标识信息指示第一文本信息不需要被修改的情况下,保留第一文本信息,并将第一文本信息适配为目标文本信息。
一实施方式中,还包括相似度匹配模块,用于响应于编辑距离操作,得到第一文本信息及第二文本信息中文本对象的相似度;对齐模块,用于根据文本对象的相似度,对第一文本信息及第二文本信息执行对齐处理,确定第一文本信息中已被修改的文本对象。
一实施方式中,还包括比对模块,用于将第一文本信息中的文本对象,与第一文本信息经适配处理策略确定要修改的第二文本信息中的文本对象进行比对,得到比对结果;整合策略生成模块,用于根据比对结果及适配处理策略得到整合处理策略,以根据整合处理策略进行整合处理。
一实施方式中,还包括样本获取模块,用于根据第一文本信息、构成第一文本信息的多个文本对象及与适配处理策略对应的分类标签,得到训练样本;训练模块,用于根据训练样本进行多场景适配的模型训练,得到训练后的多场景适配模型;模型确定模块,用于将训练后的多场景适配模型作为适配模型。
一实施方式中,训练模块,用于将训练样本输入多场景适配模型,分别计算用于表征第一文本信息类型的第一损失函数,以及用于表征第一文本信息是否需要被修改的第二损失函数;根据第一损失函数及第二损失函数,得到总损失函数;根据总损失函数的反向传播训练多场景适配模型,得到训练后的多场景适配模型。
一实施方式中,训练模块,还用于将第一文本信息的多个文本对象向量化后,得到对应多个文本对象的多个特征向量;将多个特征向量进行Bert编码,为多个特征向量分别添加对应的上下文信息,得到带上下文信息的多个特征向量;将带上下文信息的多个特征向量,输入FFN进行分类处理后分别输入Softmax层及sigmoid层;经Softmax层运算后输出第一损失函数;经sigmoid层运算后输出第二损失函数。
本申请实施例各装置中的各模块的功能可以参见上述方法中的对应描述,在此不再赘述。
根据本申请的实施例,本申请还提供了一种电子设备和一种可读存储介质。
如图6所示,是用来实现本申请实施例的文本纠错的适配方法的电子设备的框图。该电子设备可以为前述部署设备或代理设备。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文 中描述的和/或者要求的本申请的实现。
如图6所示,该电子设备包括:一个或多个处理器801、存储器802,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在电子设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示GUI的图形信息的指令。在其它实施方式中,若需要,可以将多个处理器和/或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个电子设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统)。图6中以一个处理器801为例。
存储器802即为本申请所提供的非瞬时计算机可读存储介质。其中,所述存储器存储有可由至少一个处理器执行的指令,以使所述至少一个处理器执行本申请所提供的文本纠错的适配方法。本申请的非瞬时计算机可读存储介质存储计算机指令,该计算机指令用于使计算机执行本申请所提供的文本纠错的适配方法。
存储器802作为一种非瞬时计算机可读存储介质,可用于存储非瞬时软件程序、非瞬时计算机可执行程序以及模块,如本申请实施例中的文本纠错的适配方法对应的程序指令/模块(例如,附图5所示的纠错模块、适配模块、整合模块等模块)。处理器801通过运行存储在存储器802中的非瞬时软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例中的文本纠错的适配方法。
存储器802可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器802可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些实施例中,存储器802可选包括相对于处理器801远程设置的存储器,这些远程存储器可以通过网络连接至电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
文本纠错的适配方法的电子设备,还可以包括:输入装置803和输出 装置804。处理器801、存储器802、输入装置803和输出装置804可以通过总线或者其他方式连接,图6中以通过总线连接为例。
输入装置803可接收输入的数字或字符信息,以及产生与电子设备的用户设置以及功能控制有关的键信号输入,例如触摸屏、小键盘、鼠标、轨迹板、触摸板、指示杆、一个或者多个鼠标按钮、轨迹球、操纵杆等输入装置。输出装置804可以包括显示设备、辅助照明装置(例如,LED)和触觉反馈装置(例如,振动电机)等。该显示设备可以包括但不限于,液晶显示器(LCD)、发光二极管(LED)显示器和等离子体显示器。在一些实施方式中,显示设备可以是触摸屏。
此处描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、专用ASIC(专用集成电路)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。
这些计算程序(也称作程序、软件、软件应用、或者代码)包括可编程处理器的机器指令,并且可以利用高级过程和/或面向对象的编程语言、和/或汇编/机器语言来实施这些计算程序。如本文使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉 反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。
采用本申请,可以根据第一文本信息及语法纠错模型进行纠错处理,得到第二文本信息。可以根据第一文本信息、第一文本信息所适配的当前场景信息及适配模型进行场景适配处理,得到所述第一文本信息中的文本对象是否需要在当前场景下被修改的适配处理策略。可以根据所述第一文本信息、所述第二文本信息及所述适配处理策略进行整合处理,得到适配所述当前场景的目标文本信息。由于通过适配模型可以得出第一文本信息的修改是否适配当前场景的适配处理策略,因此,根据原始信息(第一文本信息),该适配处理策略,并结合语法纠错模型输出的纠错处理结果(第二文本信息)进行整合处理,可以得到适配当前场景的目标文本信息,从而满足不同应用场景情况下纠错处理的兼容性及适配性,提高了纠错处理的准确率及纠错的处理效率。
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发申请中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本申请公开的技术方案所期望的结果,本文在此不进行限制。
上述具体实施方式,并不构成对本申请保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本申请的精神和原则之内所作的修改、等 同替换和改进等,均应包含在本申请保护范围之内。

Claims (16)

  1. 一种文本纠错的适配方法,其中,包括:
    根据第一文本信息及语法纠错模型进行纠错处理,得到第二文本信息;
    根据第一文本信息、第一文本信息所适配的当前场景信息及适配模型进行场景适配处理,得到所述第一文本信息中的文本对象是否需要在当前场景下被修改的适配处理策略;
    根据所述第一文本信息、所述第二文本信息及所述适配处理策略进行整合处理,得到适配所述当前场景的目标文本信息。
  2. 根据权利要求1所述的方法,其中,所述根据所述第一文本信息、所述第二文本信息及所述适配处理策略进行整合处理,得到适配所述当前场景的目标文本信息,包括:
    获取所述适配处理策略中对应于所述第一文本信息的标识信息;
    所述标识信息用于指示所述第一文本信息需要被修改的情况下,保留所述第二文本信息,并将所述第二文本信息适配为所述目标文本信息;
    所述标识信息用于指示所述第一文本信息不需要被修改的情况下,保留所述第一文本信息,并将所述第一文本信息适配为所述目标文本信息。
  3. 根据权利要求1所述的方法,其中,还包括:
    响应于编辑距离操作,得到所述第一文本信息及所述第二文本信息中文本对象的相似度;
    根据所述文本对象的相似度,对所述第一文本信息及所述第二文本信息执行对齐处理,确定所述第一文本信息中已被修改的文本对象。
  4. 根据权利要求3所述的方法,其中,还包括:
    将所述第一文本信息中的文本对象,与所述第一文本信息经所述适配处理策略确定要修改的所述第二文本信息中的文本对象进行比对,得到比对结果;
    根据所述比对结果及所述适配处理策略得到整合处理策略,以根据所述整合处理策略进行所述整合处理。
  5. 根据权利要求1-4中任一项所述的方法,其中,还包括:
    根据所述第一文本信息、构成所述第一文本信息的多个文本对象及与所述适配处理策略对应的分类标签,得到训练样本;
    根据所述训练样本进行多场景适配的模型训练,得到训练后的多场景 适配模型;
    将所述训练后的多场景适配模型作为所述适配模型。
  6. 根据权利要求5所述的方法,其中,所述根据所述训练样本进行多场景适配的模型训练,得到训练后的多场景适配模型,包括:
    将所述训练样本输入所述多场景适配模型,分别计算用于表征第一文本信息类型的第一损失函数,以及用于表征第一文本信息是否需要被修改的第二损失函数;
    根据所述第一损失函数及所述第二损失函数,得到总损失函数;
    根据所述总损失函数的反向传播训练所述多场景适配模型,得到所述训练后的多场景适配模型。
  7. 根据权利要求6所述的方法,其中,所述将所述训练样本输入所述多场景适配模型,在所述多场景适配模型的训练过程中还包括:
    将所述第一文本信息的多个文本对象向量化后,得到对应多个文本对象的多个特征向量;
    将所述多个特征向量进行双向编码器Bert编码,为所述多个特征向量分别添加对应的上下文信息,得到带上下文信息的多个特征向量;
    将所述带上下文信息的多个特征向量,输入前向反馈神经网络FFN进行分类处理后分别输入归一化指示函数Softmax层及激活函数sigmoid层;
    经所述Softmax层运算后输出所述第一损失函数;
    经所述sigmoid层运算后输出所述第二损失函数。
  8. 一种文本纠错的适配装置,其中,所述装置包括:
    纠错模块,用于根据第一文本信息及语法纠错模型进行纠错处理,得到第二文本信息;
    适配模块,用于根据第一文本信息、第一文本信息所适配的当前场景信息及适配模型进行场景适配处理,得到所述第一文本信息中的文本对象是否需要在当前场景下被修改的适配处理策略;
    整合模块,用于根据所述第一文本信息、所述第二文本信息及所述适配处理策略进行整合处理,得到适配所述当前场景的目标文本信息。
  9. 根据权利要求8所述的装置,其中,所述整合模块,包括:
    第一处理子模块,用于获取所述适配处理策略中对应于所述第一文本信息的标识信息;
    第二处理子模块,用于所述标识信息用于指示所述第一文本信息需要被修改的情况下,保留所述第二文本信息,并将所述第二文本信息适配为所述目标文本信息;
    第三处理子模块,用于所述标识信息用于指示所述第一文本信息不需要被修改的情况下,保留所述第一文本信息,并将所述第一文本信息适配为所述目标文本信息。
  10. 根据权利要求8所述的装置,其中,还包括:
    相似度匹配模块,用于响应于编辑距离操作,得到所述第一文本信息及所述第二文本信息中文本对象的相似度;
    对齐模块,用于根据所述文本对象的相似度,对所述第一文本信息及所述第二文本信息执行对齐处理,确定所述第一文本信息中已被修改的文本对象。
  11. 根据权利要求10所述的装置,其中,还包括:
    比对模块,用于将所述第一文本信息中的文本对象,与所述第一文本信息经所述适配处理策略确定要修改的所述第二文本信息中的文本对象进行比对,得到比对结果;
    整合策略生成模块,用于根据所述比对结果及所述适配处理策略得到整合处理策略,以根据所述整合处理策略进行所述整合处理。
  12. 根据权利要求8-11中任一项所述的装置,其中,还包括:
    样本获取模块,用于根据所述第一文本信息、构成所述第一文本信息的多个文本对象及与所述适配处理策略对应的分类标签,得到训练样本;
    训练模块,用于根据所述训练样本进行多场景适配的模型训练,得到训练后的多场景适配模型;
    模型确定模块,用于将所述训练后的多场景适配模型作为所述适配模型。
  13. 根据权利要求12所述的装置,其中,所述训练模块,用于:
    将所述训练样本输入所述多场景适配模型,分别计算用于表征第一文本信息类型的第一损失函数,以及用于表征第一文本信息是否需要被修改的第二损失函数;
    根据所述第一损失函数及所述第二损失函数,得到总损失函数;
    根据所述总损失函数的反向传播训练所述多场景适配模型,得到所述 训练后的多场景适配模型。
  14. 根据权利要求13所述的装置,其中,所述训练模块,还用于:
    将所述第一文本信息的多个文本对象向量化后,得到对应多个文本对象的多个特征向量;
    将所述多个特征向量进行双向编码器Bert编码,为所述多个特征向量分别添加对应的上下文信息,得到带上下文信息的多个特征向量;
    将所述带上下文信息的多个特征向量,输入前向反馈神经网络FFN进行分类处理后分别输入归一化指示函数Softmax层及激活函数sigmoid层;
    经所述Softmax层运算后输出所述第一损失函数;
    经所述sigmoid层运算后输出所述第二损失函数。
  15. 一种电子设备,包括:
    至少一个处理器;以及
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-7中任一项所述的方法。
  16. 一种存储有计算机指令的非瞬时计算机可读存储介质,所述计算机指令用于使计算机执行权利要求1-7中任一项所述的方法。
PCT/CN2021/114605 2020-11-06 2021-08-25 文本纠错的适配方法、装置、电子设备及存储介质 WO2022095563A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011226164.8 2020-11-06
CN202011226164.8A CN112036162B (zh) 2020-11-06 2020-11-06 文本纠错的适配方法、装置、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2022095563A1 true WO2022095563A1 (zh) 2022-05-12

Family

ID=73573603

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/114605 WO2022095563A1 (zh) 2020-11-06 2021-08-25 文本纠错的适配方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN112036162B (zh)
WO (1) WO2022095563A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115310434A (zh) * 2022-10-11 2022-11-08 深圳擎盾信息科技有限公司 合同文书语法的纠错方法、装置、计算机设备及存储介质
CN116306599A (zh) * 2023-05-23 2023-06-23 上海蜜度信息技术有限公司 基于生成文本的忠实度优化方法、系统、设备及存储介质
CN117151084A (zh) * 2023-10-31 2023-12-01 山东齐鲁壹点传媒有限公司 一种中文拼写、语法纠错方法、存储介质及设备

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112036162B (zh) * 2020-11-06 2021-02-12 北京世纪好未来教育科技有限公司 文本纠错的适配方法、装置、电子设备及存储介质
CN112597754B (zh) * 2020-12-23 2023-11-21 北京百度网讯科技有限公司 文本纠错方法、装置、电子设备和可读存储介质
CN112861518B (zh) * 2020-12-29 2023-12-01 科大讯飞股份有限公司 文本纠错方法、装置和存储介质及电子装置
CN113676394B (zh) * 2021-08-19 2023-04-07 维沃移动通信(杭州)有限公司 信息处理方法和信息处理装置
CN116932764B (zh) * 2023-09-14 2023-11-24 中移(苏州)软件技术有限公司 文本管理方法、装置、电子设备、芯片及存储介质
CN117787266A (zh) * 2023-12-26 2024-03-29 人民网股份有限公司 基于预训练知识嵌入的大语言模型文本纠错方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110232129A (zh) * 2019-06-11 2019-09-13 北京百度网讯科技有限公司 场景纠错方法、装置、设备和存储介质
CN110969012A (zh) * 2019-11-29 2020-04-07 北京字节跳动网络技术有限公司 文本纠错方法、装置、存储介质及电子设备
CN111523305A (zh) * 2019-01-17 2020-08-11 阿里巴巴集团控股有限公司 文本的纠错方法、装置和系统
CN111696545A (zh) * 2019-03-15 2020-09-22 北京京东尚科信息技术有限公司 语音识别纠错方法、装置以及存储介质
CN112036162A (zh) * 2020-11-06 2020-12-04 北京世纪好未来教育科技有限公司 文本纠错的适配方法、装置、电子设备及存储介质

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090055731A1 (en) * 2007-08-24 2009-02-26 Joyce Etta Knowles Homonym words dictionary

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111523305A (zh) * 2019-01-17 2020-08-11 阿里巴巴集团控股有限公司 文本的纠错方法、装置和系统
CN111696545A (zh) * 2019-03-15 2020-09-22 北京京东尚科信息技术有限公司 语音识别纠错方法、装置以及存储介质
CN110232129A (zh) * 2019-06-11 2019-09-13 北京百度网讯科技有限公司 场景纠错方法、装置、设备和存储介质
CN110969012A (zh) * 2019-11-29 2020-04-07 北京字节跳动网络技术有限公司 文本纠错方法、装置、存储介质及电子设备
CN112036162A (zh) * 2020-11-06 2020-12-04 北京世纪好未来教育科技有限公司 文本纠错的适配方法、装置、电子设备及存储介质

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115310434A (zh) * 2022-10-11 2022-11-08 深圳擎盾信息科技有限公司 合同文书语法的纠错方法、装置、计算机设备及存储介质
CN115310434B (zh) * 2022-10-11 2023-01-06 深圳擎盾信息科技有限公司 合同文书语法的纠错方法、装置、计算机设备及存储介质
CN116306599A (zh) * 2023-05-23 2023-06-23 上海蜜度信息技术有限公司 基于生成文本的忠实度优化方法、系统、设备及存储介质
CN116306599B (zh) * 2023-05-23 2023-09-08 上海蜜度信息技术有限公司 基于生成文本的忠实度优化方法、系统、设备及存储介质
CN117151084A (zh) * 2023-10-31 2023-12-01 山东齐鲁壹点传媒有限公司 一种中文拼写、语法纠错方法、存储介质及设备
CN117151084B (zh) * 2023-10-31 2024-02-23 山东齐鲁壹点传媒有限公司 一种中文拼写、语法纠错方法、存储介质及设备

Also Published As

Publication number Publication date
CN112036162B (zh) 2021-02-12
CN112036162A (zh) 2020-12-04

Similar Documents

Publication Publication Date Title
WO2022095563A1 (zh) 文本纠错的适配方法、装置、电子设备及存储介质
KR102448129B1 (ko) 엔티티 연결 방법, 장치, 기기 및 저장 매체
KR102504699B1 (ko) 엔티티 링킹 방법, 장치, 기기, 저장 매체 및 컴퓨터 프로그램
CN112560912B (zh) 分类模型的训练方法、装置、电子设备和存储介质
EP3852001A1 (en) Method and apparatus for generating temporal knowledge graph, device, and medium
US10629193B2 (en) Advancing word-based speech recognition processing
WO2022100045A1 (zh) 分类模型的训练方法、样本分类方法、装置和设备
US20210390260A1 (en) Method, apparatus, device and storage medium for matching semantics
US20210248484A1 (en) Method and apparatus for generating semantic representation model, and storage medium
CN111859995B (zh) 机器翻译模型的训练方法、装置、电子设备及存储介质
US20210312230A1 (en) Information Extraction Method, Extraction Model Training Method, Apparatus and Electronic Device
US11907671B2 (en) Role labeling method, electronic device and storage medium
CN112507101B (zh) 一种建立预训练语言模型的方法和装置
CN111310441A (zh) 基于bert的语音识别后文本修正方法、装置、终端及介质
CN111783443A (zh) 文本扰动检测方法、扰动还原方法、扰动处理方法和装置
EP3251114B1 (en) Transcription correction using multi-token structures
US20220358955A1 (en) Method for detecting voice, method for training, and electronic devices
CN111753532B (zh) 西文文本的纠错方法和装置、电子设备及存储介质
JP7286737B2 (ja) テキスト誤り訂正方法、装置、電子デバイス、記憶媒体及びプログラム
US11562150B2 (en) Language generation method and apparatus, electronic device and storage medium
KR20210125449A (ko) 업계 텍스트를 증분하는 방법, 관련 장치 및 매체에 저장된 컴퓨터 프로그램
CN111310481B (zh) 语音翻译方法、装置、计算机设备和存储介质
CN113591908B (zh) 事件指称匹配方法、模型训练方法、装置和电子设备
CN111753542A (zh) 文本语句的处理方法和装置、电子设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21888262

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 11.08.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21888262

Country of ref document: EP

Kind code of ref document: A1