Statement error correction method and system for AI education robot
By standardizing the data images of statement error correction in AI education robots and neural network training, a statement error correction model is generated, which solves the problem of insufficient accuracy of statement error correction in the existing technology, and achieves a more efficient statement error correction effect.
Patent Information
- Application Number
- CN202411634720.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-03-07
AI Technical Summary
Existing statement error correction techniques are difficult to effectively deal with complex contexts and diverse language expressions, resulting in insufficient accuracy of statement error correction in AI education robots.
By standardizing the data images, including grayscale processing and denoising processing, the noise introduced under different acquisition conditions is eliminated, thereby optimizing the text recognition process. Then, the standardized text image is input into the neural network for training, and a statement error correction model is generated to complete the error correction of the target text image.
Through standardized processing and neural network training, the accuracy of statement error correction is improved, and complex contexts and diverse language expressions can be handled more effectively.
Smart Images

Figure CN119578404A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sentence error correction, and in particular to a sentence error correction method and system for an AI educational robot. Background Art
[0002] With the rapid development of artificial intelligence technology, the application of AI educational robots in the field of education has gradually become popular, providing students with a personalized learning experience. However, although AI educational robots have obvious advantages in knowledge transfer and interactive learning, there are still many challenges in sentence correction.
[0003] Existing sentence correction technologies are mostly based on traditional rule matching methods, which are often unable to effectively handle complex contexts and diverse language expressions. Summary of the invention
[0004] To solve the above problems, an embodiment of the present invention aims to provide a sentence error correction method and system for an AI educational robot.
[0005] A sentence error correction method for an AI educational robot, comprising:
[0006] Step 1: Obtain the data image to be corrected;
[0007] Step 2: performing standardization processing on the data image to obtain a standardized data image;
[0008] Step 3: Identify the position of the text area from the standardized data image as the text image to be corrected;
[0009] Step 4: Input the text image to be corrected into the neural network for training to obtain a sentence correction model;
[0010] Step 5: Use the sentence error correction model to complete error correction of the target text image.
[0011] Preferably, the step 2: performing standardization processing on the data image to obtain a standardized data image comprises:
[0012] Step 2.1: grayscale the data image to obtain a grayscale data image;
[0013] Step 2.2: taking a neighborhood window from the grayscale data image;
[0014] Step 2.3: Calculate the distance coefficient between the center point and the remaining pixels in the neighborhood window;
[0015] Step 2.4: De-noising the data image based on the distance coefficient to obtain a standardized data image.
[0016] Preferably, the step 2.3: calculating the distance coefficient between the center point in the neighborhood window and the remaining pixel points includes:
[0017] Using the formula:
[0018]
[0019] Calculate the distance coefficient; where ω(i,j,x,y) represents the distance coefficient, k represents the size of the neighborhood window, I(i+u,j+v) represents the remaining pixels, I(x,y) represents the center point in the neighborhood window, and h represents the adjustment parameter.
[0020] Preferably, the step 2.4: performing denoising on the data image based on the distance coefficient to obtain a standardized data image comprises:
[0021] Based on the distance coefficient, the remaining pixel points in the neighborhood window are weighted averaged to obtain a weighted average pixel value, and the weighted average pixel value is used as the new center pixel value in the neighborhood window to obtain a standardized data image; wherein the weighted average formula is:
[0022]
[0023] Among them, J(i,j) represents the pixel value after weighted average, and C(i,j) represents the normalization coefficient.
[0024] Preferably, the step 3: identifying the position of the text area from the standardized document image as the text image to be corrected includes:
[0025] Step 3.1: Input the standardized data image into the target detection network;
[0026] Step 3.2: Use the loss function to optimize the object detection network and obtain a text area recognition model;
[0027] Step 3.3: Using the text area recognition model, the position of the text area is identified from the standardized document image as the text image to be corrected.
[0028] Preferably, in step 3.2, the loss function includes: a coordinate frame position loss function and a classification probability loss function; wherein the coordinate frame position loss function is:
[0029]
[0030] Among them, L CIoU represents the coordinate frame position loss function, IoU represents the intersection over union ratio, ρ2 (b,b ge ) represents the square of the Euclidean distance between the center point of the predicted box and the real box, c represents the diagonal distance of the minimum closure box, α represents the trade-off coefficient, v represents the aspect ratio of the predicted box and the real box, and w gt Indicates the width of the real box, h gt represents the height of the real box, w represents the width of the predicted box, and h represents the height of the predicted box;
[0031] The classification probability loss function is:
[0032]
[0033] Among them, L CIoU represents the classification probability loss function, N represents the number of samples, y i represents the predicted value output by the target detection network, represents the true label of the sample, and σ represents the activation function.
[0034] The present invention also provides a sentence error correction system for an AI educational robot, comprising:
[0035] A data image acquisition module, used to acquire a data image to be corrected;
[0036] A standardization processing module, used for performing standardization processing on the data image to obtain a standardized data image;
[0037] A text area recognition module, used to recognize the position of the text area from the standardized data image as the text image to be corrected;
[0038] A training module is used to input the text image to be corrected into the neural network for training to obtain a sentence correction model;
[0039] The error correction module is used to use the sentence error correction model to complete error correction of the target text image.
[0040] The present invention also provides an electronic device, comprising a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the transceiver, the memory, and the processor are connected via the bus, and wherein the computer program, when executed by the processor, implements the steps in the above-mentioned sentence error correction method for an AI educational robot.
[0041] The present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps in the above-mentioned sentence error correction method for an AI educational robot are implemented.
[0042] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0043] The present invention relates to a sentence correction method and system for an AI educational robot. Compared with the prior art, the present invention helps to eliminate noise introduced under different acquisition conditions by performing standardized processing on data images, thereby optimizing the subsequent text recognition process and improving the accuracy of sentence correction.
[0044] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] 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.
[0046] Figure 1 A flow chart of a sentence error correction method for an AI educational robot provided by the present invention.
[0047] Figure 2 This is a schematic diagram of the target detection network provided by the present invention. DETAILED DESCRIPTION
[0048] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.
[0049] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0050] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0051] See also Figure 1 , a sentence error correction method for an AI educational robot, comprising:
[0052] Step 1: Obtain the data image to be corrected;
[0053] Step 2: performing standardization processing on the data image to obtain a standardized data image;
[0054] Furthermore, the step 2 comprises:
[0055] Step 2.1: Grayscale the document image to obtain a grayscale document image; grayscale processing can convert a color image into a single-channel grayscale image, reducing the amount of data required in the processing process. This can significantly reduce the computational complexity of image processing and neural network training, thereby increasing the speed of training and reasoning. In addition, grayscale images emphasize light and dark changes and have higher contrast, which helps to highlight the difference between the text area and the background. This feature makes it easier for the system to find text under different lighting conditions or backgrounds when identifying text areas.
[0056] Step 2.2: taking a neighborhood window from the grayscale data image;
[0057] Step 2.3: Calculate the distance coefficient between the center point and the remaining pixels in the neighborhood window;
[0058] In step 2.3, the present invention may adopt the formula:
[0059]
[0060] Calculate the distance coefficient; where ω(i,j,x,y) represents the distance coefficient, k represents the size of the neighborhood window, I(i+u,j+v) represents the remaining pixels, I(x,y) represents the center point in the neighborhood window, and h represents the adjustment parameter.
[0061] Step 2.4: De-noising the data image based on the distance coefficient to obtain a standardized data image.
[0062] In step 2.4, the present invention can perform weighted averaging on the remaining pixel points in the neighborhood window based on the distance coefficient to obtain a weighted average pixel value, and use the weighted average pixel value as the new center pixel value in the neighborhood window to obtain a standardized data image; wherein the weighted average formula is:
[0063]
[0064] Among them, J(i,j) represents the pixel value after weighted average, and C(i,j) represents the normalization coefficient.
[0065] The present invention can dynamically adjust the denoising strength according to local information by weighted averaging the pixel values of the neighborhood window. For areas with more noise, the algorithm will enhance the denoising effect, while in areas with rich textures, the denoising will be relatively weakened, so that while removing noise, important features such as edges and textures can be retained, thereby avoiding information loss caused by over-smoothing.
[0066] Step 3: Identify the position of the text area from the standardized data image as the text image to be corrected;
[0067] Furthermore, step 3 includes:
[0068] Step 3.1: Input the standardized data image into the target detection network; Figure 2 As shown,
[0069] The target detection network (YOLOv5 network) includes a backbone feature extraction network (Backbone), a feature fusion network (Neck) and a detection head (Head). Backbone includes Focus, CSP and SPP modules. The Focus module slices the feature map before entering the Backbone, taking a value for every other pixel, similar to a downsampling operation. Each channel map generates four images, which are complementary, and the width and height information is concentrated in the channel. The input channel is expanded by 4 times to avoid information loss. The CSP module divides the input feature map into two parts. One part of the feature map is directly passed through a short connection, and the other part is processed by multiple residual blocks and spliced with the previous feature map at a certain stage. Then, the spliced feature map is further convolved, mainly to enhance the feature representation capability. The SPP module performs maximum pooling operations of different sizes on the input feature map, and then splices the feature maps obtained by these different pooling scales with the original feature map to form a new feature map. This module enhances the multi-scale information of the feature map and improves the network's detection capability for targets of different scales.
[0070] Step 3.2: Use the loss function to optimize the object detection network and obtain a text area recognition model;
[0071] In step 3.2, the loss function includes: a coordinate frame position loss function and a classification probability loss function; wherein the coordinate frame position loss function is:
[0072]
[0073] Among them, L CIoU represents the coordinate frame position loss function, IoU represents the intersection over union ratio, ρ 2 (b,b ge ) represents the square of the Euclidean distance between the center point of the predicted box and the real box, c represents the diagonal distance of the minimum closure box, α represents the trade-off coefficient, v represents the aspect ratio of the predicted box and the real box, and w gt Indicates the width of the real box, h gt represents the height of the real box, w represents the width of the predicted box, and h represents the height of the predicted box;
[0074] The classification probability loss function is:
[0075]
[0076] Among them, L CIoU represents the classification probability loss function, N represents the number of samples, y i represents the predicted value output by the target detection network, represents the true label of the sample, and σ represents the activation function.
[0077] Step 3.3: using the text region recognition model to identify the position of the text region from the standardized document image as the text image to be corrected;
[0078] Step 4: Input the text image to be corrected into the neural network for training to obtain a sentence correction model;
[0079] In step 4, the present invention needs to extract the features of the text image to be corrected, wherein the feature extraction formula is:
[0080]
[0081] Wherein, F represents the text image to be corrected, F″ represents the feature of the text image to be corrected, Conv1, Conv3 and Conv6 represent 1×1×1 convolution, Conv2 and Conv5 represent 3×3×3 convolution, Cat represents splicing operation, Maxpool represents maximum pooling, and then input into a neural network for training to obtain a sentence correction model. The present invention can convert high-dimensional image data into a low-dimensional feature map by inputting the extracted features of the text image to be corrected into a neural network model for training, thereby removing redundant information and retaining important features. In this way, the computational complexity and storage requirements of the neural network can be reduced.
[0082] The present invention helps to eliminate noise introduced under different acquisition conditions by performing standardization processing on data images, thereby optimizing the subsequent text recognition process and improving the accuracy of sentence error correction.
[0083] Step 5: Use the sentence error correction model to complete error correction of the target text image.
[0084] The present invention also provides a sentence error correction system for an AI educational robot, comprising:
[0085] A data image acquisition module, used to acquire a data image to be corrected;
[0086] A standardization processing module, used for performing standardization processing on the data image to obtain a standardized data image;
[0087] A text area recognition module, used to recognize the position of the text area from the standardized data image as the text image to be corrected;
[0088] A training module is used to input the text image to be corrected into the neural network for training to obtain a sentence correction model;
[0089] The error correction module is used to use the sentence error correction model to complete error correction of the target text image.
[0090] Compared with the prior art, the beneficial effects of the sentence correction system for an AI educational robot provided by the present invention are the same as the beneficial effects of the sentence correction method for an AI educational robot described in the above technical solution, which will not be repeated here.
[0091] The present invention also provides an electronic device, comprising a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the transceiver, the memory, and the processor are connected via the bus, and is characterized in that when the computer program is executed by the processor, the steps in the above-mentioned method for correcting sentences of an AI educational robot are implemented. Compared with the prior art, the beneficial effects of the electronic device provided by the present invention are the same as the beneficial effects of the method for correcting sentences of an AI educational robot described in the above-mentioned technical solution, and are not elaborated herein.
[0092] The present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps in the above-mentioned method for correcting sentences for an AI educational robot are implemented. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present invention are the same as the beneficial effects of the method for correcting sentences for an AI educational robot described in the above-mentioned technical solution, which will not be repeated here.
[0093] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technical solution that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A sentence error correction method for an AI educational robot, characterized in that: include: Step 1: Obtain the data image to be corrected; Step 2: performing standardization processing on the data image to obtain a standardized data image; Step 3: Identify the position of the text area from the standardized data image as the text image to be corrected; Step 4: Input the text image to be corrected into the neural network for training to obtain a sentence correction model; Step 5: Use the sentence error correction model to complete error correction of the target text image.
2. A sentence error correction method for an AI educational robot according to claim 1, characterized in that: The step 2: performing standardization processing on the data image to obtain a standardized data image includes: Step 2.1: grayscale the data image to obtain a grayscale data image; Step 2.2: taking a neighborhood window from the grayscale data image; Step 2.3: Calculate the distance coefficient between the center point and the remaining pixels in the neighborhood window; Step 2.4: De-noising the data image based on the distance coefficient to obtain a standardized data image.
3. A sentence error correction method for an AI educational robot according to claim 2, characterized in that: The step 2.3: calculating the distance coefficient between the center point and the remaining pixel points in the neighborhood window includes: Using the formula: Calculate the distance coefficient; where ω(i,j,x,y) represents the distance coefficient, k represents the size of the neighborhood window, I(i+u,j+v) represents the remaining pixels, I(x,y) represents the center point in the neighborhood window, and h represents the adjustment parameter.
4. A sentence error correction method for an AI educational robot according to claim 3, characterized in that: The step 2.4: performing denoising on the data image based on the distance coefficient to obtain a standardized data image, comprises: Based on the distance coefficient, the remaining pixel points in the neighborhood window are weighted averaged to obtain a weighted average pixel value, and the weighted average pixel value is used as the new center pixel value in the neighborhood window to obtain a standardized data image; wherein the weighted average formula is: Among them, J(i,j) represents the pixel value after weighted average, and C(i,j) represents the normalization coefficient.
5. A sentence error correction method for an AI educational robot according to claim 4, characterized in that: The step 3: identifying the position of the text area from the standardized document image as the text image to be corrected, includes: Step 3.1: Input the standardized data image into the target detection network; Step 3.2: Use the loss function to optimize the object detection network and obtain a text area recognition model; Step 3.3: Using the text area recognition model, identify the location of the text area from the standardized document image as the text image to be corrected.
6. A sentence error correction method for an AI educational robot according to claim 5, characterized in that: In step 3.2, the loss function includes: a coordinate frame position loss function and a classification probability loss function; wherein the coordinate frame position loss function is: Among them, L CIoU represents the coordinate frame position loss function, IoU represents the intersection over union ratio, ρ 2 (b,b ge ) represents the square of the Euclidean distance between the center point of the predicted box and the real box, c represents the diagonal distance of the minimum closure box, α represents the trade-off coefficient, v represents the aspect ratio of the predicted box and the real box, and w gt Indicates the width of the real box, h gt represents the height of the real box, w represents the width of the predicted box, and h represents the height of the predicted box; The classification probability loss function is: Among them, L CIoU represents the classification probability loss function, N represents the number of samples, y i represents the predicted value output by the target detection network, represents the true label of the sample, and σ represents the activation function.
7. A sentence correction system for an AI educational robot, characterized in that: include: A data image acquisition module, used to acquire a data image to be corrected; A standardization processing module, used for performing standardization processing on the data image to obtain a standardized data image; A text area recognition module, used to recognize the position of the text area from the standardized data image as the text image to be corrected; A training module is used to input the text image to be corrected into the neural network for training to obtain a sentence correction model; The error correction module is used to use the sentence error correction model to complete error correction of the target text image.
8. An electronic device, comprising a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the transceiver, the memory, and the processor are connected via the bus, wherein: When the computer program is executed by the processor, the steps of a sentence error correction method for an AI educational robot as described in any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, the steps of a sentence error correction method for an AI educational robot as described in any one of claims 1 to 6 are implemented.