Mental language text image recognition wrong character correction method and system

By combining OCR and large language model methods, using wavelet transformation, morphological contour features and semantic character annotation, the recognition accuracy and typo correction of small language OCR systems in complex scenarios are solved, and efficient character recognition and typo correction are achieved.

CN120235736APending Publication Date: 2025-07-01GLOBAL TONE COMM TECH
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510302126.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

The OCR system of small languages ​​has low recognition accuracy and insufficient typo correction ability in complex scenarios, especially when dealing with new words, foreign words and proper nouns, and it is difficult for existing methods to effectively utilize context information and small language features.

Method used

Combining OCR technology and large language model, through wavelet transform denoising, morphological contour features, support vector machine classification, character slicing model and corpus matching, combined with part-of-speech annotation and semantic role annotation, multiple candidate characters are generated and replacement characters with the highest semantic similarity are selected.

Benefits of technology

It improves the accuracy of character recognition and typo correction ability of small languages, adapts to the characteristics of different small languages, reduces the cost of dictionary maintenance, enhances the adaptability and flexibility of the system, and maintains high recognition accuracy in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120235736A_ABST
    Figure CN120235736A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for correcting wrong words in minority language text image recognition, and the method comprises the steps: obtaining a minority language text image, removing the high-frequency noise of the minority language text image through employing a preset adaptive threshold denoising algorithm based on wavelet transformation, and generating a denoised image. The morphological contour features of at least one character are extracted from the denoised image, the morphological contour features comprise stroke thickness, stroke number and stroke order direction, the features are input into a support vector machine classification model, the language category of the denoised image is determined, and a language classification result is generated. And loading a corresponding character segmentation model and a corpus according to a language classification result, carrying out character-by-character segmentation and pattern matching identification on the denoised image, and generating a preliminary identification result and an identification confidence score of each character. According to the method for correcting the wrong words in the text image recognition of the minority language, the accuracy of character recognition of the minority language and the capability of correcting the wrong words are improved, and recognition challenges in complex scenes can be coped with.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the technical field of small language recognition, and in particular, to a method and system for correcting misspelled words in small language text image recognition. Background Art

[0002] In the field of small language optical character recognition (OCR), due to the complex structure of small language characters, small differences between characters, and limited corpus size, the OCR system faces problems of low recognition accuracy and insufficient misspelled word correction ability in practical applications. Especially in the scenario of taking pictures, the text image may be affected by factors such as light, angle, and background interference, further exacerbating the risk of character misrecognition. In the prior art, the misspelled word correction method based on dictionary matching can handle known words, but has weak processing ability for new words, foreign words, and proper nouns, and the cost of dictionary maintenance and update is relatively high. The method based on statistical large language models can correct misspelled words by calculating the combination probability of characters or words, but due to the limited size of the small language corpus, the statistical model is difficult to comprehensively capture the language characteristics, resulting in poor correction effects. In addition, existing OCR systems usually process each character or word independently, ignoring the logical relationship of the context in the text, resulting in difficulty in ensuring the accuracy of misspelled word correction in scenarios with long sentences or containing technical terms. These problems make it difficult for small language OCR systems to meet the requirements of high-precision recognition and efficient misspelled word correction in practical applications. Especially in complex scenarios, the recognition error rate increases significantly, affecting the applicability and reliability of the system. Summary of the Invention

[0003] Embodiments of the present invention provide a method and system for correcting misspelled words in small language text image recognition. By combining OCR technology and large language models, and using character morphological contour features, context semantic information, and pre-trained small language text generation models, the accuracy of small language character recognition and the ability to correct misspelled words are improved, and the recognition challenges in complex scenarios can be addressed.

[0004] To achieve the above object, in a first aspect, the present invention provides a method for correcting misspelled words in small language text images, including: obtaining a small language text image, removing high-frequency noise in the small language text image by using a preset adaptive threshold denoising algorithm based on wavelet transform to generate a denoised image; extracting morphological contour features of at least one character from the denoised image, where the morphological contour features include stroke thickness, stroke number, and stroke order direction, and inputting the features into a support vector machine classification model to determine the language category of the denoised image and generate a language classification result; loading a corresponding character segmentation model and corpus according to the language classification result, performing character-by-character segmentation and pattern matching recognition on the denoised image to generate a preliminary recognition result and a recognition confidence score for each character; if the recognition confidence score is lower than a preset threshold, marking it as a suspected misspelled word, using a part-of-speech tagging algorithm to determine the position and context information of the suspected misspelled word in the original text, and generating suspected misspelled word semantic information; generating multiple candidate characters through a pre-trained small language text generation model according to the stroke structure layout and glyph integrity of the suspected misspelled word; using a semantic role labeling algorithm to calculate the semantic similarity between each candidate character and the suspected misspelled word semantic information, and selecting the candidate character with the highest similarity as the optimal replacement character; updating the optimal replacement character to the preliminary recognition result and outputting the corrected text.

[0005] In a second aspect, the present invention provides a system for correcting misspelled words in small language text images, including: a first generation module, a second generation module, a third generation module, a fourth generation module, a fifth generation module, a selection module, and an output module. The first generation module is used to obtain a small language text image and remove high-frequency noise in the small language text image by using a preset adaptive threshold denoising algorithm based on wavelet transform to generate a denoised image. The second generation module is used to extract morphological contour features of at least one character from the denoised image, where the morphological contour features include stroke thickness, stroke number, and stroke order direction, and input the features into a support vector machine classification model to determine the language category of the denoised image and generate a language classification result. The third generation module is used to load a corresponding character segmentation model and corpus according to the language classification result, perform character-by-character segmentation and pattern matching recognition on the denoised image to generate a preliminary recognition result and a recognition confidence score for each character. The fourth generation module is used to, if the recognition confidence score is lower than a preset threshold, mark it as a suspected misspelled word, use a part-of-speech tagging algorithm to determine the position and context information of the suspected misspelled word in the original text, and generate suspected misspelled word semantic information. The fifth generation module is used to generate multiple candidate characters through a pre-trained small language text generation model according to the stroke structure layout and glyph integrity of the suspected misspelled word. The selection module is used to use a semantic role labeling algorithm to calculate the semantic similarity between each candidate character and the suspected misspelled word semantic information, and select the candidate character with the highest similarity as the optimal replacement character. The output module is used to update the optimal replacement character to the preliminary recognition result and output the corrected text.

[0006] In a third aspect, the present invention provides an electronic device, including: at least one processor; and

[0007] a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method for correcting misspelled words in small language text images as described above.

[0008] In a fourth aspect, the present invention provides a computer-readable storage medium, including a computer program and instructions, which, when the computer program or instructions are run on a computer, cause the computer to execute the method for correcting misspelled words in small language text images as described above.

[0009] Compared with the prior art, the method and system for correcting misspelled words in small language text images according to the present invention have the following beneficial effects:

[0010] 1. By adopting the adaptive threshold denoising algorithm based on wavelet transform, the high-frequency noise in the small language text image is effectively removed, the image quality is improved, and thus a clearer basis is provided for subsequent character recognition; by combining morphological contour features (such as stroke thickness, stroke number and stroke order direction) and the support vector machine classification model, the language category can be determined more accurately, and the corresponding character segmentation model and corpus are loaded, improving the accuracy of character recognition.

[0011] 2. By calculating the recognition confidence score, marking the suspected misspelled words, and using the part-of-speech tagging algorithm and semantic role labeling algorithm to analyze the context of the suspected misspelled words, generating the semantic information of the suspected misspelled words, providing richer context information for misspelled word correction; according to the stroke structure layout and glyph integrity of the suspected misspelled words, generating multiple candidate characters through the pre-trained small language text generation model, and selecting the candidate character with the highest semantic similarity as the optimal replacement character, effectively improving the accuracy and intelligence level of misspelled word correction.

[0012] 3. The method and system can adapt to the characteristics of different small languages. By loading the corresponding character segmentation model and corpus, accurate recognition and misspelled word correction of different small languages are realized; by combining context and semantic similarity analysis, new words, foreign words and proper nouns can be better processed, enhancing the adaptability and flexibility of the system.

[0013] 4. By comprehensively applying various technologies such as image processing, machine learning, and natural language processing, a complete system for correcting misspelled words in small language text images is constructed, improving the overall performance and reliability of the system; it can maintain a high recognition accuracy and misspelled word correction ability in complex scenarios (such as light, angle, background interference, etc. in the photo-taking scenario), enhancing the applicability and practicality of the system.

[0014] 5. Compared with the typo correction method based on dictionary matching, the present invention reduces the maintenance and update costs of the dictionary because it no longer relies entirely on the dictionary to identify new words or proper nouns; through the pre-trained small language text generation model and semantic similarity analysis, the system can automatically learn and adapt to new language features, reducing the cost of manual intervention. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 is a schematic flow chart of a method for correcting typos in small language text image recognition in the first embodiment of the present invention;

