Information correction method and device
The pre-trained handwriting imitation model imitates the user's handwritten correction character handwriting and automatically corrects handwritten erroneous characters, solving the problem of low efficiency in correcting erroneous characters in handwritten character recognition and improving writing efficiency and accuracy.
Patent Information
- Application Number
- CN201910661321.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-07-22
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2039-07-22
AI Technical Summary
When users make mistakes in handwritten character recognition, they need to manually erase and re-enter, resulting in low efficiency.
It uses a pre-trained handwriting imitation model to imitate the handwriting of correction characters written by users, and automatically corrects incorrect characters through neural network model training and matching of incorrect characters.
It improves the accuracy and efficiency of users writing characters, reduces the steps of manually correcting errors, and improves overall writing efficiency.
Smart Images

Figure CN112257820B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer information technology, and in particular to an information correction method and device. Background Art
[0002] Handwritten character recognition refers to the process of converting the ordered trajectory information generated when a user writes characters on a handwriting device into characters in a standard character library such as a Chinese character library or an English character library. In other words, it is the mapping process from the sequence formed by the coordinates of each trajectory point in the above ordered trajectory to the characters in the standard character library.
[0003] When a user writes characters on a handwriting device, there may be writing errors. In this case, the user generally needs to manually erase the wrong characters and rewrite the correct characters, which results in low efficiency of the handwriting device obtaining the correct characters written by the user. Summary of the invention
[0004] The purpose of the embodiment of the present invention is to provide an information correction method and device to improve the efficiency of obtaining the correct characters written by the user. The specific technical solution is as follows:
[0005] In a first aspect, an embodiment of the present invention provides an information correction method, the method comprising:
[0006] Obtaining an image containing handwritten characters of a user as an image to be recognized;
[0007] Performing character recognition on the image to be recognized to obtain characters to be detected;
[0008] Matching the character to be detected with characters in a preset dictionary to obtain a matching result;
[0009] Based on the matching result, determining the wrong character in the characters to be detected, and obtaining a corrected character for the wrong character;
[0010] Using a pre-trained handwriting imitation model to imitate the handwriting of the user writing the modified character, wherein the handwriting imitation model is: a model for imitating the user's handwriting obtained by training a preset neural network model using the handwriting of the user's handwritten character;
[0011] The handwriting of the wrong character is corrected according to the imitated handwriting.
[0012] In one embodiment of the present invention, the handwriting imitation model is trained in the following manner:
[0013] Collecting handwriting of user's handwritten characters;
[0014] Determine key points in the collected handwriting, and obtain a path corresponding to the collected handwriting formed by the determined key points;
[0015] Obtaining actual characters corresponding to the collected handwriting;
[0016] The actual characters and the path are input into a preset neural network model, and the preset neural network model is trained using the path as a training benchmark to obtain the handwriting imitation model.
[0017] In one embodiment of the present invention, the preset neural network model includes: an input layer, an output layer and a hidden layer, and the hidden layer includes a plurality of cascaded long short-term memory LSTM cell nodes;
[0018] The step of inputting the actual character and the path into a preset neural network model, and using the path as a training reference to train the preset neural network model to obtain the handwriting imitation model comprises:
[0019] The input layer obtains the actual character and the path, and transmits the actual character and the path to the hidden layer;
[0020] Each LSTM cell node in the hidden layer updates its own state for each key point in accordance with the order of each key point in the path, combined with the output result of the LSTM cell node before the LSTM cell node, and the last LSTM cell node inputs its output result to the output layer, each LSTM cell node removes the first type of features from the features of the current key point and the features of the previous key point, and strengthens the second type of features, wherein the first type of features are: features that do not affect the prediction result of the next key point, and the second type of features are: features that affect the prediction result of the next key point;
[0021] The output layer obtains the mixed probability distribution of the next key point according to the output result of the last LSTM cell node, samples the obtained mixed probability distribution, and obtains the predicted point of the next key point according to the sampling result; and adjusts the model parameters according to the obtained predicted point and the actual point corresponding to the next key point in the path.
[0022] In one embodiment of the present invention, the hidden layer further includes a convolutional window layer; wherein the convolutional window layer is located between the first LSTM cell node and the second LSTM cell node in the hidden layer;
[0023] The input information of the convolution window layer includes: the actual character and the output result of the first LSTM cell node;
[0024] The input information of the first LSTM cell node in the hidden layer includes: the previous state of the LSTM cell node, the key points in the path, and the previous output information of the convolution window layer;
[0025] The input information of other LSTM cell nodes in the hidden layer includes: the last state of the LSTM cell node, the key points in the path, the output result of the previous LSTM cell node and the output result of the convolution window layer.
[0026] In one embodiment of the present invention,
[0027] The handwriting imitation model is a model built based on a mixture density network (MDN).
[0028] In one embodiment of the present invention, the method of using a pre-trained handwriting imitation model to imitate the handwriting of the user writing the revised character includes:
[0029] Obtaining the starting point coordinates of the character to be detected in the image to be recognized;
[0030] The modified character and the starting point coordinates are used as input information and input into a pre-trained handwriting imitation model to predict various key points when the user writes the modified character;
[0031] The handwriting represented by the path formed by the predicted key points is determined as the handwriting of the user writing the revised character.
[0032] In a second aspect, the present invention provides an information correction device, the device comprising:
[0033] An image acquisition module is used to acquire an image containing handwritten characters of a user as an image to be recognized;
[0034] A character recognition module is used to perform character recognition on the image to be recognized to obtain the character to be detected;
[0035] A character matching module is used to match the character to be detected with the characters in a preset dictionary to obtain a matching result;
[0036] A correction character obtaining module is used to determine the wrong character in the characters to be detected based on the matching results, and obtain the correction character of the wrong character;
[0037] A handwriting imitation module, used to imitate the handwriting of the user's handwritten corrected characters by using a pre-trained handwriting imitation model, wherein the handwriting imitation model is: a model obtained by training a preset neural network model using the handwriting of the user's handwritten characters and used to imitate the user's handwriting;
[0038] The handwriting correction module is used to correct the handwriting of wrong characters according to the imitated handwriting.
[0039] In one embodiment of the present invention, the device further comprises: a model training module;
[0040] Wherein, the model training module includes:
[0041] A handwriting collection submodule is used to collect the handwriting of the user's handwritten characters;
[0042] A key point determination submodule, used to determine the key points in the collected handwriting, and obtain the path corresponding to the collected handwriting formed by the determined key points;
[0043] The actual character acquisition submodule is used for the actual characters corresponding to the collected handwriting;
[0044] The model training submodule is used to input the actual characters and the path into a preset neural network model, and use the path as a training benchmark to train the preset neural network model to obtain the handwriting imitation model.
[0045] In one embodiment of the present invention, the preset neural network model includes: an input layer, an output layer and a hidden layer, and the hidden layer includes a plurality of cascaded long short-term memory LSTM cell nodes;
[0046] The model training submodule includes:
[0047] An information obtaining unit, used for the input layer to obtain the actual character and the path, and transmit the actual character and the path to the hidden layer;
[0048] A cell node state updating unit is used for each LSTM cell node in the hidden layer. According to the order of each key point in the path, for each key point, combined with the output result of the LSTM cell node before the LSTM cell node, the state of the cell node is updated, and the last LSTM cell node inputs its output result to the output layer. Each LSTM cell node removes the first type of features from the features of the current key point and the features of the previous key point, and strengthens the second type of features, wherein the first type of features are: features that do not affect the prediction result of the next key point, and the second type of features are: features that affect the prediction result of the next key point;
[0049] A parameter adjustment unit is used for the output layer to obtain the mixed probability distribution of the next key point according to the output result of the last LSTM cell node, sample the obtained mixed probability distribution, and obtain the predicted point of the next key point according to the sampling result; adjust the model parameters according to the obtained predicted point and the actual point corresponding to the next key point in the path.
[0050] In one embodiment of the present invention, the hidden layer further includes a convolutional window layer; wherein the convolutional window layer is located between the first LSTM cell node and the second LSTM cell node in the hidden layer;
[0051] The input information of the convolution window layer includes: the actual character and the output result of the first LSTM cell node;
[0052] The input information of the first LSTM cell node in the hidden layer includes: the previous state of the LSTM cell node, the key points in the path, and the previous output information of the convolution window layer;
[0053] The input information of other LSTM cell nodes in the hidden layer includes: the last state of the LSTM cell node, the key points in the path, the output result of the previous LSTM cell node and the output result of the convolution window layer.
[0054] In one embodiment of the present invention,
[0055] The handwriting imitation model is a model built based on a mixture density network (MDN).
[0056] In one embodiment of the present invention, the handwriting imitation module is specifically used for:
[0057] Obtaining the starting point coordinates of the character to be detected in the image to be recognized;
[0058] The modified character and the starting point coordinates are used as input information and input into a pre-trained handwriting imitation model to predict various key points when the user writes the modified character;
[0059] The handwriting represented by the path formed by the predicted key points is determined as the handwriting of the user writing the revised character.
[0060] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0061] Memory, used to store computer programs;
[0062] The processor is used to implement the method steps described in the first aspect when executing the program stored in the memory.
[0063] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in the first aspect are implemented.
[0064] Beneficial effects of the embodiments of the present invention:
[0065] When the scheme provided by the embodiment of the present invention is applied to correct information, an image containing the handwriting of the user's handwritten characters is obtained as the image to be recognized; character recognition is performed on the image to be recognized to obtain the characters to be detected; the characters to be detected are matched with the characters in the preset dictionary to obtain a matching result; based on the matching result, the wrong characters in the characters to be detected are determined, and the corrected characters of the wrong characters are obtained; a pre-trained handwriting imitation model is used to imitate the handwriting of the user writing the corrected characters, wherein the handwriting imitation model is: a model used to imitate the user's handwriting obtained by training a preset neural network model using the handwriting of the user's handwritten characters; and the handwriting of the wrong characters is corrected according to the imitated handwriting. It can be seen that when the scheme provided by the embodiment of the present invention is applied to correct the wrong characters, the user does not need to manually erase the handwritten wrong characters and re-enter the correct characters, but directly imitates the handwriting of the user's handwritten corrected characters to correct the wrong characters, thereby improving the efficiency of obtaining the correct characters written by the user, that is, improving the correctness of the user's written characters and the writing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0067] Figure 1 A schematic diagram of a flow chart of an information correction method provided by an embodiment of the present invention;
[0068] Figure 2 A flow chart of a handwriting imitation model training method provided by an embodiment of the present invention;
[0069] Figure 3 A schematic diagram of a method for determining key points of handwriting collection provided by an embodiment of the present invention
[0070] Figure 4 A schematic diagram of a preset neural network model provided by an embodiment of the present invention;
[0071] Figure 5 A schematic diagram of a convolutional window layer provided by an embodiment of the present invention;
[0072] Figure 6 A schematic diagram of the structure of an information correction device provided by an embodiment of the present invention;
[0073] Figure 7 A schematic diagram of the structure of a handwriting imitation model training device provided by an embodiment of the present invention;
[0074] Figure 8 The present invention is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0075] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0076] The embodiment of the present invention provides an information correction method and device to correct wrong characters by imitating user handwriting.
[0077] The information correction scheme provided in the embodiment of the present invention can be applied to any electronic device with a touch screen, and the electronic device can be a touch-screen computer, a touch-screen mobile phone, a touch-screen game console, a touch-screen electronic reader, and the like.
[0078] The following first introduces an information correction method provided by an embodiment of the present invention.
[0079] like Figure 1 As shown, an embodiment of the present invention provides an information correction method, comprising the following steps:
[0080] S101: Obtain an image containing handwriting characters of a user as an image to be recognized.
[0081] The electronic device can provide a handwriting character input function for the user. After the handwriting character input function of the electronic device is turned on, the user can write characters on the touch screen of the electronic device by handwriting input. The input characters can be called handwritten characters, and the image containing the handwriting of the handwritten characters can be called the image to be recognized.
[0082] The handwriting of the user's handwritten characters refers to the movement track of the user's fingers or a stylus pen when the user writes characters.
[0083] The handwritten characters may include multiple characters, and the characters may be the smallest unit in any language, for example, Chinese characters, English words, Russian words, Korean characters, and the like.
[0084] In one implementation, the image to be recognized may include: all characters input by the user during the handwriting input process, or part of the handwriting characters input by the user during the handwriting input process, or all the handwriting characters input by the user displayed on the touch screen of the electronic device.
[0085] S102: Perform character recognition on the image to be recognized to obtain the characters to be detected.
[0086] Among them, the characters to be detected in the handwritten characters obtained above can be one or more characters, and the characters to be detected at least include: the last character handwritten input by the user. In the embodiment of the present invention, after the electronic device obtains the above image to be recognized, it can use any current recognition algorithm that can recognize characters from the image to perform character recognition on the above image to be recognized. For example, the above recognition algorithm can be: structural pattern recognition algorithm and statistical pattern recognition algorithm, etc. The embodiment of the present invention does not limit the type of the above recognition algorithm.
[0087] In one implementation, the step of identifying the image to be identified and obtaining the characters to be detected in the input text may include:
[0088] The image to be recognized is recognized by an OCR (Optical Character Recognition) algorithm to obtain the characters to be detected in the handwritten characters.
[0089] It can be understood that the above OCR algorithm is an algorithm for optical character recognition through image processing and pattern recognition technology, which can not only recognize each character from the image, but also recognize the position of each character in the image. The electronic device uses the above OCR algorithm to better recognize the characters in the handwritten characters contained in the image to be recognized, and then determine the characters to be detected from the above characters.
[0090] S103: Match the character to be detected with the characters in a preset dictionary to obtain a matching result.
[0091] The preset dictionary may include accurate single characters, short sentences and phrases that conform to grammatical rules, etc., and may also include the usage frequency of each character, the usage frequency of each short sentence that conforms to grammatical rules, and the usage frequency of phrases. The short sentences and phrases that conform to grammatical rules may be a string of characters. The characters may be Chinese characters, English words, etc.
[0092] In one implementation, the above-mentioned character to be detected can be matched one by one with each character, short sentence and phrase that conforms to grammatical rules contained in a preset dictionary to obtain a matching result. Wherein, when the character identical to the above-mentioned character to be detected or the short sentence or phrase that conforms to grammatical rules exists in the preset dictionary, that is, there is no result of an incorrect character, then the matching result can include information indicating that there is no incorrect character in the character to be detected. When the character identical to the above-mentioned character to be detected and the short sentence or phrase that conforms to grammatical rules does not exist in the preset dictionary, that is, there is a result of an incorrect character, then the matching result can include information indicating that there is an incorrect character in the character to be detected.
[0093] In addition, in addition to the information indicating whether there are erroneous characters in the characters to be detected, the above matching results may also include a preset number of characters in the preset dictionary with the highest probability of matching the erroneous characters and the matching probability between the erroneous characters and the above preset number of characters.
[0094] In a specific implementation, the above-mentioned erroneous characters may be expressed in the form of a string. It should be noted that, in a specific implementation, the various characters mentioned in the embodiments of the present invention may be expressed in the form of a string.
[0095] In addition, the number of characters contained in the short sentences and phrases that conform to grammatical rules stored in the preset dictionary may be different. The above-mentioned preset dictionary can classify and store the above-mentioned contents based on the number of characters contained in the stored single characters, short sentences and phrases that conform to grammatical rules. For example: a single character is stored in a storage area A of a preset dictionary to generate a first sub-dictionary, short sentences and phrases that conform to grammatical rules containing 2 characters are stored in another storage area B of the preset dictionary to generate a second sub-dictionary, and short sentences and phrases that conform to grammatical rules containing 3 characters are stored in another storage area C of the preset dictionary to generate a third sub-dictionary, wherein the above-mentioned storage areas A, B and C are different storage areas of the preset dictionary.
[0096] Furthermore, when the electronic device obtains the character to be detected, it can first determine the number of characters in the character to be detected, and then determine the sub-dictionary to be matched based on the number of characters in the character to be recognized, wherein the number of characters corresponding to the sub-dictionary to be matched can be the same as the number of characters in the character to be detected, or can be greater than or equal to the number of characters in the character to be detected. Through the above matching method, the amount of matching operations in the recognition process can be reduced to a certain extent.
[0097] S104: Based on the matching result, determine the wrong character in the characters to be detected, and obtain a corrected character for the wrong character.
[0098] When the matching result indicates that there is an erroneous character in the characters to be detected, the character with the highest probability of matching the erroneous character in the preset dictionary can be used as the correction character. Of course, the character selected by the user from a preset number of characters with the highest probability of matching the erroneous character in the preset dictionary can also be used as the correction character.
[0099] In another embodiment, when the matching result indicates that there is an error in the characters to be detected, that is, there is an error character, the electronic device determines that there is an error character in the characters to be detected, and determines a correction character for the error character from a preset dictionary.
[0100] S105: Using a pre-trained handwriting imitation model, imitating the handwriting of the user to correct the characters.
[0101] The handwriting imitation model is a model obtained by training a preset neural network model using the handwriting of the user's handwritten characters and used to imitate the user's handwriting.
[0102] The above-mentioned preset neural network model may be a RNN (Recurrent Neural Networks) model.
[0103] In one embodiment of the present invention, the above-mentioned pre-trained handwriting imitation model can obtain the starting point coordinates of the character to be detected in the image to be recognized when imitating the handwriting of the user's handwritten corrected characters; the corrected characters and the starting point coordinates are input as input information to the pre-trained handwriting imitation model to predict the various key points when the user writes the corrected characters; and the handwriting represented by the path formed by the predicted key points is determined as the handwriting of the user's handwritten corrected characters.
[0104] The above starting point coordinates refer to the coordinates of the starting point of the character to be detected in the image to be recognized.
[0105] The above key points can be understood as: representation points that play a key role in character handwriting, for example: they can be the starting point, end point, turning point, and intersection point of the user's handwritten characters.
[0106] As can be seen from the above, the solution provided by this embodiment uses a pre-trained handwriting imitation model to imitate the handwriting of the user's handwritten characters, thereby improving the accuracy and writing efficiency of the user's handwritten characters.
[0107] In one embodiment of the present invention, the handwriting imitation model may be a model constructed based on a mixture density network (MDN).
[0108] The training process of the handwriting imitation model can be found in the following Figure 2The embodiment shown will not be described in detail here.
[0109] S106: Correct the handwriting of the wrong characters according to the imitated handwriting.
[0110] In one implementation, when correcting the handwriting of an incorrect character, the electronic device may first erase the handwriting of the incorrect character and then insert the simulated handwriting into the position of the incorrect character, thereby correcting the handwriting of the incorrect character.
[0111] In another embodiment, when correcting the handwriting of an incorrect character, the electronic device may not erase the handwriting of the incorrect character, but directly cover the handwriting of the incorrect character with the imitated handwriting in an opaque manner, thereby correcting the handwriting of the incorrect character.
[0112] It can be seen that when the method provided in this embodiment is used to correct erroneous characters, the user does not need to manually erase the handwritten erroneous characters and then re-enter the correct characters. Instead, the handwriting of the user's handwritten correction characters is directly imitated to correct the erroneous characters. Therefore, the efficiency of obtaining the correct characters written by the user is improved, that is, the accuracy of the user's handwritten characters and the writing efficiency are improved.
[0113] The training process of the above handwriting imitation model is introduced in detail below.
[0114] The embodiment of the present invention provides a method for training a handwriting imitation model. Figure 2 As shown, specifically including:
[0115] S201: Collecting handwriting of user's characters.
[0116] In one implementation, based on dot matrix technology, information such as dot matrix coordinates of the trajectory of the user's finger or writing pen during handwriting can be obtained, and the handwriting of the user's handwritten characters can be obtained based on the obtained dot matrix coordinates and other information.
[0117] S202: Determine key points in the collected handwriting, and obtain a path corresponding to the collected handwriting formed by the determined key points.
[0118] For example, Figure 3 As shown in FIG. 1 , when determining the key points in the handwriting of the collected English character “q”, the key points can be determined according to the movement trajectory of the finger or the stylus during the process of writing the character “q”. Figure 3 The starting point, circle point, turning point and ending point are shown.
[0119] It should be noted that the embodiment of the present invention is only described by taking the above as an example, and when determining the key point in the handwriting of the English character "q", it is not limited to Figure 3The points shown may also include other points. Moreover, the denser the key points are, the closer the trained model is to the user's handwriting.
[0120] According to the movement trajectory of the finger or stylus, the key points determined above can form a path, and the formed path reflects the handwriting collected above, and therefore, it can also be called the path corresponding to the collected handwriting.
[0121] by Figure 3 For example, the path corresponding to the handwriting of the character "q" is a curve formed by connecting the starting point, a series of points on the circumference, intersection points, turning points and end points in sequence.
[0122] S203: Obtaining actual characters corresponding to the collected handwriting.
[0123] In one embodiment, to obtain the actual characters corresponding to the collected handwriting, character recognition can be performed on the sample image through any recognition algorithm that can recognize characters from the sample image, and the recognized characters are used as the actual characters corresponding to the collected handwriting.
[0124] In another embodiment, the actual character corresponding to the collected handwriting can be obtained by the user directly assigning a value on the electronic device to obtain the actual character.
[0125] S204: Input the actual characters and the above path into a preset neural network model, and use the above path as a training benchmark to train the preset neural network model to obtain a handwriting imitation model.
[0126] Specifically, the actual characters and the path may be input into a preset neural network model:
[0127] When the above path is input into the preset neural network model, each key point forming the path is input into the preset neural network model in sequence, and the order of inputting each key point into the above preset neural network model is the order corresponding to the movement trajectory of the user's fingers or stylus when writing characters.
[0128] Specifically, for each key point, when the key point is input into the preset neural network model, the preset neural network model can predict the next key point of the key point based on the key point to obtain the predicted point of the next key point. Then the actual point corresponding to the next key point of the key point in the above path is compared with the predicted point. If there is a difference between the two, the model parameters in the preset neural network model are adjusted according to the difference. For the specific process of adjusting the model parameters, see Figure 4 The corresponding embodiments are not described in detail here.
[0129] For example, the preset neural network model may be a RNN model.
[0130] As can be seen from the above, when the method provided by this embodiment is used to train the preset neural network model, the path formed by the collected key points is used as the training benchmark. When there is a difference between the output result and the actual point, the parameters of the preset neural network model are adjusted to make the output result closer to the actual point. In this way, the preset neural network model after training is a handwriting imitation model.
[0131] In one embodiment of the present invention, the above-mentioned preset neural network model may include: an input layer, an output layer and a hidden layer, and the hidden layer includes a plurality of cascaded LSTM (Long Short-Term Memory) cell nodes.
[0132] Among them, the above-mentioned input layer receives input information from outside the model to the above-mentioned preset neural network model, and transmits the received input information to the above-mentioned hidden layer, the above-mentioned hidden layer processes the above-mentioned input information, and transmits the processing result to the above-mentioned output layer, and the above-mentioned output layer obtains the output result of the entire preset neural network model and outputs the above-mentioned output result to the outside of the model.
[0133] like Figure 4 As shown, a structural schematic diagram of a preset neural network model is shown.
[0134] Specifically, the LSTM cell nodes in the cascade arrangement are series connections of LSTM cell nodes. When each LSTM cell node processes information, the input information of each LSTM cell node includes: the output information of the previous LSTM cell node of the LSTM cell node according to the connection order of the LSTM cell nodes, and the output information of the LSTM cell node is the input information of the next LSTM cell node.
[0135] For example, it is assumed that the hidden layer includes three LSTM cell nodes: LSTM cell node 1, LSTM cell node 2, and LSTM cell node 3. LSTM cell node 1, LSTM cell node 2, and LSTM cell node 3 are cascaded in sequence, that is, LSTM cell node 1 is the first LSTM cell node, and its output information is the input information of LSTM cell node 2, and the output information of LSTM cell node 2 is the input information of LSTM cell node 3.
[0136] In the above case, the above S204 can be implemented by following the steps AC.
[0137] Step A: The input layer obtains the actual character and the above path, and transmits the actual character and the above path to the hidden layer.
[0138] When the path is input into the input layer, each key point forming the path is input into the input layer in sequence, and the order of inputting the key points into the input layer is the order corresponding to the movement trajectory of the finger or stylus when the user writes characters.
[0139] Therefore, it can be considered that for a character, the number of key points contained in the path corresponding to this character is the number of times the key points are input to the above input layer, which means the number of times the above preset neural network model is trained.
[0140] Step B: Each LSTM cell node in the hidden layer updates its own state according to the order of each key point in the path, combined with the output results of the LSTM cell node before the LSTM cell node for each key point, and the last LSTM cell node inputs its output result to the output layer. Each LSTM cell node eliminates the first type of features from the features of the current key point and the previous key point, and strengthens the second type of features.
[0141] The first type of features mentioned above are features that do not affect the prediction result of the next key point, that is, features that have no effect on the prediction result of the next key point.
[0142] The second type of features mentioned above are: features that affect the prediction result of the next key point, that is, features that have an effect on the prediction result of the next key point.
[0143] Specifically, since the LSTM cell node has a memory function, for each key point, each LSTM cell node can eliminate the first type of features in the features of the current key point and the previous key point, and strengthen the second type of features. In this way, the output result of each LSTM cell node is the features after the above elimination and strengthening, and the last LSTM cell node inputs the features after the above elimination and strengthening to the output layer.
[0144] The order of the key points in the above path refers to the order of the key points in the handwriting corresponding to the movement trajectory of the finger or stylus when the user writes characters.
[0145] In one embodiment of the present invention, the above-mentioned key point can be represented by triple data, which includes: the offset value of the key point in the x and y directions of the coordinate axes relative to the previous key point used to predict the key point, and information indicating whether the key point is the end point of the handwriting.
[0146] Based on this, the handwriting collected above can be a data sequence composed of triplet data.
[0147] Specifically, the above hidden layer may also include a convolution window layer, such as Figure 5As shown, the convolution window layer is located between the first LSTM cell node and the second LSTM cell node in the hidden layer.
[0148] Based on the above situation, when predicting each key point, the convolution window layer can also obtain the actual character and the output result of the first LSTM cell node, and perform a convolution operation on the obtained information to obtain the output result of the convolution window layer, wherein the operation of the convolution window layer enables the handwritten characters or strings to be input into the hidden layer.
[0149] The input information of the first LSTM cell node in the above hidden layer includes: the previous state of the LSTM cell node, the key points in the input path of the input layer, and the previous output information of the convolution window layer.
[0150] The input information of other LSTM cell nodes in the above hidden layer includes: the previous state of the LSTM cell node, the key points in the input path of the input layer, the output result of the previous LSTM cell node, and the output result of the convolution window layer.
[0151] For each LSTM cell node, the last state of the LSTM cell node can be understood as: the state of the LSTM cell node after the last update of its own state, that is, the state before the current update of its own state.
[0152] Step C: The output layer obtains the mixed probability distribution of the next key point according to the output result of the last LSTM cell node, samples the obtained mixed probability distribution, and obtains the predicted point of the next key point according to the sampling result; adjusts the model parameters according to the obtained predicted point and the actual point corresponding to the next key point in the path.
[0153] According to the output result of the last LSTM cell node, that is, the features after elimination and enhancement in step B, according to the preset correspondence, the above preset correspondence sets the correspondence between each feature and the mixed probability distribution of the next key point. The output layer can obtain the mixed probability distribution of the next key point according to each of these eliminated and enhanced features.
[0154] Since the next path point is often uncertain during writing, even if it is the same text, the position of the next key point may not be the same when writing twice. Therefore, the mixed probability distribution density of the next key point can be understood as the probability of the next key point being in different positions.
[0155] After obtaining the mixed probability distribution of the next key point, the output layer samples the obtained mixed probability distribution, randomly extracts a group of samples, and uses the statistical value of the extracted samples as the sampling result to obtain the prediction result of the next key point, wherein the statistical value of the above samples can be the average value, median value, etc. of the samples.
[0156] For example, the collected handwriting contains N key points, and the output layer predicts the key points one by one for N-1 key points excluding the starting point.
[0157] First, the second key point is predicted based on the starting point in the collected handwriting, that is, the first key point. That is, the mixed probability distribution of the predicted second key point is obtained, and a group of samples are randomly selected from the mixed probability distribution of the second key point, and the average value of the selected samples is used as the prediction result of the second key point.
[0158] Then the predicted second key point is used to predict the third key point, that is, the mixed probability distribution of the predicted third key point is obtained, a group of samples are randomly selected from the mixed probability distribution of the third key point, and the average value of the selected samples is used as the prediction result of the third key point.
[0159] In this way, key point prediction is performed on other key points among the N key points in turn, and finally, key point prediction is performed based on the predicted N-1th key point to obtain the mixed probability distribution of the Nth key point, which is the last key point. A group of samples are randomly selected from the mixed probability distribution of the Nth key point, and the average value of the selected samples is taken as the prediction result of the Nth key point.
[0160] Specifically, when adjusting the model parameters, the parameters involved in the above hidden layer and output layer can be adjusted. For example, the above parameters may include: parameters of each LSTM cell node in the hidden layer, mapping relationship parameters between the mixed probability distribution of features and prediction points in the output layer, etc.
[0161] When adjusting the model parameters, the cross entropy calculation can be first performed on the predicted point obtained above and the actual point corresponding to the next key point in the path, and the calculated result can be input into the optimizer, such as ADAM, RMSprop and other optimizers, and the model parameters can be adjusted according to the gradient descent method. When the input information of the model after adjusting the model parameters is the key point input above, the output result is close to the actual point corresponding to the next key point of the key point, thereby realizing the training of the above-mentioned preset neural network model.
[0162] If there is a difference between the next key point predicted in the prediction result and the actual key point in the above path, it means that there is a difference between the predicted next key point and the key point written by the user, which means that the hidden layer has not learned the user's handwriting. Therefore, it is necessary to adjust the parameters in the LSTM cell nodes in each sub-hidden layer to reduce the difference between the predicted key point and the user's handwritten key point.
[0163] As can be seen from the above, the structure of the preset neural network model provided in this embodiment includes an input layer, a hidden layer, and an output layer. The input layer preprocesses the sample data and adapts it to a data structure suitable for the model; the LSTM cell nodes contained in the hidden layer have a memory function, which can selectively retain and lose the features of the sample data, that is, it can strengthen and eliminate the features of the sample data, and input the eliminated and enhanced features as output results to the output layer; the output layer obtains the mixed probability distribution of the next key point based on the output result of the hidden layer, and samples the mixed probability distribution of the next key point to obtain a specific prediction point. In this way, the model parameters in the hidden layer are continuously adjusted according to the specific prediction points obtained, so that the preset neural network model can be trained to obtain a handwriting imitation model.
[0164] Corresponding to the above method embodiment, the embodiment of the present invention provides an information correction device, such as Figure 6 As shown, the above device comprises:
[0165] The image acquisition module 610 is used to obtain an image containing handwritten characters of the user as an image to be recognized;
[0166] The character recognition module 620 is used to perform character recognition on the image to be recognized to obtain the character to be detected;
[0167] The character matching module 630 is used to match the character to be detected with the characters in the preset dictionary to obtain a matching result;
[0168] A correction character obtaining module 640 is used to determine the wrong character in the characters to be detected based on the matching result, and obtain the correction character of the wrong character;
[0169] The handwriting imitation module 650 is used to imitate the handwriting of the user's handwritten revised characters by using a pre-trained handwriting imitation model, wherein the handwriting imitation model is a model obtained by training a preset neural network model using the handwriting of the user's handwritten characters and used to imitate the user's handwriting;
[0170] The handwriting correction module 660 is used to correct the handwriting of incorrect characters according to the imitated handwriting.
[0171] It can be seen that when the method provided in this embodiment is used to correct erroneous characters, the user does not need to manually erase the handwritten erroneous characters and then re-enter the correct characters. Instead, the handwriting of the user's handwritten correction characters is directly imitated to correct the erroneous characters. Therefore, the efficiency of obtaining the correct characters written by the user is improved, that is, the accuracy of the user's handwritten characters and the writing efficiency are improved.
[0172] In one embodiment of the present invention, the above-mentioned apparatus further includes: a model training module 670;
[0173] like Figure 7 As shown, the above-mentioned model training module 670 includes:
[0174] The handwriting collection submodule 670a is used to collect the handwriting of the user's handwritten characters;
[0175] The key point determination submodule 670b is used to determine the key points in the collected handwriting and obtain the path corresponding to the collected handwriting formed by the determined key points;
[0176] The actual character acquisition submodule 670c is used for obtaining the actual character corresponding to the collected handwriting;
[0177] The model training submodule 670d is used to input the above-mentioned actual characters and the above-mentioned path into the preset neural network model, and use the above-mentioned path as a training benchmark to train the preset neural network model to obtain a handwriting imitation model.
[0178] As can be seen from the above, when the method provided by this embodiment is used to train the preset neural network model, the path formed by the collected key points is used as the training benchmark. When there is a difference between the output result and the actual point, the parameters of the preset neural network model are adjusted to make the output result closer to the actual point. In this way, the preset neural network model after training is a handwriting imitation model.
[0179] In one embodiment of the present invention, the preset neural network model includes: an input layer, an output layer and a hidden layer, and the hidden layer includes a plurality of cascaded long short-term memory LSTM cell nodes;
[0180] The above-mentioned model training submodule 670d includes:
[0181] An information acquisition unit is used for the input layer to obtain actual characters and paths, and transmit the actual characters and paths to the hidden layer;
[0182] The cell node state updating unit is used for each LSTM cell node in the hidden layer. According to the order of each key point in the path, for each key point, combined with the output result of the LSTM cell node before the LSTM cell node, it updates its own state, and the last LSTM cell node inputs its output result to the output layer. Each LSTM cell node removes the first type of features from the features of the current key point and the features of the previous key point, and strengthens the second type of features, wherein the first type of features are: features that do not affect the prediction result of the next key point, and the second type of features are: features that affect the prediction result of the next key point.
[0183] The parameter adjustment unit is used for the output layer to obtain the mixed probability distribution of the next key point according to the output result of the last LSTM cell node, sample the obtained mixed probability distribution, and obtain the predicted point of the next key point according to the sampling result; adjust the model parameters according to the obtained predicted point and the actual point corresponding to the next key point in the path.
[0184] As can be seen from the above, the structure of the preset neural network model provided in this embodiment includes an input layer, a hidden layer, and an output layer. The input layer preprocesses the sample data and adapts it to a data structure suitable for the model; the LSTM cell nodes contained in the hidden layer have a memory function, which can selectively retain and lose the features of the sample data, that is, it can strengthen and eliminate the features of the sample data, and input the eliminated and enhanced features as output results to the output layer; the output layer obtains the mixed probability distribution of the next key point based on the output result of the hidden layer, and samples the mixed probability distribution of the next key point to obtain a specific prediction point. In this way, the model parameters in the hidden layer are continuously adjusted according to the specific prediction points obtained, so that the preset neural network model can be trained to obtain a handwriting imitation model.
[0185] In one embodiment, the hidden layer further includes a convolutional window layer; wherein the convolutional window layer is located between the first LSTM cell node and the second LSTM cell node in the hidden layer;
[0186] The input information of the above convolutional window layer includes: the actual character and the output result of the first LSTM cell node;
[0187] The input information of the first LSTM cell node in the hidden layer includes: the previous state of the LSTM cell node, the key points in the path, and the previous output information of the convolution window layer;
[0188] The input information of other LSTM cell nodes in the hidden layer includes: the previous state of the LSTM cell node, the key points in the path, the output result of the previous LSTM cell node, and the output result of the convolution window layer.
[0189] In one embodiment of the present invention, the handwriting imitation model is a model constructed based on a mixture density network (MDN).
[0190] In one embodiment of the present invention, the handwriting imitation module 650 is specifically used for:
[0191] Obtain the starting point coordinates of the character to be detected in the image to be recognized;
[0192] The correction character and the starting point coordinates are used as input information to a pre-trained handwriting imitation model to predict various key points when the user writes the correction character;
[0193] The handwriting represented by the path formed by the predicted key points is determined as the handwriting of the user writing the above-mentioned revised character.
[0194] As can be seen from the above, the solution provided by this embodiment uses a pre-trained handwriting imitation model to imitate the handwriting of the user's handwritten characters, thereby improving the accuracy and writing efficiency of the user's handwritten characters.
[0195] Corresponding to the above method embodiment, the embodiment of the present invention further provides an electronic device, such as Figure 8 As shown, it includes a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804.
[0196] Memory 803, used for storing computer programs;
[0197] The processor 801 is used to implement any one of the information correction method steps provided in the embodiment of the present invention when executing the program stored in the memory 803.
[0198] In one embodiment of the present invention, a method for correcting information is provided, which includes: obtaining an image of handwriting containing handwritten characters of a user as an image to be recognized; performing character recognition on the image to be recognized to obtain characters to be detected; matching the characters to be detected with characters in a preset dictionary to obtain matching results; based on the matching results, determining erroneous characters in the characters to be detected, and obtaining corrected characters for the erroneous characters; using a pre-trained handwriting imitation model to imitate the handwriting of the user's handwritten corrected characters, wherein the handwriting imitation model is: a model obtained by training a preset neural network model using the handwriting of the user's handwritten characters and used to imitate the user's handwritten handwriting; and correcting the handwriting of the erroneous characters according to the imitated handwriting.
[0199] It can be seen that when the electronic device provided by this embodiment is used to correct the wrong characters, the handwriting of the user can be directly imitated to correct the wrong characters into the handwriting of the corrected characters written by the user, thereby reducing the time of obtaining the correct characters written by the user. The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0200] The communication interface is used for communication between the above electronic device and other devices.
[0201] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0202] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0203] In another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned information correction methods are implemented.
[0204] In another embodiment of the present invention, a computer program product including instructions is provided, which, when executed on a computer, enables the computer to execute any one of the information correction methods in the above embodiments.
[0205] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0206] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0207] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, and computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0208] The above are only preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. An information correction method, characterized in that: The method comprises: Obtaining an image containing handwritten characters of a user as an image to be recognized; Performing character recognition on the image to be recognized to obtain characters to be detected; Matching the character to be detected with characters in a preset dictionary to obtain a matching result; Based on the matching result, determining the wrong character in the characters to be detected, and obtaining a corrected character for the wrong character; Using a pre-trained handwriting imitation model to imitate the handwriting of the user writing the modified character, wherein the handwriting imitation model is: a model for imitating the user's handwriting obtained by training a preset neural network model using the handwriting of the user's handwritten character; Correcting the handwriting of the erroneous characters according to the imitated handwriting; The handwriting imitation model is trained in the following way: Collecting handwriting of user's handwritten characters; Determine key points in the collected handwriting, and obtain a path corresponding to the collected handwriting formed by the determined key points; Obtaining actual characters corresponding to the collected handwriting; Inputting the actual character and the path into a preset neural network model, and using the path as a training reference to train the preset neural network model to obtain the handwriting imitation model; When the path is input into the preset neural network model, each key point forming the path is input into the preset neural network model in sequence; wherein the order of inputting each key point into the preset neural network model is the order corresponding to the motion trajectory of the finger or stylus when the user writes characters; For each key point, after the key point is input into the preset neural network model, the preset neural network model predicts the next key point of the key point according to the key point to obtain a predicted point of the next key point; Comparing the actual point corresponding to the next key point of the key point with the predicted point, and adjusting the model parameters in the preset neural network model according to the difference between the actual point and the predicted point obtained by comparison; The method of using a pre-trained handwriting imitation model to imitate the handwriting of the revised character by the user includes: A pre-trained handwriting imitation model is used to determine the handwriting represented by the path formed by each key point predicted by the handwriting imitation model as the handwriting of the user writing the modified character.
2. The method according to claim 1, characterized in that The preset neural network model includes: an input layer, an output layer and a hidden layer, wherein the hidden layer includes a plurality of cascaded long short-term memory (LSTM) cell nodes; The step of inputting the actual character and the path into a preset neural network model, and using the path as a training reference to train the preset neural network model to obtain the handwriting imitation model comprises: The input layer obtains the actual character and the path, and transmits the actual character and the path to the hidden layer; Each LSTM cell node in the hidden layer updates its own state for each key point in the order of the key points in the path in combination with the output results of the LSTM cell node before the LSTM cell node, and the last LSTM cell node inputs its output result to the output layer. Each LSTM cell node removes the first type of features from the features of the current key point and the features of the previous key point, and strengthens the second type of features, wherein the first type of features are: features that do not affect the prediction results of the next key point, and the second type of features are: features that affect the prediction results of the next key point; The output layer obtains the mixed probability distribution of the next key point according to the output result of the last LSTM cell node, samples the obtained mixed probability distribution, and obtains the predicted point of the next key point according to the sampling result; and adjusts the model parameters according to the obtained predicted point and the actual point corresponding to the next key point in the path corresponding to the collected handwriting.
3. The method according to claim 2, characterized in that The hidden layer also includes a convolution window layer; wherein the convolution window layer is located between the first LSTM cell node and the second LSTM cell node in the hidden layer; The input information of the convolution window layer includes: the actual character and the output result of the first LSTM cell node; The input information of the first LSTM cell node in the hidden layer includes: the previous state of the first LSTM cell node, the key points in the path, and the previous output information of the convolution window layer; The input information of other LSTM cell nodes in the hidden layer includes: the last state of the other LSTM cell nodes, the key points in the path, the output result of the previous LSTM cell node and the output result of the convolution window layer.
4. The method according to claim 1, characterized in that: The handwriting imitation model is a model built based on a mixture density network (MDN).
5. The method according to any one of claims 1 to 4, characterized in that The method of using a pre-trained handwriting imitation model to imitate the handwriting of the revised character by the user includes: Obtaining the starting point coordinates of the character to be detected in the image to be recognized; The modified character and the starting point coordinates are used as input information and input into a pre-trained handwriting imitation model to predict various key points when the user writes the modified character; The handwriting represented by the path formed by the predicted key points is determined as the handwriting of the user writing the revised character.
6. An information correction device, characterized in that: The device comprises: An image acquisition module is used to acquire an image containing handwritten characters of a user as an image to be recognized; A character recognition module is used to perform character recognition on the image to be recognized to obtain the character to be detected; A character matching module is used to match the character to be detected with the characters in a preset dictionary to obtain a matching result; A correction character obtaining module is used to determine the wrong character in the characters to be detected based on the matching results, and obtain the correction character of the wrong character; A handwriting imitation module, used to imitate the handwriting of the user's handwritten corrected characters by using a pre-trained handwriting imitation model, wherein the handwriting imitation model is: a model obtained by training a preset neural network model using the handwriting of the user's handwritten characters and used to imitate the user's handwriting; A handwriting correction module, used for correcting the handwriting of wrong characters according to the imitated handwriting; The device also includes: a model training module; Wherein, the model training module includes: A handwriting collection submodule is used to collect the handwriting of the user's handwritten characters; A key point determination submodule, used to determine the key points in the collected handwriting, and obtain the path corresponding to the collected handwriting formed by the determined key points; The actual character acquisition submodule is used for the actual characters corresponding to the collected handwriting; A model training submodule, used for inputting the actual character and the path into a preset neural network model, and using the path as a training reference to train the preset neural network model to obtain the handwriting imitation model; When the path is input into the preset neural network model, each key point forming the path is input into the preset neural network model in sequence; wherein the order of inputting each key point into the preset neural network model is the order corresponding to the motion trajectory of the finger or stylus when the user writes characters; For each key point, after the key point is input into the preset neural network model, the preset neural network model predicts the next key point of the key point according to the key point to obtain a predicted point of the next key point; Comparing the actual point corresponding to the next key point of the key point with the predicted point, and adjusting the model parameters in the preset neural network model according to the difference between the actual point and the predicted point obtained by comparison; The handwriting imitation module is specifically used for: A pre-trained handwriting imitation model is used to determine the handwriting represented by the path formed by each key point predicted by the handwriting imitation model as the handwriting of the user writing the modified character.
7. The device according to claim 6, characterized in that The preset neural network model includes: an input layer, an output layer and a hidden layer, wherein the hidden layer includes a plurality of cascaded long short-term memory (LSTM) cell nodes; The model training submodule includes: An information obtaining unit, used for the input layer to obtain the actual character and the path, and transmit the actual character and the path to the hidden layer; A cell node state updating unit is used for each LSTM cell node in the hidden layer. According to the order of each key point in the path, for each key point, combined with the output result of the LSTM cell node before the LSTM cell node, the state of the cell node is updated, and the last LSTM cell node inputs its output result to the output layer. Each LSTM cell node removes the first type of features from the features of the current key point and the features of the previous key point, and strengthens the second type of features, wherein the first type of features are: features that do not affect the prediction result of the next key point, and the second type of features are: features that affect the prediction result of the next key point; A parameter adjustment unit is used for the output layer to obtain the mixed probability distribution of the next key point according to the output result of the last LSTM cell node, sample the obtained mixed probability distribution, and obtain the predicted point of the next key point according to the sampling result; adjust the model parameters according to the obtained predicted point and the actual point corresponding to the next key point in the path.
8. The device according to claim 7, characterized in that The hidden layer also includes a convolution window layer; wherein the convolution window layer is located between the first LSTM cell node and the second LSTM cell node in the hidden layer; The input information of the convolution window layer includes: the actual character and the output result of the first LSTM cell node; The input information of the first LSTM cell node in the hidden layer includes: the previous state of the first LSTM cell node, the key points in the path, and the previous output information of the convolution window layer; The input information of other LSTM cell nodes in the hidden layer includes: the last state of the other LSTM cell nodes, the key points in the path, the output result of the previous LSTM cell node and the output result of the convolution window layer.
9. The device according to claim 6, characterized in that The handwriting imitation model is a model built based on a mixture density network (MDN).
10. The device according to any one of claims 6 to 9, characterized in that: The handwriting imitation module is specifically used for: Obtaining the starting point coordinates of the character to be detected in the image to be recognized; The modified character and the starting point coordinates are used as input information and input into a pre-trained handwriting imitation model to predict various key points when the user writes the modified character; The handwriting represented by the path formed by the predicted key points is determined as the handwriting of the user writing the revised character.
11. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, used to implement the information correction method steps described in any one of claims 1-5 when executing a program stored in a memory.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps for correcting information according to any one of claims 1 to 5 are implemented.
