Text error correction method, text error correction device, electronic device and medium
Through multi-dimensional feature extraction and pre-trained text error detection and correction models, the problem of low accuracy in interactive text correction in financial institutions is solved, and more efficient text correction and customer intent recognition are achieved.
Patent Information
- Application Number
- CN202411328798.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2044-09-23
AI Technical Summary
In the existing technology, the error correction accuracy of interactive texts between financial institutions and customers is low, which affects the recognition of customer intentions.
A multi-dimensional feature extraction method is adopted, including pronunciation, glyph and semantic feature extraction, combined with a pre-trained text error detection and correction model, to correct text errors through the pronunciation feature extraction sub-model, glyph feature extraction sub-model and semantic feature extraction sub-model.
It improves the accuracy of text error correction, reduces the rate of false correction, and ensures the accuracy of customer intent recognition.
Smart Images

Figure CN119294385B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of financial technology, and in particular to a text error correction method and text error correction device, electronic equipment and medium. Background Art
[0002] Financial institutions such as banks and insurance companies usually need to conduct a large amount of natural language interaction with customers, and a large amount of interactive text is generated. These interactive texts can be texts generated by translating conversational speech through automatic speech recognition (ASR) technology, or they can be texts entered by customers through the keyboard. Due to the influence of some subjective and objective factors, the generated text cannot be guaranteed to be completely correct, that is, the generated text may contain some text errors. However, text errors have an impact on accurately understanding the customer's intentions, so text error correction is particularly important. The text error correction method adopted by related technologies usually considers the semantic information of the text to achieve text error correction, but the error correction accuracy of this method is low. Therefore, how to improve the accuracy of text error correction and avoid the impact of erroneous text on customer intention recognition has become a technical problem that needs to be solved urgently. Summary of the Invention
[0003] The main purpose of the embodiments of the present application is to propose a text correction method and a text correction device, an electronic device and a medium, aiming to improve the accuracy of text correction and avoid the impact of erroneous text on customer intent recognition.
[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application provides a text error correction method, the method comprising: obtaining a target text, the target text comprising text characters;
[0005] Inputting the target text into a pre-trained text error detection model to perform text error detection to obtain text marking data, wherein the text marking data is used to mark correct characters or incorrect characters in the text characters;
[0006] Inputting the target text into a pre-trained text error correction model based on the text markup data, the text error correction model comprising a phonetic feature extraction sub-model, a glyph feature extraction sub-model, a semantic feature extraction sub-model and an error correction sub-model;
[0007] Performing phonetic feature extraction on the target text based on the phonetic feature extraction sub-model to obtain text phonetic features of the text characters;
[0008] Performing glyph feature extraction on the target text based on the glyph feature extraction sub-model to obtain text glyph features, wherein the text glyph features include a first mask feature, and the first mask feature is a glyph feature of the erroneous character;
[0009] Performing semantic feature extraction on the target text based on the semantic feature extraction sub-model to obtain text semantic features, wherein the text glyph features include a second mask feature, and the second mask feature is a semantic feature of the erroneous character;
[0010] Based on the error correction sub-model, text prediction is performed on the text phonetic features, the text glyph features and the text semantic features to obtain a target error correction text.
[0011] In some embodiments, the text markup data includes a character error mark, where the character error mark is used to indicate the erroneous character; and inputting the target text into a pre-trained text error correction model based on the text markup data includes:
[0012] Performing character replacement on the target text based on the character error mark to obtain replacement text; the replacement text is used to represent the text after the text characters corresponding to the character error mark in the target text are replaced with a preset mask;
[0013] The target text is updated according to the replacement text, and the updated target text is input into the text error correction model.
[0014] In some embodiments, the glyph feature extraction sub-model includes a character vectorization layer, a first convolutional layer, a first pooling layer, and a first fully connected layer. The glyph feature extraction of the target text based on the glyph feature extraction sub-model to obtain text glyph features includes:
[0015] Performing character vectorization on the correct characters in the target text based on the character vectorization layer to obtain character image features;
[0016] Performing character vectorization on the preset mask based on the character vectorization layer to obtain the first mask feature;
[0017] Performing convolution processing on the character image features based on the first convolution layer to obtain character convolution features;
[0018] Performing pooling processing on the character convolutional features based on the first pooling layer to obtain character pooling features;
[0019] Performing feature fusion on the character pooling features based on the first fully connected layer to obtain character glyph features;
[0020] The character glyph feature and the first mask feature are subjected to feature fusion based on a preset feature size to obtain the text glyph feature.
[0021] In some embodiments, performing character vectorization on the correct characters in the target text based on the character vectorization layer to obtain character image features includes:
[0022] Performing text style extraction on the target text to obtain text style data;
[0023] determining a first preset font and a second preset font based on the text style data;
[0024] performing character vectorization on the correct characters in the target text based on the first preset font to obtain a first character image sub-feature;
[0025] performing character vectorization on the correct characters in the target text based on the second preset font to obtain second character image sub-features;
[0026] The first character image sub-feature and the second character image sub-feature are subjected to feature fusion to obtain the character image feature.
[0027] In some embodiments, the semantic feature extraction sub-model includes an embedding layer and an encoding layer, and extracting semantic features from the target text based on the semantic feature extraction sub-model to obtain text semantic features includes:
[0028] Performing semantic vectorization on the correct characters in the target text based on the embedding layer to obtain character semantic features;
[0029] Performing semantic vectorization on the preset mask in the target text based on the embedding layer to obtain a second mask feature;
[0030] Feature encoding is performed on the character semantic feature and the second mask feature based on the encoding layer to obtain the text semantic feature.
[0031] In some embodiments, the phonetic feature extraction submodel includes a pinyin conversion layer, a second convolutional layer, a second pooling layer, and a second fully connected layer. The phonetic feature extraction submodel is used to extract the phonetic features of the target text to obtain the text phonetic features, including:
[0032] Performing pinyin conversion on the target text based on the pinyin conversion layer to obtain text pinyin, wherein the text pinyin includes a character pinyin sequence and a character tone mark;
[0033] Performing convolution processing on the character pinyin sequence and the character tone mark based on the second convolution layer to obtain a character-phonetic convolution feature;
[0034] Performing pooling processing on the pronunciation convolution feature based on the second pooling layer to obtain a pronunciation pooled feature;
[0035] The pronunciation pooling features are subjected to feature fusion based on the second fully connected layer to obtain the text pronunciation features.
[0036] In some embodiments, the error correction sub-model includes a feature fusion layer and a prediction layer, and performing text prediction on the text phonetic features, the text glyph features, and the text semantic features based on the error correction sub-model to obtain a target error correction text includes:
[0037] Based on the feature fusion layer, the text phonetic features, the text glyph features and the text semantic features are fused to obtain target text features;
[0038] The target text features are predicted based on the prediction layer to obtain the target error-corrected text.
[0039] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a text error correction device, the device comprising:
[0040] An acquisition module, configured to acquire a target text, wherein the target text includes text characters;
[0041] An error detection module is used to input the target text into a pre-trained text error detection model to perform text error detection and obtain text marking data, wherein the text marking data is used to mark correct characters and incorrect characters in the text characters;
[0042] An input module, configured to input the target text into a pre-trained text error correction model based on the text markup data, wherein the text error correction model includes a phonetic feature extraction sub-model, a glyph feature extraction sub-model, a semantic feature extraction sub-model, and an error correction sub-model;
[0043] A pronunciation extraction module, configured to extract pronunciation features of the target text based on the pronunciation feature extraction sub-model to obtain text pronunciation features of the text characters;
[0044] a glyph extraction module, configured to extract glyph features of the target text based on the glyph feature extraction sub-model to obtain text glyph features, wherein the text glyph features include a first mask feature, and the first mask feature is a glyph feature of the erroneous character;
[0045] A semantic extraction module, configured to extract semantic features of the target text based on the semantic feature extraction sub-model to obtain text semantic features, wherein the text glyph features include a second mask feature, and the second mask feature is a semantic feature of the erroneous character;
[0046] The prediction module is used to perform text prediction on the text phonetic features, the text glyph features and the text semantic features based on the error correction sub-model to obtain a target error correction text.
[0047] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the text correction method described in the first aspect above.
[0048] To achieve the above-mentioned purpose, the fourth aspect of the embodiments of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the text error correction method described in the first aspect above.
[0049] The present application proposes a text error correction method and a text error correction device, an electronic device and a medium, which obtain a target text, wherein the target text includes text characters; inputs the target text into a pre-trained text error detection model for text error detection to obtain text tag data, wherein the text tag data is used to mark correct characters and incorrect characters in the text characters; further, based on the text tag data, the target text is input into a pre-trained text error correction model, wherein the text error correction model includes a phonetic feature extraction sub-model, a glyph feature extraction sub-model, a semantic feature extraction sub-model and an error correction sub-model; based on the phonetic feature extraction sub-model, the target text is corrected and the glyph feature extraction sub-model is extracted; The text is subjected to phonetic feature extraction to obtain text phonetic features of text characters; based on the glyph feature extraction sub-model, the target text is subjected to glyph feature extraction to obtain text glyph features, the text glyph features include a first mask feature, and the first mask feature is the glyph feature of the wrong character; based on the semantic feature extraction sub-model, the target text is subjected to semantic feature extraction to obtain text semantic features, the text glyph features include a second mask feature, and the second mask feature is the semantic feature of the wrong character; based on the error correction sub-model, the text phonetic features, text glyph features and text semantic features are subjected to text prediction to obtain the target error-corrected text. In the embodiment of the present application, the target text can first be subjected to text error detection in the text error detection model to mark the correct characters and the wrong characters in the text characters, and then the target text can be input into the pre-trained text error correction model for text error correction based on the text marking data, so that the wrong characters can be corrected more accurately and the situation of being wrongly corrected can be reduced. Therefore, the present application can effectively improve the accuracy of text error correction and avoid the influence of wrong text on customer intention recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is a flow chart of the text error correction method provided by the embodiment of the present application;
[0051] Figure 2This is a schematic diagram of a model structure for implementing text error correction provided by an embodiment of the present application;
[0052] Figure 3 yes Figure 1 A flowchart of step S130 in FIG.
[0053] Figure 4 yes Figure 1 A flowchart of step S140 in FIG.
[0054] Figure 5 yes Figure 1 A flowchart of step S150 in FIG.
[0055] Figure 6 yes Figure 5 A flowchart of step S510 in FIG.
[0056] Figure 7 yes Figure 1 A flowchart of step S160 in FIG.
[0057] Figure 8 yes Figure 1 A flowchart of step S170 in FIG.
[0058] Figure 9 This is a structural diagram of a text error correction device provided by an embodiment of the present application;
[0059] Figure 10 This is a hardware structure diagram of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0061] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.
[0062] 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.
[0063] First, let’s analyze some of the terms used in this application:
[0064] Artificial intelligence (AI) is a new technical discipline that studies and develops theories, methods, technologies, and application systems for simulating, extending, and expanding human intelligence. A branch of computer science, AI seeks to understand the essence of intelligence and create new intelligent machines that can respond in a manner similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. AI can simulate the information processes of human consciousness and thinking. It also encompasses the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.
[0065] Normalized exponential (Softmax function): compresses a K-dimensional vector containing arbitrary real numbers into another K-dimensional vector so that each element ranges between (0,1) and the sum of all elements is 1.
[0066] Token: A token or mark. In computer science and cybersecurity, a "token" usually refers to a token used for authentication or authorization.
[0067] Financial institutions such as banks and insurance companies usually need to conduct a large amount of natural language interaction with customers, and a large amount of interactive text is generated. These interactive texts can be texts generated by translating conversational speech through Automatic Speech Recognition (ASR) technology, or they can be texts entered by customers through the keyboard. Due to the influence of some subjective and objective factors, the generated text cannot be guaranteed to be completely correct, that is, the generated text may contain some text errors. However, text errors have an impact on accurately understanding the customer's intentions, so text error correction is particularly important. The text error correction method adopted by related technologies usually considers the semantic information of the text to achieve text error correction, but the error correction accuracy of this method is low. Therefore, how to improve the accuracy of text error correction and avoid the impact of erroneous text on customer intention recognition has become a technical problem that needs to be solved urgently.
[0068] Based on this, the embodiments of the present application provide a text correction method and a text correction device, an electronic device and a medium, which can improve the accuracy of selecting maintenance objects based on claim orders, thereby selecting the object that is most suitable for performing maintenance operations on claim orders.
[0069] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.
[0070] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0071] The text error correction method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The text error correction method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, or can be configured as 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 software can be an application that implements the text error correction method, etc., but is not limited to the above forms.
[0072] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
[0073] It should be noted that in each specific embodiment of the present application, when it comes to the need to perform relevant processing based on data related to the identity or characteristics of the object, such as interactive texts communicated with customers, customer attribute information, and customer identity information, the permission or consent of the object will be obtained first, and the collection, use, and processing of such data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the sensitive personal information of the object, the separate permission or consent of the object will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the separate permission or consent of the object, the necessary object-related data for the normal operation of the embodiment of the present application will be obtained.
[0074] See also Figure 1 , Figure 1 This is an optional flow chart of the text error correction method provided by the embodiment of the present application. In some embodiments, Figure 1 The method may include but is not limited to steps S110 to S170:
[0075] Step S110, obtaining the target text;
[0076] Step S120, inputting the target text into a pre-trained text error detection model to perform text error detection and obtain text label data;
[0077] Step S130, inputting the target text into a pre-trained text error correction model based on the text tag data;
[0078] Step S140, extracting phonetic features of the target text based on the phonetic feature extraction sub-model to obtain text phonetic features of the text characters;
[0079] Step S150, extracting font features of the target text based on the font feature extraction sub-model to obtain font features of the text;
[0080] Step S160, extracting semantic features of the target text based on the semantic feature extraction sub-model to obtain text semantic features;
[0081] Step S1170 , performing text prediction on the text phonetic features, text glyph features, and text semantic features based on the error correction sub-model to obtain a target error correction text.
[0082] In steps S110 to S170 of some embodiments, compared with the related art which only considers the semantic information of the text to implement text error correction while ignoring the pinyin features and glyph features of Chinese texts, or even if considered, the accuracy of text error correction is not sufficient. However, in the embodiments of the present application, text error detection can be first performed on the target text in the text error detection model to mark the correct characters and incorrect characters in the text characters, and then the target text can be input into the pre-trained text error correction model for text error correction based on the text marking data, so that incorrect characters can be corrected more accurately and the situation of incorrect correction can be reduced. Therefore, the present application can effectively improve the accuracy of text error correction and avoid the influence of incorrect texts on the recognition of customer intentions.
[0083] In step S110 of some embodiments, the target text refers to the text that needs to be corrected. The target text can be the text generated by translating the dialogue voice through ASR technology, or the text input by the customer through the keyboard, or the text that needs to be corrected input by the operating object, without limitation. The target text includes text characters. For example, if the target text is "Today's weather is good", the corresponding text characters include "今", "天", "天", "气", "诊", "好".
[0084] In step S120 of some embodiments, after obtaining the target text, the target text can be first input into the pre-trained text error detection model for text error detection to obtain text marking data. The text error detection model is used to detect the characters that may be incorrect in the target text and perform corresponding processing on the characters that may be incorrect to reduce the interference of incorrect characters on text prediction in the subsequent prediction process and improve the accuracy of error correction. Among them, the text error detection model of the present application can be a model constructed based on the BERT model structure, without limitation.
[0085] It should be noted that the text marking data output by the text error detection model is used to mark the correct characters or incorrect characters in the text characters, and the marking data includes character error marks and character correct marks. The character error mark is used to indicate the incorrect characters in the target text, and the character correct mark is used to indicate the correct characters in the target text. Among them, the text marking data can be a marking string including the character marks corresponding to each text character. For example, if the target text is "Today's weather is good", the target text is input into the text error detection model, and the output text marking data is "0 0 0 0 1 0", where "0" represents the character correct mark, "1" represents the character error mark, and 0 and 1 can respectively correspond to a text character. In this way, it can be determined that the correct characters in the target text include "今", "天", "天", "气", "好", and the incorrect character includes "诊".
[0086] It should be noted that the text error detection model includes a text encoding layer, a normalization layer, and an output layer. The target text is input into the pre-trained text error detection model for text error detection to obtain text labeling data. Specifically, it can include: character encoding processing of the target text based on the text encoding layer to obtain character encoding features; normalization processing of the character encoding features based on the normalization layer to obtain character prediction probabilities; and label mapping of the character prediction probabilities based on the output layer to obtain text labeling data. Among them, the text encoding layer can be a layer constructed based on the BERT model structure, and the text content is encoded by BERT to obtain the token corresponding to each text character, and the normalization layer and the output layer can predict the token corresponding to the input text character to obtain the probability of each token being wrong. The place with high probability is the possible wrong token, and the place with low probability is the correct token. In this way, the character label corresponding to each text character can be determined according to the set probability threshold.
[0087] In step S130 of some embodiments, the text error correction model refers to a model used to correct incorrect characters in the target text and output the corrected text. Based on this, after determining the target text and the text markup data corresponding to the target text, the target text can be input into the pre-trained text error correction model based on the text markup data.
[0088] In some embodiments, see Figure 2 , Figure 2It is a schematic diagram of a model structure for implementing text error correction provided by an embodiment of the present application. The model for implementing the text error correction method of the present application includes a text error detection model 210 and a text error correction model 220. The text error correction model 220 includes a pronunciation feature extraction sub-model 221, a glyph feature extraction sub-model 222, a semantic feature extraction sub-model 223, and an error correction sub-model 224. Among them, the pronunciation feature extraction sub-model 221 refers to a model for extracting pronunciation features in the target text. By extracting the pronunciation of text characters, the present application can take into account words with similar pronunciations but different meanings. For example, "qing lang" in "the weather is qing lang" should be "qing lang", and the pronunciation feature extraction sub-model 221 usually relies on features such as phoneme information and pinyin similarity to identify possible incorrect characters. The glyph feature extraction sub-model 222 refers to a model for extracting glyph features in the target text. By extracting the glyphs of text characters, the present application can focus more on identifying and correcting errors with similar glyphs, such as "gao liang" should be "gao liang". The semantic feature extraction sub-model 223 refers to a model for extracting deep semantic features in the target text. The semantic feature extraction sub-model 223 can use word embeddings, context information, etc. to understand the meaning of the text, extract deep semantic information from the text, so as to more accurately judge and correct errors. The error correction sub-model 224 is the core of the entire text error correction model 220, which can integrate the features of the previous layers and determine and correct the errors in the text through specific algorithms. This process may involve steps such as candidate word generation, probability scoring, and final selection. Based on this, the present application greatly improves the accuracy of error correction by integrating the text error detection model 210 and the text error correction model 220, and considering the character-related features from multiple dimensions in the text error correction model 220, that is, pronunciation features, glyph features, and semantic features, by making full use of the advantages of various features. <> <>
[0089] In some embodiments, please refer to <> Figure 3 , <> Figure 3 is an optional flowchart of step S130 provided by an embodiment of the present application. Among them, this step S130 may specifically include steps S310 to S320: <> <>
[0090] Step S310, perform character replacement on the target text based on the character error mark to obtain a replacement text; <> <>
[0091] Step S320, update the target text according to the replacement text, and input the updated target text into the text error correction model. <> <>
[0092] In steps S310 to S320 of some embodiments, after obtaining the character error markers corresponding to the target text, the error characters marked with the character error markers in the target text can be character-replaced to obtain a replacement text, and the replacement text is used to represent the text obtained by replacing the text characters corresponding to the character error markers in the target text with a preset mask. Further, the replacement text can be input into the text error correction model as a new target text, that is, the text with the error detection error identifier (i.e., the preset mask corresponding to the character error marker) is used to obtain the accurate text after error correction. For example, if the target text is "Today's weather is good", after inputting the target text into the text error detection model, it can be determined that the correct characters in the target text include "今", "天", "天", "气", "好", and the error character includes "诊". If the preset mask is [mask], the text characters corresponding to the character error markers can be replaced with the preset mask. At this time, the replacement text is "Today's weather [mask] good".
[0093] In step S140 of some embodiments, when the updated target text is input into the text error correction model, the text phonetic features of the text characters can be extracted based on the phonetic feature extraction submodel for the target text. The text phonetic features at this time include the phonetic features of all text characters. The phonetic feature extraction submodel includes a pinyin conversion layer, a second convolutional layer, a second pooling layer, and a second fully connected layer.
[0094] In some embodiments, please refer to Figure 4 , Figure 4 is an optional flowchart of step S140 provided by an embodiment of the present application. Specifically, the step S140 may include steps S410 to S440:
[0095] Step S410, perform pinyin conversion on the target text based on the pinyin conversion layer to obtain text pinyin;
[0096] Step S420, perform convolutional processing on the character pinyin sequence and the character tone markers based on the second convolutional layer to obtain phonetic convolutional features;
[0097] Step S430, perform pooling processing on the phonetic convolutional features based on the second pooling layer to obtain phonetic pooling features;
[0098] Step S440, perform feature fusion on the phonetic pooling features based on the second fully connected layer to obtain text phonetic features.
[0099] In step S410 of some embodiments, the pinyin conversion layer is used to convert each text character into pinyin. The text pinyin after pinyin conversion includes a character pinyin sequence and a character tone mark. The character pinyin sequence represents the pinyin corresponding to the text character and can be composed of Roman characters; the character tone mark represents the tone corresponding to the text character. There are four types of tones. Special marks can be used to represent each tone, and the tone can occupy 4 tokens, which are arranged behind the character pinyin sequence. In addition, special marks can be set according to actual needs without limitation.
[0100] In step S420 of some embodiments, after obtaining the character phonetic sequence and character tone mark corresponding to each text character, the character phonetic sequence and character tone mark can be convolved based on the second convolutional layer to obtain the character phonetic convolution feature of the target text. The second convolutional layer can be based on a structure built by convolutional neural networks (CNN), which is responsible for extracting features from the input data. The second convolutional layer can work by sliding a series of small weight matrices (called convolution kernels or filters) on the input character phonetic sequence and character tone mark, calculating the dot product of these weight matrices with the input data, and generating a feature map, i.e., the character phonetic convolution feature.
[0101] In step S430 of some embodiments, after convolution using the CNN convolutional network, a pooling layer can be used for further processing, that is, the phonetic convolution features are pooled based on the second pooling layer to obtain phonetic pooled features. Pooling can be used to reduce the spatial size of the feature map, reduce the amount of calculation, and prevent overfitting. The pooling layer works by downsampling each small area of the input feature map. This process involves sliding a window across the feature map and extracting a single representative value from each window, such as the maximum value or average value. The pooling layer can include a maximum pooling layer and a mean pooling layer, and the first pooling layer of the present application can be a maximum pooling layer.
[0102] In step S440 of some embodiments, further, feature fusion can be performed on the phonetic pooling features based on the second fully connected layer to obtain text phonetic features. The fully connected layer can be used to convert the extracted features into the final output result. Among them, each neuron in the fully connected layer is connected to all neurons in the previous layer to achieve feature integration and reorganization. This layer captures the inherent connections and patterns between features through weighted summation, laying the foundation for further data analysis and processing.
[0103] In step S150 of some embodiments, the updated target text is input into the text error correction model, and the target text can be subjected to glyph feature extraction based on the glyph feature extraction sub-model to obtain text glyph features. The text glyph features include glyph features corresponding to the correct characters and a first mask feature, and the first mask feature is the glyph feature of the incorrect character. That is to say, when the glyph feature extraction sub-model performs glyph feature extraction, it will vectorize the preset mask in the target text into a first mask feature, so that the model can accurately predict the character corresponding to the first mask feature in subsequent predictions. The glyph feature extraction sub-model includes a character vectorization layer, a first convolutional layer, a first pooling layer, and a first fully connected layer.
[0104] In some embodiments, see Figure 5 , Figure 5 This is an optional flowchart of step S150 provided in an embodiment of the present application. Step S150 may specifically include steps S510 to S560:
[0105] Step S510, performing character vectorization on the correct characters in the target text based on the character vectorization layer to obtain character image features;
[0106] Step S520: performing character vectorization on the preset mask based on the character vectorization layer to obtain a first mask feature;
[0107] Step S530, performing convolution processing on the character image features based on the first convolution layer to obtain character convolution features;
[0108] Step S540: performing pooling processing on the character convolutional features based on the first pooling layer to obtain character pooling features;
[0109] Step S550: performing feature fusion on the character pooling features based on the first fully connected layer to obtain character shape features;
[0110] Step S560 , performing feature fusion on the character glyph feature and the first mask feature based on a preset feature size to obtain a text glyph feature.
[0111] In steps S510 to S560 of some embodiments, in the glyph feature extraction sub-model, the correct characters and the preset mask in the target text can be character vectorized based on the character vectorization layer, respectively, to obtain the character image features corresponding to the correct characters and the first mask features corresponding to the preset mask. The character vectorization layer can vectorize each text character into a 24*24 graphic, that is, the size of the feature map corresponding to the vectorized character image features and the first mask features is the same, both of which are 24 rows and 24 columns. Further, the character glyph features are obtained by sequentially passing through the first convolutional layer, the first pooling layer and the first fully connected layer. The character glyph features refer to the glyph features corresponding to the correct characters in the target text. Furthermore, the character glyph features and the first mask features are feature fused based on the preset feature size to obtain text glyph features, that is, the glyph features corresponding to multiple text characters are spliced, and the spliced features are adjusted based on the preset feature size to obtain text glyph features of the preset feature size. In addition, the first convolutional layer, the first pooling layer, and the first fully connected layer have been described in detail in the above-mentioned phonetic feature extraction sub-model, and the corresponding structures are the same, so they will not be repeated here.
[0112] It should be noted that step S560 may specifically include: performing feature splicing on the character glyph features and the first mask features in the order of the characters in the target text to obtain initial glyph features; performing feature conversion on the initial glyph features based on the preset feature size to obtain text glyph features. The feature conversion of the initial glyph features by the preset feature size is also to make the obtained text glyph features the same size as the features output by the phonetic feature extraction sub-model and the semantic feature extraction sub-model, so as to facilitate the final feature fusion. Among them, the preset feature size can be a 576-dimensional feature. In this way, if the obtained character glyph features and the first mask features are both 24*24 features, they can be converted into 1 row and 576 columns, that is, 1*576 features.
[0113] In some embodiments, step S510 may specifically include extracting text style from the target text to obtain text style data; determining a first number of preset fonts based on the text style data; performing character vectorization on correct characters in the target text based on each preset font to obtain a character image sub-feature; and performing feature fusion on the first number of character image sub-features to obtain a character image feature. The first number may be 2, 3, etc., without limitation.
[0114] In some embodiments, if the first number is 2, see Figure 6 , Figure 6 This is an optional flowchart of step S510 provided in an embodiment of the present application. Step S510 may specifically include steps S610 to S650:
[0115] Step S610, extracting the text style of the target text to obtain text style data;
[0116] Step S620, determining a first preset font and a second preset font based on the text style data;
[0117] Step S630, performing character vectorization on the correct characters in the target text based on the first preset font to obtain a first character image sub-feature;
[0118] Step S640, performing character vectorization on the correct characters in the target text based on the second preset font to obtain a second character image sub-feature;
[0119] Step S650 : performing feature fusion on the first character image sub-feature and the second character image sub-feature to obtain a character image feature.
[0120] In step S610 and step S620 of some embodiments, the present application will consider different preset fonts when determining the character glyph features to consider the impact of different fonts on the character glyphs. Specifically, the corpus can be segmented, part-of-speech tagged, sentiment analyzed, etc. through natural language processing (NLP) technology to extract the text style of the target text and obtain text style data. The text style data can represent the style of the text as a description of multiple dimensions such as elegance, formality, and liveliness. Furthermore, the corresponding first preset font and second preset font can be determined based on the text style data corresponding to the target text. The first preset font and the second preset font are fonts selected to highlight the main style features of the text. For example, if the text style is elegant, an elegant serif font may be selected to adapt to different parts of the text or different uses. Among them, the first preset font can be Fangsong, Xingkai, Lishu, etc., which are not limited here.
[0121] In some embodiments, in steps S630 to S650, after determining the first and second preset fonts, character vectorization can be performed on the correct characters in the target text based on each preset font to obtain corresponding character image sub-features. Furthermore, feature fusion can be performed on the first and second character image sub-features to obtain character image features.
[0122] It should be noted that this application can select more preset fonts according to actual needs and is not limited to the above two types, which will not be repeated here.
[0123] In the above embodiment, when extracting glyph features of text characters, the present application considers the influence of text style, text font and glyph size on feature extraction, thereby extracting text glyph features with richer features.
[0124] In step S160 of some embodiments, the updated target text is input into the text error correction model, and semantic features of the target text can be extracted based on the semantic feature extraction sub-model to obtain text semantic features. The text glyph features include second mask features, which are semantic features of erroneous characters. The semantic feature extraction sub-model includes an embedding layer and an encoding layer.
[0125] In some embodiments, see Figure 7 , Figure 7 This is an optional flowchart of step S160 provided in an embodiment of the present application. Step S160 may specifically include steps S710 to S730:
[0126] Step S710, semantic vectorization is performed on the correct characters in the target text based on the embedding layer to obtain character semantic features;
[0127] Step S720: semantically vectorizing the preset mask in the target text based on the embedding layer to obtain a second mask feature;
[0128] Step S730 , performing feature encoding on the character semantic features and the second mask features based on the encoding layer to obtain text semantic features.
[0129] In steps S710 to S730 of some embodiments, the semantic feature extraction sub-model can be a model built based on the BERT network structure, which performs semantic vectorization on the preset mask and correct characters in the target text based on the embedding layer, respectively, to obtain the second mask feature and the character semantic feature, so as to convert the character into a vector representation, which can include vocabulary embedding, position embedding and segment embedding to ensure that the model can understand the semantics, position and sentence relationship of the word. Furthermore, the character semantic feature and the second mask feature are feature encoded based on the encoding layer to obtain the text semantic feature. The encoding layer can be a multi-layer Transformer encoder, which is composed of multiple Transformer encoder layers stacked together, and each encoder layer contains a self-attention mechanism and a feedforward neural network, allowing the model to capture complex dependencies in the input sequence.
[0130] In step S170 of some embodiments, text prediction is further performed based on the text phonetic features, text glyph features, and text semantic features based on the error correction sub-model to obtain a target error-corrected text, which is the correct text after error correction. The error correction sub-model includes a feature fusion layer and a prediction layer. The feature fusion layer is used to fuse the text phonetic features, text glyph features, and text semantic features, and the prediction layer is used to perform text prediction based on the fused features.
[0131] In some embodiments, see Figure 8 , Figure 8This is an optional flowchart of step S170 provided in an embodiment of the present application. Step S170 may specifically include steps S810 to S820:
[0132] Step S810, performing feature fusion on the text phonetic features, text glyph features, and text semantic features based on the feature fusion layer to obtain target text features;
[0133] Step S820: Perform text prediction on the target text features based on the prediction layer to obtain the target error-corrected text.
[0134] In some embodiments, in steps S810 to S820, the present application may perform feature concatenation on the text phonetic features, text glyph features, and text semantic features, and pass the concatenated features through a fully connected layer to obtain target text features. Furthermore, the fused target text features may be input into a prediction layer built based on BERT, and the masked portion may be predicted using the contextual features of the text to obtain the corrected target text.
[0135] It should be noted that the non-Company's software tools or components appearing in the embodiments of this application are merely examples and do not represent actual use.
[0136] The embodiment of the present application provides a text error correction method, which adopts a combination of a text error detection model and a text error correction model. The target text is firstly subjected to text error detection in the text error detection model, and the text error detection model obtains tokens that may be erroneous, so as to reduce the miscorrection of the text error correction model. Furthermore, the features of the text error correction model adopt a fusion method of three features: phonetic features, glyph features, and semantic features, and learn the features of the text from multiple levels to achieve a better error correction effect. In addition, when the text error correction model extracts features, the text glyph features and text semantic features adopt masked token features, which reduces the impact of the erroneous part on the model and can better perform error correction, while the text phonetic features maintain complete pinyin features. Because in many cases the wrong word is pronounced correctly, the pronunciation can bring a certain auxiliary effect to the error correction. Therefore, the present application can effectively improve the accuracy of text error correction and avoid the impact of erroneous text on customer intent recognition.
[0137] See also Figure 9 The present application also provides a text error correction device that can implement the above text error correction method. The device includes:
[0138] An acquisition module 910 is configured to acquire a target text, where the target text includes text characters.
[0139] The error detection module 920 is used to input the target text into a pre-trained text error detection model to perform text error detection and obtain text markup data, where the text markup data is used to mark correct characters and incorrect characters in the text;
[0140] An input module 930 is configured to input the target text into a pre-trained text error correction model based on the text tag data, wherein the text error correction model includes a phonetic feature extraction sub-model, a glyph feature extraction sub-model, a semantic feature extraction sub-model, and an error correction sub-model;
[0141] The pronunciation extraction module 940 is used to extract the pronunciation features of the target text based on the pronunciation feature extraction sub-model to obtain the text pronunciation features of the text characters;
[0142] A glyph extraction module 950 is configured to extract glyph features of a target text based on a glyph feature extraction sub-model to obtain text glyph features, wherein the text glyph features include a first mask feature, and the first mask feature is a glyph feature of an erroneous character;
[0143] Semantic extraction module 960, configured to extract semantic features of the target text based on the semantic feature extraction sub-model to obtain text semantic features, wherein the text glyph features include a second mask feature, and the second mask feature is a semantic feature of an erroneous character;
[0144] The prediction module 970 is used to perform text prediction on the text phonetic features, text glyph features and text semantic features based on the error correction sub-model to obtain the target error correction text.
[0145] The specific implementation of the text error correction device is basically the same as the specific embodiment of the above-mentioned text error correction method, and will not be repeated here.
[0146] The present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned text error correction method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, an in-vehicle computer, or the like.
[0147] See also Figure 10 , Figure 10 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:
[0148] The processor 1010 may be implemented using a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.
[0149] The memory 1020 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1020 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1020 and is called by the processor 1010 to execute the text error correction method of the embodiments of this application.
[0150] Input / output interface 1030, used to implement information input and output;
[0151] Communication interface 1040, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, Wi-Fi, Bluetooth, etc.);
[0152] bus 1050 , which transmits information between various components of the device (e.g., processor 1010 , memory 1020 , input / output interface 1030 , and communication interface 1040 );
[0153] The processor 1010 , the memory 1020 , the input / output interface 1030 , and the communication interface 1040 are connected to each other in communication within the device via a bus 1050 .
[0154] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned text error correction method is implemented.
[0155] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0156] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0157] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0158] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0159] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0160] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0161] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0162] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0163] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0164] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0165] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store programs.
[0166] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.
Claims
1. A text error correction method, characterized in that: The method comprises: Acquire a target text, wherein the target text includes text characters; Inputting the target text into a pre-trained text error detection model to perform text error detection to obtain text mark data, wherein the text mark data is used to mark correct characters and incorrect characters in the text characters; Based on the text markup data, the target text is input into a pre-trained text error correction model, the text error correction model includes a phonetic feature extraction sub-model, a glyph feature extraction sub-model, a semantic feature extraction sub-model and an error correction sub-model; the text markup data includes a character error mark, and the character error mark is used to indicate the erroneous character; the step of inputting the target text into the pre-trained text error correction model based on the text markup data includes: replacing characters of the target text based on the character error mark to obtain a replacement text; the replacement text is used to represent a text after replacing the text characters corresponding to the character error mark in the target text with a preset mask; updating the target text according to the replacement text, and inputting the updated target text into the text error correction model; Performing phonetic feature extraction on the target text based on the phonetic feature extraction sub-model to obtain text phonetic features of the text characters; Based on the glyph feature extraction sub-model, glyph features of the target text are extracted to obtain text glyph features, and the text glyph features include a first mask feature, which is the glyph feature of the erroneous character; the glyph feature extraction sub-model includes a character vectorization layer, a first convolution layer, a first pooling layer and a first fully connected layer, and the glyph feature extraction sub-model based on the glyph feature extraction sub-model is performed to obtain text glyph features, including: performing character vectorization on the correct characters in the target text based on the character vectorization layer to obtain character image features; performing character vectorization on the preset mask based on the character vectorization layer to obtain the first mask feature; performing convolution processing on the character image features based on the first convolution layer to obtain character convolution features; performing pooling processing on the character convolution features based on the first pooling layer to obtain character pooling features; performing feature fusion on the character pooling features based on the first fully connected layer to obtain character glyph features; performing feature fusion on the character glyph features and the first mask features based on a preset feature size to obtain the text glyph features; Performing semantic feature extraction on the target text based on the semantic feature extraction sub-model to obtain text semantic features, wherein the text semantic features include a second mask feature, and the second mask feature is a semantic feature of the erroneous character; Based on the error correction sub-model, text prediction is performed on the text phonetic features, the text glyph features and the text semantic features to obtain a target error correction text.
2. The method according to claim 1, characterized in that The performing character vectorization on the correct characters in the target text based on the character vectorization layer to obtain character image features includes: Performing text style extraction on the target text to obtain text style data; determining a first preset font and a second preset font based on the text style data; performing character vectorization on the correct characters in the target text based on the first preset font to obtain a first character image sub-feature; performing character vectorization on the correct characters in the target text based on the second preset font to obtain second character image sub-features; The first character image sub-feature and the second character image sub-feature are subjected to feature fusion to obtain the character image feature.
3. The method according to any one of claims 1 to 2, characterized in that The semantic feature extraction sub-model includes an embedding layer and an encoding layer. The semantic feature extraction sub-model is used to extract semantic features from the target text to obtain text semantic features, including: Performing semantic vectorization on the correct characters in the target text based on the embedding layer to obtain character semantic features; Performing semantic vectorization on the preset mask in the target text based on the embedding layer to obtain a second mask feature; Feature encoding is performed on the character semantic feature and the second mask feature based on the encoding layer to obtain the text semantic feature.
4. The method according to any one of claims 1 to 2, characterized in that The pronunciation feature extraction sub-model includes a pinyin conversion layer, a second convolutional layer, a second pooling layer, and a second fully connected layer. The pronunciation feature extraction sub-model is used to extract the pronunciation features of the target text to obtain the text pronunciation features, including: Performing pinyin conversion on the target text based on the pinyin conversion layer to obtain text pinyin, wherein the text pinyin includes a character pinyin sequence and a character tone mark; Performing convolution processing on the character pinyin sequence and the character tone mark based on the second convolution layer to obtain a character-phonetic convolution feature; Performing pooling processing on the pronunciation convolution feature based on the second pooling layer to obtain a pronunciation pooled feature; The pronunciation pooling features are subjected to feature fusion based on the second fully connected layer to obtain the text pronunciation features.
5. The method according to any one of claims 1 to 2, characterized in that The error correction sub-model includes a feature fusion layer and a prediction layer. The text prediction is performed on the text phonetic features, the text glyph features, and the text semantic features based on the error correction sub-model to obtain a target error correction text, including: Based on the feature fusion layer, the text phonetic features, the text glyph features and the text semantic features are fused to obtain target text features; The target text features are predicted based on the prediction layer to obtain the target error-corrected text.
6. A text error correction device, characterized in that: The device comprises: An acquisition module, configured to acquire a target text, wherein the target text includes text characters; An error detection module is used to input the target text into a pre-trained text error detection model to perform text error detection and obtain text marking data, wherein the text marking data is used to mark correct characters and incorrect characters in the text characters; An input module is used to input the target text into a pre-trained text error correction model based on the text markup data, the text error correction model including a phonetic feature extraction sub-model, a glyph feature extraction sub-model, a semantic feature extraction sub-model and an error correction sub-model; the text markup data includes a character error mark, and the character error mark is used to indicate the erroneous character; the inputting of the target text into the pre-trained text error correction model based on the text markup data includes: replacing characters of the target text based on the character error mark to obtain a replacement text; the replacement text is used to represent a text after replacing the text characters corresponding to the character error mark in the target text with a preset mask; updating the target text according to the replacement text, and inputting the updated target text into the text error correction model; A pronunciation extraction module, configured to extract pronunciation features of the target text based on the pronunciation feature extraction sub-model to obtain text pronunciation features of the text characters; A glyph extraction module is used to extract glyph features of the target text based on the glyph feature extraction sub-model to obtain text glyph features, wherein the text glyph features include a first mask feature, which is the glyph feature of the erroneous character; the glyph feature extraction sub-model includes a character vectorization layer, a first convolution layer, a first pooling layer and a first fully connected layer, and the glyph feature extraction of the target text based on the glyph feature extraction sub-model to obtain text glyph features includes: performing character vectorization on the correct characters in the target text based on the character vectorization layer to obtain character image features; performing character vectorization on the preset mask based on the character vectorization layer to obtain the first mask feature; performing convolution processing on the character image features based on the first convolution layer to obtain character convolution features; performing pooling processing on the character convolution features based on the first pooling layer to obtain character pooling features; performing feature fusion on the character pooling features based on the first fully connected layer to obtain character glyph features; performing feature fusion on the character glyph features and the first mask features based on a preset feature size to obtain the text glyph features; A semantic extraction module, configured to extract semantic features of the target text based on the semantic feature extraction sub-model to obtain text semantic features, wherein the text semantic features include a second mask feature, and the second mask feature is a semantic feature of the erroneous character; The prediction module is used to perform text prediction on the text phonetic features, the text glyph features and the text semantic features based on the error correction sub-model to obtain a target error correction text.
7. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.