[0016] Figure 2 is a schematic structural diagram of a system for correcting typos in small language text image recognition in the second embodiment of the present invention;

[0017] Figure 3 is a schematic structural diagram of an electronic device in the third embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0018] The following further describes the embodiments of the present invention in detail with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the embodiments of the present invention, rather than limiting the embodiments of the present invention. In addition, it should be noted that for the sake of description, only parts related to the embodiments of the present invention are shown in the drawings, rather than all the structures.

[0019] For the convenience of understanding, the main implementation concepts of the embodiments of the present invention are first briefly described.

[0020] With the development of Optical Character Recognition (OCR) technology, it has been widely used in the fields of text digitization, document management, translation, and search engines. OCR technology has achieved remarkable results in text recognition of mainstream languages (such as English, Chinese, French, etc.). However, for small languages (such as Swahili, Tamil, Tibetan, Urdu, etc.), there is still a large room for improvement in the recognition accuracy of OCR. These small languages usually have the following characteristics: complex character structures, small differences between characters, strong context dependence, etc. These characteristics make the OCR recognition of small languages face many challenges in practical applications, such as character misrecognition, high typo rates, etc.

[0021] The current mainstream OCR technology usually relies on deep learning models, which require a large amount of high-quality annotated data for training. However, due to the limited scope of use and scarcity of corpus, it is difficult to build a dataset of the same size as mainstream languages ​​for minority language data. The lack of large-scale training data directly leads to the decline in the performance of OCR models in minority languages. In addition, the characters of minority languages ​​may be visually similar to those of mainstream languages, but they are significantly different in semantics and usage rules, which further increases the difficulty of learning OCR models.

[0022] In the prior art, the methods for correcting typos in OCR output results mainly include the following:

[0023] 1. Dictionary matching-based method: The OCR recognition results are compared with specific dictionaries of minority languages. If the recognized word is not in the dictionary, it is replaced with a similar word in the dictionary. This method is effective for common words in the language, but has poor processing capabilities for new words, foreign words, and proper nouns. In addition, dictionary maintenance and updating also face great challenges.

[0024] 2. Methods based on statistical large language models: Statistical large language models, such as n-gram models, detect and correct typos in OCR output results by calculating the probability of character or word combinations. However, for minority languages, due to the limited size of the corpus, statistical large language models are difficult to capture the full picture of the language, which can easily lead to correction errors or omissions of typos.

[0025] 3. Contextual correction methods based on deep learning: In recent years, large language models based on deep learning have performed well in correcting misspellings in mainstream languages. These models use contextual information to predict and correct misspellings. However, in the field of minority languages, due to the lack of pre-trained models and annotated data, their effects are far inferior to those in mainstream languages.

[0026] In addition, OCR recognition of minority languages ​​is also affected by factors such as image quality, shooting angle, and lighting conditions. There may be problems such as blur, noise, and background interference when taking photos, which can lead to recognition errors. At the same time, the slight differences between characters in minority languages, such as stroke thickness and character spacing, may also be misjudged due to changes in photo quality.

[0027] Therefore, there is still much room for improvement in the recognition accuracy and spelling error correction capabilities of current minority language OCR systems. When processing minority languages, existing methods either fail to fully utilize contextual information or lack optimization for minority language features, making it difficult to significantly reduce the spelling error rate.

[0028] By discovering the defects in the background art as described above, the inventors provide a method and system for correcting misspelled words in small language text images, aiming to improve the accuracy of small language character recognition by combining OCR output with a large language model, so as to better handle complex scenarios in practical applications.

[0029] Embodiment 1, Figure 1 is a schematic flowchart of a method for correcting misspelled words in small language text images in Embodiment 1 of the present invention. As Figure 1 shown, Embodiment 1 provides a method for correcting misspelled words in small language text images, including:

[0030] Step S100, obtain a small language text image, and use a preset adaptive threshold denoising algorithm based on wavelet transform to remove the high-frequency noise of the small language text image, generating a denoised image;

[0031] Specifically, this step first involves obtaining small language text images. These images are, for example, from various photographing scenarios, so they may be affected by various factors such as light, angle, and background interference, resulting in a decrease in image quality and an increase in the difficulty of character recognition. To improve the accuracy of subsequent character recognition, it is necessary to denoise these images. The denoising algorithm used here is an adaptive threshold denoising algorithm based on wavelet transform. Wavelet transform is an effective signal analysis method that can decompose a signal into components of different frequencies, facilitating detailed analysis and processing of the signal. In this denoising process, the algorithm will perform wavelet transform decomposition on the image to generate low-frequency components and high-frequency components. The low-frequency components contain the main information of the image, while the high-frequency components mainly contain noise information. Next, the algorithm will judge the noise intensity distribution of the high-frequency components according to the preset adaptive threshold and process the high-frequency components above the threshold to remove the noise components. Finally, the processed high-frequency components and low-frequency components are recombined through inverse wavelet transform to generate a denoised image. In this way, the quality of the denoised image is significantly improved, the outlines and details of the characters are clearer, providing a more reliable basis for subsequent character recognition.

[0032] Step S200, extract the morphological contour features of at least one character from the denoised image. The morphological contour features include stroke thickness, stroke number, and stroke order direction, and input the features into a support vector machine classification model to determine the language category of the denoised image, generating a language classification result;

[0033] Specifically, the extracted morphological contour features include but are not limited to stroke thickness, stroke quantity, and stroke order direction, which can effectively reflect the uniqueness and differences of characters in different languages. For example, characters in some minority languages may have specific stroke structures or writing rules, and these features can be used to distinguish them from other languages. After extracting these features, the system inputs them into a pre-trained support vector machine (SVM) classification model. The SVM model is a powerful supervised learning tool that is good at dealing with classification problems in high-dimensional feature spaces. It can map the input feature vectors to a high-dimensional space through a kernel function and find the optimal decision boundary in this space to achieve accurate language category judgment. Through this process, the system can generate accurate language classification results, providing guidance for subsequent loading of the corresponding character segmentation model and corpus, and ensuring the accuracy and efficiency of the entire misspelled character correction process. Among them, the support vector machine (SVM) classification model in the present invention is constructed, for example, through the following steps: First, extract the morphological contour features of characters from the denoised minority language text images, including stroke thickness, stroke quantity, and stroke order direction, etc., and perform normalization processing on these features to eliminate the dimensional difference. Subsequently, input the standardized feature vectors into a pre-trained SVM model, which uses a radial basis function (RBF) kernel function to map the feature vectors to a high-dimensional feature space. During the training process, a large amount of labeled minority language text image data is used, and the model parameters, such as the regularization parameter C and the parameter γ of the RBF kernel function, are optimized through cross-validation techniques to ensure that the model has good generalization ability. Finally, the trained SVM model can accurately judge the language category of the image according to the input feature vectors.

[0034] Step S300: According to the language classification result, load the corresponding character segmentation model and corpus, perform character-by-character segmentation and pattern matching recognition on the denoised image, and generate the preliminary recognition result and recognition confidence score of each character.

[0035] Specifically, first, according to the language category determined in the previous step, a character segmentation model that matches it is selected. This model is specifically designed for this language and can accurately identify and segment each character in the image. Even when the characters are closely connected or slightly deformed, it can maintain a high segmentation accuracy. Then, the system loads the corpus related to this language, which contains a large number of character samples of this language and their standard patterns, providing rich data support for subsequent pattern matching and recognition. During the process of character-by-character segmentation, the system will perform pattern matching and recognition on each segmented character, that is, compare it with the standard character patterns in the corpus to find the most similar match. At the same time, the system will also calculate the preliminary recognition result and recognition confidence score of each character. This score reflects the confidence level of the system in the recognition result of this character. If the confidence level is high, it means that the system is relatively certain about the recognition result of this character; if the confidence level is low, it may indicate that there is an error or ambiguity in the recognition of this character, and further misspelling detection and correction are required. Through this step, the system can generate the preliminary recognition result and its confidence score of each character, providing basic data and judgment basis for subsequent misspelling correction. Among them, the character segmentation model in the present invention can be constructed in the following way: for a specific minority language, a large amount of text image data of this language is collected and preprocessed to remove noise and enhance clarity. Then, a character segmentation model architecture is constructed using deep learning techniques (such as convolutional neural network CNN). During the training process, the preprocessed text image data is input into the model, and through supervised learning, the model learns the boundary features and segmentation rules between characters. By continuously adjusting the model parameters and optimizing the algorithm, the model can accurately identify and segment each character in the image. Even when the characters are closely connected or slightly deformed, it can maintain a high segmentation accuracy. Finally, the trained character segmentation model can effectively separate the characters one by one according to the input text image, providing a basis for subsequent pattern matching and recognition.

[0036] Step S400, if the recognition confidence score is lower than the preset threshold, it is marked as a suspected misspelling, and the part-of-speech tagging algorithm is used to determine the position and context information of the suspected misspelling in the original text, and generate the semantic information of the suspected misspelling;

[0037] Specifically, the purpose of this step is to identify those characters that may have been misrecognized due to various reasons (such as poor image quality, high character similarity, limitations of the OCR model, etc.). Once a character is marked as a suspected misspelling, the system will use a part-of-speech tagging algorithm for further analysis. The part-of-speech tagging algorithm can determine the specific position of the suspected misspelling in the original text, which is very important because different positions may correspond to different semantic and grammatical roles, affecting subsequent correction strategies. At the same time, the algorithm will also extract the context information of the suspected misspelling, including but not limited to the surrounding words, sentence structure, grammatical relationships, etc. Through the analysis of the context information, the system can generate the semantic information of the suspected misspelling, which helps to more accurately understand the role and meaning of the suspected misspelling in the sentence, thus providing a more targeted basis for subsequent correction. In short, this step effectively marks and analyzes the suspected misspelling by combining the recognition confidence score, part-of-speech tagging, and context analysis, laying a solid foundation for subsequent misspelling correction.

[0038] Step S500: Generate multiple candidate characters through a pre-trained small language text generation model according to the stroke structure layout and glyph integrity of the suspected misspelling;

[0039] Specifically, the core of this step lies in utilizing the stroke structure layout and glyph integrity information of the suspected misspelled characters, which are the key visual features for character recognition. The stroke structure layout refers to the combination method, relative position, and stroke direction of the strokes in a character, while the glyph integrity reflects whether the overall form of the character is complete, without any missing or deformed parts. The system first conducts a detailed analysis of these visual features and extracts the feature vectors that can represent the uniqueness of the suspected misspelled characters. Subsequently, these feature vectors are input into a pre-trained small language text generation model. This model is trained based on a large amount of small language text data and can capture the subtle differences and language characteristics between small language characters. Through the processing of the model, the system can generate multiple candidate characters that are visually similar or structurally reasonable to the suspected misspelled characters according to the input feature vectors. These candidate characters not only consider the independent form of the characters but may also incorporate context information, thereby improving the accuracy and rationality of the candidate characters. The purpose of generating multiple candidate characters is to select the replacement character that best matches the original text context through semantic similarity comparison in the subsequent steps, effectively correcting the misspelled characters and enhancing the accuracy of text recognition. Among them, the pre-trained small language text generation model in the present invention can be constructed in the following manner: First, collect and organize a large amount of small language text data, including sentences, paragraphs, etc. in different contexts, as the training corpus. Then, use deep learning techniques (such as the recurrent neural network RNN) to construct the model architecture. During the training process, use the collected small language text data to iteratively train the model so that it learns the distribution rules, grammatical structures, and context dependencies of small language characters. By adjusting the model parameters and optimization algorithms, continuously improve the generation ability of the model until the model can generate candidate characters that are highly consistent with the input text in terms of semantics and grammar. Finally, the trained pre-trained small language text generation model can generate multiple candidate characters that are visually similar or structurally reasonable according to the input feature vectors of the suspected misspelled characters, providing strong support for subsequent misspelled character correction.

[0040] Step S600, use the semantic role labeling algorithm to calculate the semantic similarity between each candidate character and the semantic information of the suspected misspelled character, and select the candidate character with the highest similarity as the optimal replacement character;

[0041] Specifically, the core of this step lies in understanding and analyzing the semantic roles in the text through algorithms, that is, the semantic functions played by each component in the sentence, such as the subject, predicate, object, etc. The system first conducts a detailed analysis of this context based on the context information of the suspected misspelled word through the semantic role labeling algorithm to generate the semantic role labeling result. This process can help the system accurately capture the semantic role of the suspected misspelled word in the sentence and its association with other words. Then, the system uses this semantic role labeling result to calculate the semantic similarity between each candidate character and the semantic information of the suspected misspelled word, generating similarity values. These similarity values reflect the degree of semantic fit between the candidate character and the suspected misspelled word and its context. Finally, the system selects the candidate character with the highest similarity as the optimal replacement character. This decision-making process ensures that the replacement character is not only similar in form to the suspected misspelled word but also highly consistent semantically with the original context, thus effectively improving the accuracy and intelligence level of misspelled word correction. In this way, the system can better handle misspelled word problems in complex language environments, especially when dealing with new words, foreign words, and proper nouns, showing stronger adaptability and flexibility.

[0042] Step S700, update the optimal replacement character to the preliminary recognition result and output the corrected text;

[0043] Specifically, the system updates the optimal replacement character to the position of the suspected misspelled word in the preliminary recognition result, thus completing the correction of the misspelled word. The output of this step is the corrected text, which has a significant improvement in accuracy compared to the preliminary recognition result and better meets the high-precision requirements of small language text image recognition.

[0044] In this embodiment, step S100 includes:

[0045] Step S101, obtain a small language text image and perform grayscale processing on the small language text image to generate a grayscale image;

[0046] Specifically, first, an image containing text in a minority language is obtained through an image acquisition device (such as a camera, scanner, etc.). Since the original image usually contains rich color information, in order to simplify the subsequent processing process and improve processing efficiency, these images need to be grayscale processed. Grayscale processing is the process of converting a color image into a black-and-white image that only contains grayscale information. In this way, each pixel point is represented by only one brightness value, thereby reducing the complexity of the data. Suppose there is a color photo containing Tamil text. The text in the photo may appear unclear due to factors such as light and background color. During grayscale processing, the system will analyze the red, green, and blue (RGB) values of each pixel point in the photo and calculate the corresponding grayscale value based on these values. This grayscale value is usually obtained through a weighted average method, that is, weights are assigned according to the sensitivity of the human eye to different colors, and then a comprehensive grayscale value is calculated. After processing, what is obtained is a Tamil text image that only contains black, white, and gray levels. The text outline in this image is clearer, and the contrast between characters is higher, providing a more favorable basis for subsequent steps such as denoising, character segmentation, and recognition. The importance of grayscale processing lies in that it can effectively reduce the dimension of image data, reduce computational complexity, and at the same time retain sufficient text information for subsequent processing. In the recognition of minority language text images, due to the complex character structure and small differences between characters, clear text outlines and high character contrast are crucial for accurate character recognition.

[0047] Step S102: Perform wavelet transform decomposition on the grayscale image to generate a low-frequency component and a high-frequency component;

[0048] Specifically, wavelet transform is a mathematical tool that can decompose a two-dimensional signal such as an image into components of different frequencies, including low-frequency components and high-frequency components. The low-frequency components mainly contain most of the energy and main information of the image, such as the outlines of objects, the background, etc. These are relatively stable and important parts of the image. The high-frequency components mainly contain the detailed information and noise of the image, such as edges, textures, and random noise generated due to poor shooting conditions or during transmission. Through wavelet transform decomposition, the system can effectively separate the low-frequency and high-frequency information in the grayscale image. In this way, subsequent processing can specifically remove the noise in the high-frequency components without affecting the useful information in the low-frequency components. For example, in actual operation, the system may apply an adaptive threshold to the high-frequency components, considering the parts above this threshold as noise and removing them, while retaining the parts below the threshold, which may contain important details of the image. Suppose there is a picture containing text in a minority language. Due to insufficient light during shooting, there are some speckle-like noises on the picture. In step S101, the system first grayscales this picture to obtain a grayscale image. Then, through wavelet transform decomposition, the system decomposes the grayscale image into low-frequency components and high-frequency components. The low-frequency components contain the clear outlines of the text and most of the character information, while the high-frequency components contain the speckle-like noises and some subtle edge information of the characters.

[0049] Step S103, according to a preset adaptive threshold algorithm, determine the noise threshold of the high-frequency components and judge the noise intensity distribution of the high-frequency components;

[0050] Specifically, the adaptive threshold algorithm is an algorithm that can automatically adjust the threshold according to the content of the image. It is different from a fixed threshold setting and dynamically determines the threshold based on the local features or overall statistical characteristics of the image. In the context of wavelet transform, the high-frequency components usually contain the detailed information and noise of the image. To remove the noise while retaining the details, an appropriate threshold is needed to distinguish between the two. The implementation of the adaptive threshold algorithm involves multiple factors, such as the local brightness, contrast, texture, etc. of the image. The algorithm analyzes the statistical distribution of the high-frequency components, such as the mean, variance, etc., to estimate the level of noise. Then, based on this estimated value, a threshold is set such that the high-frequency components above this threshold are considered noise, while those below the threshold are considered detailed information. Suppose there is an image containing text in a minority language, which is slightly affected by light interference and background noise during shooting. After wavelet transform, the high-frequency components are obtained. At this time, the adaptive threshold algorithm analyzes the statistical characteristics of these high-frequency components and finds that some of the components have significantly higher amplitudes than others, and the distribution of the positions of these high-amplitude components in the image is relatively random and has no clear structural features.

[0051] Step S104, if the high-frequency component is greater than the noise threshold, a threshold processing method is used to process the high-frequency component to remove the high-frequency noise component and generate a denoised high-frequency component;

[0052] Specifically, when the high-frequency components of the grayscale image decomposed by wavelet transform exceed the preset adaptive noise threshold, it indicates that these high-frequency components mainly contain noise information rather than effective image details. Therefore, it is necessary to perform threshold processing on these high-frequency components to remove the noise components therein. Threshold processing methods generally include hard threshold and soft threshold. The hard threshold method is to directly set the high-frequency components exceeding the threshold to zero. This method has a fast processing speed, but may produce discontinuity at the threshold. The soft threshold method is to reduce the high-frequency components exceeding the threshold so that they gradually approach zero. This method is smoother and can reduce discontinuity. In the present invention, a suitable threshold processing method can be selected according to actual conditions. In practical applications, the noise threshold of the high-frequency component is determined according to the preset adaptive threshold algorithm. If it is found that the high-frequency component is greater than the noise threshold, the soft threshold processing method is used to process the high-frequency component and reduce the part exceeding the threshold.

[0053] Step S105, performing inverse wavelet transform on the denoised high-frequency component and low-frequency component to generate a denoised image;

[0054] Specifically, in the previous steps, the image is decomposed into low-frequency components and high-frequency components by wavelet transform, wherein the high-frequency components are subjected to adaptive threshold processing to remove noise. In order to reconstruct the denoised image, the processed high-frequency components and the original low-frequency components need to be recombined. This process is achieved by inverse wavelet transform, which is the inverse process of wavelet transform and can restore the decomposed signal (or image) to the original spatial domain. Specifically, inverse wavelet transform will re-integrate the processed high-frequency components and low-frequency components to generate a denoised image that removes high-frequency noise and retains the main information of the image. For example, when processing an image containing text in a minority language (such as Tamil), the image may contain more high-frequency noise due to poor shooting conditions. After decomposition by wavelet transform, the high-frequency components contain these noise information, while the low-frequency components retain the main outline and character information of the text. After the high-frequency components are denoised by using an adaptive threshold algorithm, the noise in the high-frequency components is effectively removed. Next, the processed high-frequency components and low-frequency components are fused by inverse wavelet transform to reconstruct a denoised image. The high-frequency noise in this image is significantly reduced, and the outlines of the characters are clearer, providing a better basis for subsequent character recognition and typo correction.

[0055] In this embodiment, step S200 includes:

[0056] In step S201, for the denoised image, a morphological analysis method is used to extract the morphological contour features of the characters therein. The morphological contour features include the stroke thickness, the number of strokes, and the stroke order direction.

[0057] Specifically, this step is the key to identifying small - language characters because characters in different languages have unique morphological differences. For example, when processing Tamil text images, since Tamil characters have complex stroke structures and specific writing rules, the system extracts features such as the stroke thickness, the number of strokes, and the stroke order direction of each character through morphological analysis. These features can accurately reflect the uniqueness of Tamil characters and provide an important basis for subsequent language classification. By precisely extracting these morphological contour features, the system can more accurately identify small - language characters and improve the accuracy of language classification.

[0058] In step S202, the extracted morphological contour features are normalized to eliminate the dimensional differences between the feature values in the morphological contour features and generate a standardized feature vector.

[0059] Specifically, normalizing the extracted morphological contour features is an important step to ensure that the subsequent classification model can accurately process the feature vectors. Since the extracted morphological contour features (such as stroke thickness, number of strokes, and stroke order direction) may have different dimensions and ranges, directly inputting them into a support vector machine (SVM) classification model may lead to a decline in model performance. Therefore, it is necessary to normalize these features to eliminate the dimensional differences between the feature values and generate a standardized feature vector. Normalization usually scales the feature values to a specific range, such as [0, 1] or [-1, 1]. Taking stroke thickness as an example, the stroke thickness of different characters may vary greatly. Directly inputting it into the SVM model may lead to an unreasonable weight assignment for the stroke thickness feature by the model. Through normalization, the values of stroke thickness are scaled to a unified range, enabling the SVM model to consider each feature more evenly and thus improving the classification accuracy. In practical applications, when processing Tamil text images, the range of stroke thickness in the extracted character morphological contour features may vary from 0.5 mm to 2 mm. Through normalization, these values are scaled to the [0, 1] range. That is, for a character with a stroke thickness of 0.5 mm, its stroke thickness feature value becomes 0, and for a character with a stroke thickness of 2 mm, its feature value becomes 1, and other characters with different stroke thicknesses are scaled accordingly. After such processing, all character morphological contour features are in the same dimension, and when input into the SVM classification model, the model can more accurately determine the language category of the image based on these features.

[0060] Step S203: Input the standardized feature vectors into a pre-trained support vector machine (SVM) classification model, and map the standardized feature vectors to a high-dimensional feature space through a kernel function.

[0061] Specifically, a kernel function is a mathematical function that maps feature vectors in a low-dimensional space to a high-dimensional space. In SVM, common kernel functions include linear kernel, polynomial kernel, radial basis function (RBF) kernel, etc. When the standardized feature vectors are input into the SVM model, the kernel function maps them to a higher-dimensional space, making the feature vectors that were originally inseparable in the low-dimensional space linearly separable in the high-dimensional space. Taking the processing of Tamil text images as an example, the extracted morphological contour features (such as stroke thickness, number of strokes, and stroke order direction) are normalized to generate standardized feature vectors. These feature vectors are input into a pre-trained SVM classification model, and the model uses the RBF kernel function to map the feature vectors to a high-dimensional feature space. In the high-dimensional space, the SVM model can find the optimal decision boundary to accurately judge the language category of the image. Through this process, the system can generate accurate language classification results, providing a reliable basis for loading the corresponding character segmentation model and corpus subsequently.

[0062] Step S204: Calculate the distance between the standardized feature vectors and the decision boundary in the high-dimensional feature space.

[0063] Specifically, calculating the distance between the standardized feature vectors and the decision boundary in the high-dimensional feature space is a key step in the language classification of the support vector machine (SVM) classification model. In the high-dimensional feature space, the SVM model distinguishes different classes of data points by finding an optimal decision boundary. This decision boundary is determined by the support vectors, that is, the data points closest to the decision boundary. To determine the class to which a standardized feature vector belongs, it is necessary to calculate the distance between the vector and the decision boundary. The calculation of the distance is usually achieved through vector operations. In the high-dimensional feature space, each standardized feature vector can be regarded as a point, and the decision boundary is a hyperplane. Calculating the distance from a point to a hyperplane is to calculate the average distance from the point to all points on the hyperplane. This distance value reflects the position of the point relative to the decision boundary, that is, the probability or confidence that the point belongs to a certain class. Taking the processing of Tamil text images as an example, the standardized feature vectors after normalization are input into a pre-trained SVM classification model and mapped to the high-dimensional feature space through the kernel function. In this space, the SVM model has found an optimal decision boundary to distinguish Tamil text images from other language text images. For each input feature vector, the model calculates the distance between it and the decision boundary.

[0064] Step S205: Determine the language category of the denoised image based on the position of the standardized feature vector relative to the decision boundary in the high-dimensional feature space, and generate a language classification result.

[0065] Specifically, in the high-dimensional feature space, the SVM model distinguishes data points of different categories by finding the optimal decision boundary. For each input standardized feature vector, the model calculates its position in the high-dimensional feature space, that is, the distance between the vector and the decision boundary. If this distance meets certain conditions (such as being less than a certain threshold), it is considered that the vector belongs to one category divided by the decision boundary, otherwise it belongs to another category. Taking the processing of Tamil text images as an example, the standardized feature vector after normalization is input into the pre-trained SVM classification model and mapped to the high-dimensional feature space through the kernel function. In this space, the SVM model has obtained an optimal decision boundary based on the feature vectors of a large number of Tamil text images. For each input standardized feature vector of a Tamil text image, the model calculates its position in the high-dimensional feature space and determines its position relative to the decision boundary. If this vector is on one side of the decision boundary, it is considered that the image belongs to the Tamil text image category; otherwise, it is considered to belong to the text image category of other languages. Through this process, the system can accurately determine the language category of the denoised image and generate a language classification result.

[0066] In this embodiment, step S300 includes:

[0067] Step S301: Load the pre-established character segmentation model and corpus according to the language classification result, and perform character-by-character segmentation on the denoised image.

[0068] Specifically, the system will select and load the character segmentation model and the corresponding corpus pre-established for this language according to the language classification result. The role of the character segmentation model is to separate the characters in the image one by one for subsequent recognition processing. The corpus contains a large number of character samples of this language and their standard patterns, providing data support for pattern matching recognition. For example, if the language classification result shows that the text in the image is Tamil, the system will load the character segmentation model for Tamil and the Tamil corpus.

[0069] Step S302: Adopt a pattern matching algorithm, combine the character patterns in the corpus, and perform preliminary recognition on the segmented characters to generate a preliminary recognition result.

[0070] Specifically, the system will compare each segmented character with the character patterns in the corpus to find the most similar match as the preliminary recognition result. The core of the pattern matching algorithm lies in how to efficiently compare the similarity between characters. Common methods include similarity calculation based on feature vectors, image comparison based on template matching, etc. For example, the system may compare the segmented Tamil characters with the Tamil character samples in the corpus through feature vector comparison to find the most similar character as the preliminary recognition result.

[0071] Step S303: Calculate the matching degree between the preliminary recognition result and the character patterns in the corpus, and generate the recognition confidence score for each character.

[0072] Specifically, this score reflects the confidence level of the system in the recognition result of the character. The higher the score, the more reliable the recognition result; conversely, it indicates that the recognition result may be incorrect. For example, if the preliminary recognition result of a certain Tamil character by the system is highly similar to a character sample in the corpus, then the recognition confidence score of this character will be very high; if the similarity is low, then the score will be correspondingly reduced.

[0073] In practical applications, taking the recognition of Tamil text images as an example, assume that the system obtains an image containing Tamil text, and after denoising processing and language classification, it is determined to be Tamil. In step S301, the system will load the character segmentation model for Tamil and the Tamil corpus. Then, in step S302, the system will segment the denoised image character by character and use the pattern matching algorithm to compare each segmented character with the character patterns in the Tamil corpus to generate the preliminary recognition result. Finally, in step S303, the system will calculate the matching degree between the preliminary recognition result and the character patterns in the corpus and generate the recognition confidence score for each character. If the recognition confidence score of a certain character is lower than the preset threshold, the system will consider that this character may be a suspected misspelling and enter the subsequent misspelling correction process.

[0074] In this embodiment, step S400 includes:

[0075] Step S401: Compare the recognition confidence score with the preset threshold. If the score is lower than the threshold, mark the character as a suspected misspelling.

[0076] Specifically, after the OCR system initially recognizes a text image, each character is given a recognition confidence score. This score reflects the system's confidence in the recognition result of that character. The recognition confidence score is usually calculated based on multiple factors, including the morphological features of the character, the degree of match with character patterns in the corpus, etc. In this step, the system will compare the recognition confidence score of each character with a preset threshold. If the recognition confidence score of a certain character is lower than this threshold, the system will consider that the recognition result of this character may be incorrect, and thus mark it as a suspected misspelled word. Suppose the system is recognizing an image containing Tamil text, and one of the characters has a recognition confidence score of 0.7 (assuming the threshold is 0.8). Since this score is lower than the preset threshold, the system will mark as a suspected misspelled word. This character may have been misrecognized due to poor image quality (such as insufficient light, blurred characters) or limitations of the OCR model (such as insufficient recognition ability for minority language characters).

[0077] Step S402: Use a part-of-speech tagging algorithm to perform part-of-speech tagging on the suspected misspelled words and determine their positions in the original text;

[0078] Specifically, once a character is marked as a suspected misspelled word, the system needs to further analyze the position of this character in the original text and its context. For this purpose, the system uses a part-of-speech tagging algorithm to process the text. The part-of-speech tagging algorithm is a natural language processing technique that can assign a part-of-speech tag (such as noun, verb, adjective, etc.) to each word in the text. Through part-of-speech tagging, the system can determine the specific position of the suspected misspelled word in the original text and understand its grammatical role in the sentence. This is very important for subsequent misspelled word correction because different parts of speech may correspond to different correction strategies. Continuing with the above example, the system performs part-of-speech tagging on the Tamil text containing the suspected misspelled word . Suppose the text is After part-of-speech tagging, the system finds that Located at the beginning of the sentence and labeled as a noun. This information is very useful for subsequent typo correction because nouns usually correspond to specific entities or concepts, and the system can use this information to find more appropriate replacement characters. Among them, for typo correction in small language text image recognition, the part-of-speech tagging algorithm can be used to determine the position and context information of the suspected typo in the original text, so as to generate the semantic information of the suspected typo, providing a richer basis for subsequent typo correction; and the part-of-speech tagging algorithm of the present invention can be implemented based on the Hidden Markov Model (HMM). HMM is a commonly used statistical model, especially suitable for processing sequence data, such as natural language text. Among them, the hidden Markov model can be constructed through the following steps: First, define the part-of-speech tags as the state set of the model, then based on the labeled training corpus, statistically calculate the probability of each part of speech as the start of the sentence (initial state probability), the transition probability between parts of speech, and the probability of a specific word appearing under a given part of speech (emission probability), use these statistically obtained probability parameters to construct the hidden Markov model, and finally use decoding methods such as the Viterbi algorithm to find the most likely part-of-speech tagging sequence on the given word sequence.

[0079] Step S403, according to the part-of-speech tagging result, extract the context of the suspected typo to generate the semantic information of the suspected typo;

[0080] Specifically, in addition to determining the position and part of speech of the suspected typo, the system also needs to extract the context information of this character. The context information refers to the words, sentence structures, grammatical relationships, etc. that appear before and after the suspected typo. These information are crucial for understanding the semantics and intentions of the suspected typo. By extracting the context information, the system can generate the semantic information of the suspected typo, which helps to more accurately determine whether the character is indeed incorrect and provides a more targeted basis for subsequent correction. In the above example, the system extracted the context information of the suspected typo Assume the context is The system can analyze that may be a greeting (similar to "Hello" in English), and may be a name or a pronoun. Based on this information, the system can generate the semantic information of the suspected typo and try to find characters that match its semantics in the corpus or pre-trained model as replacement options.

[0081] In this embodiment, step S500 includes:

[0082] Step S501, extract features of the suspected typo using the number of strokes and structure type to generate a glyph feature vector;

[0083] Specifically, feature extraction mainly focuses on the number of strokes and the structural pattern of suspected misspelled characters. The number of strokes refers to the total number of strokes in a character, while the structural pattern refers to the combination method, relative position, and stroke direction of the strokes in the character. These pieces of information are the key visual features for character recognition and can effectively reflect the uniqueness and differences of characters. The system extracts the number of strokes and structural pattern features of suspected misspelled characters through image processing and morphological analysis methods. These features are encoded as glyph feature vectors, and each vector contains the unique visual information of the suspected misspelled character. This glyph feature vector will be used as the input for the subsequent steps to generate candidate characters. Suppose the system is processing an image containing Tamil text, and one of the suspected misspelled characters is The system first extracts the number of strokes of this character (assumed to be 5 strokes) and the structural pattern features (such as the combination method and relative position of the strokes). Then, these features are encoded as a glyph feature vector, for example, [5, (coordinates of stroke 1, coordinates of stroke 2,..., coordinates of stroke 5)]. This vector contains the number of strokes and structural pattern information of the character, providing a basis for generating candidate characters in the subsequent steps.

[0084] Step S502: Standardize the glyph feature vector according to the layout position and integrity to generate standard feature data;

[0085] Specifically, although the glyph feature vector generated in step S501 contains the unique visual information of the suspected misspelled character, due to the large differences in the number of strokes and structural patterns of different characters, these feature vectors may not be comparable in terms of numerical values. Therefore, in step S502, the system needs to standardize the glyph feature vector to eliminate the dimensional differences between the feature values and generate standard feature data. The standardization process mainly focuses on two aspects: layout position and integrity. The layout position refers to the position information of the character in the text, including the upper, lower, left, and right boundaries of the character and its relative position to other characters. Integrity refers to whether the overall shape of the character is complete, without missing or deformed parts. The system standardizes the glyph feature vector by calculating the layout position and integrity features of the suspected misspelled character, making it have a unified numerical range and distribution characteristics. Continuing with the above example, the system standardizes the glyph feature vector of the suspected misspelled character First, calculate the layout position features of this character in the text, such as the coordinates of the upper, lower, left, and right boundaries and the relative distance to other characters. Then, evaluate the integrity of this character, such as whether the strokes are complete and whether there are deformations. Based on this information, the system standardizes the glyph feature vector to generate standard feature data. For example, the stroke coordinates can be converted into relative coordinates relative to the character boundary, or the number of strokes can be normalized, etc.

[0086] Step S503: Input the standard feature data into the pre-trained low-resource language text generation model to generate multiple candidate characters.

[0087] Specifically, this low-resource language text generation model is trained based on a large amount of low-resource language text data and can capture the subtle differences and language characteristics between low-resource language characters. When the standard feature data is input into the model, the model will generate multiple candidate characters that are visually similar or structurally reasonable to the suspected misspelled character according to the learned low-resource language character distribution and generation rules. These candidate characters not only consider the independent form of the character but may also incorporate context information, thereby improving the accuracy and reasonableness of the candidate characters. In the above example, the system inputs the standardized glyph feature vector into the pre-trained Tamil text generation model. The model generates multiple candidate characters that are visually similar or structurally reasonable to the suspected misspelled character according to these feature vectors and the learned low-resource language character distribution and generation rules. For example, it may generate candidate characters such as . These candidate characters not only consider the morphological features of the character but may also incorporate context information, thereby improving the accuracy and reasonableness of the candidate characters.

[0088] In this embodiment, step S600 includes:

[0089] Step S601: Based on the semantic information of the suspected misspelled character, analyze the semantic roles of the semantic information of the suspected misspelled character through the semantic role labeling algorithm to generate a semantic role labeling result.

[0090] Specifically, in this step, the system first uses the part-of-speech tagging algorithm to determine the position and context information of the suspected misspelled character in the original text to generate the semantic information of the suspected misspelled character. These information not only include the lexical meaning of the suspected misspelled character itself but also cover its grammatical structure and context relevance in the sentence. Subsequently, the system uses the semantic role labeling algorithm to deeply analyze these semantic information. The semantic role labeling algorithm is a natural language processing technology that can identify and label the semantic roles played by each component in a sentence, such as the agent, patient, tool, etc. By performing semantic role labeling on the semantic information of the suspected misspelled character, the system can more accurately understand the semantic function of the character in the sentence and its association with other words. For example, when processing Tamil text, assume that the OCR system initially identifies a suspected misspelled character and determines its position and context in the sentence through part-of-speech tagging. Next, the system uses the semantic role labeling algorithm to analyze the sentence containing . If the sentence is (similar to the English "Hello How are you"), through semantic role labeling, the system may identify is a greeting, playing the role of the agent, while might be a name or a pronoun, playing the role of the patient. At the same time, the specific semantic role in this sentence will also be marked. For example, it might be a misspelling or a proper noun that has not been correctly recognized. Based on the results of such semantic role marking, the system can more comprehensively understand the semantic context of the suspected typo in the sentence, providing a solid foundation for calculating the semantic similarity between candidate characters and the semantic information of the suspected typo in subsequent calculations. Among them, the construction process of the semantic role marking algorithm can be as follows: collect and mark a large number of semantic role marking corpora, which contain sentences and their corresponding semantic role marking results; extract features related to semantic roles from the dependency syntactic tree, such as part of speech, syntactic relationship, vocabulary, etc.; use machine learning algorithms (such as neural networks) to train the semantic role marking model on the marked corpus. The model learns the mapping relationship from dependency syntactic features to semantic roles. Evaluate the performance of the model on the test set, and measure the effect of the model by calculating indicators such as accuracy, recall rate, and F1 value. Adjust the model parameters, feature selection, or algorithm structure according to the evaluation results to improve the marking performance of the model.

[0091] Step S602, according to the semantic role marking results, calculate the semantic similarity between multiple candidate characters and the semantic information of the suspected typo, and generate similarity values;

[0092] Specifically, the system calculates the semantic similarity between each candidate character and the semantic information of the suspected typo according to the semantic role marking results. Semantic similarity is an indicator that measures the degree of semantic similarity between two words or sentences. In this step, the system adopts an appropriate semantic similarity calculation method, such as cosine similarity based on word vectors, similarity based on semantic networks, etc., to calculate the similarity between each candidate character and the semantic information of the suspected typo. These similarity values reflect the degree of fit between the candidate characters and the suspected typo and its context semantically. Taking Tamil text recognition as an example, assume that the OCR system initially recognizes a suspected typo and has analyzed its context through the semantic role marking algorithm, generating the semantic role marking results. Next, the system generates multiple candidate characters according to the stroke structure layout and glyph integrity of the suspected typo, such as etc. Then, the system calculates the semantic similarity between these candidate characters and the semantic information of the suspected typo, generating similarity values. Through this step, the system can screen out the candidate characters that best match the original context, providing an important basis for the subsequent selection of the optimal replacement character. This step not only improves the accuracy of typo correction but also reflects the intelligent level of the system in dealing with complex language environments.

[0093] Step S603: If the similarity value is greater than the preset threshold, mark the candidate character as a high-priority candidate character.

[0094] Specifically, if the semantic similarity value between a candidate character and the semantic information of the suspected misspelled word is greater than the preset threshold, then the candidate character is marked as a high-priority candidate character. The core of this step is to screen out candidate characters that highly match the semantic information of the suspected misspelled word by setting a reasonable semantic similarity threshold. The semantic similarity threshold is set according to the system's requirements for the accuracy of misspelled word correction and the characteristics of the minority language. When the semantic similarity between the candidate character and the suspected misspelled word exceeds this threshold, the system considers that the candidate character is highly consistent with the suspected misspelled word and its context semantically, so it marks it as a high-priority candidate character. Taking Tamil text recognition as an example, assume that the OCR system initially identifies a suspected misspelled word and calculates the semantic similarity between multiple candidate characters (such as etc.) and the semantic information of the suspected misspelled word through step S602. If the semantic similarity value of one of the candidate characters exceeds the preset threshold (assume it is 0.8), then the system will mark as a high-priority candidate character. Through this step, the system can screen out the candidate characters that are most likely to replace the suspected misspelled word, providing a more accurate range for the subsequent selection of the optimal replacement character.

[0095] Step S604: Use a priority sorting algorithm to sort the high-priority candidate characters and generate a priority sequence.

[0096] Specifically, the system uses a priority sorting algorithm to sort the high-priority candidate characters according to the semantic similarity value between the candidate characters and the semantic information of the suspected misspelled word (i.e., the similarity value generated in step S602). The priority sorting algorithm is an algorithm that can sort a group of elements according to a specific criterion (such as the semantic similarity value). In this step, the system uses this algorithm to sort the high-priority candidate characters, aiming to rank the candidate characters that most match the semantic information of the suspected misspelled word in the front to form a priority sequence. This sorting process takes into account the degree of fit between the candidate characters and the suspected misspelled word and its context semantically, ensuring the accuracy and efficiency in the subsequent selection of the optimal replacement character. Taking Tamil text recognition as an example, assume that the OCR system initially identifies a suspected misspelled word and calculates the semantic similarity between multiple candidate characters (such as The semantic similarity values between the candidate characters (such as ) and the semantic information of the suspected typo. In step S603, the system filters out the candidate characters whose similarity values are greater than the preset threshold and marks them as high-priority candidate characters. Next, in step S604, the system sorts these high-priority candidate characters using a priority sorting algorithm. Suppose ) has the highest semantic similarity value, then it will be ranked first in the priority sequence; while the candidate character with the second-highest semantic similarity value (such as

[0097] ) is ranked second, and so on. Through this step, the system can form an ordered priority sequence that contains the candidate characters that best match the semantic information of the suspected typo. This sequence provides clear guidance for selecting the optimal replacement character in the subsequent step. The system can directly select the first candidate character in the priority sequence as the optimal replacement character, thereby improving the efficiency and accuracy of typo correction.

[0098] Step S605, according to the priority sequence, select the candidate character with the highest rank as the optimal replacement character; Specifically, the system directly selects the candidate character with the highest rank in this priority sequence as the optimal replacement character. Taking Tamil text image recognition as an example, assume that when the system processes an image containing Tamil text, it identifies a suspected typo and generates multiple candidate characters, such as . The system calculates the semantic similarity between these candidate characters and the suspected typo and generates similarity values. Suppose has the highest similarity value, then will be marked as a high-priority candidate character and become the candidate character with the highest rank after priority sorting. In step S605, the system will select

[0099] as the optimal replacement character. Based on the above analysis, it can be seen that the system can ensure that the replacement character is not only similar in glyph to the suspected typo but also highly consistent in semantics with the context of the original text, thereby effectively improving the accuracy and intelligence level of typo correction. This method of selecting replacement characters based on semantic similarity and priority sorting shows stronger adaptability and flexibility when dealing with typo problems in complex language environments, especially when dealing with new words, foreign words, and proper nouns.In a specific embodiment, the present invention includes four main steps: Step 1, language identification: The core objective of this step is to determine which minority language the text in the input image belongs to. The system first preprocesses the captured text image, removing noise, enhancing clarity, and performing language determination through a language classification model. The language classification model extracts character features (such as letter shapes, punctuation usage rules, etc.) based on training data, and makes judgments by combining image features and language distribution information. For example, when unique font features or grammar structures are detected, the system can accurately identify the language to which the text belongs. The successful implementation of this step lays the foundation for the subsequent selection of the minority language OCR model and the loading of the corpus. Step 2, OCR text recognition: According to the language identification result, the system loads the corresponding minority language OCR model to recognize the text in the input image character by character. The OCR model uses deep learning technology and can recognize the character shapes and context semantic relationships of different languages. The system converts each character in the image into text data and outputs the corresponding confidence score for subsequent misspelling detection and analysis. Through model optimization and data augmentation techniques, this step can handle complex text scenarios, including low-resolution images, italic text, and character overlaps. Step 3, misspelling detection and candidate generation: After OCR recognition is completed, the system performs misspelling detection and analysis on the generated text result. Using the pre-loaded corpus and large language model, the system evaluates each character in the text in combination with the context semantics, and marks the positions where recognition errors may occur. For the marked suspected misspellings, the system generates multiple candidate characters through semantic similarity analysis and character shape matching. These candidate characters are sorted according to relevance and large language model weights to ensure the applicability and accuracy of the recommended content. Step 4, character update and result output: The system replaces the confirmed characters into the recognition result to generate the final text output. Subsequently, the system records the corrections to optimize the misspelling detection and candidate character generation logic, thereby continuously improving the recognition accuracy of the system. Through the implementation of the above four steps, the present invention realizes a full-process closed loop of language identification, can effectively solve the technical problems of minority language text recognition and misspelling correction, and demonstrates high efficiency and practicality in application scenarios.

[0100] Embodiment 2, Figure 2 is a structural schematic diagram of a misspelling correction system for minority language text image recognition in Embodiment 2 of the present invention, as Figure 2As shown in the figure, Embodiment 2 provides a misspelling correction system for small language text image recognition, including: a first generation module 201, a second generation module 202, a third generation module 203, a fourth generation module 204, a fifth generation module 205, a selection module 206, and an output module 207. The first generation module 201 is used to obtain a small language text image, adopt a preset adaptive threshold denoising algorithm based on wavelet transform to remove the high-frequency noise of the small language text image, and generate a denoised image. The second generation module 202 is used to extract the morphological contour features of at least one character from the denoised image. The morphological contour features include stroke thickness, stroke quantity, and stroke order direction, and input the features into a support vector machine classification model to determine the language category of the denoised image and generate a language classification result. The third generation module 203 is used to load the corresponding character segmentation model and corpus according to the language classification result, perform character-by-character segmentation and pattern matching recognition on the denoised image, and generate a preliminary recognition result and a recognition confidence score for each character. The fourth generation module 204 is used to mark it as a suspected misspelling if the recognition confidence score is lower than a preset threshold, and adopt a part-of-speech tagging algorithm to determine the position and context information of the suspected misspelling in the original text, and generate suspected misspelling semantic information. The fifth generation module 205 is used to generate multiple candidate characters through a pre-trained small language text generation model according to the stroke structure layout and glyph integrity of the suspected misspelling. The selection module 206 is used to calculate the semantic similarity between each candidate character and the suspected misspelling semantic information by adopting a semantic role labeling algorithm, and select the candidate character with the highest similarity as the optimal replacement character. The output module 207 is used to update the optimal replacement character to the preliminary recognition result and output the corrected text.

[0101] In this embodiment, the first generation module 201 includes: a grayscale image generation unit, a component generation unit, an intensity distribution judgment unit, a high-frequency component generation unit, and a denoised image generation unit. The grayscale image generation unit is used to obtain a small language text image and perform grayscale processing on the small language text image to generate a grayscale image. The component generation unit is used to perform wavelet transform decomposition on the grayscale image to generate a low-frequency component and a high-frequency component. The intensity distribution judgment unit is used to determine the noise threshold of the high-frequency component according to a preset adaptive threshold algorithm and judge the noise intensity distribution of the high-frequency component. The high-frequency component generation unit is used to process the high-frequency component by adopting a threshold processing method to remove the high-frequency noise component and generate a denoised high-frequency component if the high-frequency component is greater than the noise threshold. The denoised image generation unit is used to perform wavelet inverse transform on the denoised high-frequency component and low-frequency component to generate a denoised image.

[0102] In this embodiment, the second generation module 202 includes: a morphological contour feature extraction unit, a feature vector generation unit, a mapping unit, a distance calculation unit, and a classification result generation unit. The morphological contour feature extraction unit is used to extract the morphological contour features of the characters in the denoised image by using a morphological analysis method. The morphological contour features include stroke thickness, stroke number, and stroke order direction. The feature vector generation unit is used to perform normalization processing on the extracted morphological contour features, eliminate the dimensional difference between the eigenvalues in the morphological contour features, and generate a standardized feature vector. The mapping unit is used to input the standardized feature vector into a pre-trained support vector machine classification model, and map the standardized feature vector to a high-dimensional feature space through a kernel function. The distance calculation unit is used to calculate the distance between the standardized feature vector and the decision boundary in the high-dimensional feature space. The classification result generation unit is used to determine the language category of the denoised image according to the position of the standardized feature vector relative to the decision boundary in the high-dimensional feature space, and generate a language classification result.

[0103] In this embodiment, the third generation module 203 includes: a segmentation unit, an identification result generation unit, and a confidence score generation unit. The segmentation unit is used to load a pre-established character segmentation model and corpus according to the language classification result, and perform character-by-character segmentation on the denoised image. The identification result generation unit is used to perform preliminary identification on the segmented characters by using a pattern matching algorithm in combination with the character patterns in the corpus, and generate a preliminary identification result. The confidence score generation unit is used to calculate the matching degree between the preliminary identification result and the character patterns in the corpus, and generate an identification confidence score for each character.

[0104] In this embodiment, the fourth generation module 204 includes: a suspected misspelled character marking unit, a determination unit, and a semantic information generation unit. The suspected misspelled character marking unit is used to compare the identification confidence score with a preset threshold. If the score is lower than the threshold, the character is marked as a suspected misspelled character. The determination unit is used to perform part-of-speech tagging on the suspected misspelled character by using a part-of-speech tagging algorithm, and determine its position in the original text. The semantic information generation unit is used to extract the context of the suspected misspelled character according to the part-of-speech tagging result, and generate suspected misspelled character semantic information.

[0105] In this embodiment, the fifth generation module 205 includes: a glyph feature vector generation unit, a feature data generation unit, and a candidate character generation unit. The glyph feature vector generation unit is used to extract features of the suspected misspelled character by using the number of strokes and the structure type, and generate a glyph feature vector. The feature data generation unit is used to perform normalization processing on the glyph feature vector according to the layout position and integrity, and generate standard feature data. The candidate character generation unit is used to input the standard feature data into a pre-trained small language text generation model through the pre-trained small language text generation model, and generate multiple candidate characters.

[0106] In this embodiment, the selection module 206 includes: a generating annotation result unit, a generating similarity value unit, a marking candidate character unit, a generating sequence unit, and a selecting optimal replacement character unit. The generating annotation result unit is configured to analyze the semantic roles of the suspected misspelled word semantic information through a semantic role annotation algorithm based on the suspected misspelled word semantic information, and generate a semantic role annotation result. The generating similarity value unit is configured to calculate the semantic similarity between multiple candidate characters and the suspected misspelled word semantic information according to the semantic role annotation result, and generate a similarity value. The marking candidate character unit is configured to mark the candidate character as a high-priority candidate character if the similarity value is greater than a preset threshold. The generating sequence unit is configured to sort the high-priority candidate characters by using a priority sorting algorithm to generate a priority sequence. The selecting optimal replacement character unit is configured to select the candidate character with the highest ranking as the optimal replacement character according to the priority sequence.

[0107] The various variation modes and specific examples of the small language text image recognition misspelling correction method provided in the first embodiment are equally applicable to the small language text image recognition misspelling correction system provided in this embodiment. Through the foregoing detailed description of a small language text image recognition misspelling correction method, those skilled in the art can clearly know the implementation manner of a small language text image recognition misspelling correction system in this embodiment. Therefore, for the sake of brevity of the specification, it will not be described in detail here.

[0108] Embodiment III Figure 3 is a schematic structural diagram of an electronic device in Embodiment III of the present invention. As Figure 3 shown, Embodiment III also provides an electronic device 300, and the electronic device may include: a processor 301 and a memory 302.

[0109] A memory 302 for storing programs; the memory 302 may include volatile memory (e.g., random-access memory, such as static random-access memory (SRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM), etc.); the memory may also include non-volatile memory, such as flash memory. The memory 302 is used to store computer programs (such as application programs and functional modules for implementing the above methods), computer instructions, etc. The above computer programs, computer instructions, etc. can be stored in partitions in one or more memories 302. And the above computer programs, computer instructions, data, etc. can be called by the processor 301.

[0110] The above computer programs, computer instructions, etc. can be stored in partitions in one or more memories 302. And the above computer programs, computer data, etc. can be called by the processor 301. The processor 301 is configured to execute the computer programs stored in the memory 302 to implement the various steps in the method described in the above embodiments. For specific details, please refer to the relevant descriptions in the previous method embodiments.

[0111] The processor 301 and the memory 302 can be of an independent structure or an integrated structure integrated together. When the processor 301 and the memory 302 are of an independent structure, the memory 302 and the processor 301 can be coupled and connected through a bus 303. The electronic device in this embodiment can execute the technical solutions in the above method, and the specific implementation process and technical principle are the same, so they will not be elaborated here.

[0112] Embodiment 4 also provides a computer-readable storage medium, including a computer program and instructions. When the computer program or instructions are run on a computer, the computer is caused to execute the small language text image recognition typo correction method according to any embodiment of the present invention. The computer-readable storage medium includes various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical discs.

[0113] This embodiment also provides a computer program product, which includes: a computer program stored in a readable storage medium. At least one processor of the electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to enable the electronic device to execute the solution provided in any of the above embodiments.

[0114] It should be understood that various forms of the processes shown above can be used, steps can be reordered, added or deleted. For example, the steps recited in the disclosure of the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution disclosed in the present invention can be achieved, and this is not limited herein.

[0115] Note that the above is only a preferred embodiment of the present invention and the applied technical principle. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for correcting typos in image recognition of text in a minority language, characterized in that: include: Acquire a text image in a minority language, and use a preset adaptive threshold denoising algorithm based on wavelet transform to remove high-frequency noise from the text image in the minority language to generate a denoised image; Extracting morphological contour features of at least one character from the denoised image, the morphological contour features including stroke thickness, number of strokes and stroke order, and inputting the features into a support vector machine classification model to determine the language category of the denoised image and generate a language classification result; Loading the corresponding character segmentation model and corpus according to the language classification result, performing character segmentation and pattern matching recognition on the denoised image, and generating a preliminary recognition result and recognition confidence score for each character; If the recognition confidence score is lower than a preset threshold, it is marked as a suspected typo, and a part-of-speech tagging algorithm is used to determine the position of the suspected typo in the original text and the contextual information to generate semantic information of the suspected typo; According to the stroke structure layout and glyph completeness of the suspected wrong character, a plurality of candidate characters are generated by a pre-trained minority language text generation model; Using a semantic role labeling algorithm to calculate the semantic similarity between each candidate character and the semantic information of the suspected wrong character, and selecting the candidate character with the highest similarity as the optimal replacement character; The optimal replacement character is updated to the preliminary recognition result, and the corrected text is output.

2. The method for correcting wrong characters in image recognition of minority language text according to claim 1, characterized in that: The acquiring of a minority language text image, and using a preset wavelet transform-based adaptive threshold denoising algorithm to remove high-frequency noise from the minority language text image to generate a denoised image includes: Acquire the minority language text image, and perform grayscale processing on the minority language text image to generate a grayscale image; Performing wavelet transform decomposition on the grayscale image to generate low-frequency components and high-frequency components; Determine the noise threshold of the high-frequency component according to a preset adaptive threshold algorithm, and judge the noise intensity distribution of the high-frequency component; If the high-frequency component is greater than the noise threshold, a threshold processing method is used to process the high-frequency component to remove the high-frequency noise component and generate a denoised high-frequency component; Performing inverse wavelet transform on the denoised high-frequency component and the low-frequency component to generate the denoised image.

3. The method for correcting wrong characters in image recognition of minority language text according to claim 1, characterized in that: The step of extracting at least one character's morphological contour features from the denoised image, wherein the morphological contour features include stroke thickness, stroke number and stroke order, and inputting the features into a support vector machine classification model to determine the language category of the denoised image, and generating a language classification result includes: For the denoised image, a morphological analysis method is used to extract the morphological contour features of the characters therein, wherein the morphological contour features include stroke thickness, stroke number and stroke order direction; Normalizing the extracted morphological contour features to eliminate the dimensional differences between the eigenvalues ​​in the morphological contour features and generate a standardized eigenvector; Inputting the standardized feature vector into a pre-trained support vector machine classification model, and mapping the standardized feature vector to a high-dimensional feature space through a kernel function; In the high-dimensional feature space, calculating the distance between the normalized feature vector and the decision boundary; According to the position of the standardized feature vector relative to the decision boundary in the high-dimensional feature space, the language category of the denoised image is determined to generate a language classification result.

4. The method for correcting wrong characters in image recognition of minority language text according to claim 1, characterized in that: The step of loading the corresponding character segmentation model and corpus according to the language classification result, performing character segmentation and pattern matching recognition on the denoised image, and generating a preliminary recognition result and recognition confidence score for each character includes: Loading a pre-established character segmentation model and corpus according to the language classification result, and performing character segmentation on the denoised image; Using a pattern matching algorithm, combined with character patterns in the corpus, to perform preliminary recognition on the segmented characters, and generate the preliminary recognition results; The matching degree between the preliminary recognition result and the character pattern in the corpus is calculated to generate the recognition confidence score for each character.

5. The method for correcting wrong characters in image recognition of minority language text according to claim 1, characterized in that: If the recognition confidence score is lower than a preset threshold, it is marked as a suspected typo, and a part-of-speech tagging algorithm is used to determine the position of the suspected typo in the original text and the context information, and the generated semantic information of the suspected typo includes: Comparing the recognition confidence score with a preset threshold, if the score is lower than the threshold, marking the character as a suspected typo; Using a part-of-speech tagging algorithm to tag the suspected wrong characters and determine their positions in the original text; According to the part-of-speech tagging result, the context of the suspected wrong character is extracted to generate semantic information of the suspected wrong character.

6. The method for correcting wrong characters in image recognition of text in a minority language as claimed in claim 1, characterized in that: The method of generating multiple candidate characters by using a pre-trained minority language text generation model according to the stroke structure layout and glyph completeness of the suspected wrong character includes: Extracting features of the suspected wrong characters by using the number of strokes and the structural type to generate a character feature vector; Standardizing the glyph feature vector according to the layout position and the completeness to generate standard feature data; The standard feature data is input into a pre-trained minority language text generation model to generate the plurality of candidate characters.

7. The method for correcting wrong characters in image recognition of text in a minority language as claimed in claim 5, characterized in that: The method of using a semantic role labeling algorithm to calculate the semantic similarity between each candidate character and the semantic information of the suspected wrong character, and selecting the candidate character with the highest similarity as the optimal replacement character comprises: Based on the semantic information of the suspected wrong character, analyzing the semantic role of the semantic information of the suspected wrong character by a semantic role labeling algorithm to generate a semantic role labeling result; Calculating semantic similarities between the plurality of candidate characters and the semantic information of the suspected wrong character according to the semantic role labeling result, and generating a similarity value; If the similarity value is greater than a preset threshold, the candidate character is marked as a high priority candidate character; Using a priority sorting algorithm, sorting the high priority candidate characters to generate a priority sequence; According to the priority sequence, the candidate character with the highest ranking is selected as the optimal replacement character.

8. A system for correcting typos in text images of minority languages, characterized in that: include: The first generation module is used to obtain a text image in a minority language, and remove high-frequency noise from the text image in the minority language by using a preset adaptive threshold denoising algorithm based on wavelet transform to generate a denoised image; A second generation module is used to extract the morphological contour features of at least one character from the denoised image, wherein the morphological contour features include stroke thickness, number of strokes and stroke order, and input the features into a support vector machine classification model to determine the language category of the denoised image and generate a language classification result; A third generation module is used to load the corresponding character segmentation model and corpus according to the language classification result, perform character segmentation and pattern matching recognition on the denoised image, and generate a preliminary recognition result and recognition confidence score for each character; A fourth generation module is used to mark the suspected wrong character if the recognition confidence score is lower than a preset threshold, and use a part-of-speech tagging algorithm to determine the position and contextual information of the suspected wrong character in the original text, and generate semantic information of the suspected wrong character; A fifth generation module is used to generate a plurality of candidate characters through a pre-trained minority language text generation model according to the stroke structure layout and glyph completeness of the suspected wrong character; A selection module is used to calculate the semantic similarity between each candidate character and the semantic information of the suspected wrong character by using a semantic role labeling algorithm, and select the candidate character with the highest similarity as the optimal replacement character; An output module is used to update the optimal replacement character into the preliminary recognition result and output the corrected text.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively coupled to the at least one processor; The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for correcting typos in image recognition of text in a small language as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: The method comprises a computer program and instructions. When the computer program or the instructions are run on a computer, the computer is enabled to execute the method for correcting wrong characters in image recognition of text in a minority language as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Composition correction method and device based on large model

    CN121121778A

  • A method and apparatus for essay grading based on a large model

    CN121121778B

  • Water book character recognition method and system based on target detection

    CN121281071A